decocms 4.526.2 → 4.528.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.
- package/dist/client/assets/{ActiveShapeUtils-CwNMVlsU.js → ActiveShapeUtils-Br894ljM.js} +1 -1
- package/dist/client/assets/{AlertCircle-BQ7gdGwO.js → AlertCircle-DwVsFaci.js} +1 -1
- package/dist/client/assets/{AreaChart-2TBYeD3-.js → AreaChart-BpoQ8IcB.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CzKuuRT3.js → ArrowLeft-D0U_UeWA.js} +1 -1
- package/dist/client/assets/{ArrowUp-hmPXempM.js → ArrowUp-BHvj9x12.js} +1 -1
- package/dist/client/assets/{BarChart-CqU2QH_G.js → BarChart-DSUrCO19.js} +1 -1
- package/dist/client/assets/{Building02-BP04ade-.js → Building02-4g278Kck.js} +1 -1
- package/dist/client/assets/{CartesianChart-B5qhARMe.js → CartesianChart-B8sjFfWU.js} +1 -1
- package/dist/client/assets/{CategoricalChart-GePqKrAt.js → CategoricalChart-C9NLmvFO.js} +1 -1
- package/dist/client/assets/{CheckCircle-BVnx66vP.js → CheckCircle-0mdIkBLG.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-D6sC3Vmb.js → ChevronSelectorVertical-BRbuqJl7.js} +1 -1
- package/dist/client/assets/{ChevronUp-B84nbyaB.js → ChevronUp-Cn8PaBxH.js} +1 -1
- package/dist/client/assets/{Copy01-Bac6SVw1.js → Copy01-D6STLVd9.js} +1 -1
- package/dist/client/assets/{CreditCard01-t317btce.js → CreditCard01-CAW-vU_p.js} +1 -1
- package/dist/client/assets/{DotsVertical-DjAfwlFJ.js → DotsVertical-C5Wc2qWf.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DRnbzo4s.js → ErrorBarContext-ClrUuJb8.js} +1 -1
- package/dist/client/assets/{Globe04-DSBhW1To.js → Globe04-COPfJ3z-.js} +1 -1
- package/dist/client/assets/{Image01-CNDErtLw.js → Image01-D00jtGx4.js} +1 -1
- package/dist/client/assets/{Key01-C_7n0i1h.js → Key01-CiK2_UxI.js} +1 -1
- package/dist/client/assets/{Link01-kTPC8Qx-.js → Link01-CEOBycf2.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Ps7Q2TgQ.js → LinkBroken01-Bg7pBcuJ.js} +1 -1
- package/dist/client/assets/{Minus-DwgwDeRT.js → Minus-_SQ5lvlh.js} +1 -1
- package/dist/client/assets/{Monitor01-DLFV9f_c.js → Monitor01-DyqIpSTl.js} +1 -1
- package/dist/client/assets/{Play-CQGngRNi.js → Play-BnWEmJaV.js} +1 -1
- package/dist/client/assets/{Plus-DOCl9FQV.js → Plus-BPVKrQFz.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BW-WOxqj.js → ReferenceLine-_tT0r7bG.js} +1 -1
- package/dist/client/assets/{SearchMd-BbTaBsWc.js → SearchMd-OaBCBVrZ.js} +1 -1
- package/dist/client/assets/{Sector-CZev-ohv.js → Sector-mFZOIMSW.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-2qRSy_0A.js → ShoppingBag01-GpZCrbBR.js} +1 -1
- package/dist/client/assets/{Sun-Cdvulc3r.js → Sun-BG4-BfE7.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DM99h8Bb.js → SwitchHorizontal01-CMpEiSPu.js} +1 -1
- package/dist/client/assets/{Tool01-C4vr_Fbq.js → Tool01-CIeMmnyv.js} +1 -1
- package/dist/client/assets/{Trash01-7cnh0-6j.js → Trash01-BLXgUBsw.js} +1 -1
- package/dist/client/assets/{Upload01-DJferCdW.js → Upload01-CgYtU1Ux.js} +1 -1
- package/dist/client/assets/{UserSquare-CBDcV-Sr.js → UserSquare-pnEdx237.js} +1 -1
- package/dist/client/assets/{Users01-hfFVY4Rg.js → Users01-D-rlhQmk.js} +1 -1
- package/dist/client/assets/{XClose-B2l9VhGF.js → XClose-yFNn0LgD.js} +1 -1
- package/dist/client/assets/{ZoomOut-CeC9MLz9.js → ZoomOut-D8_eDbPl.js} +1 -1
- package/dist/client/assets/{access-gate-BanurxIu.js → access-gate-CCmKpIU6.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DarQ1krm.js → add-connection-dialog-MrHyqJnn.js} +1 -1
- package/dist/client/assets/agent-analytics-wllTP-xB.js +1 -0
- package/dist/client/assets/agent-app-MGvu076D.js +1 -0
- package/dist/client/assets/{agent-assets-vnboyQof.js → agent-assets-DX3JCZz_.js} +1 -1
- package/dist/client/assets/{agent-automation-DXTohqIP.js → agent-automation-BoPrO5n1.js} +1 -1
- package/dist/client/assets/{agent-automations-BFozFJzs.js → agent-automations-Dj9SJC8y.js} +1 -1
- package/dist/client/assets/agent-calendar-CFKavSr7.js +1 -0
- package/dist/client/assets/{agent-connect-sources-CwKjdmVU.js → agent-connect-sources-guJSE0A3.js} +1 -1
- package/dist/client/assets/agent-deck-CdHFig9V.js +1 -0
- package/dist/client/assets/{agent-e2e-DinWmv8w.js → agent-e2e--KzDh_gU.js} +1 -1
- package/dist/client/assets/agent-experiments-pgMnsFIB.js +1 -0
- package/dist/client/assets/{agent-file-CXwfpXiU.js → agent-file-Cdm4fL8A.js} +1 -1
- package/dist/client/assets/{agent-hosting-Drya8fUU.js → agent-hosting-DewUrxzP.js} +1 -1
- package/dist/client/assets/agent-icon-I45DkNr8.js +1 -0
- package/dist/client/assets/agent-library-DjU97YsS.js +1 -0
- package/dist/client/assets/agent-library-file-DXHCBJAM.js +1 -0
- package/dist/client/assets/agent-monitor-Bucu2iO3.js +1 -0
- package/dist/client/assets/{agent-overview-mxgKSo__.js → agent-overview-D6KewKsA.js} +1 -1
- package/dist/client/assets/agent-releases-K-5ZFdWb.js +2 -0
- package/dist/client/assets/agent-settings-w-cNQlVy.js +1 -0
- package/dist/client/assets/{agent-site-editor-BSG_1jHk.js → agent-site-editor-5gjIAuRv.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-B432kGPM.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CQYunysB.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CLsSdnEd.js +1 -0
- package/dist/client/assets/agent-view-DP6mfHYN.js +1 -0
- package/dist/client/assets/{agent-view-guard-BHNxFqz2.js → agent-view-guard-CiKD3WZM.js} +1 -1
- package/dist/client/assets/{agents-list-LjE12uZe.js → agents-list-Bm03MUBc.js} +1 -1
- package/dist/client/assets/{ai-providers-BnPLndR5.js → ai-providers--gYjttQ2.js} +1 -1
- package/dist/client/assets/alert-CRToIlco.js +1 -0
- package/dist/client/assets/{analytics-sections-BwRAKayH.js → analytics-sections-CNk_D8Ba.js} +1 -1
- package/dist/client/assets/{analytics-tab-KcCM-OzF.js → analytics-tab-BmUlDGzX.js} +2 -2
- package/dist/client/assets/api-keys-8RAAQTX6.js +1 -0
- package/dist/client/assets/{api-keys-BYiu4OiJ.js → api-keys-MdTn4EBK.js} +1 -1
- package/dist/client/assets/app-editor-DLDQxSbu.js +1 -0
- package/dist/client/assets/{asset-utils-BFPFspZC.js → asset-utils-B46ygA_L.js} +1 -1
- package/dist/client/assets/{auth-BRizJz1-.js → auth-AQB7DTaB.js} +1 -1
- package/dist/client/assets/{auth-catchall-D1S0_WyO.js → auth-catchall-WOw2KABS.js} +1 -1
- package/dist/client/assets/{auth-entry-Bh9wXS29.js → auth-entry-D8h4o_s7.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BvrJixVI.js → auth-split-layout-D1niEerJ.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DzQvKWuf.js → authenticate-and-persist-oauth-08aLFUVr.js} +1 -1
- package/dist/client/assets/{automation-list-row-DH4mXmBN.js → automation-list-row-D9muuYwH.js} +1 -1
- package/dist/client/assets/{automation-runs-DJix-DxY.js → automation-runs-Cu7hhQJb.js} +1 -1
- package/dist/client/assets/{automations-BGTqqP4a.js → automations-Ct6FcxrV.js} +1 -1
- package/dist/client/assets/{autosend-DweeW6OU.js → autosend-CxxtAFJ_.js} +1 -1
- package/dist/client/assets/{badge-6mumabZP.js → badge-zxuYXquF.js} +1 -1
- package/dist/client/assets/{block-document-6D9S2QJM.js → block-document-D4CMkt4c.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-CQlVHIqR.js → blocks-preview-workspace-context-LeIpajCL.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-5o0yQDwk.js → blocks-tab-states-BrRgLQ_Y.js} +1 -1
- package/dist/client/assets/{blog-schema-B1vhzoV7.js → blog-schema-B4i8W-yj.js} +1 -1
- package/dist/client/assets/{buckets-BXoMxN54.js → buckets-CQWPtT87.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CNSfu0YZ.js → build-improve-prompt-doc-CpbAFEGo.js} +1 -1
- package/dist/client/assets/{calendar-lhJ8p0qo.js → calendar-C7teLmhJ.js} +1 -1
- package/dist/client/assets/{capability-load-error-C3GmqKPQ.js → capability-load-error-lTXihmQk.js} +1 -1
- package/dist/client/assets/category-editor-BrbTG2-B.js +1 -0
- package/dist/client/assets/{cdn-tab-MGIcjUqn.js → cdn-tab-BstEuIpQ.js} +1 -1
- package/dist/client/assets/{chart-DgE2oixW.js → chart-DVgatavr.js} +1 -1
- package/dist/client/assets/{chat-context-BfN3Aasc.js → chat-context-DIvwe-Wr.js} +5 -5
- package/dist/client/assets/{chat-draft-1H_chlRR.js → chat-draft-DByw699W.js} +1 -1
- package/dist/client/assets/{checkbox-BGizxNX2.js → checkbox-CW4Dzojp.js} +1 -1
- package/dist/client/assets/{choose-editor-DPHanNqQ.js → choose-editor-zIlz3nud.js} +1 -1
- package/dist/client/assets/{cli-auth-success-KhIa1i1d.js → cli-auth-success-CYE6hkOe.js} +1 -1
- package/dist/client/assets/{client-icons-BB7vt0gq.js → client-icons-DL1p9F4w.js} +1 -1
- package/dist/client/assets/cms-settings-editor-D8-PKCcN.js +1 -0
- package/dist/client/assets/{collapsible-BN3qlGJC.js → collapsible-zPk-2gi_.js} +1 -1
- package/dist/client/assets/{collection-detail-BaXvekU8.js → collection-detail-Drfng1H4.js} +1 -1
- package/dist/client/assets/{collection-display-button-CFQaHfMS.js → collection-display-button-DPvQVdd-.js} +1 -1
- package/dist/client/assets/{collection-search-INMm_CkT.js → collection-search-kUVZkueq.js} +1 -1
- package/dist/client/assets/collection-table-wrapper-vDq2vkVG.js +1 -0
- package/dist/client/assets/{collection-tabs-SEBBjtRQ.js → collection-tabs-C3pu5E-Q.js} +1 -1
- package/dist/client/assets/{column-rules-BL4ZPS3s.js → column-rules-Dz5XFx3r.js} +1 -1
- package/dist/client/assets/{combobox-BO0oi3KV.js → combobox-BZSt-sf0.js} +1 -1
- package/dist/client/assets/{command-Cn1kHhQA.js → command-CSPNVB8c.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-C6y38zop.js → companion-mcps-section-HHphF1lt.js} +1 -1
- package/dist/client/assets/{config-BmU_9L81.js → config-B7tLWM1b.js} +1 -1
- package/dist/client/assets/{connect-Bf0Ja-ij.js → connect-BK8j-UfV.js} +1 -1
- package/dist/client/assets/{connect-layout-fE-7a2Jq.js → connect-layout-BC5qZusj.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Cxd2UcNI.js → connect-source-dialog-Ch0tynWX.js} +1 -1
- package/dist/client/assets/{connection-Dizw96b7.js → connection-amzL9L9Z.js} +1 -1
- package/dist/client/assets/{connection-card-D3-Gdl0S.js → connection-card-D8aS8J6Q.js} +1 -1
- package/dist/client/assets/{connection-detail-Chq5IDv2.js → connection-detail-Cu7F0ogE.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DYxyLK9S.js → connection-form-helpers-TT6AKW6f.js} +1 -1
- package/dist/client/assets/{connections-Ba6gsUgY.js → connections-B29MQqZW.js} +1 -1
- package/dist/client/assets/content-tab-BhOwV-AC.js +22 -0
- package/dist/client/assets/context-CgB14LeY.js +1 -0
- package/dist/client/assets/{context-menu-gP7nFahM.js → context-menu-CFt3f_Gb.js} +1 -1
- package/dist/client/assets/{context-shell-sMRc_A5o.js → context-shell-KhGmYnbX.js} +5 -5
- package/dist/client/assets/{core.esm-BdDh475y.js → core.esm-Brf7c66K.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Ci-3-YrG.js → create-organization-dialog-Dshiy6sU.js} +1 -1
- package/dist/client/assets/daily-pulse-DglWu2t-.js +1 -0
- package/dist/client/assets/{discover-Dgk-X72W.js → discover-BLv8PWTL.js} +1 -1
- package/dist/client/assets/{domain-settings-DXLwO71Z.js → domain-settings-7tpPEEzB.js} +1 -1
- package/dist/client/assets/{drawer-LA3NkA0S.js → drawer-w05H8pBO.js} +1 -1
- package/dist/client/assets/{editor-C2vaY1i0.js → editor-CiOoO-Ym.js} +1 -1
- package/dist/client/assets/{editor-classes-wrVHQOxp.js → editor-classes-DNAm8ZAW.js} +1 -1
- package/dist/client/assets/{empty-state-DHgdXyfD.js → empty-state-BiIeVz7z.js} +1 -1
- package/dist/client/assets/{empty-state-BIXUpBao.js → empty-state-ErDRcN-P.js} +1 -1
- package/dist/client/assets/experiments-tab-BghFguNv.js +1 -0
- package/dist/client/assets/{experiments-tab-choice-DdG3xkHn.js → experiments-tab-choice-CY-Qbhut.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BPic6jPp.js → extract-connection-data-C02FZ5zb.js} +1 -1
- package/dist/client/assets/{feature-gate-uVlfgQri.js → feature-gate-CE1MLoN2.js} +1 -1
- package/dist/client/assets/{feature-paywall-0Gw_Q4lr.js → feature-paywall-C560RaP5.js} +1 -1
- package/dist/client/assets/{file-explorer-DgWEbnfC.js → file-explorer-CVmiakjw.js} +1 -1
- package/dist/client/assets/{file-preview-BHY7-Pu0.js → file-preview-Cc6_BSbv.js} +1 -1
- package/dist/client/assets/{file-share-button-Dj47FtSF.js → file-share-button-Do4wEYep.js} +1 -1
- package/dist/client/assets/{file-type-icon-D98G7WK4.js → file-type-icon-CeBZX69W.js} +1 -1
- package/dist/client/assets/{folder-icon-CMFoNGkh.js → folder-icon-DgtIAyY7.js} +2 -2
- package/dist/client/assets/{form-oXstmc9Q.js → form-nJy5zMPE.js} +1 -1
- package/dist/client/assets/{general-Dg84kr26.js → general-BOPFN5z3.js} +1 -1
- package/dist/client/assets/{held-block-view-CpXdgp7m.js → held-block-view-tvHMvR4T.js} +3 -3
- package/dist/client/assets/{home-DzHhk92o.js → home-CcsI1NKl.js} +1 -1
- package/dist/client/assets/hosted-publish-feedback-DxOmBJxT.js +1 -0
- package/dist/client/assets/{icon-button-vGME3QbC.js → icon-button-Xe7zTqiw.js} +1 -1
- package/dist/client/assets/{index-20HoU-20.js → index-B8jtRR0H.js} +2 -2
- package/dist/client/assets/{index-CKwkOVRk.js → index-BD0IquFc.js} +1 -1
- package/dist/client/assets/{index-DMyWhhx4.js → index-BJTbyKBB.js} +1 -1
- package/dist/client/assets/{index-BVIkRnC2.js → index-BK_RqkJq.js} +1 -1
- package/dist/client/assets/{index-BcT8d0Ct.js → index-BzwMZ-96.js} +1 -1
- package/dist/client/assets/{index-BBCK9r3-.js → index-CcnAFkjW.js} +1 -1
- package/dist/client/assets/{index-DampV2dK.js → index-Ce7G0he3.js} +44 -44
- package/dist/client/assets/{index-BcOdVYcr.js → index-Cjzst5W1.js} +1 -1
- package/dist/client/assets/{index-B0CHXOni.js → index-ComxOMRa.js} +1 -1
- package/dist/client/assets/{index-DgIUPTVB.js → index-DZ7OjEm4.js} +1 -1
- package/dist/client/assets/{index-CAdTS9ZX.js → index-DjOPmK0D.js} +1 -1
- package/dist/client/assets/{index-C4-Z_rKB.js → index-Dm-21QtS.js} +1 -1
- package/dist/client/assets/{index-redirect-BcArEk0h.js → index-redirect-BRlBNfxv.js} +1 -1
- package/dist/client/assets/{index-BapUxZWk.js → index-tffbmy1v.js} +1 -1
- package/dist/client/assets/index-u-z_8GjU.css +1 -0
- package/dist/client/assets/{index-CUZ1Ro0y.js → index-uE3tVNL6.js} +1 -1
- package/dist/client/assets/{index-CTcO2Era.js → index-xw_Jw9LH.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-koP9jk4d.js → infiniteQueryObserver-BJujpYxh.js} +1 -1
- package/dist/client/assets/{infra-billing-Dh0UUr_Y.js → infra-billing-C0m6hfZU.js} +1 -1
- package/dist/client/assets/{input-nNYp-8x6.js → input-B45cW293.js} +4 -4
- package/dist/client/assets/{input-B3p7vRnZ.js → input-CzPtcD68.js} +1 -1
- package/dist/client/assets/{integration-icon-CiAW8rDV.js → integration-icon-Cs3IASPS.js} +1 -1
- package/dist/client/assets/{jira-icon-CPygEn4Q.js → jira-icon-BuriBSdU.js} +1 -1
- package/dist/client/assets/{label-CjCrcKeN.js → label-ivnVLsJB.js} +1 -1
- package/dist/client/assets/{layout-BdGh_t6z.js → layout-CZlIpVTU.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-Cm0fVoJt.js → legacy-agents-deep-DMpNnXol.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-yklNT500.js → legacy-main-redirect-CBL3GGt7.js} +1 -1
- package/dist/client/assets/library-CdY45oa5.js +1 -0
- package/dist/client/assets/{login-zLCkg8LX.js → login-ByMZv8aL.js} +1 -1
- package/dist/client/assets/{markdown-Cqcjq3Xf.js → markdown-UmudOdor.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-dATLexqT.js → mcp-app-renderer-PAwZvEJj.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CfI4AoXx.js → mcp-oauth-Cz4RwYAs.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CJZC8nld.js → mcp-oauth-qpkBxX91.js} +1 -1
- package/dist/client/assets/{members-4PYMHLuR.js → members-DcVu4FNR.js} +1 -1
- package/dist/client/assets/{memory-C6HI5VGy.js → memory-C_hVYwsN.js} +2 -2
- package/dist/client/assets/{mini-report-page-pa3awJPv.js → mini-report-page-DqysKZ5e.js} +1 -1
- package/dist/client/assets/mock-board-BSsrmRDS.js +81 -0
- package/dist/client/assets/{monaco-editor-5y8rZvs2.js → monaco-editor-Cc-5fhHI.js} +1 -1
- package/dist/client/assets/monitoring-DVujO52F.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-CKIqhhys.js → monitoring-stats-row-DosbF5BV.js} +1 -1
- package/dist/client/assets/{multi-select-B11Nwxds.js → multi-select-DHn_nlnM.js} +1 -1
- package/dist/client/assets/mustache-CKGDjf9j.js +4 -0
- package/dist/client/assets/{named-rule-uses-ZJHANdK7.js → named-rule-uses-Drzf8cgA.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BVdmAMTF.js → new-project-dialog-D3vjD1Ks.js} +1 -1
- package/dist/client/assets/{oauth-callback-Clp9_mQH.js → oauth-callback-D5wWKok2.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B50P_7pe.js → oauth-callback-ai-provider-BKG0BbMN.js} +1 -1
- package/dist/client/assets/{onboarding-zwPhPqAT.js → onboarding-Ci8OMwC9.js} +1 -1
- package/dist/client/assets/{openai-conversation-BH7MRGH3.js → openai-conversation-D9RDSbbV.js} +2 -2
- package/dist/client/assets/{optimistic-project-sidebar-views-p4b0qW4M.js → optimistic-project-sidebar-views-L0iLKNqt.js} +1 -1
- package/dist/client/assets/{order-monitor-day-CqO3tTmM.js → order-monitor-day-CYrv-YPX.js} +1 -1
- package/dist/client/assets/{organization-choice-9p7y5Qyt.js → organization-choice-DS1Td5mt.js} +1 -1
- package/dist/client/assets/{orgs-mkCn2L3g.js → orgs-BdW5vuy7.js} +1 -1
- package/dist/client/assets/{page-seo-form-BsL_nGoH.js → page-seo-form-4Td1Bwhl.js} +1 -1
- package/dist/client/assets/{pair-BlVTZ-F_.js → pair-D40XxJSs.js} +1 -1
- package/dist/client/assets/{parse-sections-D3_nSXsH.js → parse-sections-6LYwkRXc.js} +1 -1
- package/dist/client/assets/{plan-ea0rrjrS.js → plan-B5MpX63p.js} +1 -1
- package/dist/client/assets/{plan-ladder-BQnQ-c-o.js → plan-ladder-DyKNTGpe.js} +1 -1
- package/dist/client/assets/{popover-C6LRW83t.js → popover-BF3N_cWR.js} +1 -1
- package/dist/client/assets/post-calendar-BtEPuDia.js +1 -0
- package/dist/client/assets/{post-editor-CEWlJ8jo.js → post-editor-DlfqwxIk.js} +2 -2
- package/dist/client/assets/{preview-content-C-60FNpz.js → preview-content-BV8Fh5Qw.js} +1 -1
- package/dist/client/assets/{preview-dialog-CrPz9LUi.js → preview-dialog-BmUPiPPl.js} +1 -1
- package/dist/client/assets/{preview-panel-tI2aO6cK.js → preview-panel-llvMLYPZ.js} +1 -1
- package/dist/client/assets/{preview-tab-CZ3Cot3B.js → preview-tab-DieLxroc.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-JbKEmFSB.js → product-picker-dialog-DVInlx3E.js} +1 -1
- package/dist/client/assets/{profile-tb3VLWGr.js → profile-BeQa-VCG.js} +1 -1
- package/dist/client/assets/project-app-view-Cey1t0qJ.js +1 -0
- package/dist/client/assets/{project-apps-CUVHvRf7.js → project-apps-B_x_Bovr.js} +1 -1
- package/dist/client/assets/{project-feed-BUL7QZMR.js → project-feed-CFTw8-Bu.js} +1 -1
- package/dist/client/assets/{project-icon-C4YSWqLo.js → project-icon-Cgbmeoa9.js} +1 -1
- package/dist/client/assets/project-reports-BuglSKY2.js +1 -0
- package/dist/client/assets/project-tasks-CwzdWFfG.js +1 -0
- package/dist/client/assets/{projects-Dd92LlpW.js → projects-Cadx_2S-.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BkJevxQj.js → projects-empty-state-B0sxQqwF.js} +1 -1
- package/dist/client/assets/{prompts-CjZHwr1o.js → prompts-B6yRUPTQ.js} +1 -1
- package/dist/client/assets/record-editor-1SlOHcz4.js +1 -0
- package/dist/client/assets/redirect-editor-UO7ym99V.js +1 -0
- package/dist/client/assets/releases-api-Dz4kituq.js +1 -0
- package/dist/client/assets/{reports-CjzKQyjq.js → reports-BN03l_kE.js} +1 -1
- package/dist/client/assets/reports-DuuFM9rE.js +1 -0
- package/dist/client/assets/{reports-onboarding-PhZdbYYv.js → reports-onboarding-CXYw21hI.js} +1 -1
- package/dist/client/assets/{reports-tab-Cl5b6xq6.js → reports-tab-DNDxSx2i.js} +2 -2
- package/dist/client/assets/{repositories-Df9FHJII.js → repositories-DkDpuhbE.js} +1 -1
- package/dist/client/assets/repositories-Dvbq5CpF.js +1 -0
- package/dist/client/assets/{repository-binding-DSYWyWQk.js → repository-binding-Dg4XMxXs.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CSAKO3X5.js → repository-import-picker-BZ7PPi9W.js} +1 -1
- package/dist/client/assets/{repository-picker-3tqi2Hvb.js → repository-picker-aA12wSzy.js} +1 -1
- package/dist/client/assets/{require-capability-CLXh_YYN.js → require-capability-CXN6JJ5S.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DMJ9p0SW.js → required-auth-layout-pDiTStrv.js} +1 -1
- package/dist/client/assets/{reset-password-C8ez-uKX.js → reset-password-CRhNEOOs.js} +1 -1
- package/dist/client/assets/{resizable-CWhIVRKn.js → resizable-HiC69AzM.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-l6kvyo7T.js → resolve-tab-icon-DdbyVt-l.js} +1 -1
- package/dist/client/assets/{review-settings-CXbKpHZd.js → review-settings-BdnOsmg6.js} +1 -1
- package/dist/client/assets/{roles-DSB-aYYs.js → roles-C54CSjKN.js} +1 -1
- package/dist/client/assets/{route-C4rRmU6W.js → route-19TfZ9Nu.js} +1 -1
- package/dist/client/assets/{route-BDXg8II4.js → route-ChUurj1a.js} +1 -1
- package/dist/client/assets/route-CkPY6J06.js +1 -0
- package/dist/client/assets/{sandbox-git-api-CH_-QFpD.js → sandbox-git-api-DcqI6XE4.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BVJJp5p1.js → sandbox-lifecycle-context-C-6LRZKK.js} +1 -1
- package/dist/client/assets/schema-4d6JAPZJ.js +1 -0
- package/dist/client/assets/{schema-BcGVNeII.js → schema-DjHUnA9X.js} +1 -1
- package/dist/client/assets/{scroll-area-Dbl0Ja6M.js → scroll-area-DmCvljJ6.js} +1 -1
- package/dist/client/assets/{search-input-CI-RscAC.js → search-input-DuxKe01B.js} +1 -1
- package/dist/client/assets/{search-toggle-DfEbn4An.js → search-toggle-5fjHehxP.js} +1 -1
- package/dist/client/assets/{secret-picker-Cki8V7fz.js → secret-picker-gnCLcdHl.js} +1 -1
- package/dist/client/assets/{secrets-CiPY8Xbn.js → secrets-1Q0KkbT2.js} +1 -1
- package/dist/client/assets/{section-array-field-DvT6jzl0.js → section-array-field-DJWSUlEO.js} +1 -1
- package/dist/client/assets/{sections-qI0m5KhX.js → sections-BFagCGU_.js} +1 -1
- package/dist/client/assets/sections-editor-Cd0e4qhb.js +1 -0
- package/dist/client/assets/{select-BjOZT7HR.js → select-BU91L4uy.js} +1 -1
- package/dist/client/assets/{select-model-DkLK9HGj.js → select-model-CtxoaFb9.js} +1 -1
- package/dist/client/assets/{seo-editor-D05ebZyJ.js → seo-editor-dOpYS1fH.js} +1 -1
- package/dist/client/assets/{separator-CjZHveNE.js → separator-C2eDbIfB.js} +1 -1
- package/dist/client/assets/settings-tab-D7WyDwD7.js +1 -0
- package/dist/client/assets/{sheet-DfTFlGFH.js → sheet-CyFkbR9Y.js} +1 -1
- package/dist/client/assets/{shell-layout-DDrdQOKB.js → shell-layout-DjxWvBNL.js} +1 -1
- package/dist/client/assets/site-draft-actions-Ck3uf8oy.js +3 -0
- package/dist/client/assets/site-draft-view-DmpsxvZd.js +2 -0
- package/dist/client/assets/site-editor-BXDxn3xb.js +1 -0
- package/dist/client/assets/site-editor-toast-DwH2UhLV.js +1 -0
- package/dist/client/assets/{skills-B_QDMWu_.js → skills-CEjNG6HD.js} +1 -1
- package/dist/client/assets/{slider-DrOo7_UG.js → slider-wRMQIU5C.js} +1 -1
- package/dist/client/assets/{sortable.esm-bTAsk8Vk.js → sortable.esm-GfRDqHVM.js} +1 -1
- package/dist/client/assets/{sso-BwNLNHyD.js → sso-ou3AfF03.js} +1 -1
- package/dist/client/assets/{suggestion-D6r-qU7q.js → suggestion-GTJqe6wD.js} +2 -2
- package/dist/client/assets/{switch-BaweF4ir.js → switch-Be6f0Lf5.js} +1 -1
- package/dist/client/assets/{symbol-CJnTkOND.js → symbol-D9upvJXv.js} +1 -1
- package/dist/client/assets/{synced-repos-BD02afV5.js → synced-repos-BMxqOtvT.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Dka1P8cQ.js → tab-icon-glyph-ixZicBgd.js} +1 -1
- package/dist/client/assets/{table-ByFmIMk8.js → table-Sgqiv7ow.js} +1 -1
- package/dist/client/assets/{tabs-C_tuCc9E.js → tabs-CTBn6AHY.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-pNz0ct84.js → task-assignee-avatar-CgqfXsXT.js} +1 -1
- package/dist/client/assets/{task-board-CFm7hWmU.js → task-board-B-WXUk04.js} +1 -1
- package/dist/client/assets/{task-route-CroNqaC_.js → task-route-D7L_AjBa.js} +1 -1
- package/dist/client/assets/{task-status-SVf_UHQ8.js → task-status-D47mg_UC.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BPmcL0th.js → taskboard-analytics-BXOv_DdG.js} +1 -1
- package/dist/client/assets/tasks-CDonOW9g.js +1 -0
- package/dist/client/assets/{tasks-CcIwJnqw.js → tasks-DRiqBj-N.js} +3 -3
- package/dist/client/assets/{textarea-CiRqIfaf.js → textarea-CiBj0MLq.js} +1 -1
- package/dist/client/assets/{thread-analytics-VH5cv6lu.js → thread-analytics-apzZ--go.js} +1 -1
- package/dist/client/assets/{thread-intent-BAI3Rlfu.js → thread-intent-ClCyX82j.js} +1 -1
- package/dist/client/assets/{thread-route-Nzl7YVXC.js → thread-route-CFct_VQa.js} +1 -1
- package/dist/client/assets/{thread-route-DCxAnsEA.js → thread-route-D14ghtgQ.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CpP9OOWv.js → thread-sheet-body-BCarr4x7.js} +1 -1
- package/dist/client/assets/{time-range-picker-8OmeiBBB.js → time-range-picker-C3_uZ5O2.js} +1 -1
- package/dist/client/assets/{toggle-group-DkOJZdVq.js → toggle-group-BVSslRda.js} +1 -1
- package/dist/client/assets/{tool-namespace-MjGHB-2n.js → tool-namespace-C-2tGGMF.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DPdWBHmX.js → toolbar-icon-button-3L1Mfrbu.js} +1 -1
- package/dist/client/assets/{tooltip-DZKcSDR4.js → tooltip-BHLCIkH9.js} +1 -1
- package/dist/client/assets/{tooltipContext-J8gN2jYl.js → tooltipContext-BMB7e6XT.js} +1 -1
- package/dist/client/assets/{track-CPKI19Qd.js → track-DUL7obAK.js} +1 -1
- package/dist/client/assets/{types-D-tO7eft.js → types-9H7KFAzM.js} +3 -3
- package/dist/client/assets/{url-slug-B3-3kua2.js → url-slug-CrYfl8wu.js} +1 -1
- package/dist/client/assets/{usage-stats-D7pL8W8y.js → usage-stats-CtXF_bWd.js} +1 -1
- package/dist/client/assets/{use-ai-providers-t0yXUakZ.js → use-ai-providers-DmHiyABc.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-x6zm2qwO.js → use-apply-named-rule-DnrC-2Y6.js} +1 -1
- package/dist/client/assets/{use-automations-DvxXx4v3.js → use-automations-BeX04Bm6.js} +1 -1
- package/dist/client/assets/{use-autosave-CKJcAkk6.js → use-autosave-Civ5dqYG.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-Be7PCK7m.js → use-chat-layout-state-DEHPkPVs.js} +1 -1
- package/dist/client/assets/{use-clock-tick-_wcwwysm.js → use-clock-tick-C1thlLib.js} +1 -1
- package/dist/client/assets/use-cms-publish-actions-Ca_6MHNE.js +10 -0
- package/dist/client/assets/{use-connect-companion-DqnlsCkr.js → use-connect-companion-XN72CB3K.js} +1 -1
- package/dist/client/assets/{use-connection-BwtjQBnQ.js → use-connection-DdV5v_sO.js} +1 -1
- package/dist/client/assets/{use-copy-CRYT_lEh.js → use-copy-DGCMROZD.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B7toVaXI.js → use-create-virtual-mcp-CYamK9uo.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DF7pxcBk.js → use-date-fns-locale-RvTpk_ov.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CQ0k7XU4.js → use-debounced-autosave-CCKD06RC.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BgU5Mlo6.js → use-debounced-value-D4hMc82O.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DRFtUrcE.js → use-deco-credits-8Cm_6S2l.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-aPDwNsv_.js → use-decopilot-events-CMhdGvid.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DB3Kupec.js → use-delete-connection-DczFLZ2h.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-2Gp9fLRN.js → use-deployment-admin-D33YqaOd.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DfZ_rD3i.js → use-fast-preview-draft-url-5-OqnV1z.js} +1 -1
- package/dist/client/assets/{use-file-configs-DG6lQxbS.js → use-file-configs-B-dtUlcn.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-BAUqtwyl.js → use-inbox-feed-DgAPUhXS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-_QxCAV2S.js → use-infinite-scroll-Boo11DpH.js} +1 -1
- package/dist/client/assets/{use-join-requests-6CPF_lfc.js → use-join-requests-WGDHodyD.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CKFNH0cz.js → use-main-panel-tabs-D8UhTy5h.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CG_Nglqa.js → use-mcp-auth-status-Ue891t8t.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Db3WwHkW.js → use-mcp-client-B9-9jnHW.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D76okIQm.js → use-mcp-prompts-Duq-F4uG.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BqAiOdl2.js → use-mcp-tools-DvCVc1NG.js} +1 -1
- package/dist/client/assets/{use-mobile-BihCEjWm.js → use-mobile-BZz7cwuI.js} +1 -1
- package/dist/client/assets/use-move-blocks-DUpXqrhw.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-DH-wfLLT.js → use-navigate-to-agent-CEpb-TPy.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BRN6W4Vx.js → use-open-billing-url-AHjpaAXa.js} +1 -1
- package/dist/client/assets/{use-org-fs-DYzo-CVk.js → use-org-fs-8kFrjmMH.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-D2UZHvP3.js → use-org-repo-syncs-DHiYUCj6.js} +1 -1
- package/dist/client/assets/{use-org-sso-dGa9sTJw.js → use-org-sso-l3h7LAOC.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DNM22dA7.js → use-organization-roles-DWGBtp2u.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DOUb81j1.js → use-organization-settings-DAQWwUyU.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BYbZXvp4.js → use-panel-navigate-C-mQZt-r.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DaDkyw-s.js → use-project-native-view-presence-D2zRgAqZ.js} +1 -1
- package/dist/client/assets/{use-project-scope-JP7EfYKk.js → use-project-scope-DYBc2cnp.js} +1 -1
- package/dist/client/assets/{use-recent-apps-CXehLx4B.js → use-recent-apps-CahLdkOq.js} +1 -1
- package/dist/client/assets/{use-releases-BN_Y86Es.js → use-releases-Drxi11Hn.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-R8fOEnxQ.js → use-reports-diagnostic-C0y8CLzl.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-DoS1U6Xg.js → use-sandbox-events-DKnAt9WL.js} +1 -1
- package/dist/client/assets/{use-secrets-D5GrKapk.js → use-secrets-CCJcL_mR.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DoGRuc7-.js → use-section-preview-base-yGU9kv3R.js} +1 -1
- package/dist/client/assets/{use-session-runtime-Bp29dZ9K.js → use-session-runtime-CL3Ry0XG.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-B3wyR6wL.js → use-sidebar-collapsed-CbzeRAk-.js} +1 -1
- package/dist/client/assets/{use-tags-CyP6VoHu.js → use-tags-Af_mmSB1.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DIHarjfC.js → use-task-board-analytics-BkPBycom.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BWNw3HI5.js → use-task-board-events-Bs2sMvhO.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BhBkGpQk.js → use-task-board-item-prs-DtKTjCYS.js} +1 -1
- package/dist/client/assets/{use-task-metadata-B9_EDVoX.js → use-task-metadata-CaEOmtPV.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DJ-a1GYM.js → use-thread-analytics-DFAhXiiU.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-C5vhvZFZ.js → use-thread-outputs-wHP5lV5E.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DAGt4Ai1.js +1 -0
- package/dist/client/assets/{useQueries-DQ6fzXUk.js → useQueries-bayVPMWC.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BCXHmK3t.js +1 -0
- package/dist/client/assets/{users-CQ7ISHLn.js → users-BXC7BZTC.js} +1 -1
- package/dist/client/assets/{utils-rLTU2EyK.js → utils-C_XIOzcP.js} +1 -1
- package/dist/client/assets/{variant-calendar-Cc7Av7n-.js → variant-calendar-DqsG-wJ9.js} +1 -1
- package/dist/client/assets/variant-matcher-override-BfAJFrjh.js +1 -0
- package/dist/client/assets/view-header-BlWEzmVd.js +1 -0
- package/dist/client/assets/{virtual-mcp-D2W6CtJ3.js → virtual-mcp-BfSfmNNT.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-Cue4trO6.js → watch-sse-pool-D5nA1051.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/migrate.js +195 -195
- package/dist/server/server.js +846 -828
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-Cazr3KtN.js +0 -1
- package/dist/client/assets/agent-app-C_2G2yFw.js +0 -1
- package/dist/client/assets/agent-calendar-DVHehu_x.js +0 -1
- package/dist/client/assets/agent-deck-DvlsuAfl.js +0 -1
- package/dist/client/assets/agent-experiments-mSZe2g7e.js +0 -1
- package/dist/client/assets/agent-icon-Bo37g0fF.js +0 -1
- package/dist/client/assets/agent-library-CF5liEzt.js +0 -1
- package/dist/client/assets/agent-library-file-CdQ4OD0k.js +0 -1
- package/dist/client/assets/agent-monitor-D_MkJVMA.js +0 -1
- package/dist/client/assets/agent-releases-Bg7ZL_Eh.js +0 -2
- package/dist/client/assets/agent-settings-DEMD2MSc.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CN1FjAA8.js +0 -2
- package/dist/client/assets/agent-site-editor-content-243OnENt.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BMX4-2ho.js +0 -1
- package/dist/client/assets/agent-view-CC8vCjbP.js +0 -1
- package/dist/client/assets/alert-DGv9RNV8.js +0 -1
- package/dist/client/assets/api-keys-Ix_KjoIE.js +0 -1
- package/dist/client/assets/app-editor-Dhabc6r3.js +0 -1
- package/dist/client/assets/category-editor-B-uVQjgp.js +0 -1
- package/dist/client/assets/cms-settings-editor-DwHv5VFb.js +0 -1
- package/dist/client/assets/collection-table-wrapper-Dt2ctjEE.js +0 -1
- package/dist/client/assets/content-tab-gYwhAZMG.js +0 -22
- package/dist/client/assets/context-2BuuIfvl.js +0 -1
- package/dist/client/assets/daily-pulse-Ir1cHSjy.js +0 -1
- package/dist/client/assets/experiments-tab-DOsWoa0_.js +0 -1
- package/dist/client/assets/index-DfpwvZQG.css +0 -1
- package/dist/client/assets/library-DxYyWAwR.js +0 -1
- package/dist/client/assets/mock-board-DKq30aNi.js +0 -81
- package/dist/client/assets/monitoring-CGJWrng1.js +0 -1
- package/dist/client/assets/mustache-C57uA7K3.js +0 -4
- package/dist/client/assets/post-calendar-DScrSJbD.js +0 -1
- package/dist/client/assets/project-app-view-BN5-NmcY.js +0 -1
- package/dist/client/assets/project-reports-BkL-vra7.js +0 -1
- package/dist/client/assets/project-tasks-CkDZssBo.js +0 -1
- package/dist/client/assets/record-editor-dqXrhJSK.js +0 -1
- package/dist/client/assets/redirect-editor-CbLBgrtr.js +0 -1
- package/dist/client/assets/releases-api-BXtcXUmK.js +0 -1
- package/dist/client/assets/reports-Dqbx9vvQ.js +0 -1
- package/dist/client/assets/repositories-CXJpDO8c.js +0 -1
- package/dist/client/assets/route-CBQzhShl.js +0 -1
- package/dist/client/assets/schema-C1grSGu6.js +0 -1
- package/dist/client/assets/sections-editor-B5DUhp2P.js +0 -1
- package/dist/client/assets/settings-tab-D7kokq_E.js +0 -1
- package/dist/client/assets/site-draft-actions-CGinyKcf.js +0 -12
- package/dist/client/assets/site-draft-view-zFIJN3xy.js +0 -2
- package/dist/client/assets/site-editor-toast-SKvfrYhz.js +0 -1
- package/dist/client/assets/site-editor-uqa8dwZT.js +0 -1
- package/dist/client/assets/tasks-CAcr5cg4.js +0 -1
- package/dist/client/assets/use-content-sync-Cnva7d9w.js +0 -1
- package/dist/client/assets/use-move-blocks-CkTgDd_J.js +0 -1
- package/dist/client/assets/useInfiniteQuery-gMQYsgHb.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-huohnS0M.js +0 -1
- package/dist/client/assets/variant-matcher-override-CMTA6uf4.js +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
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 Fn,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 $n,C as el,R as tl}from"./index-DampV2dK.js";import{S as sl}from"./separator-CjZHveNE.js";import{f as nl,u as Zt,r as Pa,l as ja,c as Sa,b as al}from"./chat-context-BfN3Aasc.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-SKvfrYhz.js";import{L as pl,a as bl}from"./shell-layout-DDrdQOKB.js";import{I as Ta}from"./toolbar-icon-button-DPdWBHmX.js";import{P as gl,a as xl,b as vl}from"./popover-C6LRW83t.js";import{c as kt,T as Ct,a as Nt,b as As}from"./tooltip-DZKcSDR4.js";import{d as yl,e as wl,c as Pl,C as _n,a as On,b as Ln}from"./command-Cn1kHhQA.js";import{T as Lt,a as Ia,c as Da}from"./tabs-C_tuCc9E.js";import{t as Ba}from"./ChevronUp-B84nbyaB.js";import{aF as Rs,H as jl,a as Ma,aG as Sl,b as Fa,aH as $a,O as kl}from"./agent-icon-Bo37g0fF.js";import{i as Ea}from"./DotsVertical-DjAfwlFJ.js";import{b as _a}from"./Tool01-C4vr_Fbq.js";import{s as Oa}from"./Plus-DOCl9FQV.js";import{s as Ts}from"./Trash01-7cnh0-6j.js";import{u as hn,r as _s,a as Un,n as Os,g as fn,b as mn}from"./use-releases-BN_Y86Es.js";import{k as Cl,d as Nl,j as qn}from"./thread-intent-BAI3Rlfu.js";import{h as La,r as Ua,g as Al,f as tt,a as pn,j as qa}from"./repository-binding-DSYWyWQk.js";import{u as Rl}from"./use-debounced-value-BgU5Mlo6.js";import{u as Tl}from"./use-clock-tick-_wcwwysm.js";import{u as Il}from"./useInfiniteQuery-gMQYsgHb.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-DH-wfLLT.js";import{a as zn}from"./virtual-mcp-D2W6CtJ3.js";import{u as Va,c as Fl,e as $l}from"./experiments-tab-choice-DdG3xkHn.js";import{G as Ga}from"./repository-picker-3tqi2Hvb.js";import{u as bn}from"./use-session-runtime-Bp29dZ9K.js";import{u as El,c as _l,d as Ol,e as Ll}from"./use-fast-preview-draft-url-DfZ_rD3i.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 $t,f as xn,af as Vl}from"./parse-sections-D3_nSXsH.js";import"./index-BVIkRnC2.js";import{T as Gl}from"./textarea-CiRqIfaf.js";import{i as vn}from"./CheckCircle-BVnx66vP.js";import{s as xs}from"./Image01-CNDErtLw.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-BXtcXUmK.js";import{a as ni,g as ai}from"./UserSquare-CBDcV-Sr.js";import{n as ri,b as li,m as ii}from"./named-rule-uses-ZJHANdK7.js";import{f as yn,b as Ja,r as Is,p as oi,c as Xa,i as wn,d as ci,e as Ya,m as di,h as ui,g as Za,j as hi,n as fi,k as mi,l as pi,o as bi,q as Pn,t as gi,u as er,s as tr,v as Ls}from"./sandbox-git-api-CH_-QFpD.js";import{b as xi,g as vi}from"./utils-rLTU2EyK.js";import{i as yi}from"./Monitor01-DLFV9f_c.js";import{w as jn,g as wi,D as Pi}from"./section-preview-url-7zfngvgW.js";import{w as Sn}from"./device-hint-SeLRi17j.js";import{w as Hn}from"./editor-C2vaY1i0.js";import{d as ji,a as Si,R as sr}from"./section-array-field-DvT6jzl0.js";import{u as nr}from"./use-content-sync-Cnva7d9w.js";import{s as ar}from"./save-changes-debug-nBi-n9eV.js";import{u as ki}from"./use-mcp-client-Db3WwHkW.js";import{u as Ci}from"./use-sandbox-events-DoS1U6Xg.js";import{b as Ni,a as Ai}from"./sandbox-lifecycle-context-BVJJp5p1.js";import{b as Ri}from"./thread-route-DCxAnsEA.js";const Kn=/[\r\n<>]/,Ti=/^[^\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}:Ti.test(s)?{userName:e,userEmail:s}:{userName:e}}function Ii(t){return t.split(`
|
|
2
|
-
`).filter(e=>!/^Co-authored-by:\s/i.test(e)).join(`
|
|
3
|
-
`).trimEnd()}function Di(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=Ii(t),n=Di(s);if(a.includes(n))return a;const o=a.trimEnd();return o.length>0?`${o}
|
|
4
|
-
|
|
5
|
-
${n}`:n}function Bi(t,e){const s=t?.trim();return s?rr(s,e):s||void 0}function Mi(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 $i(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 Ei(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=()=>_i(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(Oi,{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 _i(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??rl})}function Oi(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 Li=10080*60*1e3;function Ui({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-Li,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 qi=100,zi=50,Hi=300;function Ks(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Ki(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,Hi);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?zi:qi,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:F}=Il(k),I=j&&(b!==m||A),T=(N?.pages??[]).flatMap(Vi),D=Tl(6e4),Y=Ui({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]!==F?(U=()=>{F()},e[26]=F,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 Vi(t){return t.branches}function Gi(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),[F,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:$}=ka(s),te=Ca(s),re=P&&!!te.connection,he=P?te.connection?.endpoint??null:J,G=!!he;let pe;e[0]!==$||e[1]!==P||e[2]!==te?(pe=()=>{$(),P&&te.clear()},e[0]=$,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,Fe,Be,Pe,Me,Se,$e,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}=Mi({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($s=>$s.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],$e=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($s=>$s.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],Fe=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 Fs=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";e[119]!==Fs?(Ne=X("shrink min-w-0 max-w-[220px] gap-2",Fs,Ta),e[119]=Fs,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]=Fe,e[43]=Be,e[44]=Pe,e[45]=Me,e[46]=Se,e[47]=$e,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],Fe=e[42],Be=e[43],Pe=e[44],Me=e[45],Se=e[46],$e=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]!==F||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]!==$e||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=F?r.jsx(Wi,{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(Qi,{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:()=>$e(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(Ei,{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]=F,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]=$e,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 Ft;e[205]===Symbol.for("react.memo_cache_sentinel")?(Ft=ue=>{ue||ee(null)},e[205]=Ft):Ft=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]!==Fe||e[225]!==He?(Ke=r.jsx(sn,{onClick:Fe,variant:"destructive",children:He}),e[224]=Fe,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:Ft,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 F;e[41]!==N||e[42]!==E?(F=r.jsxs(Ss,{children:[N,E]}),e[41]=N,e[42]=E,e[43]=F):F=e[43];let I;return e[44]!==s||e[45]!==P||e[46]!==F||e[47]!==p?(I=r.jsxs("div",{ref:s,className:p,children:[P,F]}),e[44]=s,e[45]=P,e[46]=F,e[47]=p,e[48]=I):I=e[48],I}function Qi(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 Wi(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}=Ki(w),F=u&&d==="prs";let I;e[10]!==s||e[11]!==a||e[12]!==c||e[13]!==l||e[14]!==F||e[15]!==o?(I={orgId:s,orgSlug:a,target:o,owner:c,repo:l,enabled:F},e[10]=s,e[11]=a,e[12]=c,e[13]=l,e[14]=F,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 $;e[54]!==x?($=x("thread.branchPicker.branchesTab"),e[54]=x,e[55]=$):$=e[55];let te;e[56]!==$?(te=r.jsx(Lt,{value:"branches",className:"h-6 px-2.5 text-xs",children:$}),e[56]=$,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($i,{url:p,onSave:m}):r.jsxs(yl,{filter:d==="branches"?Ji: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 Ji(t,e){return Ks(t,e)?1:0}function Xi(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(Gi,{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 Yi(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 Zi(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=f&&La(p)?r.jsx(Xi,{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]!==F?(I=r.jsx(Yi,{branchPill:F}),e[23]=F,e[24]=I):I=e[24],I}const eo=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 to(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(eo({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 so(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(to,{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(no)})]}):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 no(t){return r.jsx(so,{item:t},t.key)}async function ao(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function ro(t,e,{hosted:s}){return s&&t!==null?t:e}function lo(t,e){const s=M.c(11),[a,n]=q.useState(null);let o;s[0]!==a||s[1]!==t||s[2]!==e?(o=ro(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 io({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}const oo="secret";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:Bi(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 Ja(ys(t),a,t.baseBranch,mo(t)).catch(()=>null);if(n&&Is(n)!==s)throw new Vs}function fr(t,e){return oi(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"),()=>Xa(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?xi(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===oo&&"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=>Fn(Kr(p.file))===Fn(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 F=y?Kt(f,y,n):null;i.push({...N,kind:"page",name:F?.name??Qa(f),pagePath:F?.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(F=>F.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 Fo(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 $o(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=$o(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 F;e[23]!==s.missingRules?(F=s.missingRules??[],e[23]=s.missingRules,e[24]=F):F=e[24];const I=F,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=Fo(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,F=S>=0?A.slice(0,S):null,I=vi(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}),F&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F}),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"&&ji(e)?t.blockKey:null}function Ko(t){return t.kind!=="page"?!0:!t.pagePath||$t(t.pagePath).length>0}function Vo(t,e){try{return wi(t,Vl,e)}catch{return null}}function Go(t,e,s){if(!e)return;const a=Kl(e,t);if(!a)return null;if($t(a.path).length===0||s?.path!==a.path)return a.path;const n=xn(a.path,s.params);return $t(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($t(s).length===0)return s;if(e?.path!==s)return"";const a=xn(s,e.params);return $t(a).length===0?a:""}function Jo(t,e){const s=e.trim();if(!s||$t(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(),Pi):null,F=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=$t(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&&$t(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:F].flatMap(O=>O?[Sn(O,P)]:[]):[]).every(O=>ee.has(O));let $;e[16]!==u||e[17]!==se?($=se&&u?O=>{O&&u()}:void 0,e[16]=u,e[17]=se,e[18]=$):$=e[18];const te=$,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:F,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(yi,{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)}},F=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:()=>ci({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?F(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 F(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||!Za(w))throw w;return d.current??=l(),await d.current,P()}},f=fa({...Ya(i),queryFn:()=>h(()=>yn(i))}),p=f.data,m=p.changedFiles??null,b=p.headSha??null,g=m?m.length>0:di(p)||ui(p),x=Tt({queryKey:mc(e,s,a,o,b,bc(p,c)),queryFn:()=>h(()=>Ja(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=()=>hi({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!Za(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&&fi(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=mi(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=pi(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=bi(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=io({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:Fa;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(Fc,{...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 Fr(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=Fr(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 Fc(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=Fr(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:F}=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=lo(oe,J),{summary:$,cardsPending:te,bodiesPending:re,compareDraft:he}=se.shown,[G,pe]=q.useState(null),[Z,L]=q.useState(!1),[K,ce]=q.useState($c);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]!==$?(De=Co(G,Ro($)),e[11]=G,e[12]=$,e[13]=De):De=e[13];const Fe=De,Be=[...$.pages,...$.blocks,...$.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),$e=!!s.v8,[nt,pt]=q.useState(null),Re=$e?Nc({selectedId:Me,readyIds:K,lastShownId:nt,liveIds:Se}):Me;$e&&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]!==Fe||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:Fe,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]=Fe,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&&$.count===0,Ze=$.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]!==$.count||e[51]!==S?(it=de?$.count===0?S("thread.publishPopover.submitForReview"):$.count===1?S("thread.publishPopover.submitOneForReview"):S("thread.publishPopover.submitCountForReview",{count:$.count}):Ye?S("thread.publishPopover.notLive"):kc($.count,d,!!s.v8,S),e[46]=d,e[47]=de,e[48]=Ye,e[49]=s.v8,e[50]=$.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]!==F||e[57]!==W||e[58]!==S){const me=Zr(new Date(W.mergedAt),F),Te=dc(W);be=Te?S("thread.publishPopover.lastPublishedBy",{when:me,name:Te}):S("thread.publishPopover.lastPublished",{when:me}),e[56]=F,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]!==$.count||e[62]!==S?(Mt=de?S("thread.publishPopover.submitForReview"):$.count===1?S("thread.publishPopover.publishOne"):$.count>1?S("thread.publishPopover.publishCount",{count:$.count}):S("thread.publishPopover.publish"),e[60]=de,e[61]=$.count,e[62]=S,e[63]=Mt):Mt=e[63];const _t=Mt,Ft=(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]!==$.count||e[81]!==S?(ct=$.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]=$.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,{})]})}):$.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(Fa,{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")})]}):$.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:$.count,total:ae})}):null,Ft(S("thread.publishPopover.pagesGroup"),$.pages),Ft(S("thread.publishPopover.blocksGroup"),$.blocks),Ft(S("thread.publishPopover.otherGroup"),$.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",$e?Ie(W)===Re?"z-10":"pointer-events-none opacity-0":Ie(W)!==Me&&"hidden"),inert:$e&&Ie(W)!==Re,"aria-hidden":$e&&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:$e?()=>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]!==Fe||e[93]!==$.count||e[94]!==S?(Ke=$.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:Fe,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]=Fe,e[93]=$.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 $c(){return new Set}function Ec(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return Si[t].short}const _c=new Set(["failure","timed_out","cancelled","action_required"]);function $r(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($r).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($r).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($a,{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),F=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=Ya({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(F.data,u??""):null,J=oe?oe.branchMeta:U?{kind:"ready",branch:Pn(U)??u??"",base:U.base??"main",workingTreeDirty:gi(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,$=A?F: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=$n({mutationFn:()=>ao({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 Xa({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:tr({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=$n(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:$.isFetching&&!!$.error,statusError:$.error instanceof Error?$.error.message:$.error?String($.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,Fe=q.useRef(null);if(q.useEffect(()=>{!De||!te||Fe.current!==De&&(Fe.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":{$.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,$e=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:$e,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:er(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($a,{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),F=c&&da.has(S.action),I=S.action==="merge"&&o,T=F?s("thread.headerActions.saving"):E?s("thread.headerActions.chatIsRunning"):S.tooltip;return{key:S.key,label:S.label,icon:oa(S.action),disabled:!!(E||F||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=ki({connectionId:tl,orgId:s.id,orgSlug:s.slug}),b=Ni(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}=Ci(),N={orgSlug:s.slug,virtualMcpId:t,branch:c??"",threadId:u??null},C=Tt({queryKey:tr(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,F=c??E??void 0,I=(A.kind==="ready"?A.branch:null)??F??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=er(n?.metadata?.publishPolicy),ee=Ra(s.slug,t),{previewUrl:Q}=Ai(),{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:F,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,$=_.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!==$&&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:$}));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 F?r.jsxs(r.Fragment,{children:[L,r.jsx(Br,{open:f.open,mode:f.mode,fastPreview:!1,recoverSandbox:()=>b.mutateAsync({virtualMcpId:t,branch:F,...u?{threadId:u}:{}}),onOpenChange:K=>{K||p(ce=>({...ce,open:!1}))},orgSlug:s.slug,virtualMcpId:t,branch:F,baseBranch:$,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(sr,{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 F=[...w.pages,...w.blocks],I=F.find(ae=>Ie(ae)===g)??F[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(sr,{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(Ri());let s;return t[0]!==e?(s=$l(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&&Fl(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(Zi,{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};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-site-editor-BSG_1jHk.js","assets/index-DampV2dK.js","assets/index-DfpwvZQG.css","assets/chat-context-BfN3Aasc.js","assets/use-panel-navigate-BYbZXvp4.js","assets/thread-route-DCxAnsEA.js","assets/use-project-scope-JP7EfYKk.js","assets/repository-binding-DSYWyWQk.js","assets/use-mcp-client-Db3WwHkW.js","assets/auth-BRizJz1-.js","assets/autosend-DweeW6OU.js","assets/thread-intent-BAI3Rlfu.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-Cue4trO6.js","assets/task-board-CFm7hWmU.js","assets/schema-C1grSGu6.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-aPDwNsv_.js","assets/use-ai-providers-t0yXUakZ.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-DOUb81j1.js","assets/site-draft-actions-CGinyKcf.js","assets/separator-CjZHveNE.js","assets/site-editor-toast-SKvfrYhz.js","assets/use-session-runtime-Bp29dZ9K.js","assets/experiments-tab-choice-DdG3xkHn.js","assets/sandbox-url-D3mC8qhT.js","assets/utils-rLTU2EyK.js","assets/ZoomOut-CeC9MLz9.js","assets/Image01-CNDErtLw.js","assets/use-sandbox-events-DoS1U6Xg.js","assets/sandbox-git-api-CH_-QFpD.js","assets/shell-layout-DDrdQOKB.js","assets/Building02-BP04ade-.js","assets/UserSquare-CBDcV-Sr.js","assets/agent-icon-Bo37g0fF.js","assets/AlertCircle-BQ7gdGwO.js","assets/Tool01-C4vr_Fbq.js","assets/ArrowUp-hmPXempM.js","assets/ArrowLeft-CzKuuRT3.js","assets/LinkBroken01-Ps7Q2TgQ.js","assets/ShoppingBag01-2qRSy_0A.js","assets/CheckCircle-BVnx66vP.js","assets/ChevronUp-B84nbyaB.js","assets/ChevronSelectorVertical-D6sC3Vmb.js","assets/Copy01-Bac6SVw1.js","assets/CreditCard01-t317btce.js","assets/DotsVertical-DjAfwlFJ.js","assets/Globe04-DSBhW1To.js","assets/SwitchHorizontal01-DM99h8Bb.js","assets/Key01-C_7n0i1h.js","assets/Link01-kTPC8Qx-.js","assets/Minus-DwgwDeRT.js","assets/Monitor01-DLFV9f_c.js","assets/Sun-Cdvulc3r.js","assets/Play-CQGngRNi.js","assets/Plus-DOCl9FQV.js","assets/SearchMd-BbTaBsWc.js","assets/Trash01-7cnh0-6j.js","assets/Upload01-DJferCdW.js","assets/Users01-hfFVY4Rg.js","assets/XClose-B2l9VhGF.js","assets/use-clock-tick-_wcwwysm.js","assets/command-Cn1kHhQA.js","assets/index-DMyWhhx4.js","assets/integration-icon-CiAW8rDV.js","assets/project-icon-C4YSWqLo.js","assets/new-project-dialog-BVdmAMTF.js","assets/label-CjCrcKeN.js","assets/repository-import-picker-CSAKO3X5.js","assets/use-navigate-to-agent-DH-wfLLT.js","assets/repository-picker-3tqi2Hvb.js","assets/tooltip-DZKcSDR4.js","assets/index-DgIUPTVB.js","assets/useInfiniteQuery-gMQYsgHb.js","assets/infiniteQueryObserver-koP9jk4d.js","assets/collection-search-INMm_CkT.js","assets/use-debounced-value-BgU5Mlo6.js","assets/required-auth-layout-DMJ9p0SW.js","assets/use-org-sso-dGa9sTJw.js","assets/shell-layout-CE2Eihra.css","assets/toolbar-icon-button-DPdWBHmX.js","assets/popover-C6LRW83t.js","assets/tabs-C_tuCc9E.js","assets/active-indicator-CCMhAsc_.js","assets/use-releases-BN_Y86Es.js","assets/serial-task-queue-CGOeQgpr.js","assets/virtual-mcp-D2W6CtJ3.js","assets/url-slug-B3-3kua2.js","assets/use-fast-preview-draft-url-DfZ_rD3i.js","assets/section-preview-url-7zfngvgW.js","assets/preview-link-C762yHOt.js","assets/variant-draft-pointer-BeAKcq_c.js","assets/parse-sections-D3_nSXsH.js","assets/index-BVIkRnC2.js","assets/tool-namespace-MjGHB-2n.js","assets/drawer-LA3NkA0S.js","assets/use-mobile-BihCEjWm.js","assets/use-mcp-prompts-D76okIQm.js","assets/usage-stats-D7pL8W8y.js","assets/form-oXstmc9Q.js","assets/utils-CVEq3hMx.js","assets/markdown-Cqcjq3Xf.js","assets/use-copy-CRYT_lEh.js","assets/input-nNYp-8x6.js","assets/icon-button-vGME3QbC.js","assets/file-type-icon-D98G7WK4.js","assets/chat-draft-1H_chlRR.js","assets/select-BjOZT7HR.js","assets/index-BdQq_4o_.js","assets/use-deco-credits-DRFtUrcE.js","assets/toggle-group-DkOJZdVq.js","assets/use-open-billing-url-BRN6W4Vx.js","assets/index-20HoU-20.js","assets/checkbox-BGizxNX2.js","assets/ai-providers-logos-DD3qZ33J.js","assets/input-B3p7vRnZ.js","assets/suggestion-D6r-qU7q.js","assets/use-org-fs-DYzo-CVk.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-0Gw_Q4lr.js","assets/plan-ladder-BQnQ-c-o.js","assets/add-connection-dialog-DarQ1krm.js","assets/extract-connection-data-BPic6jPp.js","assets/metadata-D72DunRR.js","assets/connection-Dizw96b7.js","assets/connection-card-D3-Gdl0S.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-CiRqIfaf.js","assets/use-connection-BwtjQBnQ.js","assets/schema-BcGVNeII.js","assets/connection-form-helpers-DYxyLK9S.js","assets/authenticate-and-persist-oauth-DzQvKWuf.js","assets/mcp-oauth-CfI4AoXx.js","assets/mcp-oauth-CJZC8nld.js","assets/collection-tabs-SEBBjtRQ.js","assets/badge-6mumabZP.js","assets/use-infinite-scroll-_QxCAV2S.js","assets/useSuspenseInfiniteQuery-huohnS0M.js","assets/use-task-board-events-BWNw3HI5.js","assets/use-chat-layout-state-Be7PCK7m.js","assets/input-Bwd_JSM8.css","assets/pair-BlVTZ-F_.js","assets/collapsible-BN3qlGJC.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-dATLexqT.js","assets/types-D-tO7eft.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-DfTFlGFH.js","assets/use-thread-outputs-C5vhvZFZ.js","assets/releases-api-BXtcXUmK.js","assets/use-content-sync-Cnva7d9w.js","assets/named-rule-uses-ZJHANdK7.js","assets/device-hint-SeLRi17j.js","assets/editor-C2vaY1i0.js","assets/section-array-field-DvT6jzl0.js","assets/alert-DGv9RNV8.js","assets/save-changes-debug-nBi-n9eV.js","assets/sandbox-lifecycle-context-BVJJp5p1.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/index-CUZ1Ro0y.js","assets/use-sidebar-collapsed-B3wyR6wL.js","assets/resizable-CWhIVRKn.js","assets/agent-site-editor-DDGTF8rc.css","assets/agent-site-editor-content-243OnENt.js","assets/agent-view-guard-BHNxFqz2.js","assets/use-main-panel-tabs-CKFNH0cz.js","assets/use-mcp-tools-BqAiOdl2.js","assets/resolve-tab-icon-l6kvyo7T.js","assets/use-task-metadata-B9_EDVoX.js","assets/preview-source-BsRLGWUP.js","assets/use-project-native-view-presence-DaDkyw-s.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/use-file-configs-DG6lQxbS.js","assets/site-slug-DebpOoQq.js","assets/feature-gate-uVlfgQri.js","assets/content-tab-gYwhAZMG.js","assets/blocks-tab-states-5o0yQDwk.js","assets/slider-DrOo7_UG.js","assets/index-CAdTS9ZX.js","assets/tooltipContext-J8gN2jYl.js","assets/CategoricalChart-GePqKrAt.js","assets/index-BapUxZWk.js","assets/ActiveShapeUtils-CwNMVlsU.js","assets/Sector-CZev-ohv.js","assets/symbol-CJnTkOND.js","assets/empty-state-DHgdXyfD.js","assets/held-block-view-CpXdgp7m.js","assets/switch-BaweF4ir.js","assets/scroll-area-Dbl0Ja6M.js","assets/monaco-editor-5y8rZvs2.js","assets/calendar-lhJ8p0qo.js","assets/editor-classes-wrVHQOxp.js","assets/core.esm-BdDh475y.js","assets/sortable.esm-bTAsk8Vk.js","assets/combobox-BO0oi3KV.js","assets/search-input-CI-RscAC.js","assets/asset-utils-BFPFspZC.js","assets/mustache-C57uA7K3.js","assets/date-utils-CrvIKg-s.js","assets/use-move-blocks-CkTgDd_J.js","assets/empty-state-BIXUpBao.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as j,j as m,B as L,b as E,l as ie,E as oe,r as M,t as F,x as re,I as G,v as ce,D as de,be as J,a4 as me,bj as ue,n as A}from"./index-DampV2dK.js";import{i as fe}from"./ArrowLeft-CzKuuRT3.js";import{B as K}from"./badge-6mumabZP.js";import{L as pe}from"./label-CjCrcKeN.js";import{s as xe}from"./Trash01-7cnh0-6j.js";import{a as he,n as ge,c as ve,d as Re,e as be,f as Ne,g as X,h as je}from"./named-rule-uses-ZJHANdK7.js";import{ag as C,ai as Q,al as ee,ar as ye,d as Ce,as as we,at as Ee,au as ke}from"./parse-sections-D3_nSXsH.js";import{K as te,aw as Se,ax as V,u as se,D as Ue,ak as De,ah as Oe,l as Te}from"./site-editor-toast-SKvfrYhz.js";import{y as ne,L as ae,p as He,i as Ie,u as _e,S as Be}from"./blocks-tab-states-5o0yQDwk.js";import{b as Fe}from"./ZoomOut-CeC9MLz9.js";import{a as Pe}from"./UserSquare-CBDcV-Sr.js";import{u as $e}from"./use-apply-named-rule-x6zm2qwO.js";import{E as Me}from"./empty-state-BIXUpBao.js";import{u as Ke}from"./chat-context-BfN3Aasc.js";import{a as Ve}from"./use-panel-navigate-BYbZXvp4.js";const jt="p-4";function yt(s){const e=j.c(14),{intro:t,back:n,actions:a}=s;let i;e[0]!==a?(i=a?m.jsx("div",{className:"flex shrink-0 items-center gap-2","data-slot":"view-actions",children:a}):null,e[0]=a,e[1]=i):i=e[1];const r=i;if(n){let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(fe,{size:16}),e[2]=c):c=e[2];let d;e[3]!==n.label||e[4]!==n.onClick?(d=m.jsxs(L,{variant:"ghost",size:"sm",onClick:n.onClick,children:[c,n.label]}),e[3]=n.label,e[4]=n.onClick,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==d?(u=m.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between gap-2 border-b px-4","data-testid":"site-draft-view-header",children:[d,r]}),e[6]=r,e[7]=d,e[8]=u):u=e[8],u}let o;e[9]!==t?(o=m.jsx("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:t}),e[9]=t,e[10]=o):o=e[10];let l;return e[11]!==r||e[12]!==o?(l=m.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-x-4 gap-y-2 px-4 pt-4","data-testid":"site-draft-view-header",children:[o,r]}),e[11]=r,e[12]=o,e[13]=l):l=e[13],l}function Le(s,e,t,n){const a=C(s,e);return a.kind==="conflict"?null:{writes:{[Q(e).blockKey]:ee(a.block,e,t,n)}}}function Ae(s,e,t,n){const a=C(s,e);if(a.kind==="conflict")return{problem:"conflict"};const i=ne(t,Object.keys(a.values));return i?{problem:i}:{change:Le(s,e,t.trim(),n)}}function ze(s,e,t){const n=C(s,e);return n.kind!=="saved"||!Object.hasOwn(n.block,t)?null:{writes:{[Q(e).blockKey]:ye(n.block,t)}}}function We(s,e,t,n){if(n===void 0)return null;const a=C(s,e);return a.kind==="conflict"||Object.hasOwn(a.block,t)?null:{writes:{[Q(e).blockKey]:ee(a.block,e,t,n)}}}function qe(s,e,t,n){if(!s)return null;const a=C(s,e);return a.kind!=="saved"||!Object.hasOwn(a.values,t)?"new":Je(a.values[t],n)?"published":"changed"}function Qe(s,e,t){if(!s)return;const n=C(s,e);if(n.kind==="saved")return n.values[t]}function Ge(s,e,t){if(!e)return[];const n=C(e,t);if(n.kind!=="saved")return[];const a=C(s,t),i=a.kind==="conflict"?{}:a.values;return Object.keys(n.values).filter(r=>!Object.hasOwn(i,r))}function Je(s,e){return typeof s=="number"||typeof e=="number"?s===e:Y(s.start,e.start)&&Y(s.end,e.end)}function Y(s,e){return s===void 0||e===void 0?s===e:s===e||new Date(s).getTime()===new Date(e).getTime()}function Ct(s){const e=j.c(21),{kind:t,rows:n,wholeRows:a,loading:i,marked:r,onOpen:o}=s,l=E(),c=t==="experiments";let d;e[0]!==l?(d=l("sectionsEditor.namedRuleUses.title"),e[0]=l,e[1]=d):d=e[1];let u;e[2]!==d?(u=m.jsx("h3",{className:"text-sm font-medium",children:d}),e[2]=d,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==r||e[6]!==o||e[7]!==n||e[8]!==l||e[9]!==c?(f=i?m.jsx("p",{className:"text-sm text-muted-foreground",children:l("sectionsEditor.namedRuleUses.loading")}):n.length===0?m.jsx("p",{className:"text-sm text-muted-foreground",children:l(c?"sectionsEditor.namedRuleUses.emptyTests":"sectionsEditor.namedRuleUses.emptyCampaigns")}):m.jsx(W,{rows:n,marked:r,onOpen:o}),e[4]=i,e[5]=r,e[6]=o,e[7]=n,e[8]=l,e[9]=c,e[10]=f):f=e[10];let x;e[11]!==r||e[12]!==o||e[13]!==l||e[14]!==c||e[15]!==a?(x=a.length>0&&m.jsxs("div",{className:"mt-3 flex flex-col gap-1",children:[m.jsx("h4",{className:"text-xs font-medium text-muted-foreground",children:l(c?"sectionsEditor.namedRuleUses.wholeTests":"sectionsEditor.namedRuleUses.wholeCampaigns")}),m.jsx("p",{className:"text-xs text-muted-foreground",children:l(c?"sectionsEditor.namedRuleUses.wholeTestsHint":"sectionsEditor.namedRuleUses.wholeCampaignsHint")}),m.jsx(W,{rows:a,marked:r,onOpen:o})]}),e[11]=r,e[12]=o,e[13]=l,e[14]=c,e[15]=a,e[16]=x):x=e[16];let h;return e[17]!==u||e[18]!==f||e[19]!==x?(h=m.jsxs("section",{className:"flex flex-col gap-2","data-testid":"named-rule-used-by",children:[u,f,x]}),e[17]=u,e[18]=f,e[19]=x,e[20]=h):h=e[20],h}function W(s){const e=j.c(11),{rows:t,marked:n,onOpen:a}=s,i=E();let r;if(e[0]!==n||e[1]!==a||e[2]!==t||e[3]!==i){let l;e[5]!==n||e[6]!==a||e[7]!==i?(l=c=>{const d=c.blockKind==="page"?Pe:Fe,u=c.state==="removed-in-draft";return m.jsxs("li",{className:"flex items-center gap-3 px-3 py-2","data-use-state":c.state,children:[m.jsx(d,{size:14,className:"shrink-0 text-muted-foreground"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:ie("truncate text-sm",u&&"text-muted-foreground line-through"),children:c.title}),m.jsx("p",{className:"truncate text-xs text-muted-foreground",children:[c.path,c.section,c.variant?i("sectionsEditor.namedRuleUses.variant",{index:String(c.variant)}):null].filter(Boolean).join(" · ")})]}),n&&c.state==="draft-only"&&m.jsx(K,{variant:"muted",children:i("sectionsEditor.namedRuleUses.draftOnly")}),n&&u&&m.jsx(K,{variant:"muted",children:i("sectionsEditor.namedRuleUses.removed")}),a&&!u&&m.jsxs(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>a(c),children:[i("sectionsEditor.namedRuleUses.open"),m.jsx(oe,{size:14})]})]},he(c))},e[5]=n,e[6]=a,e[7]=i,e[8]=l):l=e[8],r=t.map(l),e[0]=n,e[1]=a,e[2]=t,e[3]=i,e[4]=r}else r=e[4];let o;return e[9]!==r?(o=m.jsx("ul",{className:"divide-y divide-border/60 rounded-md border border-border/60",children:r}),e[9]=r,e[10]=o):o=e[10],o}function Xe(s){const e=j.c(12),{kind:t,rows:n,names:a,onOpen:i}=s,r=E();if(n.length===0)return null;let o;e[0]!==t||e[1]!==a||e[2]!==r?(o=r(t==="experiments"?a===1?"sectionsEditor.namedRuleUses.missingTestOne":"sectionsEditor.namedRuleUses.missingTests":a===1?"sectionsEditor.namedRuleUses.missingCampaignOne":"sectionsEditor.namedRuleUses.missingCampaigns"),e[0]=t,e[1]=a,e[2]=r,e[3]=o):o=e[3];let l;e[4]!==o?(l=m.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[4]=o,e[5]=l):l=e[5];let c;e[6]!==i||e[7]!==n?(c=m.jsx(W,{rows:n,marked:!1,onOpen:i}),e[6]=i,e[7]=n,e[8]=c):c=e[8];let d;return e[9]!==l||e[10]!==c?(d=m.jsxs("section",{className:"flex flex-col gap-2","data-testid":"named-rule-missing-uses",children:[l,c]}),e[9]=l,e[10]=c,e[11]=d):d=e[11],d}function Ye({kind:s,name:e,meta:t,pending:n,apply:a,reread:i,onDeleted:r,onUndo:o}){const l=E(),c=s==="experiments",[d,u]=M.useState(!1),f=async()=>{const p=await i();return p||F.info(l("sectionsEditor.namedRules.unavailable"),{...V,description:l("sectionsEditor.namedRules.unavailableHint")}),p},x=async p=>{const R=await f();if(!R)return;const g=We(R,s,e,p);if(g){o(g);return}const b=C(R,s).kind==="conflict";F.info(l(b?"sectionsEditor.namedRules.changedMeanwhile":"sectionsEditor.namedRules.alreadyBack"),{...V,description:l(b?"sectionsEditor.namedRules.changedMeanwhileHint":"sectionsEditor.namedRules.alreadyBackHint")})},h=async()=>{u(!0);let p;try{p=await f()}finally{u(!1)}if(!p)return;const R=ze(p,s,e);if(!R)return;const g=C(p,s),b=g.kind==="saved"?g.block[e]:void 0,v=ge(l,ve(p,t,s,e)),y=await a(R);if(y.ok){if(y.keptTheirs){te(l,!1);return}r(),F.success(c?l("experiments.v8.deleted",{name:e}):l("sandbox.dateCampaigns.deleted",{name:e}),{id:Se,description:v?.one?l("sectionsEditor.namedRuleDelete.stillUsedOne",{places:v.places}):v?l("sectionsEditor.namedRuleDelete.stillUsed",{places:v.places}):l(c?"experiments.v8.deletedHint":"sandbox.dateCampaigns.deletedHint"),action:{label:l("sectionsEditor.namedRules.undo"),onClick:()=>{x(b)}}})}};return m.jsxs(L,{type:"button",variant:"ghost",size:"sm",disabled:n||d,onClick:()=>{h()},children:[m.jsx(xe,{size:16}),l(c?"experiments.v8.delete":"sandbox.dateCampaigns.delete")]})}function Ze(s){const e=j.c(11);let t;e[0]!==s.branch||e[1]!==s.orgSlug||e[2]!==s.virtualMcpId?(t={orgSlug:s.orgSlug,virtualMcpId:s.virtualMcpId,branch:s.branch},e[0]=s.branch,e[1]=s.orgSlug,e[2]=s.virtualMcpId,e[3]=t):t=e[3];const n=t,a=se(s.virtualMcpId,s.branch),i=Ue(n),r=De(a,i||null),o=Oe(a,i||null,r.data);if(!s.decofile)return null;let l;e[4]!==r.data?(l=r.data?Object.keys(r.data.changes).length:void 0,e[4]=r.data,e[5]=l):l=e[5];const c=o.data?.entries;let d;return e[6]!==s.decofile||e[7]!==s.meta||e[8]!==l||e[9]!==c?(d=Re({decofile:s.decofile,meta:s.meta,changeCount:l,sides:c}),e[6]=s.decofile,e[7]=s.meta,e[8]=l,e[9]=c,e[10]=d):d=e[10],d}function T(s,e){return e==="experiments"?{new:s("experiments.v8.new"),usedBy:t=>s("experiments.v8.usedBy",{count:String(t)}),notUsed:s("experiments.v8.notUsed"),stateNew:s("experiments.v8.state.new"),stateChanged:s("experiments.v8.state.changed"),removedTitle:s("experiments.v8.removedTitle"),removedHint:s("experiments.v8.removedHint"),created:t=>s("sectionsEditor.namedRulePicker.createdTest",{name:t}),renamed:t=>s("experiments.v8.renamed",{name:t}),renameHint:s("experiments.v8.renameHint"),renameWholeHint:s("experiments.v8.renameWholeHint")}:{new:s("sandbox.dateCampaigns.new"),usedBy:t=>s("sandbox.dateCampaigns.usedBy",{count:String(t)}),notUsed:s("sandbox.dateCampaigns.notUsed"),stateNew:s("sandbox.dateCampaigns.state.new"),stateChanged:s("sandbox.dateCampaigns.state.changed"),removedTitle:s("sandbox.dateCampaigns.removedTitle"),removedHint:s("sandbox.dateCampaigns.removedHint"),created:t=>s("sectionsEditor.namedRulePicker.createdCampaign",{name:t}),renamed:t=>s("sandbox.dateCampaigns.renamed",{name:t}),renameHint:s("sandbox.dateCampaigns.renameHint"),renameWholeHint:s("sandbox.dateCampaigns.renameWholeHint")}}function et(s,e,t){const n=Ce(e,t);return n!=="available"?n:C(s,t).kind==="conflict"?"conflict":null}function wt(s,e){const t=j.c(49),n=E(),{orgSlug:a,virtualMcpId:i,branch:r,decofile:o,meta:l}=e;let c;t[0]!==r||t[1]!==o||t[2]!==l||t[3]!==a||t[4]!==i?(c={orgSlug:a,virtualMcpId:i,branch:r,decofile:o,meta:l},t[0]=r,t[1]=o,t[2]=l,t[3]=a,t[4]=i,t[5]=c):c=t[5];const d=Ze(c);let u;t[6]!==r||t[7]!==a||t[8]!==i?(u={orgSlug:a,virtualMcpId:i,branch:r},t[6]=r,t[7]=a,t[8]=i,t[9]=u):u=t[9];const{apply:f,reread:x,planStored:h,isPending:p,holdsCopy:R}=$e(u),[g,b]=M.useState(null),[v,y]=M.useState(!1);let D;t[10]!==f||t[11]!==n?(D=async(w,$)=>{const B=$===void 0?n("sectionsEditor.namedRules.saved"):$;if(!w)return!1;const O=await f(w);return O.ok&&O.keptTheirs?te(n,!1):O.ok&&F.success(B,{...V,description:n("sectionsEditor.namedRules.savedHint")}),O.ok},t[10]=f,t[11]=n,t[12]=D):D=t[12];const N=D;let k;t[13]!==o||t[14]!==s||t[15]!==N||t[16]!==n?(k=w=>{if(w.kind!==s||!w.create)return;const $=w.kind==="experiments"?w.create.share:w.create.window,B=Ae(o,s,w.name,$);if(!("change"in B)){F.info(B.problem==="conflict"?n("sectionsEditor.namedRules.changedMeanwhile"):ae(n,B.problem),V);return}const O=w.name.trim();N(B.change,T(n,s).created(O)).then(le=>{le&&(y(!1),b(O))})},t[13]=o,t[14]=s,t[15]=N,t[16]=n,t[17]=k):k=t[17];const U=k;let S;t[18]!==o||t[19]!==s||t[20]!==l?(S=et(o,l,s),t[18]=o,t[19]=s,t[20]=l,t[21]=S):S=t[21];let H;t[22]!==o||t[23]!==s||t[24]!==l||t[25]!==d?(H=d?be(d,s,o,l):[],t[22]=o,t[23]=s,t[24]=l,t[25]=d,t[26]=H):H=t[26];let I;t[27]!==o||t[28]!==s||t[29]!==l||t[30]!==d?(I=d?Ne(d,s,o,l):0,t[27]=o,t[28]=s,t[29]=l,t[30]=d,t[31]=I):I=t[31];let _;t[32]!==N?(_=w=>{N(w)},t[32]=N,t[33]=_):_=t[33];let P;return t[34]!==f||t[35]!==U||t[36]!==v||t[37]!==R||t[38]!==p||t[39]!==g||t[40]!==h||t[41]!==x||t[42]!==N||t[43]!==S||t[44]!==H||t[45]!==I||t[46]!==_||t[47]!==d?(P={uses:d,apply:f,reread:x,planStored:h,isPending:p,holdsCopy:R,openName:g,setOpenName:b,creating:v,setCreating:y,blocked:S,missing:H,missingNames:I,save:N,create:U,undo:_},t[34]=f,t[35]=U,t[36]=v,t[37]=R,t[38]=p,t[39]=g,t[40]=h,t[41]=x,t[42]=N,t[43]=S,t[44]=H,t[45]=I,t[46]=_,t[47]=d,t[48]=P):P=t[48],P}function Et(s){const e=j.c(23),{kind:t,open:n,onOpenChange:a,existingNames:i,pending:r,onCreate:o}=s,l=E();let c;e[0]!==t||e[1]!==l?(c=T(l,t),e[0]=t,e[1]=l,e[2]=c):c=e[2];let d;e[3]!==c.new?(d=m.jsx(re,{className:"sr-only",children:c.new}),e[3]=c.new,e[4]=d):d=e[4];let u;e[5]!==l?(u=l("sectionsEditor.namedRules.create"),e[5]=l,e[6]=u):u=e[6];let f;e[7]!==a?(f=()=>a(!1),e[7]=a,e[8]=f):f=e[8];let x;e[9]!==i||e[10]!==t||e[11]!==o||e[12]!==r||e[13]!==u||e[14]!==f?(x=m.jsx(He,{kind:t,initialName:"",existingNames:i,pending:r,submitLabel:u,dismiss:"cancel",standalone:!0,onBack:f,onSubmit:o}),e[9]=i,e[10]=t,e[11]=o,e[12]=r,e[13]=u,e[14]=f,e[15]=x):x=e[15];let h;e[16]!==d||e[17]!==x?(h=m.jsxs(ce,{className:"p-0 sm:max-w-md",children:[d,x]}),e[16]=d,e[17]=x,e[18]=h):h=e[18];let p;return e[19]!==a||e[20]!==n||e[21]!==h?(p=m.jsx(de,{open:n,onOpenChange:a,children:h}),e[19]=a,e[20]=n,e[21]=h,e[22]=p):p=e[22],p}function kt(s){const e=j.c(14),{kind:t,missing:n,missingNames:a,removed:i,onOpenUse:r}=s,o=E();let l;e[0]!==t||e[1]!==o?(l=T(o,t),e[0]=t,e[1]=o,e[2]=l):l=e[2];const c=l;let d;e[3]!==t||e[4]!==n||e[5]!==a||e[6]!==r?(d=m.jsx(Xe,{kind:t,rows:n,names:a,onOpen:r}),e[3]=t,e[4]=n,e[5]=a,e[6]=r,e[7]=d):d=e[7];let u;e[8]!==c||e[9]!==i?(u=i.length>0&&m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx("h3",{className:"text-sm font-medium",children:c.removedTitle}),m.jsx("p",{className:"text-xs text-muted-foreground",children:c.removedHint}),m.jsx("ul",{className:"text-sm text-muted-foreground",children:i.map(tt)})]}),e[8]=c,e[9]=i,e[10]=u):u=e[10];let f;return e[11]!==d||e[12]!==u?(f=m.jsxs(m.Fragment,{children:[d,u]}),e[11]=d,e[12]=u,e[13]=f):f=e[13],f}function tt(s){return m.jsx("li",{className:"line-through",children:s},s)}function St(s,e,t){const n=T(s,e);return t>0?n.usedBy(t):n.notUsed}function st(s){const e=j.c(7),{kind:t,state:n,changed:a}=s,i=a===void 0?!0:a,r=E();let o;e[0]!==t||e[1]!==r?(o=T(r,t),e[0]=t,e[1]=r,e[2]=o):o=e[2];const l=o;if(n==="new"){let c;return e[3]!==l.stateNew?(c=m.jsx(K,{variant:"muted",children:l.stateNew}),e[3]=l.stateNew,e[4]=c):c=e[4],c}if(n==="changed"&&i){let c;return e[5]!==l.stateChanged?(c=m.jsx(K,{variant:"muted",children:l.stateChanged}),e[5]=l.stateChanged,e[6]=c):c=e[6],c}return null}function Ut(s){const e=j.c(9),{kind:t,name:n,status:a,entryState:i}=s;let r;e[0]!==n?(r=m.jsx("h2",{className:"text-lg font-semibold",children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]!==i||e[3]!==t?(o=m.jsx(st,{kind:t,state:i,changed:!1}),e[2]=i,e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==r||e[7]!==o?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[r,a,o]}),e[5]=a,e[6]=r,e[7]=o,e[8]=l):l=e[8],l}function Dt(s){const e=j.c(9),{kind:t,detail:n}=s;let a;return e[0]!==n.apply||e[1]!==n.meta||e[2]!==n.onDeleted||e[3]!==n.onUndo||e[4]!==n.pending||e[5]!==n.reread||e[6]!==n.row.name||e[7]!==t?(a=m.jsx(Ye,{kind:t,name:n.row.name,meta:n.meta,pending:n.pending,apply:n.apply,reread:n.reread,onDeleted:n.onDeleted,onUndo:n.onUndo}),e[0]=n.apply,e[1]=n.meta,e[2]=n.onDeleted,e[3]=n.onUndo,e[4]=n.pending,e[5]=n.reread,e[6]=n.row.name,e[7]=t,e[8]=a):a=e[8],a}function Ot(s,e,t){return{row:e,decofile:t.decofile,meta:t.meta,uses:s.uses,pending:s.isPending,holdsCopy:s.holdsCopy,onBack:()=>s.setOpenName(null),onOpenUse:t.onOpenUse,onSave:s.save,onRenamed:s.setOpenName,apply:s.apply,reread:s.reread,planStored:s.planStored,onDeleted:()=>s.setOpenName(null),onUndo:s.undo}}function Tt(s,e,t,n,a){return{useRows:t?X(t,s,e,n,a):[],wholeRows:t?X(t,s,null,n,a):[]}}function Ht(s,e){const t=j.c(23),n=E(),a=e.row.name,[i,r]=M.useState(a);let o;t[0]!==i?(o=i.trim(),t[0]=i,t[1]=o):o=t[1];const l=o===a;let c,d,u,f,x,h;if(t[2]!==a||t[3]!==s||t[4]!==i||t[5]!==e||t[6]!==n||t[7]!==l){let g;t[14]!==a?(g=v=>v!==a,t[14]=a,t[15]=g):g=t[15];const b=we(C(e.decofile,s)).filter(g);c=l?null:ne(i,b),d=async()=>{const v=i.trim();if(c||v===a)return;const y=await e.planStored(D=>Ee(D,s,a,v,e.meta));y&&await e.onSave(y,T(n,s).renamed(v))&&e.onRenamed(v)},u=a,f=i,x=r,h=c?ae(n,c):null,t[2]=a,t[3]=s,t[4]=i,t[5]=e,t[6]=n,t[7]=l,t[8]=c,t[9]=d,t[10]=u,t[11]=f,t[12]=x,t[13]=h}else c=t[8],d=t[9],u=t[10],f=t[11],x=t[12],h=t[13];const p=!!c||l;let R;return t[16]!==d||t[17]!==u||t[18]!==f||t[19]!==x||t[20]!==h||t[21]!==p?(R={savedName:u,name:f,setName:x,message:h,blocked:p,rename:d},t[16]=d,t[17]=u,t[18]=f,t[19]=x,t[20]=h,t[21]=p,t[22]=R):R=t[22],R}function It(s){const e=j.c(19),{kind:t,id:n,rename:a,pending:i,wholeUses:r,locked:o}=s,l=E();let c;e[0]!==t||e[1]!==l?(c=T(l,t),e[0]=t,e[1]=l,e[2]=c):c=e[2];const d=c;let u;e[3]!==l?(u=l("sectionsEditor.namedRules.nameLabel"),e[3]=l,e[4]=u):u=e[4];let f;e[5]!==n||e[6]!==u?(f=m.jsx(pe,{htmlFor:n,children:u}),e[5]=n,e[6]=u,e[7]=f):f=e[7];let x;e[8]!==d||e[9]!==n||e[10]!==o||e[11]!==i||e[12]!==a||e[13]!==l||e[14]!==r?(x=o?m.jsxs(m.Fragment,{children:[m.jsx(G,{id:n,className:"max-w-xs",value:a.savedName,readOnly:!0,disabled:!0}),o]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(G,{id:n,className:"max-w-xs",value:a.name,onChange:p=>a.setName(p.target.value)}),m.jsx(L,{size:"sm",variant:"outline",disabled:i||a.blocked,onClick:()=>{a.rename()},children:l("sectionsEditor.namedRules.rename")})]}),a.message&&m.jsx("p",{className:"text-xs text-destructive",children:a.message}),m.jsx("p",{className:"text-xs text-muted-foreground",children:d.renameHint}),r>0&&m.jsx("p",{className:"text-xs text-muted-foreground",children:d.renameWholeHint})]}),e[8]=d,e[9]=n,e[10]=o,e[11]=i,e[12]=a,e[13]=l,e[14]=r,e[15]=x):x=e[15];let h;return e[16]!==f||e[17]!==x?(h=m.jsxs("section",{className:"flex flex-col gap-2",children:[f,x]}),e[16]=f,e[17]=x,e[18]=h):h=e[18],h}const Z={running:0,everyone:1,off:2};function _t(s,e){const t=C(s,"experiments");if(t.kind==="conflict")return[];const n=e?.published??null;return Object.entries(t.values).map(([i,r],o)=>{const l=qe(n,"experiments",i,r),c=l==="changed"?Qe(n,"experiments",i):void 0;return{order:o,row:{name:i,share:r,status:ke(r),uses:e?je(e,"experiments",i):0,entryState:l,...c!==void 0?{publishedShare:c}:{}}}}).sort((i,r)=>Z[i.row.status]-Z[r.row.status]||i.order-r.order).map(i=>i.row)}function Bt(s,e){return Ge(s,e?.published??null,"experiments")}function Ft(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 z=null;function nt(){return z??=Promise.all([J(()=>import("./agent-site-editor-BSG_1jHk.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])),J(()=>import("./agent-site-editor-content-243OnENt.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,156,157,189,190,191,155,192,193,194,195,196,197,198,199,152,159,200,201,202]))]).catch(s=>{throw z=null,s}),z}function at(s){return e=>{if(!e)return;const t=()=>{s().catch(()=>{})};if(typeof requestIdleCallback=="function"){const a=requestIdleCallback(t,{timeout:2e3});return()=>cancelIdleCallback(a)}const n=setTimeout(t,200);return()=>clearTimeout(n)}}const lt=at(nt);function q(s){const e=j.c(7),{icon:t,title:n,description:a,action:i}=s;let r;e[0]!==i?(r=i?{children:i.label,onClick:i.onClick}:void 0,e[0]=i,e[1]=r):r=e[1];let o;return e[2]!==a||e[3]!==t||e[4]!==r||e[5]!==n?(o=m.jsx(A,{children:m.jsx(A.Content,{children:m.jsx(A.Container,{children:m.jsx(Me,{icon:t,title:n,description:a,buttonProps:r})})})}),e[2]=a,e[3]=t,e[4]=r,e[5]=n,e[6]=o):o=e[6],o}function Pt(s){const e=j.c(28),{virtualMcpId:t,icon:n,copy:a,skeleton:i,children:r}=s,o=E(),{org:l}=me(),c=Ke(),d=c?.currentBranch??null,u=se(t,d);ue(u.kind==="protocol"&&u.source==="github");const{openPanel:f}=Ve();if(!d){const p=a.noDraftTitle,R=a.noDraftDesc;let g;e[0]!==o?(g=o("sectionsEditor.namedRules.openEditor"),e[0]=o,e[1]=g):g=e[1];let b;e[2]!==f?(b=()=>f("content"),e[2]=f,e[3]=b):b=e[3];let v;e[4]!==g||e[5]!==b?(v={label:g,onClick:b},e[4]=g,e[5]=b,e[6]=v):v=e[6];let y;return e[7]!==a.noDraftDesc||e[8]!==a.noDraftTitle||e[9]!==n||e[10]!==v?(y=m.jsx(q,{icon:n,title:p,description:R,action:v}),e[7]=a.noDraftDesc,e[8]=a.noDraftTitle,e[9]=n,e[10]=v,e[11]=y):y=e[11],y}if(Ie(u)){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(Be,{}),e[12]=p):p=e[12],p}if(u.kind==="pending"){let p;return e[13]!==i?(p=m.jsx(m.Fragment,{children:i}),e[13]=i,e[14]=p):p=e[14],p}if(u.kind!=="protocol"){let p;return e[15]!==a.loadFailed||e[16]!==a.loadFailedHint||e[17]!==n?(p=m.jsx(q,{icon:n,title:a.loadFailed,description:a.loadFailedHint}),e[15]=a.loadFailed,e[16]=a.loadFailedHint,e[17]=n,e[18]=p):p=e[18],p}const x=c?.taskId??null;let h;return e[19]!==d||e[20]!==r||e[21]!==a||e[22]!==n||e[23]!==l.slug||e[24]!==i||e[25]!==x||e[26]!==t?(h=m.jsx(it,{orgSlug:l.slug,virtualMcpId:t,branch:d,threadId:x,icon:n,copy:a,skeleton:i,children:r},d),e[19]=d,e[20]=r,e[21]=a,e[22]=n,e[23]=l.slug,e[24]=i,e[25]=x,e[26]=t,e[27]=h):h=e[27],h}function it(s){const e=j.c(30),{orgSlug:t,virtualMcpId:n,branch:a,threadId:i,icon:r,copy:o,skeleton:l,children:c}=s,d=E();let u;e[0]!==a||e[1]!==t||e[2]!==i||e[3]!==n?(u={orgSlug:t,virtualMcpId:n,branch:a,threadId:i,previewUrl:null},e[0]=a,e[1]=t,e[2]=i,e[3]=n,e[4]=u):u=e[4];const f=u,x=Te(f),h=_e(f),p=x.data,R=h.data;if(!p||!R){if(x.isError||h.isError){const y=o.loadFailed,D=o.loadFailedHint;let N;e[5]!==d?(N=d("sectionsEditor.namedRules.tryAgain"),e[5]=d,e[6]=N):N=e[6];let k;e[7]!==x||e[8]!==h?(k=()=>{x.refetch(),h.refetch()},e[7]=x,e[8]=h,e[9]=k):k=e[9];let U;e[10]!==N||e[11]!==k?(U={label:N,onClick:k},e[10]=N,e[11]=k,e[12]=U):U=e[12];let S;return e[13]!==o.loadFailed||e[14]!==o.loadFailedHint||e[15]!==r||e[16]!==U?(S=m.jsx(q,{icon:r,title:y,description:D,action:U}),e[13]=o.loadFailed,e[14]=o.loadFailedHint,e[15]=r,e[16]=U,e[17]=S):S=e[17],S}let v;return e[18]!==l?(v=m.jsx(m.Fragment,{children:l}),e[18]=l,e[19]=v):v=e[19],v}let g;e[20]!==a||e[21]!==c||e[22]!==p||e[23]!==R||e[24]!==t||e[25]!==i||e[26]!==n?(g=c({orgSlug:t,virtualMcpId:n,branch:a,threadId:i,decofile:p,meta:R}),e[20]=a,e[21]=c,e[22]=p,e[23]=R,e[24]=t,e[25]=i,e[26]=n,e[27]=g):g=e[27];let b;return e[28]!==g?(b=m.jsx("div",{className:"contents",ref:lt,children:g}),e[28]=g,e[29]=b):b=e[29],b}export{kt as N,jt as S,Pt as a,St as b,st as c,Ht as d,_t as e,Tt as f,Ut as g,It as h,Ft as i,yt as j,Et as k,Dt as l,Ct as m,Ot as n,q as o,Le as p,qe as q,Bt as r,Qe as s,Ge as t,wt as u};
|