decocms 4.564.0 → 4.565.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CQ8p4KFs.js → AlertCircle-BavhHXrm.js} +1 -1
- package/dist/client/assets/{AreaChart-BG9b7IWq.js → AreaChart-CpdR-UAM.js} +1 -1
- package/dist/client/assets/{ArrowLeft-jRoq4RpN.js → ArrowLeft-NHzfDSKs.js} +1 -1
- package/dist/client/assets/{ArrowUp-WAaoRlHa.js → ArrowUp-D6obKkNl.js} +1 -1
- package/dist/client/assets/{CartesianChart-CGjmrhMJ.js → CartesianChart-BuCntSQu.js} +1 -1
- package/dist/client/assets/{CategoricalChart-hyHkOxr8.js → CategoricalChart-9YwAdaOL.js} +1 -1
- package/dist/client/assets/{CheckCircle-Buet-eH6.js → CheckCircle-BZC8qNjY.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DCDJ0sdb.js → ChevronSelectorVertical-XtqZtaGN.js} +1 -1
- package/dist/client/assets/{ChevronUp-BTGxI7Zs.js → ChevronUp-CP2Q1tno.js} +1 -1
- package/dist/client/assets/{CreditCard01-CnLItLU2.js → CreditCard01-DSR9reUx.js} +1 -1
- package/dist/client/assets/{Globe04-DMe5HSmJ.js → Globe04-DsEVRQ8J.js} +1 -1
- package/dist/client/assets/{Key01-Dxtn8NGa.js → Key01-CACSt4gn.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CqkORUqT.js → LinkBroken01-Dhqzd5Xp.js} +1 -1
- package/dist/client/assets/{Minus-D2T9DyMG.js → Minus-CF20rGao.js} +1 -1
- package/dist/client/assets/{Monitor01-D-9i_0yJ.js → Monitor01-CTh24U4S.js} +1 -1
- package/dist/client/assets/{Play-P7egrfAg.js → Play-Dl9rHUIQ.js} +1 -1
- package/dist/client/assets/{Plus-DsyYMAU8.js → Plus-CcxRdpHl.js} +1 -1
- package/dist/client/assets/{ReferenceLine-i4QcKbhg.js → ReferenceLine-DG_YV7QB.js} +1 -1
- package/dist/client/assets/{SearchMd-CW5cmPaz.js → SearchMd-BvpUvADB.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-CajIv2w8.js → ShoppingBag01-B2TVYCJe.js} +1 -1
- package/dist/client/assets/{Sun-BZ5I37JT.js → Sun-CwYfSEKK.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DqmEmDR5.js → SwitchHorizontal01-C6F9FLuz.js} +1 -1
- package/dist/client/assets/{Tool01-CSZn_Wh0.js → Tool01-BpRvGDMW.js} +1 -1
- package/dist/client/assets/{Tooltip-BueNEHzC.js → Tooltip-DyscjpNm.js} +1 -1
- package/dist/client/assets/{Trash01-DDMIP9jc.js → Trash01-rMYgPi4D.js} +1 -1
- package/dist/client/assets/{Upload01-DT2jBuxA.js → Upload01-CTvUgusS.js} +1 -1
- package/dist/client/assets/{UserSquare-DKikapRU.js → UserSquare-CeUdUVlp.js} +1 -1
- package/dist/client/assets/{Users01-NB4c6tGb.js → Users01-CgIFV9B4.js} +1 -1
- package/dist/client/assets/{XClose-DpL893eV.js → XClose-B8ZWakSs.js} +1 -1
- package/dist/client/assets/{Zap-DOqlsWJQ.js → Zap-BheFKoJA.js} +1 -1
- package/dist/client/assets/{access-gate-OrPI42qE.js → access-gate-DetE2JQz.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-C4a3y2Tw.js → add-connection-dialog-HS2-iXa_.js} +1 -1
- package/dist/client/assets/agent-app-Cj5VRE9N.js +1 -0
- package/dist/client/assets/{agent-assets-B6JReGpa.js → agent-assets-BVfyM3W2.js} +1 -1
- package/dist/client/assets/{agent-automation-CUEwumhB.js → agent-automation-CFoval4K.js} +1 -1
- package/dist/client/assets/{agent-automations-CUEa-MdA.js → agent-automations-PQlm_1-3.js} +1 -1
- package/dist/client/assets/{agent-calendar-B-kfsJeA.js → agent-calendar-JHkSgIaW.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CmoLwTEk.js → agent-capabilities-D5dRez_U.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DCF_9i75.js → agent-connect-sources-DpIMd_nf.js} +1 -1
- package/dist/client/assets/agent-deck-C8zPFh-t.js +1 -0
- package/dist/client/assets/{agent-e2e-Me1Y__d1.js → agent-e2e-Co6-h6xW.js} +1 -1
- package/dist/client/assets/agent-experiments-DTpS9tX-.js +1 -0
- package/dist/client/assets/{agent-file-C2urOOFa.js → agent-file-D2ltAo8E.js} +1 -1
- package/dist/client/assets/{agent-hosting-bDpflwDy.js → agent-hosting-_jnJiyJB.js} +1 -1
- package/dist/client/assets/{agent-icon-TjMVTO6h.js → agent-icon-WM9Nds86.js} +1 -1
- package/dist/client/assets/agent-library-D7usyBbZ.js +1 -0
- package/dist/client/assets/agent-library-file-BctrjiTr.js +1 -0
- package/dist/client/assets/agent-overview-0_ctMLbb.js +1 -0
- package/dist/client/assets/{agent-releases-iFoEZYLj.js → agent-releases-Cs9chBHo.js} +1 -1
- package/dist/client/assets/agent-settings-V07gT5Cf.js +1 -0
- package/dist/client/assets/{agent-site-editor-Bk0gdWbE.js → agent-site-editor-CUzXKk_L.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-CwFZJgDv.js +2 -0
- package/dist/client/assets/agent-site-editor-content-B-zSDz5I.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DtjBE5NW.js +1 -0
- package/dist/client/assets/agent-view-VjGFcOmA.js +1 -0
- package/dist/client/assets/{agent-view-guard-CgD2SRHj.js → agent-view-guard-BxS78jGZ.js} +1 -1
- package/dist/client/assets/{ai-providers-DP_LPW_J.js → ai-providers-Bg6XVNeS.js} +1 -1
- package/dist/client/assets/{alert-DOoQbEiz.js → alert-U9tZtWPC.js} +1 -1
- package/dist/client/assets/{analytics-sections-BnrB72yH.js → analytics-sections-_Da0sWct.js} +1 -1
- package/dist/client/assets/api-keys-B1FZ7y5P.js +1 -0
- package/dist/client/assets/{api-keys-Cz-pcuKo.js → api-keys-Bj6cZbJj.js} +1 -1
- package/dist/client/assets/{app-editor-BtQvbROq.js → app-editor-DsNvlfaV.js} +1 -1
- package/dist/client/assets/{asset-utils-D0vrhEGW.js → asset-utils-B5Sq3qKL.js} +1 -1
- package/dist/client/assets/{auth-Bo7mZ0XZ.js → auth-A_dHVlLy.js} +1 -1
- package/dist/client/assets/{auth-catchall-DpoQiWR3.js → auth-catchall-C9DBUwY3.js} +1 -1
- package/dist/client/assets/{auth-entry-BjPguG1n.js → auth-entry-B2MqWpcF.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DZpBIwlD.js → auth-split-layout-CwJlT6Oq.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-ntvNyemj.js → authenticate-and-persist-oauth-Ci98CWsZ.js} +1 -1
- package/dist/client/assets/{automation-list-row-BEFQKTX1.js → automation-list-row-5R79B6L2.js} +1 -1
- package/dist/client/assets/{automation-runs-DzWprxEK.js → automation-runs-muPpbYEP.js} +1 -1
- package/dist/client/assets/{automations-Bxf0CCXl.js → automations-C7djfZR5.js} +1 -1
- package/dist/client/assets/{autosend-U0ehaXsA.js → autosend-BLwaDfuL.js} +1 -1
- package/dist/client/assets/{badge-Dfaw3WBB.js → badge-C8SoiSYZ.js} +1 -1
- package/dist/client/assets/{block-document-6dm-00hY.js → block-document-C7XO3wXa.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-B_sPksUi.js → blocks-preview-workspace-context-Ct_L2Frv.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-eGTb5mvz.js → blocks-tab-states-DjNiCspc.js} +1 -1
- package/dist/client/assets/{blog-schema-Dsmv2ihg.js → blog-schema-Buyn-oQb.js} +1 -1
- package/dist/client/assets/{buckets-C23i5gyQ.js → buckets-D-SuQdJV.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BCaQdWBF.js → build-improve-prompt-doc-BiW3JFW6.js} +1 -1
- package/dist/client/assets/{calendar-CmUvBlY1.js → calendar-B-_EB2yo.js} +1 -1
- package/dist/client/assets/{capability-load-error-8rnJwJni.js → capability-load-error-DTfH6BCq.js} +1 -1
- package/dist/client/assets/{category-editor-Cf4WXU9v.js → category-editor-BEQyGteX.js} +1 -1
- package/dist/client/assets/{chart-C0imxM4a.js → chart-BgKVrBIO.js} +1 -1
- package/dist/client/assets/{chat-context-BBpIuXC7.js → chat-context-DGEoSZ8g.js} +1 -1
- package/dist/client/assets/{chat-draft-CGuyKppk.js → chat-draft-Hfl-Vt7X.js} +1 -1
- package/dist/client/assets/{checkbox-CTu0WRp7.js → checkbox-2hVfC1K9.js} +1 -1
- package/dist/client/assets/{choose-editor-BG1SjT1d.js → choose-editor-DoJJP7Y2.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C7trLL5C.js → cli-auth-success-BhPPAawt.js} +1 -1
- package/dist/client/assets/{client-icons-DQougokE.js → client-icons-D56oac-S.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-B30HFRSW.js → cms-settings-editor-DS_lS8up.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-BphiU1zo.js → cms-store-drafts-BOzxBdUW.js} +1 -1
- package/dist/client/assets/{collapsible-Ddfj_16s.js → collapsible-CBkOKy_V.js} +1 -1
- package/dist/client/assets/{collection-detail-Cm2aKNHg.js → collection-detail-BwgBO9rx.js} +1 -1
- package/dist/client/assets/{collection-display-button-9rq6-Wdl.js → collection-display-button-B1FWTXCr.js} +1 -1
- package/dist/client/assets/{collection-search-BnR15-7O.js → collection-search-DLMLNhxJ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-yg2kkMXP.js → collection-table-wrapper-OFbnOu-w.js} +1 -1
- package/dist/client/assets/{collection-tabs-BC3eX7CT.js → collection-tabs-Tp4T2q9Y.js} +1 -1
- package/dist/client/assets/{combobox-BWpli-Xr.js → combobox-Bv4H0UoH.js} +1 -1
- package/dist/client/assets/{command-DF3tcytL.js → command-Dnw2pasR.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-C8SHo1sU.js → companion-mcps-section-68jW8mRF.js} +1 -1
- package/dist/client/assets/{config-CiEg0__n.js → config-LiKo2fo2.js} +1 -1
- package/dist/client/assets/{connect-BGwBZ_Ka.js → connect-BFbtHYxe.js} +1 -1
- package/dist/client/assets/{connect-layout-DbCgCtqS.js → connect-layout-ByOzPiGU.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-qP8ktZhS.js → connect-source-dialog-B7Ld_9Px.js} +1 -1
- package/dist/client/assets/{connection-card-BwHX3nOo.js → connection-card-BChC3QcL.js} +1 -1
- package/dist/client/assets/{connection-detail-DKP8tp8_.js → connection-detail-B9GtoOQz.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BGJcgEzh.js → connection-form-helpers-B8GujYbR.js} +1 -1
- package/dist/client/assets/{connection-Dqu9RsNH.js → connection-q83jFl6d.js} +1 -1
- package/dist/client/assets/{connection-slug-taekJBaK.js → connection-slug-e_XZGcMc.js} +1 -1
- package/dist/client/assets/{connections-cWHNOk6t.js → connections-BmZaBZ7X.js} +1 -1
- package/dist/client/assets/{content-tab-BLJmurLN.js → content-tab-DEygOE9A.js} +3 -3
- package/dist/client/assets/{context-XrwEqwYe.js → context-DixWzk5F.js} +1 -1
- package/dist/client/assets/{context-menu-gp9FU1Mh.js → context-menu-sQTRwOW7.js} +1 -1
- package/dist/client/assets/{context-shell-DlBNmZfR.js → context-shell-u2FWmfVw.js} +3 -3
- package/dist/client/assets/{core.esm-CTO4JGte.js → core.esm-Dg3ste3x.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-F-su-nyA.js → create-organization-dialog-Ddfg1y7k.js} +1 -1
- package/dist/client/assets/{device-hint-tzTpy1A9.js → device-hint-CyVF9iUZ.js} +1 -1
- package/dist/client/assets/{discover-CkXTTHib.js → discover-CsUnTSVq.js} +1 -1
- package/dist/client/assets/{domain-settings-Dfq6uTsb.js → domain-settings-Bv-_QfjI.js} +1 -1
- package/dist/client/assets/{drawer-BgyRTjxD.js → drawer-Cr3trfMB.js} +1 -1
- package/dist/client/assets/{editor-CyZCJa0L.js → editor-CtNrPORw.js} +1 -1
- package/dist/client/assets/{editor-classes-D0UJsX59.js → editor-classes-DGhQ0khm.js} +1 -1
- package/dist/client/assets/{empty-state-Dx-vBzke.js → empty-state-CPzwuwQF.js} +1 -1
- package/dist/client/assets/{empty-state-qO8fmVkF.js → empty-state-CQDiVxjd.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-BsONYetS.js → experiments-tab-choice-DYELyAgl.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CI_UJ-ru.js → extract-connection-data-BrWbQJSD.js} +1 -1
- package/dist/client/assets/{feature-gate-0S4LDUGl.js → feature-gate-BYSpD9vV.js} +1 -1
- package/dist/client/assets/{feature-paywall-DbRigt-8.js → feature-paywall-Vs4R367Q.js} +1 -1
- package/dist/client/assets/{feedback-DpZ51nw_.js → feedback-BvXufGHE.js} +1 -1
- package/dist/client/assets/{file-explorer-Is8X98eh.js → file-explorer-BnhpA6z2.js} +1 -1
- package/dist/client/assets/{file-preview-DA7tD6qn.js → file-preview-DUdl3Yo6.js} +1 -1
- package/dist/client/assets/{file-share-button-DNqRplIB.js → file-share-button-CVNjiAGQ.js} +1 -1
- package/dist/client/assets/{file-type-icon-DrIF_ach.js → file-type-icon-BbCX4o-i.js} +1 -1
- package/dist/client/assets/{folder-icon-CE9rKFgu.js → folder-icon-COq_f1Ug.js} +1 -1
- package/dist/client/assets/{form-BmoTeXbP.js → form-CX9Y8rXx.js} +1 -1
- package/dist/client/assets/{general-Ds6mKAD-.js → general-C2M6kUiq.js} +1 -1
- package/dist/client/assets/{github-icon-Cfkkw3me.js → github-icon-D5WAOakM.js} +1 -1
- package/dist/client/assets/{home-gn6ueFSP.js → home-BomzyME8.js} +1 -1
- package/dist/client/assets/{home-overview-Bk4OGXI-.js → home-overview-M5WdT7OK.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-liA8Ue5e.js → hosted-reconcile-CFgAFv0C.js} +1 -1
- package/dist/client/assets/{icon-button-Cpw9GkVM.js → icon-button-nqkgw44k.js} +1 -1
- package/dist/client/assets/{index-Cst8xARc.js → index-B-SSEV3y.js} +1 -1
- package/dist/client/assets/{index-DtPyNOkW.js → index-BI_4p3rJ.js} +1 -1
- package/dist/client/assets/{index-B7P1i0U8.js → index-BJboiqe7.js} +1 -1
- package/dist/client/assets/{index-C90BaQbH.js → index-C6icdhcm.js} +1 -1
- package/dist/client/assets/{index-CU6Pikl7.js → index-C7fe-3-1.js} +1 -1
- package/dist/client/assets/{index-CtB8Tw63.js → index-CH6fvsN5.js} +1 -1
- package/dist/client/assets/{index-B5Rq0Q_b.js → index-CLm0YAEW.js} +1 -1
- package/dist/client/assets/{index-CpV2sqUd.js → index-CTGLhdnQ.js} +1 -1
- package/dist/client/assets/{index-BhO2XRBo.js → index-C_uBCqyj.js} +1 -1
- package/dist/client/assets/{index-cgovyYsQ.js → index-D8pFT62M.js} +3 -3
- package/dist/client/assets/{index-DUKj5t3l.js → index-D9_88oYJ.js} +1 -1
- package/dist/client/assets/{index-Ckdck5oP.js → index-DAtb5cig.js} +1 -1
- package/dist/client/assets/{index-DLDJ3DHb.js → index-DX6T00mS.js} +1 -1
- package/dist/client/assets/{index-3pV4g77m.js → index-DsP4hX0b.js} +1 -1
- package/dist/client/assets/{index-DId4rr-A.js → index-GzXknTmE.js} +1 -1
- package/dist/client/assets/{index-redirect-pAjv5SXQ.js → index-redirect-DNhgvlnT.js} +1 -1
- package/dist/client/assets/{index-BFqtpAvr.js → index-wPGh-4Qn.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D_MIEAF-.js → infiniteQueryObserver-BCA8pHQ9.js} +1 -1
- package/dist/client/assets/{infra-billing-DRZUvwh3.js → infra-billing-tTGuSBOr.js} +1 -1
- package/dist/client/assets/{input-DuP90nBH.js → input-CS6hOcXP.js} +3 -3
- package/dist/client/assets/{input-Dm8Dm-Qz.js → input-DzvNX6KE.js} +1 -1
- package/dist/client/assets/{integration-icon-bQl-nSH8.js → integration-icon-oVgUnqWm.js} +1 -1
- package/dist/client/assets/{jira-icon-DBFOj94A.js → jira-icon-DpVhNd3p.js} +1 -1
- package/dist/client/assets/{label-BJpZpGc0.js → label-DyJSQ7-Z.js} +1 -1
- package/dist/client/assets/{layout-7S8BP6VQ.js → layout-uNVzsDnw.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DR8nRly5.js → legacy-agents-deep-DX51gRsB.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Dth5bVh1.js → legacy-main-redirect-acRLIQQu.js} +1 -1
- package/dist/client/assets/library-CxZb-jUS.js +1 -0
- package/dist/client/assets/{library-tab-BL_lF-ft.js → library-tab-Daw4myox.js} +1 -1
- package/dist/client/assets/{login-DjUNKygv.js → login-Cayh2Ab3.js} +1 -1
- package/dist/client/assets/{markdown-mKHkB6FI.js → markdown-h9PNnEh6.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DjL0niPw.js → mcp-app-renderer-CQuQ-XsR.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BIp0LO3E.js → mcp-oauth-B7rGQlv9.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C7DXVMTi.js → mcp-oauth-BJRs38bR.js} +1 -1
- package/dist/client/assets/{members-CtRzSe07.js → members-CdshZLmo.js} +1 -1
- package/dist/client/assets/{memory-CRxleuoc.js → memory-DJgsUgS2.js} +1 -1
- package/dist/client/assets/{mock-board-DnsUfCSW.js → mock-board-B2foCBkp.js} +3 -3
- package/dist/client/assets/{monaco-editor-CuW8q0yx.js → monaco-editor-Cjb9-6hs.js} +1 -1
- package/dist/client/assets/{monitoring-9MjXgbIo.js → monitoring-cw60w70o.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BcsNTX2l.js → monitoring-stats-row-DUQcmnd2.js} +1 -1
- package/dist/client/assets/{multi-select-D9xyRxxq.js → multi-select-PFXUkRJa.js} +1 -1
- package/dist/client/assets/{mustache-8etVpD7L.js → mustache-DYLtwKk5.js} +1 -1
- package/dist/client/assets/{named-rule-view-CTR1XvI8.js → named-rule-view-CMSveLhT.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CG2L3MM-.js → new-project-dialog-CkpxzAtO.js} +1 -1
- package/dist/client/assets/{oauth-callback-BbuovBw_.js → oauth-callback-BN5rMV5w.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DHqdJcsI.js → oauth-callback-ai-provider-BNpWukqC.js} +1 -1
- package/dist/client/assets/{oauth-consent-DweBwUQF.js → oauth-consent-CFvEz3rr.js} +1 -1
- package/dist/client/assets/{onboarding-DrVndD7e.js → onboarding-CcWFl6rw.js} +1 -1
- package/dist/client/assets/{openai-conversation-yopZy_vm.js → openai-conversation-BwEhAFIx.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DacJkxjX.js → optimistic-project-sidebar-views-Bbojv3r5.js} +1 -1
- package/dist/client/assets/{order-monitor-day-CKYfInMA.js → order-monitor-day-Bsfg1ZCB.js} +1 -1
- package/dist/client/assets/{organization-choice-Fbcae3dn.js → organization-choice-DzLKhvgC.js} +1 -1
- package/dist/client/assets/{orgs-DDZTEU_k.js → orgs-DzDCfdd2.js} +1 -1
- package/dist/client/assets/{own-accounts-section-C1y0YP6A.js → own-accounts-section-DxED_LsY.js} +1 -1
- package/dist/client/assets/{pair-C5AjfCSI.js → pair-BqxIn6Y_.js} +1 -1
- package/dist/client/assets/{parse-sections-Cu97Vu_M.js → parse-sections-Cu3Ael-d.js} +3 -3
- package/dist/client/assets/{plan-BohW26kq.js → plan-BwTvKeoR.js} +1 -1
- package/dist/client/assets/{plan-ladder-BaPcuCG0.js → plan-ladder-Nrfbc5fv.js} +1 -1
- package/dist/client/assets/{plan-usage-card-YdOsJ_ZX.js → plan-usage-card-BTqlywv2.js} +1 -1
- package/dist/client/assets/{popover-ns8sHJq5.js → popover-Bc0Osxls.js} +1 -1
- package/dist/client/assets/{post-calendar-DXzGaukN.js → post-calendar-Cj1rSs4t.js} +1 -1
- package/dist/client/assets/{post-editor-DR58AVSj.js → post-editor-CB2rddqd.js} +1 -1
- package/dist/client/assets/{preview-content-VCoMFFk-.js → preview-content-CB9eYnQK.js} +1 -1
- package/dist/client/assets/{preview-dialog-Dhde6lFg.js → preview-dialog-DB7-jTmO.js} +1 -1
- package/dist/client/assets/{preview-panel-BL4zck9B.js → preview-panel-B_W92FeD.js} +1 -1
- package/dist/client/assets/{preview-tab-Dw3ViDnI.js → preview-tab-6TAM9aA1.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DtlAip15.js → product-picker-dialog-BkNY0_GA.js} +1 -1
- package/dist/client/assets/{profile-CX0TYtL2.js → profile-Ctw12CJ6.js} +1 -1
- package/dist/client/assets/{project-app-view-DbconS9D.js → project-app-view-BUgKvzjP.js} +1 -1
- package/dist/client/assets/{project-apps-DCer9_HY.js → project-apps-OqNLxpWb.js} +1 -1
- package/dist/client/assets/{project-icon-BTrwq8bi.js → project-icon-D_-oKizr.js} +1 -1
- package/dist/client/assets/{project-index-DwUzdWkU.js → project-index-Dqo3lK4y.js} +1 -1
- package/dist/client/assets/project-reports-wHT0lgrT.js +1 -0
- package/dist/client/assets/{project-sidebar-views-vqZZbL1p.js → project-sidebar-views-BIhw1vTs.js} +1 -1
- package/dist/client/assets/project-tasks-CsGsl0Ue.js +1 -0
- package/dist/client/assets/{projects-DRZyZAme.js → projects-BTc2uvLZ.js} +1 -1
- package/dist/client/assets/{projects-empty-state-TY4kUtt4.js → projects-empty-state-BO8xkUWT.js} +1 -1
- package/dist/client/assets/{prompts-kv226h0M.js → prompts-DuFnMTdK.js} +1 -1
- package/dist/client/assets/record-editor-DwEzP7FO.js +1 -0
- package/dist/client/assets/{redirect-editor-B3601TC3.js → redirect-editor-DVXp876P.js} +1 -1
- package/dist/client/assets/reports-CM-guqFW.js +1 -0
- package/dist/client/assets/{reports-C7qj5Hfb.js → reports-Dv36rH_a.js} +1 -1
- package/dist/client/assets/{reports-onboarding-DW_hGBmK.js → reports-onboarding-BaBC6lkq.js} +1 -1
- package/dist/client/assets/{reports-tab-fjcRNutW.js → reports-tab-Dixc59hm.js} +2 -2
- package/dist/client/assets/repositories-B1FKGPtG.js +1 -0
- package/dist/client/assets/{repositories-C9ox4SEq.js → repositories-CBz0Kfvj.js} +1 -1
- package/dist/client/assets/{repository-binding-CoBbz5GR.js → repository-binding-BgpHTQa3.js} +1 -1
- package/dist/client/assets/{repository-picker-_0XvcaQZ.js → repository-picker-DxnB6y8P.js} +1 -1
- package/dist/client/assets/{require-capability-BEaEpCmo.js → require-capability-rIoksLSL.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CtQpY9CE.js → required-auth-layout-BPTXO06k.js} +1 -1
- package/dist/client/assets/{reset-password-DMO2Wfnx.js → reset-password-Bbozq7HR.js} +1 -1
- package/dist/client/assets/{resizable-D1KNHtt_.js → resizable-DHZRSfuo.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DnI4GUKU.js → resolve-tab-icon-CQ5UCjTa.js} +1 -1
- package/dist/client/assets/{review-settings-qBiQynjA.js → review-settings-Ca5wNyAg.js} +1 -1
- package/dist/client/assets/{role-color-m3ekTafX.js → role-color-DaNs5ahF.js} +1 -1
- package/dist/client/assets/{roles-Dlv8qi0F.js → roles-DWA1nSJR.js} +1 -1
- package/dist/client/assets/{route-DBjrARiw.js → route-Bn0Zg4Y6.js} +1 -1
- package/dist/client/assets/{route-BwO9p6WQ.js → route-Br6B1RCL.js} +1 -1
- package/dist/client/assets/route-CFGDEN28.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-6GAWc6Uh.js → sandbox-lifecycle-context-KNW6PNmy.js} +1 -1
- package/dist/client/assets/{schema-BAc2zoda.js → schema-CTKQWjpO.js} +1 -1
- package/dist/client/assets/{schema-D09C1K2b.js → schema-Czvp_Lwx.js} +1 -1
- package/dist/client/assets/{scroll-area-DhC9My5l.js → scroll-area-mSNTFn2P.js} +1 -1
- package/dist/client/assets/{search-input-CaK4kync.js → search-input-BFuc9oQg.js} +1 -1
- package/dist/client/assets/{search-toggle-DPRPz4f9.js → search-toggle-CQD7JD66.js} +1 -1
- package/dist/client/assets/{secret-picker-KlL9XTXY.js → secret-picker-DQnAib0F.js} +1 -1
- package/dist/client/assets/{secrets-BRi5VdUF.js → secrets-DBF3k11O.js} +1 -1
- package/dist/client/assets/{section-array-field--v0XzXwk.js → section-array-field-DvmsCB7P.js} +1 -1
- package/dist/client/assets/{sections-Dm0haO3S.js → sections-BBJqTxGW.js} +1 -1
- package/dist/client/assets/{sections-editor-BpvyJAUh.js → sections-editor-CxLQrocH.js} +1 -1
- package/dist/client/assets/{select-model-BfBifSzm.js → select-model-Bb6eOMs-.js} +1 -1
- package/dist/client/assets/{select-eZpStU_o.js → select-o79Ct_ay.js} +1 -1
- package/dist/client/assets/{seo-editor-PC4JhIxf.js → seo-editor-BE13UypD.js} +1 -1
- package/dist/client/assets/{separator-DTEg-0rT.js → separator-DMd7UEiq.js} +1 -1
- package/dist/client/assets/settings-tab-DNa3VCcv.js +1 -0
- package/dist/client/assets/{sheet-DWPcPfVu.js → sheet-DzHWnq_T.js} +1 -1
- package/dist/client/assets/{shell-layout-C_vTrOFi.js → shell-layout-DP24kzbV.js} +1 -1
- package/dist/client/assets/{site-draft-actions-BHxYhtRx.js → site-draft-actions-CecQb3Ga.js} +1 -1
- package/dist/client/assets/{site-draft-view-B62lda-n.js → site-draft-view-dNLIex4F.js} +1 -1
- package/dist/client/assets/site-editor-Z3fmTiRV.js +1 -0
- package/dist/client/assets/{site-editor-toast-DtZvuCiL.js → site-editor-toast-Aeb7soFG.js} +1 -1
- package/dist/client/assets/{skills-xTHKZ-fS.js → skills-D2_FfMjv.js} +1 -1
- package/dist/client/assets/{slider-Ciu4_ug0.js → slider-Dh1rUkk7.js} +1 -1
- package/dist/client/assets/{sortable.esm-BpQuZ2Ss.js → sortable.esm-BeVlNSdK.js} +1 -1
- package/dist/client/assets/{sso-BBNnGqrM.js → sso-BfMn38Ls.js} +1 -1
- package/dist/client/assets/{suggestion-C3ZKXBdN.js → suggestion-D7zzeZOU.js} +1 -1
- package/dist/client/assets/{switch-BMZWxSSe.js → switch-BaIjfvqD.js} +1 -1
- package/dist/client/assets/{synced-repos-CvcyOOTD.js → synced-repos-BP9uEFMS.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-C7CENxYE.js → tab-icon-glyph-CVcm827m.js} +1 -1
- package/dist/client/assets/{table-BXlZF1sj.js → table-_XF-prXn.js} +1 -1
- package/dist/client/assets/{tabs-CTACUnuC.js → tabs-CzXyAmJC.js} +1 -1
- package/dist/client/assets/{task-board-AmZMoSDj.js → task-board-HVkUhR2P.js} +1 -1
- package/dist/client/assets/{task-route-DZtDO9ed.js → task-route-B3pI7dth.js} +1 -1
- package/dist/client/assets/{task-status-CHJ2KIGX.js → task-status-yRMe4nbp.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-oNMzSYdF.js → taskboard-analytics-Du7Elnb7.js} +1 -1
- package/dist/client/assets/tasks-BtYoq0Uy.js +1 -0
- package/dist/client/assets/{tasks-CbVjJ3WE.js → tasks-BzhoYnpL.js} +1 -1
- package/dist/client/assets/{textarea-eeqMJnUq.js → textarea-B05kUdob.js} +1 -1
- package/dist/client/assets/{thread-analytics-D2UkVv7U.js → thread-analytics-BfeByGR2.js} +1 -1
- package/dist/client/assets/{thread-intent-B59SA_sa.js → thread-intent-BIRE7Qtk.js} +1 -1
- package/dist/client/assets/{thread-route-DT3i-QGQ.js → thread-route-CZ8MMB_J.js} +1 -1
- package/dist/client/assets/{thread-route-Dpw37tsP.js → thread-route-Cn39v6pB.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DfCWtsKP.js → thread-sheet-body-D65WuUvv.js} +1 -1
- package/dist/client/assets/{time-range-picker-Cd1A1wA5.js → time-range-picker-DzKmFLJB.js} +1 -1
- package/dist/client/assets/{toggle-group-C6Pg2YNy.js → toggle-group-HpKtAH98.js} +1 -1
- package/dist/client/assets/{tool-namespace-DbWzvuWO.js → tool-namespace-DxYdT3r_.js} +1 -1
- package/dist/client/assets/{tool-set-selector-CCOfv97s.js → tool-set-selector-CnBqlG8R.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Cy2z0B4C.js → toolbar-icon-button-TYsxy9yJ.js} +1 -1
- package/dist/client/assets/{tooltip-Bg4P3YaG.js → tooltip-BgCnMV2H.js} +1 -1
- package/dist/client/assets/{tooltipContext-DNapU3M5.js → tooltipContext-BRYDLqxt.js} +1 -1
- package/dist/client/assets/{track-BAapDq3b.js → track-BDp_1Hit.js} +1 -1
- package/dist/client/assets/{types-BrSjQREm.js → types-D8M__V__.js} +1 -1
- package/dist/client/assets/{url-slug-DyPxKD3g.js → url-slug-Bsw_pMhA.js} +1 -1
- package/dist/client/assets/{usage-stats-Di2DK9Gv.js → usage-stats-DJLHvs3H.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bz3SR-CO.js → use-ai-providers-F8TOugyU.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-BXKIXuir.js → use-apply-named-rule-BRkF3nZ-.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-C9KFi3ct.js +1 -0
- package/dist/client/assets/{use-automations-BU5c4wvD.js → use-automations-EsbplC7e.js} +1 -1
- package/dist/client/assets/{use-autosave-CkIhfcE5.js → use-autosave-BG4nXiOR.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-BOjb1YoC.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-DvftxykM.js → use-chat-layout-state-CQ-6yLaB.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-B3qNhOq8.js → use-cms-publish-actions-CiGJc3Qg.js} +1 -1
- package/dist/client/assets/{use-connect-companion-3Wux1jMd.js → use-connect-companion-ClTD8ccL.js} +1 -1
- package/dist/client/assets/{use-connection-IiFidBLV.js → use-connection-DCYGUl-Y.js} +1 -1
- package/dist/client/assets/{use-content-sync-BrMwpVNk.js → use-content-sync-CoOj2Ul7.js} +1 -1
- package/dist/client/assets/{use-copy-D49VwPhf.js → use-copy-L2-IdJ_Y.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DKLPMzYi.js → use-date-fns-locale-DPCm9If2.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CcnJ6SAY.js → use-debounced-autosave-DWtRBliW.js} +1 -1
- package/dist/client/assets/{use-debounced-value-nhqnKklo.js → use-debounced-value-Dn9biZK4.js} +1 -1
- package/dist/client/assets/{use-deco-credits-NgUo324z.js → use-deco-credits-dZ-Tevsi.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-mew6sG2k.js → use-decopilot-events-CKMPTK-j.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D-oKvtiI.js → use-delete-connection-DxUOloiw.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CHn3xyJc.js → use-deployment-admin-_7fnOeiD.js} +1 -1
- package/dist/client/assets/{use-entitlements-C6In-vfl.js → use-entitlements-BB4qLcGz.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CIz-3ef3.js → use-fast-preview-draft-url-D8KiT4ue.js} +1 -1
- package/dist/client/assets/{use-file-configs-CwAhp36j.js → use-file-configs-c0RGBFjk.js} +1 -1
- package/dist/client/assets/{use-id-selection-mULmZ-Hz.js → use-id-selection-CmywK9L9.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CHAfyO1k.js → use-inbox-feed-BHnwr1_f.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-fmrdKwVH.js → use-infinite-scroll-CM4CmzMp.js} +1 -1
- package/dist/client/assets/{use-join-requests-D9VYGJJu.js → use-join-requests-DbFDM92p.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-3c9VwMgJ.js → use-main-panel-tabs-Xv2NwPm3.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CK0IBQOj.js → use-mcp-auth-status-irD2t1-7.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B3mZDGvG.js → use-mcp-client-CqE4Ghrf.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DnVJp_BL.js → use-mcp-prompts-SlwHiJ8X.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dn8Dy7zb.js → use-mcp-tools-BwZkbv7p.js} +1 -1
- package/dist/client/assets/{use-mobile-dJL_Pm5y.js → use-mobile-EwBUtNij.js} +1 -1
- package/dist/client/assets/{use-move-blocks-R4zS1l6g.js → use-move-blocks-DIQrtI4I.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CYu1HJsb.js → use-navigate-to-agent-ByCAg0It.js} +1 -1
- package/dist/client/assets/{use-org-fs-C83fBFK-.js → use-org-fs-CZ6M3p96.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CVhh3XbC.js → use-org-repo-syncs-DSYvITnH.js} +1 -1
- package/dist/client/assets/{use-org-sso-BVcty70n.js → use-org-sso-BQNy4M1M.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D9LYxkkn.js → use-organization-settings-B6zxeTvg.js} +1 -1
- package/dist/client/assets/{use-project-scope-Y6vAoZoW.js → use-project-scope-BmxYOSqD.js} +1 -1
- package/dist/client/assets/{use-recent-apps-ZWyNF1BM.js → use-recent-apps-CMc3bDPy.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CGaxGYkR.js → use-reports-diagnostic-Bz_fmb8r.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BFiAvETH.js → use-sandbox-events-Bcmjy8_y.js} +1 -1
- package/dist/client/assets/{use-secrets-DLxKCtNq.js → use-secrets-D3u_mrII.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CNXXBKYv.js → use-section-preview-base-RT0rIB3U.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-SAa7Vnq8.js → use-sidebar-collapsed-BWIgVYHH.js} +1 -1
- package/dist/client/assets/{use-tags-Dns9fjGu.js → use-tags-C_S8Ff1f.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-D75AC0iX.js → use-task-board-analytics-BCLzvxv7.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Dv2JYyOG.js → use-task-board-events-BQW5hXik.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DoH7p5yB.js → use-task-board-item-prs-B6Z2gJgd.js} +1 -1
- package/dist/client/assets/{use-task-board-items-CqIbwb7-.js → use-task-board-items-B3aJ_5y5.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-ptkIJi--.js → use-task-board-prompts-Dr1CEZWZ.js} +1 -1
- package/dist/client/assets/{use-task-metadata-D4qj8QP6.js → use-task-metadata-CdWilbXi.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Btu23rT9.js → use-thread-outputs-B4Zce4lE.js} +1 -1
- package/dist/client/assets/{use-voice-input-Bo9Hi7-O.js → use-voice-input-ADzQEEIx.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C3wEWRY0.js +1 -0
- package/dist/client/assets/{useQueries-Blq1gg86.js → useQueries-sl3HeH6v.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-mTZwKUMV.js +1 -0
- package/dist/client/assets/{users-CXxP5GbR.js → users-ChLpJ4P2.js} +1 -1
- package/dist/client/assets/{utils-D_vHWhJR.js → utils-ymd1FJWf.js} +1 -1
- package/dist/client/assets/{variant-calendar-B-mtMhAk.js → variant-calendar-Cs7cI_1m.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-hYkKBfSm.js → variant-matcher-override-1piR_ouW.js} +1 -1
- package/dist/client/assets/{view-header-DrakbT1r.js → view-header-DjtjUnvm.js} +1 -1
- package/dist/client/assets/{virtual-mcp-wPX8BO9V.js → virtual-mcp-BwBYFvbj.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-0ZXuPLm-.js → watch-sse-pool-BoqhatUL.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +24 -23
- package/dist/server/server.js +687 -687
- package/package.json +1 -1
- package/dist/client/assets/agent-app-ClOnnzDV.js +0 -1
- package/dist/client/assets/agent-deck-V4MMZHZM.js +0 -1
- package/dist/client/assets/agent-experiments-DH_tqVqH.js +0 -1
- package/dist/client/assets/agent-library-Co57cOat.js +0 -1
- package/dist/client/assets/agent-library-file-C_ffGwfX.js +0 -1
- package/dist/client/assets/agent-overview-D_ilxAiM.js +0 -1
- package/dist/client/assets/agent-settings-Fpuz9R9B.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CZax6TM0.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BaWyOpGo.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BwBm5AOl.js +0 -1
- package/dist/client/assets/agent-view-y52sDry1.js +0 -1
- package/dist/client/assets/api-keys-eCL0fGKt.js +0 -1
- package/dist/client/assets/library-DgHRYlXy.js +0 -1
- package/dist/client/assets/project-reports-BDw7SW7K.js +0 -1
- package/dist/client/assets/project-tasks-BrIInxOE.js +0 -1
- package/dist/client/assets/record-editor-Cybz45vp.js +0 -1
- package/dist/client/assets/reports-9BRnMytv.js +0 -1
- package/dist/client/assets/repositories-CSX3h8Qf.js +0 -1
- package/dist/client/assets/route-C9j-dl8S.js +0 -1
- package/dist/client/assets/settings-tab-BiP5If_9.js +0 -1
- package/dist/client/assets/site-editor-D-_GHa40.js +0 -1
- package/dist/client/assets/tasks-haJ5q1d6.js +0 -1
- package/dist/client/assets/use-ask-in-chat-BF9v_lE6.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-BSsXx46E.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BhHoWMFB.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DJxixS4t.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-
|
|
2
|
-
import{c as ue,j as r,r as j,m as Fe,b as Te,B as $e,a3 as ti,aF as cn,b4 as ct,aG as De,b5 as ni,b6 as si,b7 as ri,b8 as ai,v as Sr,D as Pr,K as Gn,w as jr,x as Er,e as ii,h as gt,I as Mn,y as oi,b9 as li,a5 as Jn,aZ as ci,b2 as di,i as Nr,ar as Un,at as In,a8 as Tr,P as zn,E as ui,t as dn,b3 as fi,q as pi}from"./index-cgovyYsQ.js";import{u as Cr,g as mi,c as qs,B as Rn,P as hi,r as gi,R as vi,a as xi,H as bi,b as Rr,S as wi,d as yi,l as ki,m as Si,p as Pi,e as ji,f as Ln,N as Ei}from"./parse-sections-Cu97Vu_M.js";import{b as Ni,c as Mt,r as Lr,l as Ar,f as Ti,g as Ci,w as Ri}from"./chat-context-BBpIuXC7.js";import{t as Li}from"./ChevronUp-BTGxI7Zs.js";import{P as Ai,Q as _i,J as _r,R as Oi,S as Di,b as Fi,T as $i,U as Or,V as Bi,W as Dr,X as Gs,Y as Mi}from"./agent-icon-TjMVTO6h.js";import{a as Ui,n as Ii}from"./UserSquare-DKikapRU.js";import{s as Fr}from"./Plus-DsyYMAU8.js";import{a as $r,b as Br,P as Mr}from"./popover-ns8sHJq5.js";import{e as dt,b as ut,c as Ur,f as Ir,a as zr,C as Kr}from"./command-DF3tcytL.js";import{b as zi,c as Ki,u as Hi}from"./repository-binding-CoBbz5GR.js";import{a as Ut}from"./sandbox-lifecycle-context-6GAWc6Uh.js";import{r as Vi}from"./thread-intent-B59SA_sa.js";import{u as Hr}from"./use-voice-input-Bo9Hi7-O.js";import{d as Wi,f as qi,i as Gi,g as Ji,h as Yi,j as Qi,k as Xi,u as fn,l as Yn,m as Xe,n as Zi,o as Vr,q as eo,t as to,v as no,w as Wr,x as so,c as qr,b as Gr,y as ro,z as He,A as ao,B as io,C as oo,D as lo,E as co,F as uo,G as Js,H as fo,I as Ys,J as po,K as mo,L as Qs,M as Xs,N as Zs,O as er,P as tr,Q as An,R as ho,S as go,U as vo,V as xo,W as bo,e as wo}from"./site-editor-toast-DtZvuCiL.js";import{u as Jr}from"./use-mobile-dJL_Pm5y.js";import{T as pt,a as mt,c as ht}from"./tooltip-Bg4P3YaG.js";import{T as Ze}from"./toolbar-icon-button-Cy2z0B4C.js";import{w as nn,i as yo}from"./variant-matcher-override-hYkKBfSm.js";import{s as Bt,n as Qn,a as Yr,f as Ve,v as Qr,u as Xr,h as ko,i as So,B as Po,S as jo,C as Eo,b as No,e as To,c as Co,d as Ro,N as Lo,g as Ao,r as _o,j as Oo,k as nr,p as Do}from"./blocks-tab-states-eGTb5mvz.js";import{u as Fo}from"./use-fast-preview-draft-url-CIz-3ef3.js";import{g as $o}from"./section-array-field--v0XzXwk.js";import{a as Bo,c as Zr}from"./shell-layout-C_vTrOFi.js";import{u as Xn,b as Mo}from"./use-sandbox-events-BFiAvETH.js";import{u as Kn}from"./useQueries-Blq1gg86.js";import{i as Uo}from"./LinkBroken01-CqkORUqT.js";import{u as ea}from"./blocks-preview-workspace-context-B_sPksUi.js";import{MonacoCodeEditor as Io}from"./monaco-editor-CuW8q0yx.js";import{c as zo,u as Ko,i as Ho,l as Vo,D as Wo}from"./hosted-reconcile-liA8Ue5e.js";import{d as qo}from"./utils-D_vHWhJR.js";import{R as sr,a as sn,b as rr}from"./resizable-D1KNHtt_.js";import{u as Go}from"./use-blocks-v8-project-BSsXx46E.js";import{s as Jo,L as Yo,R as ta,D as ar,w as Hn}from"./device-hint-tzTpy1A9.js";import{L as Qo}from"./label-BJpZpGc0.js";import{a as Xo,T as ir}from"./toggle-group-C6Pg2YNy.js";import{b as Zo}from"./sandbox-url-D3mC8qhT.js";import{r as el,R as tl}from"./virtual-mcp-wPX8BO9V.js";import{d as nl}from"./delay-CnY5UFtP.js";import{s as na}from"./XClose-DpL893eV.js";import{o as sl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as _n,b as rl,w as al,n as or}from"./app-preview-url-9Od4s8Sz.js";import{a as il}from"./use-organization-settings-D9LYxkkn.js";import{a as On}from"./agent-capabilities-CmoLwTEk.js";import{E as ol}from"./empty-state-qO8fmVkF.js";import{G as lr}from"./github-icon-Cfkkw3me.js";import{R as ll}from"./new-project-dialog-CG2L3MM-.js";import{r as cl}from"./preview-source-BsRLGWUP.js";import{A as dl,a as ul,b as fl}from"./alert-DOoQbEiz.js";import{u as pl}from"./use-task-metadata-D4qj8QP6.js";function ml(t){const e=ue.c(10),{waiting:n}=t,s=n?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Ai,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=l):l=e[1];let c;e[2]!==n?(c=n&&r.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=c):c=e[3];let o;e[4]!==c?(o=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[l,c]}),e[4]=c,e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(_i,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let d;return e[7]!==s||e[8]!==o?(d=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":s,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=s,e[8]=o,e[9]=d):d=e[9],d}function hl(t){const e=ue.c(22),{index:n,numbered:s,step:a,heading:l}=t,c=j.useId();let o;e[0]!==n||e[1]!==s?(o=s&&r.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let i;e[3]!==l||e[4]!==c||e[5]!==a.title?(i=r.jsx(l,{id:c,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=l,e[4]=c,e[5]=a.title,e[6]=i):i=e[6];let d;e[7]!==o||e[8]!==i?(d=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=d):d=e[9];const m=s&&"sm:pl-9";let f;e[10]!==m?(f=Fe("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=f):f=e[11];let p;e[12]!==a.body?(p=a.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=p):p=e[13];let S;e[14]!==a.after||e[15]!==f||e[16]!==p?(S=r.jsxs("div",{className:f,children:[p,a.after]}),e[14]=a.after,e[15]=f,e[16]=p,e[17]=S):S=e[17];let v;return e[18]!==c||e[19]!==d||e[20]!==S?(v=r.jsxs("li",{"aria-labelledby":c,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,S]}),e[18]=c,e[19]=d,e[20]=S,e[21]=v):v=e[21],v}const gl=[];function un(t){const e=ue.c(20),{title:n,lead:s,waiting:a,alerts:l,steps:c,footer:o,headingLevel:i}=t,d=c===void 0?gl:c,m=i===void 0?1:i,f=m===1?"h1":"h2",p=a&&d.length===0?"status":void 0;let S;e[0]!==a?(S=r.jsx(ml,{waiting:a}),e[0]=a,e[1]=S):S=e[1];let v;e[2]!==f||e[3]!==n?(v=r.jsx(f,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=f,e[3]=n,e[4]=v):v=e[4];let x;e[5]!==s?(x=s&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:s}),e[5]=s,e[6]=x):x=e[6];let h;e[7]!==p||e[8]!==S||e[9]!==v||e[10]!==x?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[S,v,x]}),e[7]=p,e[8]=S,e[9]=v,e[10]=x,e[11]=h):h=e[11];let b;e[12]!==m||e[13]!==d?(b=d.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,g)=>r.jsx(hl,{index:g+1,numbered:d.length>1,step:y,heading:m===1?"h2":"h3"},y.title))}),e[12]=m,e[13]=d,e[14]=b):b=e[14];let T;return e[15]!==l||e[16]!==o||e[17]!==h||e[18]!==b?(T=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[h,l,b,o]})}),e[15]=l,e[16]=o,e[17]=h,e[18]=b,e[19]=T):T=e[19],T}function vl(t){const e=ue.c(43),{wait:n,hosts:s,invalidLink:a}=t,l=a===void 0?!1:a,c=Te();let o;e[0]!==l||e[1]!==c?(o=l&&r.jsx(dl,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(ul,{className:"line-clamp-none text-foreground",children:c("decoServe.link.invalidTitle")}),r.jsx(fl,{children:c("decoServe.link.invalidBody")})]})}),e[0]=l,e[1]=c,e[2]=o):o=e[2];const i=o;if(n.kind==="problem"){let g;e[3]!==c||e[4]!==n.host||e[5]!==n.problem?(g=Jo(c,n.problem,n.host),e[3]=c,e[4]=n.host,e[5]=n.problem,e[6]=g):g=e[6];const{title:N,body:E}=g;let k;e[7]!==E?(k=r.jsx(ta,{text:E}),e[7]=E,e[8]=k):k=e[8];let P;e[9]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(ar,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=P):P=e[9];let C;return e[10]!==i||e[11]!==k||e[12]!==N?(C=r.jsx(un,{headingLevel:2,waiting:!1,title:N,lead:k,alerts:i,footer:P}),e[10]=i,e[11]=k,e[12]=N,e[13]=C):C=e[13],C}const d=n.kind==="looking",m=d&&!n.paused;let f;e[14]!==c?(f=c("decoServe.waiting.title"),e[14]=c,e[15]=f):f=e[15];let p;e[16]!==c?(p=c("decoServe.waiting.lead"),e[16]=c,e[17]=p):p=e[17];let S;e[18]!==i||e[19]!==n.kind?(S=(i||n.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,n.kind==="denied"&&r.jsx(Yo,{})]}),e[18]=i,e[19]=n.kind,e[20]=S):S=e[20];let v;e[21]!==c?(v=c("decoServe.waiting.connect.title"),e[21]=c,e[22]=v):v=e[22];let x;e[23]!==c?(x=c("decoServe.waiting.connect.body"),e[23]=c,e[24]=x):x=e[24];let h;e[25]!==s||e[26]!==d||e[27]!==c||e[28]!==n.kind||e[29]!==n.onStart||e[30]!==n.paused?(h=n.kind==="needs-gesture"?r.jsx($e,{variant:"outline",className:"self-start",onClick:n.onStart,children:c("decoServe.guide.start")}):d&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?c("decoServe.guide.paused"):c("decoServe.guide.looking",{hosts:s})}),e[25]=s,e[26]=d,e[27]=c,e[28]=n.kind,e[29]=n.onStart,e[30]=n.paused,e[31]=h):h=e[31];let b;e[32]!==v||e[33]!==x||e[34]!==h?(b=[{title:v,body:x,after:h}],e[32]=v,e[33]=x,e[34]=h,e[35]=b):b=e[35];let T;e[36]===Symbol.for("react.memo_cache_sentinel")?(T=r.jsx(ar,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=T):T=e[36];let y;return e[37]!==b||e[38]!==m||e[39]!==f||e[40]!==p||e[41]!==S?(y=r.jsx(un,{headingLevel:2,waiting:m,title:f,lead:p,alerts:S,steps:b,footer:T}),e[37]=b,e[38]=m,e[39]=f,e[40]=p,e[41]=S,e[42]=y):y=e[42],y}function xl(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const bl=15e3,wl=3e3;function yl(t){const{candidates:e,probe:n,onFound:s,onChange:a,doc:l=document,setTimer:c=(g,N)=>setTimeout(g,N),clearTimer:o=g=>clearTimeout(g),timeoutMs:i=wl}=t;let d={status:"searching",firstRoundDone:!1,problem:null},m=!1,f=!1,p=0,S=null,v=null;const x=()=>l.visibilityState==="hidden",h=g=>{d={...d,...g},a(d)},b=async g=>{v=new AbortController;const N=v,E=c(()=>N.abort(),i);try{return await n(g,N.signal),!0}catch(k){if(m)return!1;const P=qi(k);return P.reason!=="not-answering"?h({problem:{...P,endpoint:g}}):d.problem?.endpoint===g&&h({problem:null}),!1}finally{o(E),v=null}},T=async()=>{if(S=null,!(m||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(x()){h({status:"paused"});return}f=!0,d.status!=="searching"&&h({status:"searching"});for(const g of e){if(m)break;if(await b(g)){if(f=!1,m)return;m=!0,l.removeEventListener("visibilitychange",y),h({status:"found",firstRoundDone:!0}),s(g);return}}if(f=!1,!m){if(p+=1,d.firstRoundDone||h({firstRoundDone:!0}),x()){h({status:"paused"});return}S=c(()=>{T()},Wi(p,bl))}}};function y(){if(!m){if(x()){S!==null&&(o(S),S=null),f||h({status:"paused"});return}S!==null&&o(S),p=0,T()}}return l.addEventListener("visibilitychange",y),a(d),T(),()=>{m=!0,S!==null&&o(S),v?.abort(),l.removeEventListener("visibilitychange",y)}}function kl(t,e){return Ji(Yi({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const Sl=["loopback-network","local-network-access"];async function Pl(){if(Gi(window.location.origin))return null;for(const t of Sl)try{return await navigator.permissions.query({name:t})}catch{}return null}let sa=null,cr=!1;const Dn=new Set;function jl(t){if(Dn.add(t),!cr){cr=!0;const e=n=>{sa=n;for(const s of Dn)s()};Pl().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Dn.delete(t)}const El={status:"stopped",firstRoundDone:!1,problem:null},Fn=new Map;function Nl(t){const e=Fn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const s=new Set;let a=null;const l={onFound:()=>{},getSnapshot:()=>n,subscribe:c=>(s.add(c),a??=yl({candidates:t.split(" "),probe:kl,onFound:o=>l.onFound(o),onChange:o=>{n=o;for(const i of s)i()}}),()=>{s.delete(c),!(s.size>0)&&(a?.(),a=null,Fn.delete(t))})};return Fn.set(t,l),l}function ra(){return j.useSyncExternalStore(jl,ur,ur)}const Tl=()=>()=>{},dr=()=>El,ur=()=>sa;function qu(t){const e=ue.c(9),{candidates:n,onFound:s}=t,[a,l]=j.useState(!1),c=ra(),i=(c==="granted"||c==="unsupported"||c==="prompt"&&a)&&n.length>0;let d;e[0]!==i||e[1]!==n||e[2]!==s?(d=i?Nl(n.join(" ")):null,d&&(d.onFound=s),e[0]=i,e[1]=n,e[2]=s,e[3]=d):d=e[3];const m=j.useSyncExternalStore(d?.subscribe??Tl,d?.getSnapshot??dr,d?.getSnapshot??dr),f=c==="prompt"&&!a;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>l(!0),e[4]=p):p=e[4];let S;return e[5]!==c||e[6]!==m||e[7]!==f?(S={state:m,access:c,needsGesture:f,start:p},e[5]=c,e[6]=m,e[7]=f,e[8]=S):S=e[8],S}const fr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Cl(t){const{previewState:e,progressStatus:n,fastPreviewActive:s=!1,fastPreviewReady:a=!1,codingSession:l=!1,hostedDraft:c=!1}=t,o=l?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?fr:c&&t.hostedPointerPending&&!a?{...fr,showDecidingLoader:!0}:s&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:s&&c&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!s&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Rl=1e4,Ll=1e3,Al=3e4;function _l({iframeRef:t,src:e,active:n}){const s=j.useRef(0),a=j.useRef(null),l=j.useRef(null),c=j.useRef(e),o=j.useRef(n);c.current=e,o.current=n;const i=()=>{a.current&&clearTimeout(a.current),l.current&&clearTimeout(l.current),a.current=null,l.current=null},d=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Rl)},m=()=>{if(!o.current||!c.current)return;l.current&&clearTimeout(l.current);const S=ti(Al,Ll,s.current,2,.5);s.current+=1,l.current=setTimeout(()=>{l.current=null;const v=t.current,x=c.current;!v||!x||!o.current||(v.src=x,d())},S)},f=()=>{s.current=0,i()},p=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return j.useEffect(()=>{if(i(),s.current=0,!(!n||!e))return d(),i},[e,n]),{handleLoad:f,handleError:p}}const Ol=1500,Dl=500;function Fl({iframe:t,reload:e,waitMs:n=Ol,confirmMs:s=Dl}){let a;const l=()=>{clearTimeout(c),a=setTimeout(e,s)};t.addEventListener("load",l,{once:!0});const c=setTimeout(()=>{t.removeEventListener("load",l),e()},n);return()=>{clearTimeout(c),clearTimeout(a),t.removeEventListener("load",l)}}const $l=cn({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:cn({width:ct(),height:ct()}),position:cn({x:ct(),y:ct()})}),Bl=`(function() {
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-CxLQrocH.js","assets/index-D8pFT62M.js","assets/index-SmuiYnIl.css","assets/chat-context-DGEoSZ8g.js","assets/autosend-BLwaDfuL.js","assets/thread-route-CZ8MMB_J.js","assets/use-project-scope-BmxYOSqD.js","assets/repository-binding-BgpHTQa3.js","assets/use-mcp-client-CqE4Ghrf.js","assets/auth-A_dHVlLy.js","assets/thread-intent-BIRE7Qtk.js","assets/delay-CnY5UFtP.js","assets/watch-sse-pool-BoqhatUL.js","assets/task-board-HVkUhR2P.js","assets/schema-Czvp_Lwx.js","assets/use-entitlements-BB4qLcGz.js","assets/use-ai-providers-F8TOugyU.js","assets/use-decopilot-events-CKMPTK-j.js","assets/use-organization-settings-B6zxeTvg.js","assets/parse-sections-Cu3Ael-d.js","assets/utils-ymd1FJWf.js","assets/agent-icon-WM9Nds86.js","assets/AlertCircle-BavhHXrm.js","assets/Tool01-BpRvGDMW.js","assets/ArrowUp-D6obKkNl.js","assets/ArrowLeft-NHzfDSKs.js","assets/LinkBroken01-Dhqzd5Xp.js","assets/ShoppingBag01-B2TVYCJe.js","assets/Globe04-DsEVRQ8J.js","assets/CheckCircle-BZC8qNjY.js","assets/ChevronUp-CP2Q1tno.js","assets/ChevronSelectorVertical-XtqZtaGN.js","assets/UserSquare-CeUdUVlp.js","assets/CreditCard01-DSR9reUx.js","assets/SwitchHorizontal01-C6F9FLuz.js","assets/Key01-CACSt4gn.js","assets/Minus-CF20rGao.js","assets/Monitor01-CTh24U4S.js","assets/Sun-CwYfSEKK.js","assets/Play-Dl9rHUIQ.js","assets/Plus-CcxRdpHl.js","assets/SearchMd-BvpUvADB.js","assets/Trash01-rMYgPi4D.js","assets/Upload01-CTvUgusS.js","assets/Users01-CgIFV9B4.js","assets/XClose-B8ZWakSs.js","assets/Zap-BheFKoJA.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-BqxIn6Y_.js","assets/collapsible-CBkOKy_V.js","assets/use-copy-L2-IdJ_Y.js","assets/usage-stats-DJLHvs3H.js","assets/tool-namespace-DxYdT3r_.js","assets/form-CX9Y8rXx.js","assets/label-DyJSQ7-Z.js","assets/utils-CVEq3hMx.js","assets/markdown-h9PNnEh6.js","assets/use-mobile-EwBUtNij.js","assets/tooltip-BgCnMV2H.js","assets/index-CLm0YAEW.js","assets/shell-layout-DP24kzbV.js","assets/use-deployment-admin-_7fnOeiD.js","assets/admin-fetch-BhTJlAsX.js","assets/command-Dnw2pasR.js","assets/index-C_uBCqyj.js","assets/integration-icon-oVgUnqWm.js","assets/project-icon-D_-oKizr.js","assets/use-navigate-to-agent-ByCAg0It.js","assets/new-project-dialog-CkpxzAtO.js","assets/repository-picker-DxnB6y8P.js","assets/github-icon-D5WAOakM.js","assets/useInfiniteQuery-C3wEWRY0.js","assets/infiniteQueryObserver-BCA8pHQ9.js","assets/collection-search-DLMLNhxJ.js","assets/use-debounced-value-Dn9biZK4.js","assets/required-auth-layout-BPTXO06k.js","assets/use-org-sso-BQNy4M1M.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CQuQ-XsR.js","assets/types-D8M__V__.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-DzHWnq_T.js","assets/use-connection-DCYGUl-Y.js","assets/use-mcp-prompts-SlwHiJ8X.js","assets/use-thread-outputs-B4Zce4lE.js","assets/file-type-icon-BbCX4o-i.js","assets/section-array-field-DvmsCB7P.js","assets/blocks-tab-states-DjNiCspc.js","assets/site-editor-toast-Aeb7soFG.js","assets/use-voice-input-ADzQEEIx.js","assets/popover-Bc0Osxls.js","assets/drawer-Cr3trfMB.js","assets/index-DsP4hX0b.js","assets/checkbox-2hVfC1K9.js","assets/select-o79Ct_ay.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/use-blocks-v8-project-BOjb1YoC.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-Bcmjy8_y.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-CQDiVxjd.js","assets/hosted-reconcile-CFgAFv0C.js","assets/slider-Dh1rUkk7.js","assets/index-D9_88oYJ.js","assets/tooltipContext-BRYDLqxt.js","assets/CategoricalChart-9YwAdaOL.js","assets/index-C6icdhcm.js","assets/switch-BaIjfvqD.js","assets/textarea-B05kUdob.js","assets/scroll-area-mSNTFn2P.js","assets/monaco-editor-Cjb9-6hs.js","assets/editor-CtNrPORw.js","assets/calendar-B-_EB2yo.js","assets/editor-classes-DGhQ0khm.js","assets/core.esm-Dg3ste3x.js","assets/sortable.esm-BeVlNSdK.js","assets/toggle-group-HpKtAH98.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-Bv4H0UoH.js","assets/search-input-BFuc9oQg.js","assets/tabs-CzXyAmJC.js","assets/use-file-configs-c0RGBFjk.js","assets/asset-utils-B5Sq3qKL.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-DYLtwKk5.js","assets/use-section-preview-base-RT0rIB3U.js","assets/seo-editor-BE13UypD.js","assets/use-apply-named-rule-BRkF3nZ-.js","assets/use-move-blocks-DIQrtI4I.js","assets/variant-matcher-override-1piR_ouW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as ue,j as r,r as j,m as Fe,b as Te,B as $e,a3 as ti,aF as cn,b4 as ct,aG as De,b5 as ni,b6 as si,b7 as ri,b8 as ai,v as Sr,D as Pr,K as Gn,w as jr,x as Er,e as ii,h as gt,I as Mn,y as oi,b9 as li,a5 as Jn,aZ as ci,b2 as di,i as Nr,ar as Un,at as In,a8 as Tr,P as zn,E as ui,t as dn,b3 as fi,q as pi}from"./index-D8pFT62M.js";import{u as Cr,g as mi,c as qs,B as Rn,P as hi,r as gi,R as vi,a as xi,H as bi,b as Rr,S as wi,d as yi,l as ki,m as Si,p as Pi,e as ji,f as Ln,N as Ei}from"./parse-sections-Cu3Ael-d.js";import{b as Ni,c as Mt,r as Lr,l as Ar,f as Ti,g as Ci,w as Ri}from"./chat-context-DGEoSZ8g.js";import{t as Li}from"./ChevronUp-CP2Q1tno.js";import{P as Ai,Q as _i,J as _r,R as Oi,S as Di,b as Fi,T as $i,U as Or,V as Bi,W as Dr,X as Gs,Y as Mi}from"./agent-icon-WM9Nds86.js";import{a as Ui,n as Ii}from"./UserSquare-CeUdUVlp.js";import{s as Fr}from"./Plus-CcxRdpHl.js";import{a as $r,b as Br,P as Mr}from"./popover-Bc0Osxls.js";import{e as dt,b as ut,c as Ur,f as Ir,a as zr,C as Kr}from"./command-Dnw2pasR.js";import{b as zi,c as Ki,u as Hi}from"./repository-binding-BgpHTQa3.js";import{a as Ut}from"./sandbox-lifecycle-context-KNW6PNmy.js";import{r as Vi}from"./thread-intent-BIRE7Qtk.js";import{u as Hr}from"./use-voice-input-ADzQEEIx.js";import{d as Wi,f as qi,i as Gi,g as Ji,h as Yi,j as Qi,k as Xi,u as fn,l as Yn,m as Xe,n as Zi,o as Vr,q as eo,t as to,v as no,w as Wr,x as so,c as qr,b as Gr,y as ro,z as He,A as ao,B as io,C as oo,D as lo,E as co,F as uo,G as Js,H as fo,I as Ys,J as po,K as mo,L as Qs,M as Xs,N as Zs,O as er,P as tr,Q as An,R as ho,S as go,U as vo,V as xo,W as bo,e as wo}from"./site-editor-toast-Aeb7soFG.js";import{u as Jr}from"./use-mobile-EwBUtNij.js";import{T as pt,a as mt,c as ht}from"./tooltip-BgCnMV2H.js";import{T as Ze}from"./toolbar-icon-button-TYsxy9yJ.js";import{w as nn,i as yo}from"./variant-matcher-override-1piR_ouW.js";import{s as Bt,n as Qn,a as Yr,f as Ve,v as Qr,u as Xr,h as ko,i as So,B as Po,S as jo,C as Eo,b as No,e as To,c as Co,d as Ro,N as Lo,g as Ao,r as _o,j as Oo,k as nr,p as Do}from"./blocks-tab-states-DjNiCspc.js";import{u as Fo}from"./use-fast-preview-draft-url-D8KiT4ue.js";import{g as $o}from"./section-array-field-DvmsCB7P.js";import{a as Bo,c as Zr}from"./shell-layout-DP24kzbV.js";import{u as Xn,b as Mo}from"./use-sandbox-events-Bcmjy8_y.js";import{u as Kn}from"./useQueries-sl3HeH6v.js";import{i as Uo}from"./LinkBroken01-Dhqzd5Xp.js";import{u as ea}from"./blocks-preview-workspace-context-Ct_L2Frv.js";import{MonacoCodeEditor as Io}from"./monaco-editor-Cjb9-6hs.js";import{c as zo,u as Ko,i as Ho,l as Vo,D as Wo}from"./hosted-reconcile-CFgAFv0C.js";import{d as qo}from"./utils-ymd1FJWf.js";import{R as sr,a as sn,b as rr}from"./resizable-DHZRSfuo.js";import{u as Go}from"./use-blocks-v8-project-BOjb1YoC.js";import{s as Jo,L as Yo,R as ta,D as ar,w as Hn}from"./device-hint-CyVF9iUZ.js";import{L as Qo}from"./label-DyJSQ7-Z.js";import{a as Xo,T as ir}from"./toggle-group-HpKtAH98.js";import{b as Zo}from"./sandbox-url-D3mC8qhT.js";import{r as el,R as tl}from"./virtual-mcp-BwBYFvbj.js";import{d as nl}from"./delay-CnY5UFtP.js";import{s as na}from"./XClose-B8ZWakSs.js";import{o as sl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as _n,b as rl,w as al,n as or}from"./app-preview-url-9Od4s8Sz.js";import{a as il}from"./use-organization-settings-B6zxeTvg.js";import{a as On}from"./agent-capabilities-D5dRez_U.js";import{E as ol}from"./empty-state-CQDiVxjd.js";import{G as lr}from"./github-icon-D5WAOakM.js";import{R as ll}from"./new-project-dialog-CkpxzAtO.js";import{r as cl}from"./preview-source-BsRLGWUP.js";import{A as dl,a as ul,b as fl}from"./alert-U9tZtWPC.js";import{u as pl}from"./use-task-metadata-CdWilbXi.js";function ml(t){const e=ue.c(10),{waiting:n}=t,s=n?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Ai,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=l):l=e[1];let c;e[2]!==n?(c=n&&r.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=c):c=e[3];let o;e[4]!==c?(o=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[l,c]}),e[4]=c,e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(_i,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let d;return e[7]!==s||e[8]!==o?(d=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":s,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=s,e[8]=o,e[9]=d):d=e[9],d}function hl(t){const e=ue.c(22),{index:n,numbered:s,step:a,heading:l}=t,c=j.useId();let o;e[0]!==n||e[1]!==s?(o=s&&r.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let i;e[3]!==l||e[4]!==c||e[5]!==a.title?(i=r.jsx(l,{id:c,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=l,e[4]=c,e[5]=a.title,e[6]=i):i=e[6];let d;e[7]!==o||e[8]!==i?(d=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=d):d=e[9];const m=s&&"sm:pl-9";let f;e[10]!==m?(f=Fe("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=f):f=e[11];let p;e[12]!==a.body?(p=a.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=p):p=e[13];let S;e[14]!==a.after||e[15]!==f||e[16]!==p?(S=r.jsxs("div",{className:f,children:[p,a.after]}),e[14]=a.after,e[15]=f,e[16]=p,e[17]=S):S=e[17];let v;return e[18]!==c||e[19]!==d||e[20]!==S?(v=r.jsxs("li",{"aria-labelledby":c,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,S]}),e[18]=c,e[19]=d,e[20]=S,e[21]=v):v=e[21],v}const gl=[];function un(t){const e=ue.c(20),{title:n,lead:s,waiting:a,alerts:l,steps:c,footer:o,headingLevel:i}=t,d=c===void 0?gl:c,m=i===void 0?1:i,f=m===1?"h1":"h2",p=a&&d.length===0?"status":void 0;let S;e[0]!==a?(S=r.jsx(ml,{waiting:a}),e[0]=a,e[1]=S):S=e[1];let v;e[2]!==f||e[3]!==n?(v=r.jsx(f,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=f,e[3]=n,e[4]=v):v=e[4];let x;e[5]!==s?(x=s&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:s}),e[5]=s,e[6]=x):x=e[6];let h;e[7]!==p||e[8]!==S||e[9]!==v||e[10]!==x?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[S,v,x]}),e[7]=p,e[8]=S,e[9]=v,e[10]=x,e[11]=h):h=e[11];let b;e[12]!==m||e[13]!==d?(b=d.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,g)=>r.jsx(hl,{index:g+1,numbered:d.length>1,step:y,heading:m===1?"h2":"h3"},y.title))}),e[12]=m,e[13]=d,e[14]=b):b=e[14];let T;return e[15]!==l||e[16]!==o||e[17]!==h||e[18]!==b?(T=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[h,l,b,o]})}),e[15]=l,e[16]=o,e[17]=h,e[18]=b,e[19]=T):T=e[19],T}function vl(t){const e=ue.c(43),{wait:n,hosts:s,invalidLink:a}=t,l=a===void 0?!1:a,c=Te();let o;e[0]!==l||e[1]!==c?(o=l&&r.jsx(dl,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(ul,{className:"line-clamp-none text-foreground",children:c("decoServe.link.invalidTitle")}),r.jsx(fl,{children:c("decoServe.link.invalidBody")})]})}),e[0]=l,e[1]=c,e[2]=o):o=e[2];const i=o;if(n.kind==="problem"){let g;e[3]!==c||e[4]!==n.host||e[5]!==n.problem?(g=Jo(c,n.problem,n.host),e[3]=c,e[4]=n.host,e[5]=n.problem,e[6]=g):g=e[6];const{title:N,body:E}=g;let k;e[7]!==E?(k=r.jsx(ta,{text:E}),e[7]=E,e[8]=k):k=e[8];let P;e[9]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(ar,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=P):P=e[9];let C;return e[10]!==i||e[11]!==k||e[12]!==N?(C=r.jsx(un,{headingLevel:2,waiting:!1,title:N,lead:k,alerts:i,footer:P}),e[10]=i,e[11]=k,e[12]=N,e[13]=C):C=e[13],C}const d=n.kind==="looking",m=d&&!n.paused;let f;e[14]!==c?(f=c("decoServe.waiting.title"),e[14]=c,e[15]=f):f=e[15];let p;e[16]!==c?(p=c("decoServe.waiting.lead"),e[16]=c,e[17]=p):p=e[17];let S;e[18]!==i||e[19]!==n.kind?(S=(i||n.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,n.kind==="denied"&&r.jsx(Yo,{})]}),e[18]=i,e[19]=n.kind,e[20]=S):S=e[20];let v;e[21]!==c?(v=c("decoServe.waiting.connect.title"),e[21]=c,e[22]=v):v=e[22];let x;e[23]!==c?(x=c("decoServe.waiting.connect.body"),e[23]=c,e[24]=x):x=e[24];let h;e[25]!==s||e[26]!==d||e[27]!==c||e[28]!==n.kind||e[29]!==n.onStart||e[30]!==n.paused?(h=n.kind==="needs-gesture"?r.jsx($e,{variant:"outline",className:"self-start",onClick:n.onStart,children:c("decoServe.guide.start")}):d&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?c("decoServe.guide.paused"):c("decoServe.guide.looking",{hosts:s})}),e[25]=s,e[26]=d,e[27]=c,e[28]=n.kind,e[29]=n.onStart,e[30]=n.paused,e[31]=h):h=e[31];let b;e[32]!==v||e[33]!==x||e[34]!==h?(b=[{title:v,body:x,after:h}],e[32]=v,e[33]=x,e[34]=h,e[35]=b):b=e[35];let T;e[36]===Symbol.for("react.memo_cache_sentinel")?(T=r.jsx(ar,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=T):T=e[36];let y;return e[37]!==b||e[38]!==m||e[39]!==f||e[40]!==p||e[41]!==S?(y=r.jsx(un,{headingLevel:2,waiting:m,title:f,lead:p,alerts:S,steps:b,footer:T}),e[37]=b,e[38]=m,e[39]=f,e[40]=p,e[41]=S,e[42]=y):y=e[42],y}function xl(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const bl=15e3,wl=3e3;function yl(t){const{candidates:e,probe:n,onFound:s,onChange:a,doc:l=document,setTimer:c=(g,N)=>setTimeout(g,N),clearTimer:o=g=>clearTimeout(g),timeoutMs:i=wl}=t;let d={status:"searching",firstRoundDone:!1,problem:null},m=!1,f=!1,p=0,S=null,v=null;const x=()=>l.visibilityState==="hidden",h=g=>{d={...d,...g},a(d)},b=async g=>{v=new AbortController;const N=v,E=c(()=>N.abort(),i);try{return await n(g,N.signal),!0}catch(k){if(m)return!1;const P=qi(k);return P.reason!=="not-answering"?h({problem:{...P,endpoint:g}}):d.problem?.endpoint===g&&h({problem:null}),!1}finally{o(E),v=null}},T=async()=>{if(S=null,!(m||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(x()){h({status:"paused"});return}f=!0,d.status!=="searching"&&h({status:"searching"});for(const g of e){if(m)break;if(await b(g)){if(f=!1,m)return;m=!0,l.removeEventListener("visibilitychange",y),h({status:"found",firstRoundDone:!0}),s(g);return}}if(f=!1,!m){if(p+=1,d.firstRoundDone||h({firstRoundDone:!0}),x()){h({status:"paused"});return}S=c(()=>{T()},Wi(p,bl))}}};function y(){if(!m){if(x()){S!==null&&(o(S),S=null),f||h({status:"paused"});return}S!==null&&o(S),p=0,T()}}return l.addEventListener("visibilitychange",y),a(d),T(),()=>{m=!0,S!==null&&o(S),v?.abort(),l.removeEventListener("visibilitychange",y)}}function kl(t,e){return Ji(Yi({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const Sl=["loopback-network","local-network-access"];async function Pl(){if(Gi(window.location.origin))return null;for(const t of Sl)try{return await navigator.permissions.query({name:t})}catch{}return null}let sa=null,cr=!1;const Dn=new Set;function jl(t){if(Dn.add(t),!cr){cr=!0;const e=n=>{sa=n;for(const s of Dn)s()};Pl().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Dn.delete(t)}const El={status:"stopped",firstRoundDone:!1,problem:null},Fn=new Map;function Nl(t){const e=Fn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const s=new Set;let a=null;const l={onFound:()=>{},getSnapshot:()=>n,subscribe:c=>(s.add(c),a??=yl({candidates:t.split(" "),probe:kl,onFound:o=>l.onFound(o),onChange:o=>{n=o;for(const i of s)i()}}),()=>{s.delete(c),!(s.size>0)&&(a?.(),a=null,Fn.delete(t))})};return Fn.set(t,l),l}function ra(){return j.useSyncExternalStore(jl,ur,ur)}const Tl=()=>()=>{},dr=()=>El,ur=()=>sa;function qu(t){const e=ue.c(9),{candidates:n,onFound:s}=t,[a,l]=j.useState(!1),c=ra(),i=(c==="granted"||c==="unsupported"||c==="prompt"&&a)&&n.length>0;let d;e[0]!==i||e[1]!==n||e[2]!==s?(d=i?Nl(n.join(" ")):null,d&&(d.onFound=s),e[0]=i,e[1]=n,e[2]=s,e[3]=d):d=e[3];const m=j.useSyncExternalStore(d?.subscribe??Tl,d?.getSnapshot??dr,d?.getSnapshot??dr),f=c==="prompt"&&!a;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>l(!0),e[4]=p):p=e[4];let S;return e[5]!==c||e[6]!==m||e[7]!==f?(S={state:m,access:c,needsGesture:f,start:p},e[5]=c,e[6]=m,e[7]=f,e[8]=S):S=e[8],S}const fr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Cl(t){const{previewState:e,progressStatus:n,fastPreviewActive:s=!1,fastPreviewReady:a=!1,codingSession:l=!1,hostedDraft:c=!1}=t,o=l?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?fr:c&&t.hostedPointerPending&&!a?{...fr,showDecidingLoader:!0}:s&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:s&&c&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!s&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Rl=1e4,Ll=1e3,Al=3e4;function _l({iframeRef:t,src:e,active:n}){const s=j.useRef(0),a=j.useRef(null),l=j.useRef(null),c=j.useRef(e),o=j.useRef(n);c.current=e,o.current=n;const i=()=>{a.current&&clearTimeout(a.current),l.current&&clearTimeout(l.current),a.current=null,l.current=null},d=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Rl)},m=()=>{if(!o.current||!c.current)return;l.current&&clearTimeout(l.current);const S=ti(Al,Ll,s.current,2,.5);s.current+=1,l.current=setTimeout(()=>{l.current=null;const v=t.current,x=c.current;!v||!x||!o.current||(v.src=x,d())},S)},f=()=>{s.current=0,i()},p=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return j.useEffect(()=>{if(i(),s.current=0,!(!n||!e))return d(),i},[e,n]),{handleLoad:f,handleError:p}}const Ol=1500,Dl=500;function Fl({iframe:t,reload:e,waitMs:n=Ol,confirmMs:s=Dl}){let a;const l=()=>{clearTimeout(c),a=setTimeout(e,s)};t.addEventListener("load",l,{once:!0});const c=setTimeout(()=>{t.removeEventListener("load",l),e()},n);return()=>{clearTimeout(c),clearTimeout(a),t.removeEventListener("load",l)}}const $l=cn({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:cn({width:ct(),height:ct()}),position:cn({x:ct(),y:ct()})}),Bl=`(function() {
|
|
3
3
|
if (window.__visualEditorActive) return;
|
|
4
4
|
window.__visualEditorActive = true;
|
|
5
5
|
|
|
@@ -548,4 +548,4 @@ import{c as ue,j as r,r as j,m as Fe,b as Te,B as $e,a3 as ti,aF as cn,b4 as ct,
|
|
|
548
548
|
}
|
|
549
549
|
});
|
|
550
550
|
})();`,rn=Object.freeze({ready:"deco:ready",load:"deco:load",loaded:"deco:loaded",loadError:"deco:load-error"}),zl="v1",Kl="/studio-modules",$n=["wireframe","html-swap"];function Hl(t,e,n){const s=new URL(`${Kl}/${zl}/${e}.js`,t);return n&&s.searchParams.set("build",n),s.href}const Vl=2e3;class Wl{constructor(e){this.options=e,this.urls=Object.fromEntries($n.map(n=>[n,Hl(e.studioOrigin,n,e.build)]))}options;origin=null;urls;loaded=new Set;swapId=0;pendingSwap=null;startTimer=null;has(e){return this.loaded.has(e)}handle(e){const n=this.options.frame();if(!n||e.source!==n)return!1;const s=e.data;if(!s||typeof s.type!="string")return!1;if(s.type===rn.ready)return ql(e.origin)?(this.ready(e.origin),!0):!1;if(e.origin!==this.origin)return!1;const a=s;switch(a.type){case rn.loaded:{const l=this.nameOf(a.url);return l&&(this.loaded.add(l),this.options.onModulesChange?.(),l==="wireframe"&&this.options.onWireframeReady?.()),!0}case rn.loadError:{const l=this.nameOf(a.url);return l&&this.loaded.delete(l)&&this.options.onModulesChange?.(),l==="html-swap"&&this.failSwap(),!0}case"wireframe:hover":case"wireframe:select":return this.options.onWireframe?.(a),!0;case"html-swap:start":return this.pendingSwap?.id===a.id&&(this.pendingSwap.started=!0,this.clearStartTimer()),!0;case"html-swap:end":return this.pendingSwap?.id!==a.id||(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.()),!0;case"html-swap:error":return this.pendingSwap?.id===a.id&&this.failSwap(),!0;default:return!1}}wireframe(e){return this.post("wireframe",e)}refresh(e){if(e!==void 0&&!this.isFrameOrigin(e))return!1;const n=++this.swapId,s=e?{type:"html-swap:refresh",id:n,url:e}:{type:"html-swap:refresh",id:n};return this.post("html-swap",s)?(this.pendingSwap={id:n,started:!1},this.clearStartTimer(),this.startTimer=setTimeout(()=>{this.startTimer=null,this.pendingSwap?.id===n&&!this.pendingSwap.started&&this.failSwap()},Vl),!0):!1}dispose(){this.clearStartTimer(),this.pendingSwap=null,this.loaded.clear(),this.origin=null}ready(e){this.origin=e,this.loaded.size&&(this.loaded.clear(),this.options.onModulesChange?.()),this.pendingSwap&&(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.());const n=this.options.frame();for(const s of $n)n?.postMessage({type:rn.load,url:this.urls[s]},e)}post(e,n){const s=this.options.frame();return!s||!this.origin||!this.loaded.has(e)?!1:(s.postMessage(n,this.origin),!0)}isFrameOrigin(e){try{return new URL(e).origin===this.origin}catch{return!1}}nameOf(e){return $n.find(n=>this.urls[n]===e)??null}failSwap(){this.clearStartTimer(),this.pendingSwap&&(this.pendingSwap=null,this.options.onSwapFailed?.())}clearStartTimer(){this.startTimer&&clearTimeout(this.startTimer),this.startTimer=null}}function ql(t){if(typeof t!="string"||t==="null")return!1;try{const e=new URL(t).origin;return e!=="null"&&e===t}catch{return!1}}function Vn(t,e,n=!1){let s=t,a=typeof s?.__resolveType=="string"?s.__resolveType:"";for(let l=0;a&&l<5;l++){const c=e[a];if(c&&typeof c=="object"&&"__resolveType"in c){const o=c.__resolveType;if(typeof o=="string"&&o&&o!==a){s=c,a=o;continue}}break}if(!a)return[];if(a.includes("flags/multivariate")||n&&ni(a,n)){const l=Array.isArray(s.variants)?s.variants:[];if(l.length===0||l.every(i=>{const d=i?.rule;return si(d?.__resolveType,n)}))return null;const o=[];for(const i of l){const d=ri(i,n);if(d&&typeof d=="object")for(const m of Vn(d,e,n)??[])o.includes(m)||o.push(m)}return o}if(ai(a)){const l=s.section&&typeof s.section=="object"?Vn(s.section,e,n):[];return l===null?null:l.length?[a,...l]:[a]}return[a]}function lt(t){return t.replace(/[`*_]/g,"\\$&")}function Gl(t,e){const n=[`The user selected an element on the live preview and asked: **"${lt(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&n.push(`**Section resolveType:** \`${lt(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const s=`<${t.tag}${t.classes?` class="${lt(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${s}\``),t.parents&&n.push(`**DOM breadcrumb:** ${lt(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${lt(t.text)}"`),t.componentName&&n.push(`**Component name:** ${lt(t.componentName)}`);const a=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",a,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
|
|
551
|
-
`)}function Jl(t,e,n=320,s=44,a=12){const{x:l,y:c}=t,{width:o,height:i}=e,d=Math.max(a,Math.min(l-n/2,o-n-a)),f=c/i>.68?Math.max(a,c-s-18):Math.min(c+18,i-s-a);return{leftPct:d/o*100,topPct:f/i*100}}function Yl(t){const e=ue.c(45),{element:n,onDismiss:s}=t,[a,l]=j.useState(""),c=j.useRef(null),{sendMessage:o}=Ni(),{openSidePanel:i}=Bo(),d=Te();let m;e[0]!==n||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const W=Gl(n,a);i(),o({parts:[{type:"text",text:W}]}),s()},e[0]=n,e[1]=a,e[2]=s,e[3]=i,e[4]=o,e[5]=m):m=e[5];const f=m;let p;e[6]!==n.position||e[7]!==n.viewport?(p=Jl(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=p):p=e[8];const S=p,v=`${S.leftPct}%`,x=`${S.topPct}%`;let h;e[9]!==v||e[10]!==x?(h={left:v,top:x,width:"320px"},e[9]=v,e[10]=x,e[11]=h):h=e[11];let b;e[12]!==f?(b=W=>{W.preventDefault(),f()},e[12]=f,e[13]=b):b=e[13];let T;e[14]===Symbol.for("react.memo_cache_sentinel")?(T=W=>l(W.target.value),e[14]=T):T=e[14];let y;e[15]!==s?(y=W=>{W.key==="Escape"&&s()},e[15]=s,e[16]=y):y=e[16];let g;e[17]!==d?(g=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=g):g=e[18];let N;e[19]!==a||e[20]!==y||e[21]!==g?(N=r.jsx("input",{ref:c,autoFocus:!0,type:"text",value:a,onChange:T,onKeyDown:y,placeholder:g,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=y,e[21]=g,e[22]=N):N=e[22];let E;e[23]!==a?(E=a.trim(),e[23]=a,e[24]=E):E=e[24];const k=!E;let P;e[25]!==d?(P=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=P):P=e[26];let C;e[27]!==d?(C=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=C):C=e[28];let O;e[29]!==C?(O=r.jsx("title",{children:C}),e[29]=C,e[30]=O):O=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=R):R=e[31];let A;e[32]!==O?(A=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[O,R]}),e[32]=O,e[33]=A):A=e[33];let D;e[34]!==k||e[35]!==P||e[36]!==A?(D=r.jsx("button",{type:"submit",disabled:k,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:P,children:A}),e[34]=k,e[35]=P,e[36]=A,e[37]=D):D=e[37];let _;e[38]!==N||e[39]!==D||e[40]!==b?(_=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:b,children:[N,D]}),e[38]=N,e[39]=D,e[40]=b,e[41]=_):_=e[41];let B;return e[42]!==_||e[43]!==h?(B=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:_}),e[42]=_,e[43]=h,e[44]=B):B=e[44],B}const pr="site-links",Ql=/details?page|\bpdp\b/i,Xl=/listingpage|\bplp\b/i;function Zl(t,e,n){const s=new Set;for(const o of n)Ql.test(o)&&s.add("product"),Xl.test(o)&&s.add("category");const a=Bt(Qn(t)),l=a[a.length-1],c=a[a.length-2];return l?.type==="text"&&l.text==="/p"&&c?.type==="param"&&c.name===e&&s.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&s.add("category"),s}const ec=["rosa","preto","pink","black"];function an(t,e){const n=e.trim();return n?t(n):ec.flatMap(s=>t(s))}function tc(t,e){const n=e.trim(),s=[];/^\d+$/.test(n)&&s.push({resolveType:t,props:{ids:[n]}});const l=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return s.push({resolveType:t,props:{query:l,count:10}}),s}const aa=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Zn(t){return t.split("/")[0]??""}function nc(t){const e=new Set;for(const n of t){const s=Zn(n);aa.has(s)&&e.add(s)}return e}function sc(t,e){const n=Zn(t);return!aa.has(n)||e.size===0?!0:e.has(n)}const rc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>an(n=>tc(t,n),e),optionsFromPayload:on},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:on},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:on},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:on},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:uc}];function ac(t,e,n=new Set){const s=[...e],a=o=>{const i=[];for(const d of rc){if(d.kind!==o)continue;const m=s.find(f=>d.test(f)&&sc(f,n));m&&i.push({cand:d,resolveType:m})}return i.find(d=>n.has(Zn(d.resolveType)))??i[0]},l=(o,i,d)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:d,buildRequests:m=>o.buildRequests(i,m),optionsFromPayload:o.optionsFromPayload}),c=[];for(const o of["product","category"]){if(!t.has(o))continue;const i=a(o);i&&c.push(l(i.cand,i.resolveType,!1))}return t.size>0&&c.push(ic(t.has("category")?"category":"product")),c}function ic(t){return{kind:t,id:pr,resolveType:pr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>gc(e,n)}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function oc(t,e,n){const s=new Set,a=new Set,l=c=>{if(Array.isArray(c)){for(const d of c)l(d);return}const o=et(c);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(n(i))s.add(i);else if(i in e&&!a.has(i)){a.add(i);const d=et(e[i])?.__resolveType;typeof d=="string"&&n(d)&&s.add(i),l(e[i])}}for(const d of Object.values(o))l(d)};return l(t),s}function ia(t){const e=new Set,n=[];for(const s of t)for(const a of s)e.has(a.value)||(e.add(a.value),n.push(a));return n}function oa(t){try{return decodeURIComponent(t)}catch{return t}}function lc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cc(t){const e=[];let n="^";for(const s of t)s.type==="text"?n+=lc(s.text):(e.push(s.name),n+=s.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function la(t,e,n){if(typeof t!="string"||!t)return null;let s;try{s=new URL(t,"https://placeholder.invalid").pathname}catch{return null}s=s.replace(/\/+$/,"");const a=Bt(Qn(e)),{pattern:l,order:c}=cc(a),o=c.indexOf(n);if(o===-1)return null;const i=s.match(l);if(!i)return null;const d=i[o+1]?.replace(/^\/+|\/+$/g,"");return d?oa(d):null}function on(t,e){const n=et(t),s=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],a=[],l=new Set;for(const c of s){const o=et(c);if(!o)continue;const i=la(o.url,e.template,e.paramName);if(!i||l.has(i))continue;l.add(i);const d=et(o.isVariantOf),m=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||i,f=Array.isArray(o.image)?et(o.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;a.push({value:i,label:m,image:p})}return a}function dc(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?oa(n):null}function uc(t){const e=[],n=new Set,s=(a,l)=>{const c=et(a);if(!c)return;const o=typeof c.name=="string"&&c.name?c.name:"",i=o?[...l,o]:l,d=dc(c.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:i.join(" › ")||d})),Array.isArray(c.children))for(const m of c.children)s(m,i)};if(Array.isArray(t))for(const a of t)s(a,[]);return e}const fc=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function pc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function mc(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let s,a=0;for(;(s=n.exec(t))!==null&&a++<5e3;){const l=s[1]??"",c=(s[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:l,text:c})}return e}function hc(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,s=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let l,c=0;for(;(l=s.exec(t))!==null&&c++<3e3;){const o=(l[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const i=t.slice(l.index,l.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:l[2]??"",image:i||void 0})}return e}function gc(t,e){const n=[],s=new Set,a=(l,c,o,i)=>{if(n.length>=200)return;const d=la(l,e.template,e.paramName);!d||s.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&fc.has(d.split("/")[0]??"")||(s.add(d),n.push({value:d,label:c&&c.length<=80?c:pc(d),kind:o,image:i}))};for(const{url:l,name:c,image:o}of hc(t))a(l,c,"product",o);for(const{href:l,text:c}of mc(t))l.startsWith("/")&&!l.startsWith("//")&&a(l,c,"category");return n}function Dt(t,e,n=50){const s=e.trim().toLowerCase();return(s?t.filter(l=>l.label.toLowerCase().includes(s)||l.value.toLowerCase().includes(s)):t).slice(0,n)}const ca=1e4;function vc(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function xc(t,{resolveType:e,props:n}){const s=await fetch(Qi(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(ca)});if(!s.ok)throw new Error(`Failed to fetch options: ${s.status}`);return s.json()}async function mr(t,e){const n=await fetch(Xi(t,e),{signal:AbortSignal.timeout(ca)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function bc(t,e,n){const s=e.optionsFromPayload(await mr(t,"/"),n),a=s.find(c=>c.kind==="category");if(!a)return s;const l=Ve(n.template,{[n.paramName]:a.value});if(l==="/")return s;try{const c=e.optionsFromPayload(await mr(t,l),n).filter(o=>o.kind==="product");return ia([s,c])}catch{return s}}function wc(t,e,n){return Gn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function yc(t,e,n,s){if(e.homepageLinks)return bc(t,e,s);const a=e.buildRequests?.(n)??[];if(a.length===0)return[];const l=await Promise.allSettled(a.map(o=>xc(t,o))),c=l.filter(o=>o.status==="fulfilled").map(o=>o.value);if(c.length===0){const o=l.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return ia(c.map(o=>e.optionsFromPayload(o,s)))}function Wn(t,e,n,s,a){return{queryKey:wc(t,e,n),queryFn:()=>yc(t,e,n,s),enabled:a,staleTime:6e4,retry:1}}function Ft(t){const e=ue.c(16),{heading:n,iconKind:s,options:a,template:l,paramName:c,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let d;if(e[0]!==s||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==c||e[5]!==l){let f;e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==c||e[11]!==l?(f=p=>r.jsxs(ut,{value:`${o}:${p.value}`,className:"gap-3 py-2",onSelect:()=>i(p.value),children:[s==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.image?r.jsx("img",{src:p.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(_r,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:p.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(l,{[c]:p.value})})]})]},`${o}:${p.value}`),e[7]=s,e[8]=o,e[9]=i,e[10]=c,e[11]=l,e[12]=f):f=e[12],d=a.map(f),e[0]=s,e[1]=o,e[2]=i,e[3]=a,e[4]=c,e[5]=l,e[6]=d}else d=e[6];let m;return e[13]!==n||e[14]!==d?(m=r.jsx(dt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=m):m=e[15],m}function hr(t){const e=ue.c(2),{text:n}=t;let s;return e[0]!==n?(s=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=s):s=e[1],s}function kc(t){const e=ue.c(52),{sources:n,template:s,paramName:a,value:l,sandboxRef:c,onCommit:o}=t,i=Te(),[d,m]=j.useState(!1),[f,p]=j.useState(""),[S,v]=j.useState(""),x=j.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,b=vc(i),y=[...new Set(n.map(ee=>b[ee.kind].noun))].join(" or ");let g;e[0]!==i||e[1]!==y?(g=i("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=i,e[1]=y,e[2]=g):g=e[2];const N=g,E={template:s,paramName:a};let k;e[3]!==f?(k=(ee,ce)=>({source:ee,query:ce,options:ee.clientFilter?Dt(ce.data??[],f):ce.data??[]}),e[3]=f,e[4]=k):k=e[4];const P=k,C=n.filter(Rc),O=n.filter(Cc),R=Kn({queries:C.map(ee=>Wn(c,ee,S,E,d))});let A;e[5]!==R||e[6]!==P?(A=(ee,ce)=>P(ee,R[ce]),e[5]=R,e[6]=P,e[7]=A):A=e[7];const D=C.map(A),_=D.length===0||D.every(Tc),B=Kn({queries:O.map(ee=>Wn(c,ee,S,E,d&&_))});let W;e[8]!==B||e[9]!==P?(W=(ee,ce)=>P(ee,B[ce]),e[8]=B,e[9]=P,e[10]=W):W=e[10];const Z=O.map(W),G=_?Z:D,J=G.length===1&&G[0]?.source.homepageLinks?G[0]:null,q=J&&!J.query.isLoading&&!J.query.isError?J?.query.data??[]:[],X=Dt(q.filter(Nc),f),L=Dt(q.filter(Ec),f),M=X.length>0&&L.length>0,U=ee=>{m(ee),x.current&&clearTimeout(x.current),p(ee?l:""),v(ee?l:"")};let H;e[11]===Symbol.for("react.memo_cache_sentinel")?(H=ee=>{p(ee),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{v(ee)},300)},e[11]=H):H=e[11];const F=H,z=ee=>{o(ee),U(!1)},V=Yr(f),Q=Ve(s,{[a]:V}),ne=Pr,se=Sr,I="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",re=jc;let ae;e[12]!==h||e[13]!==i?(ae=i("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=i,e[14]=ae):ae=e[14];let ie;e[15]!==ae?(ie=r.jsx(jr,{className:"sr-only",children:r.jsx(Er,{children:ae})}),e[15]=ae,e[16]=ie):ie=e[16];let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=r.jsx(_r,{size:16,className:"shrink-0 text-foreground"}),e[17]=me):me=e[17];let pe;e[18]!==i?(pe=i("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=i,e[19]=pe):pe=e[19];let xe;e[20]!==h?(xe=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=xe):xe=e[21];let he;e[22]!==pe||e[23]!==xe?(he=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[me,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",xe]})]}),e[22]=pe,e[23]=xe,e[24]=he):he=e[24];const ve=Ir,Se=!1,fe="min-h-0 flex-1";let le;e[25]!==N||e[26]!==f?(le=r.jsx(zr,{autoFocus:!0,placeholder:N,value:f,onValueChange:F}),e[25]=N,e[26]=f,e[27]=le):le=e[27];const Re=Ur,Me="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ue;e[28]!==i?(Ue=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=Ue):Ue=e[29];let Be;e[30]!==Ue?(Be=r.jsx(Kr,{children:Ue}),e[30]=Ue,e[31]=Be):Be=e[31];const vt=V&&r.jsx(dt,{className:"shrink-0",children:r.jsxs(ut,{value:`__raw__:${V}`,className:"gap-3 py-2",onSelect:()=>z(V),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(Uo,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:i("sandbox.pathParamPickerChip.useRawValue",{rawTerm:V,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Q})]})]})}),ge=M?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(Ft,{heading:b.category.heading,iconKind:"category",options:X,template:s,paramName:a,keyPrefix:`${J?.source.id}:cat`,onSelect:z})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(Ft,{heading:b.product.heading,iconKind:"product",options:L,template:s,paramName:a,keyPrefix:`${J?.source.id}:prod`,onSelect:z})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:G.map(ee=>{const{source:ce,query:We,options:xt}=ee,{noun:qe}=b[ce.kind];if(We.isLoading)return r.jsx(hr,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},ce.id);if(We.isError)return r.jsx(hr,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},ce.id);if(ce.homepageLinks){const It=We.data??[];return r.jsxs(j.Fragment,{children:[r.jsx(Ft,{heading:b.category.heading,iconKind:"category",options:Dt(It.filter(Pc),f),template:s,paramName:a,keyPrefix:`${ce.id}:cat`,onSelect:z}),r.jsx(Ft,{heading:b.product.heading,iconKind:"product",options:Dt(It.filter(Sc),f),template:s,paramName:a,keyPrefix:`${ce.id}:prod`,onSelect:z})]},ce.id)}return r.jsx(Ft,{heading:G.length>1?b[ce.kind].heading:void 0,iconKind:ce.kind,options:xt,template:s,paramName:a,keyPrefix:ce.id,onSelect:z},ce.id)})});let _e;e[32]!==Re||e[33]!==Be||e[34]!==vt||e[35]!==ge?(_e=r.jsxs(Re,{className:Me,children:[Be,vt,ge]}),e[32]=Re,e[33]=Be,e[34]=vt,e[35]=ge,e[36]=_e):_e=e[36];let be;e[37]!==ve||e[38]!==le||e[39]!==_e?(be=r.jsxs(ve,{shouldFilter:Se,className:fe,children:[le,_e]}),e[37]=ve,e[38]=le,e[39]=_e,e[40]=be):be=e[40];let Ie;e[41]!==se||e[42]!==ie||e[43]!==he||e[44]!==be||e[45]!==re?(Ie=r.jsxs(se,{className:I,onClick:re,children:[ie,he,be]}),e[41]=se,e[42]=ie,e[43]=he,e[44]=be,e[45]=re,e[46]=Ie):Ie=e[46];let Le;return e[47]!==ne||e[48]!==U||e[49]!==d||e[50]!==Ie?(Le=r.jsx(ne,{open:d,onOpenChange:U,children:Ie}),e[47]=ne,e[48]=U,e[49]=d,e[50]=Ie,e[51]=Le):Le=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:i("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:ee=>{ee.stopPropagation(),U(!0)},children:l||h}),Le]})}function Sc(t){return t.kind==="product"}function Pc(t){return t.kind!=="product"}function jc(t){return t.stopPropagation()}function Ec(t){return t.kind==="product"}function Nc(t){return t.kind!=="product"}function Tc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Cc(t){return t.isFallback}function Rc(t){return!t.isFallback}function Lc(t){const e=ue.c(8),{sources:n,template:s,paramName:a,sandboxRef:l,onFill:c}=t;let o,i;if(e[0]!==a||e[1]!==l||e[2]!==n||e[3]!==s){const S={template:s,paramName:a},v=n.filter(Ac);i=Kn,o=v.map(x=>Wn(l,x,"",S,!0)),e[0]=a,e[1]=l,e[2]=n,e[3]=s,e[4]=o,e[5]=i}else o=e[4],i=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const m=i(d),[f,p]=j.useState(!1);if(!f)for(const S of m){if(S.isLoading)break;const v=S.data?.[0];if(v){p(!0),queueMicrotask(()=>c(v.value));break}}return null}function Ac(t){return!t.isFallback}function _c(t){const e=ue.c(31),{name:n,value:s,onCommit:a}=t,l=Te(),[c,o]=j.useState(s),[i,d]=j.useState(!1),m=j.useRef(!1);let f;e[0]!==n||e[1]!==l?(f=n==="*"?l("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=l,e[2]=f):f=e[2];const p=f,S=c||p;let v;e[3]!==S?(v=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:S}),e[3]=S,e[4]=v):v=e[4];let x;e[5]!==p||e[6]!==l?(x=l("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=l,e[7]=x):x=e[7];let h,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=P=>o(P.target.value),b=()=>d(!0),e[8]=h,e[9]=b):(h=e[8],b=e[9]);let T;e[10]!==s?(T=P=>{P.key==="Enter"&&P.currentTarget.blur(),P.key==="Escape"&&(m.current=!0,o(s),P.currentTarget.blur())},e[10]=s,e[11]=T):T=e[11];let y;e[12]!==c||e[13]!==a||e[14]!==s?(y=()=>{if(d(!1),m.current){m.current=!1;return}const P=Yr(c);o(P),P!==s&&a(P)},e[12]=c,e[13]=a,e[14]=s,e[15]=y):y=e[15];let g;e[16]!==c||e[17]!==p||e[18]!==x||e[19]!==T||e[20]!==y?(g=r.jsx("input",{type:"text",value:c,placeholder:p,title:x,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Oc,onChange:h,onFocus:b,onKeyDown:T,onBlur:y}),e[16]=c,e[17]=p,e[18]=x,e[19]=T,e[20]=y,e[21]=g):g=e[21];let N;e[22]!==v||e[23]!==g?(N=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,g]}),e[22]=v,e[23]=g,e[24]=N):N=e[24];let E;e[25]!==i||e[26]!==l?(E=i&&r.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[r.jsx(Oi,{size:10}),l("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=l,e[27]=E):E=e[27];let k;return e[28]!==E||e[29]!==N?(k=r.jsxs(r.Fragment,{children:[N,E]}),e[28]=E,e[29]=N,e[30]=k):k=e[30],k}function Oc(t){return t.stopPropagation()}function Dc(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),s=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${s}`}catch{return e}}function Fc(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function $c(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function Bc(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function Mc(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class da extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Uc(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new da;return n}async function Ic(t,e,n){return n?qs(t,e,await Uc(n.meta,n.loadMeta)):qs(t,e)}function zc(t){const e=ue.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const s=Cr(n);let a;return e[2]!==t||e[3]!==s?(a={mutationFn:async l=>{const{name:c,path:o,template:i,schema:d}=l;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=mi(c),f=i?{...i,name:c,path:o}:await Ic(c,o,d);return await s.mutateAsync({blockKey:m,data:f}),{key:m,name:c,path:o}}},e[2]=t,e[3]=s,e[4]=a):a=e[4],ii(a)}function Kc(t){const e=ue.c(89),{open:n,onOpenChange:s,isPending:a,error:l,templates:c,onSubmit:o}=t,i=a===void 0?!1:a,d=Te();let m;e[0]!==d?(m=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=m):m=e[1];const[f,p]=j.useState(m);let S;e[2]!==d?(S=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=S):S=e[3];const[v,x]=j.useState(S),[h,b]=j.useState(Rn),[T,y]=j.useState(null),[g,N]=j.useState(n);n!==g&&(N(n),n&&(p(d("sectionsEditor.createPageModal.defaultPageName")),x(d("sectionsEditor.createPageModal.defaultPagePath")),b(Rn),y(null)));const E=!!c?.length;let k;e[4]!==i||e[5]!==s?(k=pe=>{!pe&&!i&&(y(null),s(!1))},e[4]=i,e[5]=s,e[6]=k):k=e[6];const P=k;let C;e[7]!==i||e[8]!==f||e[9]!==o||e[10]!==v||e[11]!==E||e[12]!==h?(C=async pe=>{pe.preventDefault();const xe=f.trim(),he=v.trim();if(!xe||!he||i)return;const ve=Qr(he);if(ve){y(ve);return}y(null),await o({name:xe,path:he,templateKey:E&&h!==Rn?h:null})},e[7]=i,e[8]=f,e[9]=o,e[10]=v,e[11]=E,e[12]=h,e[13]=C):C=e[13];const O=C,R=T??l;let A;e[14]!==d?(A=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=A):A=e[15];let D;e[16]!==A?(D=r.jsx(jr,{children:r.jsx(Er,{children:A})}),e[16]=A,e[17]=D):D=e[17];let _;e[18]!==d?(_=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=_):_=e[19];let B;e[20]!==_?(B=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=B):B=e[21];let W;e[22]===Symbol.for("react.memo_cache_sentinel")?(W=pe=>p(pe.target.value),e[22]=W):W=e[22];let Z;e[23]!==d?(Z=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=Z):Z=e[24];let G;e[25]!==i||e[26]!==f||e[27]!==Z?(G=r.jsx(Mn,{id:"new-page-name",value:f,onChange:W,placeholder:Z,autoFocus:!0,disabled:i}),e[25]=i,e[26]=f,e[27]=Z,e[28]=G):G=e[28];let J;e[29]!==G||e[30]!==B?(J=r.jsxs("div",{className:"space-y-1.5",children:[B,G]}),e[29]=G,e[30]=B,e[31]=J):J=e[31];let K;e[32]!==d?(K=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=K):K=e[33];let q;e[34]!==K?(q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:K}),e[34]=K,e[35]=q):q=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=pe=>x(pe.target.value),e[36]=X):X=e[36];let L;e[37]!==d?(L=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=L):L=e[38];let M;e[39]!==i||e[40]!==v||e[41]!==L?(M=r.jsx(Mn,{id:"new-page-path",value:v,onChange:X,placeholder:L,disabled:i}),e[39]=i,e[40]=v,e[41]=L,e[42]=M):M=e[42];let U;e[43]!==q||e[44]!==M?(U=r.jsxs("div",{className:"space-y-1.5",children:[q,M]}),e[43]=q,e[44]=M,e[45]=U):U=e[45];let H;e[46]!==i||e[47]!==E||e[48]!==d||e[49]!==h||e[50]!==c?(H=E&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),r.jsx(hi,{id:"new-page-template",value:h,onChange:b,templates:c??[],disabled:i})]}),e[46]=i,e[47]=E,e[48]=d,e[49]=h,e[50]=c,e[51]=H):H=e[51];let F;e[52]!==R?(F=R&&r.jsx("p",{className:"text-xs text-destructive",children:R}),e[52]=R,e[53]=F):F=e[53];let z;e[54]!==J||e[55]!==U||e[56]!==H||e[57]!==F?(z=r.jsxs("div",{className:"space-y-4 py-4",children:[J,U,H,F]}),e[54]=J,e[55]=U,e[56]=H,e[57]=F,e[58]=z):z=e[58];let V;e[59]!==s?(V=()=>s(!1),e[59]=s,e[60]=V):V=e[60];let Q;e[61]!==d?(Q=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=Q):Q=e[62];let ne;e[63]!==i||e[64]!==V||e[65]!==Q?(ne=r.jsx($e,{type:"button",variant:"outline",onClick:V,disabled:i,children:Q}),e[63]=i,e[64]=V,e[65]=Q,e[66]=ne):ne=e[66];let se;e[67]!==i||e[68]!==f||e[69]!==v?(se=!f.trim()||!v.trim()||i,e[67]=i,e[68]=f,e[69]=v,e[70]=se):se=e[70];let I;e[71]!==i||e[72]!==d?(I=i?r.jsxs(r.Fragment,{children:[r.jsx(gt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=d,e[73]=I):I=e[73];let re;e[74]!==se||e[75]!==I?(re=r.jsx($e,{type:"submit",disabled:se,children:I}),e[74]=se,e[75]=I,e[76]=re):re=e[76];let ae;e[77]!==ne||e[78]!==re?(ae=r.jsxs(oi,{children:[ne,re]}),e[77]=ne,e[78]=re,e[79]=ae):ae=e[79];let ie;e[80]!==O||e[81]!==z||e[82]!==ae||e[83]!==D?(ie=r.jsx(Sr,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:O,children:[D,z,ae]})}),e[80]=O,e[81]=z,e[82]=ae,e[83]=D,e[84]=ie):ie=e[84];let me;return e[85]!==P||e[86]!==n||e[87]!==ie?(me=r.jsx(Pr,{open:n,onOpenChange:P,children:ie}),e[85]=P,e[86]=n,e[87]=ie,e[88]=me):me=e[88],me}function Hc(t){const e=ue.c(36),{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:c,decofile:o,blockKey:i}=t,d=Te();let m;e[0]!==a||e[1]!==n||e[2]!==s?(m={orgSlug:n,virtualMcpId:s,branch:a},e[0]=a,e[1]=n,e[2]=s,e[3]=m):m=e[3];const f=Cr(m);let p;e[4]!==f?(p=xi((k,P)=>f.mutate({blockKey:k,data:P})),e[4]=f,e[5]=p):p=e[5];const S=p;let v;e[6]!==i||e[7]!==o?(v=gi(o,i),e[6]=i,e[7]=o,e[8]=v):v=e[8];const{resolveType:x,props:h,title:b}=v;if(!x){let k;e[9]!==d?(k=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=k):k=e[10];let P;return e[11]!==k?(P=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:k}),e[11]=k,e[12]=P):P=e[12],P}const T=`loader:${i}`,y=`loader:${i}`;let g;e[13]!==i||e[14]!==x||e[15]!==b?(g={mode:"saved",blockKey:i,resolveType:x,title:b},e[13]=i,e[14]=x,e[15]=b,e[16]=g):g=e[16];let N;e[17]!==a||e[18]!==o||e[19]!==c||e[20]!==n||e[21]!==l||e[22]!==h||e[23]!==f.isPending||e[24]!==S||e[25]!==y||e[26]!==g||e[27]!==s?(N=r.jsx(vi,{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:c,decofile:o,kind:"loaders",target:g,initialValue:h,isCreating:f.isPending,onCreate:Vc,onSaveReferencedBlock:S,showRun:!1},y),e[17]=a,e[18]=o,e[19]=c,e[20]=n,e[21]=l,e[22]=h,e[23]=f.isPending,e[24]=S,e[25]=y,e[26]=g,e[27]=s,e[28]=N):N=e[28];let E;return e[29]!==i||e[30]!==a||e[31]!==n||e[32]!==T||e[33]!==N||e[34]!==s?(E=r.jsx(bi,{orgSlug:n,virtualMcpId:s,branch:a,blockKey:i,present:void 0,children:N},T),e[29]=i,e[30]=a,e[31]=n,e[32]=T,e[33]=N,e[34]=s,e[35]=E):E=e[35],E}async function Vc(){}function Wc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function gr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:Wc(t.error)}}function qc(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function Gc(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=qc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const Jc=j.lazy(()=>li(()=>import("./sections-editor-BpvyJAUh.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])).then(t=>({default:t.SectionsEditor})));function vr(t){const e=ue.c(60),{virtualMcpId:n,externalSelection:s,onViewJsonFile:a}=t,l=s===void 0?null:s,{org:c}=Jn(),{currentBranch:o,taskId:i}=Mt(),d=Xn(),m=Ut(),f=ea(),p=d.lifecycle.phase==="running",S=m.previewUrl;let v;e[0]!==o||e[1]!==c||e[2]!==S||e[3]!==i||e[4]!==n?(v=o?{orgSlug:c.slug,virtualMcpId:n,branch:o,threadId:i??null,previewUrl:S}:null,e[0]=o,e[1]=c,e[2]=S,e[3]=i,e[4]=n,e[5]=v):v=e[5];const x=v,h=fn(n,o);let b;e[6]!==p?(b={fetchEnabled:p},e[6]=p,e[7]=b):b=e[7];const T=Yn(x,b);let y;e[8]!==p?(y={fetchEnabled:p},e[8]=p,e[9]=y):y=e[9];const g=Xr(x,y),N=Gc({lifecyclePhase:d.lifecycle.phase,decofile:gr(T),meta:gr(g),hasEditableContent:ko(T.data,g.data),fastPreviewActive:Hr(n).runtime==="cms"||Xe(h)}),E=Rr()===void 0,k=Yc;if(So(h)){let L;return e[10]===Symbol.for("react.memo_cache_sentinel")?(L=k(r.jsx(jo,{})),e[10]=L):L=e[10],L}if(h.kind==="pending"&&h.retrying){let L;return e[11]!==h?(L=k(r.jsx(Eo,{backend:h})),e[11]=h,e[12]=L):L=e[12],L}if(N.kind==="loading"||E){let L;return e[13]===Symbol.for("react.memo_cache_sentinel")?(L=k(r.jsx(ci,{})),e[13]=L):L=e[13],L}if(T.data&&Zi(g.data)){const L=f.state.target,M=L?.kind==="page"||L?.kind==="section"?L.key:null,U=M??"",H=o??"";let F;return e[14]!==T.data||e[15]!==M||e[16]!==c.slug||e[17]!==U||e[18]!==H||e[19]!==n?(F=k(r.jsx(wi,{orgSlug:c.slug,virtualMcpId:n,branch:H,decofile:T.data,initialKey:M,compact:!0},U)),e[14]=T.data,e[15]=M,e[16]=c.slug,e[17]=U,e[18]=H,e[19]=n,e[20]=F):F=e[20],F}if(N.kind==="empty"){let L;return e[21]===Symbol.for("react.memo_cache_sentinel")?(L=k(r.jsx(No,{})),e[21]=L):L=e[21],L}if(N.kind==="error"){let L;e[22]!==T||e[23]!==m||e[24]!==g||e[25]!==N.source?(L=()=>{if(N.source==="sandbox"){m.retry();return}Promise.all([T.refetch(),g.refetch()])},e[22]=T,e[23]=m,e[24]=g,e[25]=N.source,e[26]=L):L=e[26];const M=L;let U;return e[27]!==M||e[28]!==N.source?(U=k(r.jsx(Po,{source:N.source,onRetry:M})),e[27]=M,e[28]=N.source,e[29]=U):U=e[29],U}let P;e[30]===Symbol.for("react.memo_cache_sentinel")?(P=L=>k(r.jsx("div",{className:"h-full min-h-0",children:L})),e[30]=P):P=e[30];const C=P,O=f.state.target;if(O?.kind==="loader"&&T.data&&g.data){const L=o??"",M=S??null;let U;return e[31]!==T.data||e[32]!==g.data||e[33]!==c.slug||e[34]!==L||e[35]!==M||e[36]!==O.key||e[37]!==n?(U=C(r.jsx(Hc,{orgSlug:c.slug,virtualMcpId:n,branch:L,previewUrl:M,meta:g.data,decofile:T.data,blockKey:O.key})),e[31]=T.data,e[32]=g.data,e[33]=c.slug,e[34]=L,e[35]=M,e[36]=O.key,e[37]=n,e[38]=U):U=e[38],U}let R;e[39]!==o||e[40]!==c.slug||e[41]!==O||e[42]!==n?(R=O||!o?null:Lr(Ar(c.slug,n,o)),e[39]=o,e[40]=c.slug,e[41]=O,e[42]=n,e[43]=R):R=e[43];const A=R;let D="/",_=null,B=null;O?.kind==="page"?(D=O.path,_=O.key):O?.kind==="section"?B=O.key:A&&(D=A.path,_=A.pageKey);const W=_?`page:${_}`:B?`section:${B}`:`path:${D}`;let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=Z):Z=e[44];const G=o??"",J=S??void 0,K=B?null:l,q=!!_&&f.state.editSeoPageKey===_;let X;return e[45]!==B||e[46]!==_||e[47]!==D||e[48]!==W||e[49]!==a||e[50]!==c.slug||e[51]!==K||e[52]!==q||e[53]!==G||e[54]!==J||e[55]!==n||e[56]!==f.consumeEditSeo||e[57]!==f.setFocusedBlock||e[58]!==f.setVariantOverride?(X=C(r.jsx(j.Suspense,{fallback:Z,children:r.jsx(Jc,{orgSlug:c.slug,virtualMcpId:n,branch:G,previewReady:!0,previewUrl:J,currentPath:D,activePageBlockKey:_,activeGlobalBlockKey:B,externalSelection:K,initialEditSeo:q,onExitSeo:f.consumeEditSeo,onVariantPreviewOverride:f.setVariantOverride,onFocusedBlockChange:f.setFocusedBlock,onViewJsonFile:a},W)})),e[45]=B,e[46]=_,e[47]=D,e[48]=W,e[49]=a,e[50]=c.slug,e[51]=K,e[52]=q,e[53]=G,e[54]=J,e[55]=n,e[56]=f.consumeEditSeo,e[57]=f.setFocusedBlock,e[58]=f.setVariantOverride,e[59]=X):X=e[59],X}function Yc(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function xr(t){const e=ue.c(51),{virtualMcpId:n,pageKey:s,onClose:a,ref:l}=t,c=Te(),o=Rr(),i=o===!0,d=Vr(n);let m;e[0]!==d||e[1]!==s?(m=eo(d,qo(s)),e[0]=d,e[1]=s,e[2]=m):m=e[2];const f=m,{org:p}=Jn(),{currentBranch:S,taskId:v}=Mt(),h=Ut().previewUrl;let b;e[3]!==S||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==n?(b=S?{orgSlug:p.slug,virtualMcpId:n,branch:S,threadId:v??null,previewUrl:h}:null,e[3]=S,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=n,e[8]=b):b=e[8];const y=Yn(b),g=S??"";let N;e[9]!==p.slug||e[10]!==g||e[11]!==n?(N={orgSlug:p.slug,virtualMcpId:n,branch:g},e[9]=p.slug,e[10]=g,e[11]=n,e[12]=N):N=e[12];let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E={holdsCopy:!0},e[13]=E):E=e[13];const{save:k,flush:P,hold:C}=yi(N,E),O=S??"";let R;e[14]!==p.slug||e[15]!==O||e[16]!==n?(R=zo({orgSlug:p.slug,virtualMcpId:n,branch:O}),e[14]=p.slug,e[15]=O,e[16]=n,e[17]=R):R=e[17];const A=Ko(R);let D;e[18]!==s||e[19]!==A?(D=A(s),e[18]=s,e[19]=A,e[20]=D):D=e[20];const _=D;let B;e[21]!==_||e[22]!==s?(B={pageKey:s,copyEpoch:_},e[21]=_,e[22]=s,e[23]=B):B=e[23];const[W,Z]=j.useState(B);(W.pageKey!==s||W.copyEpoch!==_)&&(Z({pageKey:s,copyEpoch:_}),C(s));const G=y.data?.[s],J=y.data===void 0&&y.isLoading||o===void 0,K=y.data!==void 0&&G===void 0,q=!S||K||J;let X;e[24]!==G?(X=G===void 0?"":JSON.stringify(G,null,2),e[24]=G,e[25]=X):X=e[25];const L=X;let M;e[26]!==s||e[27]!==q||e[28]!==k?(M=Q=>{if(q)return;let ne;try{ne=JSON.parse(Q)}catch{return}ne===null||typeof ne!="object"||Array.isArray(ne)||k(s,ne)},e[26]=s,e[27]=q,e[28]=k,e[29]=M):M=e[29];const U=M;let H;e[30]!==P?(H=()=>({flush:P}),e[30]=P,e[31]=H):H=e[31],j.useImperativeHandle(l,H);let F;e[32]!==f||e[33]!==i||e[34]!==a||e[35]!==c?(F=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:c("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx($e,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":c("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(di,{size:14})})]}),e[32]=f,e[33]=i,e[34]=a,e[35]=c,e[36]=F):F=e[36];let z;e[37]!==_||e[38]!==y.data||e[39]!==P||e[40]!==L||e[41]!==J||e[42]!==K||e[43]!==s||e[44]!==q||e[45]!==U||e[46]!==c?(z=J?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}):K?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",c("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(Io,{code:L,language:"json",readOnly:q,height:"100%",onChange:Q=>U(Q??""),onSave:Q=>{U(Q),P()}},`${s}:${y.data===void 0?"loading":"ready"}:${_}`)}),e[37]=_,e[38]=y.data,e[39]=P,e[40]=L,e[41]=J,e[42]=K,e[43]=s,e[44]=q,e[45]=U,e[46]=c,e[47]=z):z=e[47];let V;return e[48]!==F||e[49]!==z?(V=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[F,z]}),e[48]=F,e[49]=z,e[50]=V):V=e[50],V}function ua(t){return t.contentEditingEnabled&&!t.isMobile}function Qc(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Xc(t,e){return t==="blocks"?"preview":e?"blocks":t}function Zc(t){return ua({contentEditingEnabled:Zr(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function ed(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function td(t){const e=to(t),{display:n}=t;let s=null;if(n.mode==="production"&&n.iframeBase)try{s=new URL(t.path,n.iframeBase).href}catch{s=null}const a=no(s,e);return{value:e,frame:a?Hn(a,t.device):null,newTab:a}}function nd(t){const e=ue.c(94),{tests:n,load:s,onOpen:a,options:l,onChange:c,available:o}=t,i=Te();let d;e[0]!==l?(d=Wr(l),e[0]=l,e[1]=d):d=e[1];const m=d;let f;e[2]!==l.tests?(f=l.tests??{},e[2]=l.tests,e[3]=f):f=e[3];const p=f;let S;e[4]!==c||e[5]!==l?(S=I=>{const re=I?Vo(I):null,{at:ae,...ie}=l;c(re?{...ie,at:re}:ie)},e[4]=c,e[5]=l,e[6]=S):S=e[6];const v=S;let x;e[7]!==p||e[8]!==c||e[9]!==l?(x=(I,re)=>{const ae={...p};re==="on"?ae[I]=!0:re==="off"?ae[I]=!1:delete ae[I];const{tests:ie,...me}=l;c(Object.keys(ae).length>0?{...me,tests:ae}:me)},e[7]=p,e[8]=c,e[9]=l,e[10]=x):x=e[10];const h=x;let b;e[11]!==a?(b=I=>{I&&a?.()},e[11]=a,e[12]=b):b=e[12];let T;e[13]!==i?(T=i("sandbox.previewAs.label"),e[13]=i,e[14]=T):T=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=r.jsx(Di,{size:16}),e[15]=y):y=e[15];let g;e[16]!==m||e[17]!==T?(g=r.jsx(pt,{asChild:!0,children:r.jsx($r,{asChild:!0,children:r.jsx(Ze,{"aria-label":T,active:m,"data-testid":"preview-as-trigger",children:y})})}),e[16]=m,e[17]=T,e[18]=g):g=e[18];let N;e[19]!==i?(N=i("sandbox.previewAs.label"),e[19]=i,e[20]=N):N=e[20];let E;e[21]!==N?(E=r.jsx(mt,{children:N}),e[21]=N,e[22]=E):E=e[22];let k;e[23]!==E||e[24]!==g?(k=r.jsxs(ht,{children:[g,E]}),e[23]=E,e[24]=g,e[25]=k):k=e[25];let P;e[26]!==i?(P=i("sandbox.previewAs.label"),e[26]=i,e[27]=P):P=e[27];let C;e[28]!==P?(C=r.jsx("h3",{className:"text-sm font-medium",children:P}),e[28]=P,e[29]=C):C=e[29];let O;e[30]!==o||e[31]!==i?(O=i(o?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=o,e[31]=i,e[32]=O):O=e[32];let R;e[33]!==O?(R=r.jsx("p",{className:"text-xs text-muted-foreground",children:O}),e[33]=O,e[34]=R):R=e[34];let A;e[35]!==C||e[36]!==R?(A=r.jsxs("div",{className:"flex flex-col gap-1",children:[C,R]}),e[35]=C,e[36]=R,e[37]=A):A=e[37];let D;e[38]!==i?(D=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=D):D=e[39];let _;e[40]!==D?(_=r.jsx(Qo,{htmlFor:"preview-as-moment",children:D}),e[40]=D,e[41]=_):_=e[41];let B;e[42]!==l.at?(B=Ho(l.at),e[42]=l.at,e[43]=B):B=e[43];let W;e[44]!==v?(W=I=>v(I.target.value),e[44]=v,e[45]=W):W=e[45];let Z;e[46]!==B||e[47]!==W?(Z=r.jsx(Mn,{id:"preview-as-moment",type:"datetime-local",className:Wo,value:B,onChange:W}),e[46]=B,e[47]=W,e[48]=Z):Z=e[48];const G=l.at===void 0;let J;e[49]!==v?(J=()=>v(""),e[49]=v,e[50]=J):J=e[50];let K;e[51]!==i?(K=i("sandbox.previewAs.now"),e[51]=i,e[52]=K):K=e[52];let q;e[53]!==G||e[54]!==J||e[55]!==K?(q=r.jsx($e,{type:"button",variant:"ghost",size:"sm",disabled:G,onClick:J,children:K}),e[53]=G,e[54]=J,e[55]=K,e[56]=q):q=e[56];let X;e[57]!==Z||e[58]!==q?(X=r.jsxs("div",{className:"flex items-center gap-2",children:[Z,q]}),e[57]=Z,e[58]=q,e[59]=X):X=e[59];let L;e[60]!==i?(L=i("sandbox.previewAs.momentHint"),e[60]=i,e[61]=L):L=e[61];let M;e[62]!==L?(M=r.jsx("p",{className:"text-xs text-muted-foreground",children:L}),e[62]=L,e[63]=M):M=e[63];let U;e[64]!==_||e[65]!==X||e[66]!==M?(U=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,X,M]}),e[64]=_,e[65]=X,e[66]=M,e[67]=U):U=e[67];let H;e[68]!==i?(H=i("sandbox.previewAs.testsLabel"),e[68]=i,e[69]=H):H=e[69];let F;e[70]!==H?(F=r.jsx("span",{className:"text-sm font-medium",children:H}),e[70]=H,e[71]=F):F=e[71];let z;e[72]!==p||e[73]!==s||e[74]!==h||e[75]!==i||e[76]!==n?(z=s&&!s.ready?s.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsLoadFailed")}),r.jsx($e,{type:"button",variant:"outline",size:"sm",onClick:s.retry,children:i("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(gt,{className:"size-4 text-muted-foreground"})}):n.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(I=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:I}),r.jsxs(Xo,{type:"single",variant:"outline",size:"sm",value:p[I]===void 0?"":p[I]?"on":"off",onValueChange:re=>h(I,re),"aria-label":I,children:[r.jsx(ir,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(ir,{value:"on",children:i("sandbox.previewAs.on")})]})]},I))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=s,e[74]=h,e[75]=i,e[76]=n,e[77]=z):z=e[77];let V;e[78]!==F||e[79]!==z?(V=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[F,z]}),e[78]=F,e[79]=z,e[80]=V):V=e[80];let Q;e[81]!==m||e[82]!==c||e[83]!==i?(Q=m&&r.jsx($e,{type:"button",variant:"outline",size:"sm",onClick:()=>c({}),children:i("sandbox.previewAs.reset")}),e[81]=m,e[82]=c,e[83]=i,e[84]=Q):Q=e[84];let ne;e[85]!==A||e[86]!==U||e[87]!==V||e[88]!==Q?(ne=r.jsxs(Br,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[A,U,V,Q]}),e[85]=A,e[86]=U,e[87]=V,e[88]=Q,e[89]=ne):ne=e[89];let se;return e[90]!==k||e[91]!==ne||e[92]!==b?(se=r.jsxs(Mr,{onOpenChange:b,children:[k,ne]}),e[90]=k,e[91]=ne,e[92]=b,e[93]=se):se=e[93],se}const sd=15e3;function rd(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function br(t){return t.loading?{...t,loading:!1}:t}function ad(t,e){try{const n=new URL(t),s=new URL(e);return n.origin===s.origin&&n.pathname===s.pathname}catch{return!1}}function id(t,{base:e,frameSrc:n,loadedSrc:s,wanted:a,canSwap:l}){const c=t?.base===e?t:null,o=c?.src??n,i=c?.shown??n;return!a||!o||!i?null:i===a?c:l&&s===o&&ad(i,a)?{base:e,src:o,shown:a}:null}const od=["next"],ld=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],fa=new Set(["tsx","ts","jsx","js","mdx"]),cd=new Set(["tsx","jsx"]),dd=new Set(["404","500"]);function ud(t){const e=new Set;if(!t||typeof t!="object")return e;const n=t;for(const s of["dependencies","devDependencies"]){const a=n[s];if(a&&typeof a=="object"&&!Array.isArray(a))for(const l of Object.keys(a))e.add(l)}return e}function fd(t){const e=ud(t);return od.some(n=>e.has(n))?"next":ld.some(n=>e.has(n))?"tanstack":null}function pa(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function pd(t,e){const n=s=>pa(e,s);switch(t){case"next":return[{router:"next-pages",dir:n("pages"),pattern:"**/*"},{router:"next-pages",dir:n("src/pages"),pattern:"**/*"},{router:"next-app",dir:n("app"),pattern:"**/page.*"},{router:"next-app",dir:n("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:n("src/routes"),pattern:"**/*"}];default:{const s=t;throw new Error(`Unknown framework: ${String(s)}`)}}}function es(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function md(t){const e=es(t.at(-1)??"");if(!e||!fa.has(e[1]))return null;const[n]=e;if(n.includes("."))return null;const s=[...t.slice(0,-1),n];return s[0]==="api"||s.length===1&&dd.has(n)||s.some(a=>a.startsWith("_")||a.includes("["))?null:(s.at(-1)==="index"&&s.pop(),`/${s.join("/")}`)}function hd(t){const e=es(t.at(-1)??"");if(!e||e[0]!=="page"||!fa.has(e[1]))return null;const n=[];for(const s of t.slice(0,-1)){if(s.startsWith("_")||s.startsWith("@")||/^\(\.{1,3}\)/.test(s)||s.includes("["))return null;s.startsWith("(")&&s.endsWith(")")||n.push(s)}return`/${n.join("/")}`}function gd(t){const e=[];let n="",s=!1;for(const a of t)a==="["?s=!0:a==="]"&&(s=!1),a==="."&&!s?(e.push(n),n=""):n+=a;return e.push(n),e}function vd(t){const e=es(t.at(-1)??"");if(!e||!cd.has(e[1]))return null;const n=[...t.slice(0,-1),...gd(e[0])].filter(Boolean);n.at(-1)==="lazy"&&n.pop();const s=n.at(-1);if(!s||s==="__root"||n.some(l=>l.startsWith("-"))||s.startsWith("_"))return null;(s==="index"||s==="route")&&n.pop();const a=[];for(const l of n){if(l.includes("$"))return null;if(l.startsWith("_")||l.startsWith("(")&&l.endsWith(")"))continue;const c=l.replace(/_$/,"").replace(/[[\]]/g,"");c&&a.push(c)}return`/${a.join("/")}`}function xd(t,e){const n=e.split("/").filter(Boolean);if(n.length===0)return null;switch(t){case"next-pages":return md(n);case"next-app":return hd(n);case"tanstack":return vd(n);default:{const s=t;throw new Error(`Unknown router: ${String(s)}`)}}}function bd(t){const e=new Set;for(const{root:n,files:s}of t){const a=`${n.dir}/`;for(const l of s){if(!l.startsWith(a))continue;const c=xd(n.router,l.slice(a.length));c&&e.add(c)}}return[...e].sort((n,s)=>n==="/"?-1:s==="/"?1:n.localeCompare(s))}const wd=5e3,yd=6e4;async function kd(t,e){const n=await fetch(Zo(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:wd})});if(!n.ok)throw new Error(`Failed to list ${e.dir}: ${n.status}`);const s=await n.json();return Array.isArray(s.files)?s.files.filter(a=>typeof a=="string"):[]}async function Sd(t,e){const n=await so(t,pa(e,"package.json"));if(n.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const s=n.kind==="data"?fd(n.data):null;if(!s)return[];const a=pd(s,e),l=await Promise.all(a.map(async c=>({root:c,files:await kd(t,c)})));return bd(l)}function Pd(t,e,n){const s=ue.c(12);let a;s[0]!==e||s[1]!==t?(a=t?Gn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],s[0]=e,s[1]=t,s[2]=a):a=s[2];let l;s[3]!==e||s[4]!==t?(l=()=>t?Sd(t,e):[],s[3]=e,s[4]=t,s[5]=l):l=s[5];const c=n&&!!t;let o;s[6]!==a||s[7]!==l||s[8]!==c?(o={queryKey:a,queryFn:l,enabled:c,staleTime:yd},s[6]=a,s[7]=l,s[8]=c,s[9]=o):o=s[9];const i=Nr(o);let d;return s[10]!==i.data?(d=i.data??[],s[10]=i.data,s[11]=d):d=s[11],d}const jd=500,Ed={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},wr=1,ln=["desktop","mobile","tablet"],Nd=["preview","visual","blocks"],yr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Td(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function $t(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Bn(t,e){try{return new URL(t,e).href}catch{return null}}function Cd(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function Rd(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Ld(t,e,n){const s=t.toLowerCase(),a=e.toLowerCase(),l=a.split("/").filter(Boolean),c=i=>{if(i===n)return 100;const d=i.indexOf(n);if(d===-1)return 0;let m=40;return d===0?m+=30:/[\s/-]/.test(i[d-1]??"")&&(m+=20),m+=Math.round(n.length/i.length*20),m};let o=Math.max(c(s),c(a));return l.at(-1)===n?o=Math.max(o,95):l.includes(n)&&(o=Math.max(o,90)),o}function Ad(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function _d({virtualMcpId:t}){const e=Te(),n=Jr(),{currentBranch:s,taskId:a,virtualMcpId:l}=Mt(),c=!!Ti(),o=ea(),i=zi(l===t?t:null),d=Hr(t),m=el(i?.metadata?.ui?.layout??null),f=Zr(m),p=ua({contentEditingEnabled:f,isMobile:n}),[S]=j.useState(()=>Zc({cmsMode:m,isMobile:n})),[v,x]=Un(In.previewEditingMode(t),u=>u&&Nd.includes(u)?u:null),h=v??S,[b,T]=Un(In.previewDeviceSize(t),u=>u&&ln.includes(u)?u:"desktop"),[y,g]=j.useState(null),[N,E]=j.useState(null),k=j.useRef(null),P=j.useRef(null),[C,O]=j.useState(!1),R=j.useRef(null),A=()=>{R.current?.flush(),O(!1)},D=()=>O(u=>(u&&R.current?.flush(),!u)),[_,B]=j.useState({width:0,height:0}),[W,Z]=j.useState(!1),[G,J]=j.useState({}),[K,q]=j.useState(""),X=j.useRef(null),[L,M]=j.useState(!1),[U,H]=j.useState(),[F,z]=j.useState(null),[V,Q]=j.useState(null),[ne,se]=j.useState(null),[I,re]=j.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[ae,ie]=j.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[me,pe]=j.useState({}),[xe,he]=j.useState(!1),ve=j.useRef(null),Se=()=>{he(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>he(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),he(!1)},{org:le}=Jn(),Re=Xn(),Me=Ut(),Ue=Me.vmEntry,Be=Re.lifecycle.phase,{url:vt}=qr(t),ge=fn(t,s),{connection:_e}=Gr(t),be=Go(t),Ie=ro({hasServeConnection:!!_e,runtime:d.runtime}),Le=!Xe(ge)&&ge.kind!=="pending",ee=He(ge)??vt,ce=ee??Me.previewUrl,We=!!ee||Be==="running",xt=i?.id===t?Vi(i.metadata):null,qe=!ee&&i?.id===t&&d.runtime==="cms",It=d.projectDefault==="cms",bt=Le?ao({sandboxUrl:ce,previewServerUrl:xt,fastPreviewActive:qe}):null,ts=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,threadId:a??null,previewUrl:ce}:null,ns=Yn(ts,{fetchEnabled:We}),pn=Xr(ts,{fetchEnabled:We}),de=ns.data,Pe=pn.data,Ge=de?To(de,Pe).sort((u,w)=>u.name.localeCompare(w.name)):[],zt=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s}:null,ss=zc(zt),ma=io(zt),mn=de&&Pe?Co(de,Pe):[],rs=Le&&de&&Pe?ki(Pe,de,"loaders"):[],as=K?(()=>{const u=K.toLowerCase();return Ge.map(w=>({page:w,score:Ld(w.name,w.path,u)})).filter(({score:w})=>w>0).sort((w,$)=>$.score-w.score||w.page.path.length-$.page.path.length).map(({page:w})=>w)})():Ge,is=mn.filter(u=>{if(!K)return!0;const w=K.toLowerCase();return u.name.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),os=p?rs:[],ls=os.filter(u=>{if(!K)return!0;const w=K.toLowerCase();return u.title.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),Kt=V?rs.find(u=>u.key===V)??null:null,Ee=Qn,hn=F||V?null:Ro(Ge,I,ae),oe=hn?.key??null,tt=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,Ht=hn?.path??null,nt=(oe?me[oe]:void 0)??{},Ce=Ve(I,nt),gn={};if(Le&&We&&ce&&Pe&&de){const u=Si(Pe,"loaders"),w=oe?de[oe]:void 0,$=oc(w,de,ye=>u.has(ye)),te=nc($);for(const ye of Bt(I)){if(ye.type!=="param")continue;const Ne=Zl(I,ye.name,$),ot=ac(Ne,u,te);ot.length>0&&(gn[ye.name]=ot)}}const wt=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,threadId:a??null}:null,cs=de&&oe?$o(de,oe,0):[],ds=Xe(ge),us=de?Pi(cs,de,ds):[],yt=us.map(u=>u.isSavedBlock?u.label:""),kt=us.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),St=cs.map(u=>Vn(u,de??{},ds)),st=j.useRef(null),Oe=j.useRef(null),ha=Re.status.state==="paused",vn=Re.phase,fs=ji({claimPhase:vn,lifecycle:Re.lifecycle}),Je=Me.previewState,ga=Me.userStopped,va=oo(le.slug,t??""),{url:ze}=Fo(qe&&t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,previewServerUrl:xt??null,path:Ce}:null),xa=It&&d.runtime==="sandbox",Ae=lo(ge,Ie,be),ps=co(Ae&&qe&&ge.kind==="protocol"&&t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s}:null),ms=Ae?ps.pointer:null,Y=Cl({previewState:Je,progressStatus:fs.status,previewServerUrl:xt,fastPreviewActive:qe,fastPreviewReady:!!ze,codingSession:xa,localPreviewUrl:ee,hostedDraft:Ae,hostedPointerPending:Ae&&(ge.kind==="pending"||ps.pending)}),hs=Y.showWakingPill||Ae&&Y.mode==="production"&&!ms,Pt=Y.mode!=="none",ba=Y.mode==="production"&&Y.iframeBase?$t(Y.iframeBase):null,rt=Y.mode==="production"?ba:$t(ce),wa=i?.id===t&&i.metadata?.fastPreviewInPlace===!0,jt=Le?ee?Y.mode==="sandbox"&&p&&h==="blocks":Y.mode==="production"&&qe&&wa&&p&&h==="blocks":!1,gs=j.useRef(null),{pin:ya,effective:ka}=Cd(gs.current,{inPlaceRenderActive:jt,draftPreviewUrl:ze,resolvedPath:Ce});gs.current=ya;const vs=o.state.variantOverride??[],Vt=Le?vs:[],Et=Le?[]:vs,Wt=Xe(ge)&&Lo.some(u=>Ao(Pe,u)==="available"),at=Wt?G:{},xs=Wr(at),Sa=Wt&&de?Object.keys(_o(de).experiments):[],[bs,Pa]=j.useState(!1),ws=uo(zt,Wt&&bs?Oo:[]),ja={...ws,ready:!(ge.kind==="protocol"&&ge.hosted)||bs&&ws.ready},Ye=t?Js(le.slug,t):null,Ea=fo(Ye),qt=Ae?td({display:Y,path:Ce,pointer:ms,heldRevision:Ea,device:b,forcedVariants:Et,previewOptions:at}):null,ys=JSON.stringify([Et,at]);j.useEffect(()=>{if(!Ae||!Ye)return;const[u,w]=JSON.parse(ys);Ys(Ye,{forcedVariants:u,previewOptions:w})},[Ae,Ye,ys]),j.useEffect(()=>{if(!(!Ae||!Ye))return()=>Ys(Ye,null)},[Ae,Ye]);const xn=_e&&He(ge)?po(_e.endpoint,Et,xs):null,Na=_e&&He(ge)?xn?mo(xn,at):Qs:null,Qe=Td(Y.mode==="sandbox"?nn(Hn(Xs(ne??Bn(Ce,Y.iframeBase)??Y.iframeBase,Na),b),Vt):Y.mode==="production"&&qt?.frame?qt.frame:Y.mode==="production"?nn(Hn(Zs(er(Xs(ne??ka??Bn(Ce,Y.iframeBase)??Y.iframeBase,hs?Qs:null),Et),at),b),Vt):null),ks=ze??(Y.iframeBase?Bn(Ce,Y.iframeBase):null),Ss=Y.mode==="production"&&qt?qt.newTab:Y.mode==="production"?ks?nn(Zs(er(ks,Et),at),Vt):null:Qe??Y.iframeBase,Ta=()=>{const u=Ss;u&&window.open(u,"_blank","noopener")},Nt=t&&s?Ar(le.slug,t,s):null,Tt=u=>{Nt&&Ri(Nt,u)},ke=o.state.target;j.useEffect(()=>{if(!(!ke||!bt||!Pe))if(ke.kind==="page"){const u=me[ke.key]??{};Oe.current=Ve(ke.path,u),z(null),Q(null),se(null),ie(ke.key),re(ke.path),Tt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")Oe.current=null,z(null),Q(ke.key),se(null);else{const u=mn.find(w=>w.key===ke.key);if(u){Oe.current=null;const w=nr(Pe);Q(null),z(u),se(tr(bt,w,u.key))}}},[ke,bt,Pe,me]),j.useEffect(()=>{!oe||Ht===null||ke?.kind==="page"&&ke.key===oe&&ke.path===Ht||o.selectTarget({kind:"page",key:oe,path:Ht})},[oe,Ht,ke]);const[Ps,Ca]=j.useState(null);if(Je.kind==="iframe"&&Ps!==Je.previewUrl){const u=Ps!==null;Ca(Je.previewUrl);const w=Nt?Lr(Nt):null;if(w){if(Oe.current=Ve(w.path,w.params),re(w.path),ie(w.pageKey),se(null),z(null),Q(null),w.pageKey&&Object.keys(w.params).length>0){const $=w.pageKey;pe(te=>({...te,[$]:w.params}))}}else u&&(Oe.current=null,re("/"),se(null),ie(null),z(null),Q(null))}st.current=Qe;const Ra=Y.mode==="production"&&!!ze&&!ee,[Gt,bn]=j.useState({src:Qe??void 0,loading:!1}),[La,wn]=j.useState(!1),[Aa,_a]=j.useState(),[js,Es]=j.useState(null),je=id(js,{base:Y.iframeBase??"",frameSrc:Gt.src,loadedSrc:Aa,wanted:Qe??void 0,canSwap:be&&La&&!Gt.loading});je!==js&&Es(je);const Jt=rd(Gt,je?je.src:Qe??void 0,Ra);Jt!==Gt&&bn(Jt);const it=Jt.src,Ns=Jt.loading,Ts=_l({iframeRef:k,src:Y.mode==="sandbox"?Qe:null,active:Y.mode==="sandbox"}),Cs=j.useRef(null);j.useEffect(()=>{const u=Ns?setTimeout(()=>bn(br),sd):null,w=()=>{u&&clearTimeout(u)};if(!ze||!it||Cs.current===ze)return w;Cs.current=ze;const $=k.current;return $&&$.getAttribute("src")!==it&&(Se(),$.src=it),w},[ze,it,Ns]);const Rs=()=>{const u=k.current?.contentWindow,w=rt;if(!u||!w||!de||!oe)return;const $=de[oe];if(!$||typeof $!="object")return;const te=bo({previewBaseUrl:w,pageBlock:$,decofile:de,path:Ce,pathTemplate:I});if(!te)return;const ye=nn(te.src,yo(Vt,oe));u.postMessage({type:"cms-editor::render",src:ye,body:te.body},w)},yn=j.useRef(null);j.useEffect(()=>{if(!jt||F||V||!oe||!de){yn.current=null;return}const u={nav:JSON.stringify({page:oe,path:Ce,pathTemplate:I}),content:JSON.stringify(de)},w=Rd(yn.current,u);yn.current=u,w&&Rs()},[de,jt,F,V,oe,Ce,I]);const kn=j.useRef(null);j.useEffect(()=>{if(!jt||F||V||!oe||!de){kn.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),w=kn.current;kn.current={page:oe,sig:u},!(!w||w.page!==oe||w.sig===u)&&Rs()},[o.state.variantOverride,jt,F,V,oe]);const Ls=!!t&&!!s&&!Re.notFound&&!ga&&!ha&&(vn?.kind==="ready"||Be!=="idle"),As=!Xe(ge),Oa=Vr(t??void 0),Da=Pd(wt,Oa,As&&Ls),Fa=new Set(Ge.map(u=>Ee(u.path))),Yt=As?Da.filter(u=>!Fa.has(Ee(u))):[],_s=K?Yt.filter(u=>u.toLowerCase().includes(K.toLowerCase())):Yt,we=ed({editingMode:h,sandboxDisplay:Y.mode==="sandbox",blocksEditingEnabled:p});j.useEffect(()=>{const u=rt;if(!u)return;const w=$=>{if($.origin===u)if($.data?.type==="visual-editor::element-clicked"){const te=$l.safeParse($.data.payload);te.success&&g(te.data)}else if($.data?.type==="cms-editor::section-clicked"){const te=Ul.safeParse($.data.payload);te.success&&E({index:te.data.sectionIndex,seq:te.data.clickSeq})}else $.data?.type==="cms-editor::render-start"?Se():$.data?.type==="cms-editor::render-end"?(fe(),k.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:yt,kinds:kt,keys:St},u)):$.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",w),()=>window.removeEventListener("message",w)},[rt,yt,kt,St]);const Os=()=>{const u=k.current?.contentWindow,w=$t(ce),$=Mc({v8:be,script:Bl});!u||!w||!$||u.postMessage($,w)},$a=()=>{if(be)return;const u=k.current?.contentWindow,w=$t(ce);!u||!w||u.postMessage({type:"visual-editor::deactivate"},w)},Ds=()=>{const u=Ke.current;u?.has("wireframe")&&(u.wireframe({type:"wireframe:sections",labels:yt,kinds:kt,keys:St}),u.wireframe({type:we==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Sn=()=>{if(be){Ds();return}const u=k.current?.contentWindow,w=rt,$=Bc({v8:be,production:Y.mode==="production",localPreview:!!ee,script:Il});!u||!w||!$||(u.postMessage($,w),u.postMessage({type:"cms-editor::set-labels",labels:yt,kinds:kt,keys:St},w))},Ba=()=>{if(be){Ke.current?.wireframe({type:"wireframe:deactivate"});return}const u=k.current?.contentWindow,w=rt;!u||!w||u.postMessage({type:"cms-editor::deactivate"},w)},Ma=()=>{if(Ke.current?.wireframe({type:"wireframe:clear-hover"}),be)return;const u=k.current?.contentWindow,w=rt;!u||!w||(u.postMessage({type:"cms-editor::clear-hover"},w),u.postMessage({type:"visual-editor::clear-hover"},w))},Qt=u=>{if(u==="blocks"&&!p)return;const w=h;!n&&u!==w&&(u==="blocks"?P.current?.resize("30%"):P.current?.collapse()),x(u),g(null),E(null),u!=="blocks"&&Q(null),w==="visual"&&$a(),u==="visual"&&Os(),w==="blocks"&&u!=="blocks"&&Ba(),u==="blocks"&&Sn()},Ua=()=>{Qt(Qc(h,p))},Ia=()=>{Qt(Xc(h,p))},Xt=()=>{const u=k.current;if(!u)return;Se();const w=document.activeElement,$=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Ad(u,st.current);let te;const ye=()=>{clearTimeout(te),u.tabIndex=$,u.style.pointerEvents="";const Ne=document.activeElement;(!Ne||Ne===document.body||Ne===u)&&w?.focus(),u.removeEventListener("load",ye)};u.addEventListener("load",ye),te=setTimeout(ye,3e3)};Mo(Xt);const Ke=j.useRef(null),Fs=j.useEffectEvent(Ds),za=j.useEffectEvent((u,w)=>{E({index:u,seq:w})}),Ka=j.useEffectEvent(()=>{fe(),je&&(Pn.current=je.shown),Rt&&An(Ct)}),$s=j.useEffectEvent(()=>{if(wn(!1),je&&Es(null),je&&je.src!==st.current){Se();return}Xt()});j.useEffect(()=>{if(!be)return;const u=new Wl({studioOrigin:window.location.origin,build:"4.564.0",frame:()=>k.current?.contentWindow??null,onWireframeReady:()=>Fs(),onWireframe:$=>{$.type==="wireframe:select"&&za($.sectionIndex,$.clickSeq)},onModulesChange:()=>wn(u.has("html-swap")),onSwapEnd:()=>Ka(),onSwapFailed:()=>$s()});Ke.current=u;const w=$=>{u.handle($)};return window.addEventListener("message",w),()=>{window.removeEventListener("message",w),u.dispose(),wn(!1),Ke.current===u&&(Ke.current=null)}},[be,Y.iframeBase]);const Bs=be?JSON.stringify([yt,kt,St,we]):"";j.useEffect(()=>{Bs&&Fs()},[Bs]);const Ms=j.useRef(null);j.useEffect(()=>{const u=Ms.current;if(Ms.current=je,je&&je!==u){Ke.current?.refresh(je.shown)?Se():$s();return}!je&&u&&u.shown!==u.src&&u.src===st.current&&Xt()},[je]);const Us=()=>{Ke.current?.refresh()||Xt()},Ct=Js(le.slug,t??""),Rt=Ae&&Pt&&!!t,Pn=j.useRef(null);j.useEffect(()=>{if(Rt)return ho(Ct)},[Rt,Ct]);const{reload:Lt}=go(le.slug,t??""),Is=j.useRef(Lt.seq);j.useEffect(()=>{if(Is.current!==Lt.seq&&(Is.current=Lt.seq,!!Rt&&Pn.current===st.current)){if(Lt.navigates){An(Ct);return}Us()}},[Lt.seq]);const Ha=vo(zt),At=xo(He(ge)?Ha:""),zs=j.useRef(At);j.useEffect(()=>{const u=zs.current;if(zs.current=At,!u||!At||u===At)return;const w=k.current;if(w)return Fl({iframe:w,reload:Us})},[At]);const Va=()=>{const u=ln.indexOf(b);T(ln[(u+1)%ln.length])},jn=(u,w)=>{if(!oe)return;const $=oe,te={...nt,[u]:w};Oe.current=Ve(I,te),pe(ye=>({...ye,[$]:te})),Tt({path:I,pageKey:$,params:te})},Wa=Dc({iframeBase:Y.iframeBase,resolvedPath:Ce,activeGlobalSectionName:F?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),En=u=>{const w=me[u.key]??{},$=Ve(u.path,w);(F||Ee($)!==Ee(Ce))&&Se(),Oe.current=$,z(null),Q(null),se(null),E(null),ie(u.key),re(u.path),Tt({path:u.path,pageKey:u.key,params:w}),o.selectTarget({kind:"page",key:u.key,path:u.path})},Ks=u=>{(F||Ee(u)!==Ee(Ce))&&Se(),Oe.current=u,z(null),Q(null),se(null),E(null),ie(null),re(u),Tt({path:u,pageKey:null,params:{}})};Ci(Nt,Ks);const qa=u=>{if(Xe(ge)){const te=de?Do(de,u.key,Pe):null;te?En(te):dn.info(e("sandbox.preview.blockOnNoPage"));return}if(!bt||!Pe){dn.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),Oe.current=null;const w=nr(Pe),$=tr(bt,w,u.key);z(u),Q(null),se($),E(null),o.selectTarget({kind:"section",key:u.key})},Ga=u=>{p&&(z(null),Q(u.key),se(null),Qt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},Ja=async({name:u,path:w,templateKey:$})=>{if(!t||!s)return;const te=Qr(w);if(te){H(te);return}const ye=w.trim().startsWith("/")?w.trim():`/${w.trim()}`;if(Ge.some(Ne=>Ee(Ne.path)===Ee(ye))){H(e("sandbox.preview.pageAlreadyExists",{path:ye}));return}H(void 0);try{const Ne=$?await ma(de,$):void 0;if($&&!Ne){H(e("sandbox.preview.templateNoLongerExists"));return}const ot=await ss.mutateAsync({name:u,path:ye,template:Ne,schema:Xe(ge)?{meta:Pe,loadMeta:async()=>(await pn.refetch()).data}:void 0});M(!1),dn.success(e("sandbox.preview.pageCreated",{name:u})),await nl(jd),En({key:ot.key,name:ot.name,path:ot.path}),Qt("blocks")}catch(Ne){H(Ne instanceof da?e("sandbox.preview.pageSchemaNotReady"):Ne instanceof Error?Ne.message:e("sandbox.preview.failedToCreatePage"))}},Zt=Fc({previewSurfaceActive:Pt,daemonReady:Ls,production:Y.mode==="production",servePreviewUrl:He(ge)}),Ya=$c({showPreviewToolbar:Zt,contentEditingEnabled:f}),_t=()=>{Z(!1),q("")},Nn=F?.name??Kt?.title??hn?.name,Tn=ns.isPending||pn.isPending,Cn=Tn?$t(Y.iframeBase):Nn,Ot=F?`section:${F.key}`:V?`loader:${V}`:oe?`page:${oe}`:Yt.includes(Ee(I))?`route:${Ee(I)}`:void 0,Qa=Zt?Ya?r.jsxs(Mr,{open:W,onOpenChange:u=>{Z(u),u||q("")},children:[r.jsx($r,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:Tn?Cn??void 0:F||Kt?Nn:[Nn,I].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[F&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[r.jsx(Fi,{size:11}),e("sandbox.preview.globalBadge")]}),Kt&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[r.jsx($i,{size:11}),e("sandbox.preview.loaderBadge")]}),Cn&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:Cn}),!Tn&&!F&&!Kt&&r.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:I}),r.jsx(Li,{size:12,className:Fe("shrink-0 transition-transform",W&&"rotate-180")})]})})}),r.jsxs(Br,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(Ir,{shouldFilter:!1,defaultValue:Ot,children:[r.jsx(zr,{value:K,onValueChange:u=>{q(u),X.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Ur,{ref:X,className:"max-h-80",children:[r.jsx(Kr,{children:Ge.length===0&&Yt.length===0&&mn.length===0&&os.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),as.length>0&&r.jsx(dt,{children:as.map(u=>r.jsxs(ut,{value:`page:${u.key}`,"aria-current":Ot===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{_t(),En(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),_s.length>0&&r.jsx(dt,{heading:e("sandbox.preview.siteRoutes"),children:_s.map(u=>r.jsx(ut,{value:`route:${u}`,"aria-current":Ot===`route:${u}`||void 0,title:u,onSelect:()=>{_t(),Ks(u)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:u})},u))}),is.length>0&&r.jsx(dt,{heading:e("sandbox.preview.globalComponents"),children:is.map(u=>r.jsx(ut,{value:`section:${u.key}`,"aria-current":Ot===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{_t(),qa(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),ls.length>0&&r.jsx(dt,{heading:e("sandbox.preview.globalLoaders"),children:ls.map(u=>r.jsx(ut,{value:`loader:${u.key}`,"aria-current":Ot===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{_t(),Ga(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!F&&!V&&Bt(I).some(u=>u.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Bt(I).map((u,w)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${w}`);const $=gn[u.name];return $&&wt?r.jsx(kc,{sources:$,template:I,paramName:u.name,value:nt[u.name]??"",sandboxRef:wt,onCommit:te=>jn(u.name,te)},`${oe}:${u.name}`):r.jsx(_c,{name:u.name,value:nt[u.name]??"",onCommit:te=>jn(u.name,te)},`${oe}:${u.name}`)})}),r.jsx("div",{className:"border-t p-1.5",children:r.jsxs($e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{_t(),H(void 0),M(!0)},children:[r.jsx(Fr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Wa}):null,Hs=Zt||f?r.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:Va,"aria-label":e(yr[b]),children:b==="mobile"?r.jsx(Or,{size:16}):b==="tablet"?r.jsx(Bi,{size:16}):r.jsx(Dr,{size:16})})}),r.jsx(mt,{children:e(yr[b])})]}),Qa,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Wt&&r.jsx(nd,{tests:Sa,load:ja,onOpen:()=>Pa(!0),options:G,onChange:u=>{J(u),o.previewAsChanged()},available:!!xn||!hs||!xs}),r.jsx(Ze,{onClick:Ta,disabled:Ae&&!Ss,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Tr,{size:16})})]})]}):null,Xa=(Le||c)&&Y.mode==="sandbox",en=Ed[b],tn=b==="desktop"&&(_.width===0||_.width>=en.width+2*wr),Vs=tn?1:Math.min(_.width>0?_.width/(en.width+2*wr):1,1),Za=tn?{width:"100%",height:"100%"}:{width:`${en.width}px`,height:_.height>0?`${_.height/Vs}px`:`${en.height}px`,transform:`scale(${Vs})`,transformOrigin:"top center"},Ws=r.jsxs(r.Fragment,{children:[Xa&&(Zt||f)&&r.jsx(Ze,{onClick:Ua,"aria-pressed":we==="visual","aria-label":e("sandbox.preview.visualEditor"),active:we==="visual",children:r.jsx(Gs,{size:16})}),p&&r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:Ia,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:r.jsx(Ui,{size:16})})}),r.jsx(mt,{children:e("sandbox.preview.blocksEditor")})]}),tt&&r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:D,"aria-pressed":C,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:C,children:r.jsx(Mi,{size:16})})}),r.jsx(mt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ei=!!V&&we==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(gn).map(([u,w])=>(nt[u]??"")===""?r.jsx(Lc,{sources:w,template:I,paramName:u,sandboxRef:wt,onFill:$=>jn(u,$)},`${oe}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(zn.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Hs}),children:Hs}),r.jsx(zn.Toolbar.Right.Portal,{fallback:Ws,children:Ws})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:ei?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(vr,{virtualMcpId:t,externalSelection:N,onViewJsonFile:D}),C&&tt&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(xr,{ref:R,virtualMcpId:t,pageKey:tt,onClose:A})})]}):r.jsxs(sr,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[r.jsx(sn,{ref:P,id:"preview-blocks-editor",defaultSize:we==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:we==="blocks"&&r.jsx(vr,{virtualMcpId:t,externalSelection:N,onViewJsonFile:D})}),we==="blocks"&&r.jsx(rr,{withHandle:!0}),r.jsx(sn,{id:"preview-canvas",defaultSize:we==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(sr,{orientation:"horizontal",disabled:!(C&&tt),children:[r.jsx(sn,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:u=>{if(!u)return;const w=()=>B(te=>te.width===u.clientWidth&&te.height===u.clientHeight?te:{width:u.clientWidth,height:u.clientHeight});w();const $=new ResizeObserver(w);return $.observe(u),()=>$.disconnect()},className:Fe("h-full relative overflow-clip flex justify-center",Pt&&!tn&&"bg-muted/30"),children:[(xe||va)&&Pt&&r.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:r.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),Y.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}),Y.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"starting",progress:fs,claimPhase:vn})}),!ee&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"suspended",onResume:Me.resume})}),!ee&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"errored",error:Je.error,onRetry:Me.retry,connectionsHref:`/${le.slug}/settings/connections`})}),Y.showWakingPill&&r.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[r.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),we==="visual"&&!y&&r.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[r.jsx(Gs,{size:12}),e("sandbox.preview.clickElementToAsk")]}),we==="visual"&&y&&r.jsx(Yl,{element:y,onDismiss:()=>g(null)}),Pt&&Qe&&r.jsx("div",{className:Fe("shrink-0",!tn&&"bg-background shadow-edge"),style:Za,onMouseLeave:Ma,children:r.jsx("iframe",{ref:k,src:it,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Ts.handleError,onLoad:()=>{if(bn(br),_a(it),Ts.handleLoad(),fe(),Pn.current=st.current,Rt&&An(Ct),Y.mode!=="sandbox"||ee){(Y.mode==="production"&&!Y.showWakingPill||ee)&&we==="blocks"&&Sn();return}if(ui("vm_preview_loaded",{view_mode:we,vm_id:Ue?.sandboxHandle??null}),!F)try{const u=k.current?.contentWindow?.location?.pathname;if(!u)return;const w=Oe.current;if(w!==null&&(Oe.current=null,Ee(u)!==Ee(w))||Ee(u)===Ee(Ce))return;re(u),Tt({path:u,pageKey:ae,params:nt})}catch{}we==="visual"&&Os(),we==="blocks"&&Sn()}},Y.iframeBase)})]})}),C&&tt&&r.jsxs(r.Fragment,{children:[r.jsx(rr,{withHandle:!0}),r.jsx(sn,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(xr,{ref:R,virtualMcpId:t,pageKey:tt,onClose:A})})]})]})})]})}),r.jsx(Kc,{open:L,onOpenChange:M,isPending:ss.isPending,error:U,templates:Ge,onSubmit:Ja})]})}const qn={app:null,split:!1};function Od(t){const e=ue.c(24),{project:n,maxApps:s,children:a}=t,l=Te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={silent:!0},e[0]=c):c=e[0];const o=Ki(c),i=Ut();let d;e[1]!==n.metadata.runtime?(d=n.metadata.runtime??{},e[1]=n.metadata.runtime,e[2]=d):d=e[2];const m=d;let f;e[3]!==m.apps?(f=m.apps??[],e[3]=m.apps,e[4]=f):f=e[4];const p=f;let S;e[5]!==o.update||e[6]!==i||e[7]!==n.id||e[8]!==n.metadata||e[9]!==m||e[10]!==l?(S=y=>o.update.mutate({id:n.id,data:{metadata:{...sl(n.metadata),runtime:{...m,apps:y.length?y:null}}}},{onSuccess:()=>i.start(),onError:()=>dn.error(l("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=n.id,e[8]=n.metadata,e[9]=m,e[10]=l,e[11]=S):S=e[11];const v=S,x=m.path??null;let h,b;e[12]!==p||e[13]!==v?(h=y=>v([...p,{path:y}]),b=y=>v(p.filter(g=>g.path!==y)),e[12]=p,e[13]=v,e[14]=h,e[15]=b):(h=e[14],b=e[15]);let T;return e[16]!==p||e[17]!==a||e[18]!==s||e[19]!==n.id||e[20]!==x||e[21]!==h||e[22]!==b?(T=r.jsx(Dd,{virtualMcpId:n.id,mainPath:x,apps:p,maxApps:s,onAddApp:h,onRemoveApp:b,children:a}),e[16]=p,e[17]=a,e[18]=s,e[19]=n.id,e[20]=x,e[21]=h,e[22]=b,e[23]=T):T=e[23],T}function Dd(t){const e=ue.c(102),{virtualMcpId:n,mainPath:s,apps:a,maxApps:l,onAddApp:c,onRemoveApp:o,children:i}=t,d=Te(),m=Jr(),{currentBranch:f}=Mt(),p=Ut(),S=Xn().lifecycle.phase,v=fn(n,f),{url:x}=qr(n);let h;e[0]!==v||e[1]!==x?(h=He(v)??x,e[0]=v,e[1]=x,e[2]=h):h=e[2];const b=h,T=b??p.previewUrl,y=!!b||S==="running",g=!y&&p.status==="errored";let N;e[3]!==p.vmEntry?.startedWith?.apps?(N=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=N):N=e[4];const E=N;let k;e[5]!==n?(k=In.previewAppLayout(n),e[5]=n,e[6]=k):k=e[6];const[P,C]=Un(k,Fd);let O;e[7]!==a||e[8]!==P?(O=a.some(fe=>fe.path===P.app)?P.app:null,e[7]=a,e[8]=P,e[9]=O):O=e[9];const R=O,A=R!==null&&P.split&&!m,D=R===null||A,_=R??a[0]?.path??null,[B,W]=j.useState(null),[Z,G]=j.useState(!1);let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{W(null),G(!1)},e[10]=J):J=e[10];const K=J;let q;e[11]!==a||e[12]!==B||e[13]!==m||e[14]!==s||e[15]!==c||e[16]!==C?(q=()=>{if(B===null)return;const fe=or(B);if(!fe){K();return}if(fe===or(s??"")||a.some(le=>le.path===fe)){G(!0);return}c(fe),C({app:fe,split:!m}),K()},e[11]=a,e[12]=B,e[13]=m,e[14]=s,e[15]=c,e[16]=C,e[17]=q):q=e[17];const X=q;let L;e[18]!==s||e[19]!==d?(L=s?_n(s):d("sandbox.appTabs.root"),e[18]=s,e[19]=d,e[20]=L):L=e[20];const M=L;let U;e[21]!==A||e[22]!==d?(U=d(A?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=A,e[22]=d,e[23]=U):U=e[23];const H=U;let F;e[24]!==d?(F=d("sandbox.appTabs.label"),e[24]=d,e[25]=F):F=e[25];let z;e[26]!==d?(z=d("sandbox.appTabs.main"),e[26]=d,e[27]=z):z=e[27];let V;e[28]!==d?(V=d("sandbox.appTabs.mainHint"),e[28]=d,e[29]=V):V=e[29];let Q;e[30]!==C?(Q=()=>C(qn),e[30]=C,e[31]=Q):Q=e[31];let ne;e[32]!==g||e[33]!==M||e[34]!==y||e[35]!==D||e[36]!==z||e[37]!==V||e[38]!==Q?(ne=r.jsx(kr,{label:M,badge:z,hint:V,ready:y,failed:g,onScreen:D,onSelect:Q}),e[32]=g,e[33]=M,e[34]=y,e[35]=D,e[36]=z,e[37]=V,e[38]=Q,e[39]=ne):ne=e[39];let se;if(e[40]!==a||e[41]!==R||e[42]!==g||e[43]!==M||e[44]!==o||e[45]!==y||e[46]!==C||e[47]!==A||e[48]!==d){let fe;e[50]!==R||e[51]!==g||e[52]!==M||e[53]!==o||e[54]!==y||e[55]!==C||e[56]!==A||e[57]!==d?(fe=le=>{const Re=_n(le.path);return r.jsx(kr,{label:Re,hint:d("sandbox.appTabs.extraHint",{app:M}),ready:y,failed:g,onScreen:le.path===R,onSelect:()=>C({app:le.path,split:A}),onRemove:()=>o(le.path),removeLabel:d("sandbox.appTabs.remove",{app:Re})},le.path)},e[50]=R,e[51]=g,e[52]=M,e[53]=o,e[54]=y,e[55]=C,e[56]=A,e[57]=d,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=R,e[42]=g,e[43]=M,e[44]=o,e[45]=y,e[46]=C,e[47]=A,e[48]=d,e[49]=se}else se=e[49];let I;e[59]!==ne||e[60]!==se||e[61]!==F?(I=r.jsxs("div",{role:"tablist","aria-label":F,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[ne,se]}),e[59]=ne,e[60]=se,e[61]=F,e[62]=I):I=e[62];let re;e[63]!==a.length||e[64]!==X||e[65]!==B||e[66]!==Z||e[67]!==l||e[68]!==d?(re=B!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),X()},children:r.jsx("input",{autoFocus:!0,value:B,placeholder:"apps/checkout","aria-label":d("sandbox.appTabs.pathLabel"),"aria-invalid":Z,onChange:fe=>{W(fe.target.value),G(!1)},onBlur:K,onKeyDown:fe=>{fe.key==="Escape"&&K()},className:Fe("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",Z?"border-destructive":"border-border")})}):a.length<l&&r.jsx(ft,{label:d("sandbox.appTabs.add"),onClick:()=>W(""),children:r.jsx(Fr,{})}),e[63]=a.length,e[64]=X,e[65]=B,e[66]=Z,e[67]=l,e[68]=d,e[69]=re):re=e[69];let ae;e[70]!==m||e[71]!==C||e[72]!==A||e[73]!==H||e[74]!==_?(ae=!m&&_&&r.jsx(ft,{label:H,active:A,onClick:()=>C(A?qn:{app:_,split:!0}),children:r.jsx(Ii,{})}),e[70]=m,e[71]=C,e[72]=A,e[73]=H,e[74]=_,e[75]=ae):ae=e[75];let ie;e[76]!==I||e[77]!==re||e[78]!==ae?(ie=r.jsxs(r.Fragment,{children:[I,re,ae]}),e[76]=I,e[77]=re,e[78]=ae,e[79]=ie):ie=e[79];const me=ie;let pe;e[80]!==me?(pe=r.jsx(zn.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:me}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:me})}),e[80]=me,e[81]=pe):pe=e[81];let xe;e[82]!==i||e[83]!==D?(xe=D&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=D,e[84]=xe):xe=e[84];let he;e[85]!==R||e[86]!==g||e[87]!==p.start||e[88]!==b||e[89]!==M||e[90]!==T||e[91]!==y||e[92]!==C||e[93]!==A||e[94]!==E?(he=R!==null&&r.jsx($d,{name:_n(R),mainName:M,appUrl:T?rl(T,R):null,ready:y,failed:g,notStarted:!b&&!E.includes(R),onStart:p.start,className:Fe(A&&"border-l border-border"),onClose:A?()=>C({app:R,split:!1}):void 0},R),e[85]=R,e[86]=g,e[87]=p.start,e[88]=b,e[89]=M,e[90]=T,e[91]=y,e[92]=C,e[93]=A,e[94]=E,e[95]=he):he=e[95];let ve;e[96]!==xe||e[97]!==he?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[xe,he]}),e[96]=xe,e[97]=he,e[98]=ve):ve=e[98];let Se;return e[99]!==pe||e[100]!==ve?(Se=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Se):Se=e[101],Se}function Fd(t){return t??qn}function kr(t){const e=ue.c(28),{label:n,badge:s,hint:a,ready:l,failed:c,onScreen:o,onSelect:i,onRemove:d,removeLabel:m}=t,f=o?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let p;e[0]!==f?(p=Fe("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",f),e[0]=f,e[1]=p):p=e[1];const S=l?"bg-success":c?"bg-destructive":"animate-pulse bg-warning";let v;e[2]!==S?(v=Fe("size-1.5 rounded-full",S),e[2]=S,e[3]=v):v=e[3];let x;e[4]!==v?(x=r.jsx("span",{"aria-hidden":!0,className:v}),e[4]=v,e[5]=x):x=e[5];let h;e[6]!==n?(h=r.jsx("span",{className:"max-w-40 truncate",children:n}),e[6]=n,e[7]=h):h=e[7];let b;e[8]!==s?(b=s&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),e[8]=s,e[9]=b):b=e[9];let T;e[10]!==o||e[11]!==i||e[12]!==x||e[13]!==h||e[14]!==b?(T=r.jsx(pt,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:i,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[x,h,b]})}),e[10]=o,e[11]=i,e[12]=x,e[13]=h,e[14]=b,e[15]=T):T=e[15];let y;e[16]!==a?(y=r.jsx(mt,{className:"max-w-64",children:a}),e[16]=a,e[17]=y):y=e[17];let g;e[18]!==T||e[19]!==y?(g=r.jsxs(ht,{children:[T,y]}),e[18]=T,e[19]=y,e[20]=g):g=e[20];let N;e[21]!==d||e[22]!==m?(N=d&&r.jsx("button",{type:"button","aria-label":m,onClick:d,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(na,{className:"size-3"})}),e[21]=d,e[22]=m,e[23]=N):N=e[23];let E;return e[24]!==g||e[25]!==N||e[26]!==p?(E=r.jsxs("div",{className:p,children:[g,N]}),e[24]=g,e[25]=N,e[26]=p,e[27]=E):E=e[27],E}function $d(t){const e=ue.c(71),{name:n,mainName:s,appUrl:a,ready:l,failed:c,notStarted:o,onStart:i,className:d,onClose:m}=t,f=Te(),[p,S]=j.useState("/"),[v,x]=j.useState("desktop"),[h,b]=j.useState(0),T=j.useRef(null);let y;e[0]!==a||e[1]!==p?(y=a?al(a,p):null,e[0]=a,e[1]=p,e[2]=y):y=e[2];const g=y;let N;e[3]!==d?(N=Fe("flex min-h-0 min-w-0 flex-1 flex-col",d),e[3]=d,e[4]=N):N=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=V=>{V.preventDefault(),S(T.current?.value||"/")},e[5]=E):E=e[5];let k;e[6]!==n||e[7]!==f?(k=f("sandbox.appPane.path",{app:n}),e[6]=n,e[7]=f,e[8]=k):k=e[8];let P;e[9]!==p||e[10]!==k?(P=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:E,children:r.jsx("input",{ref:T,defaultValue:p,"aria-label":k,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=p,e[10]=k,e[11]=P):P=e[11];let C;e[12]!==v||e[13]!==f?(C=f(v==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=v,e[13]=f,e[14]=C):C=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=()=>x(Md),e[15]=O):O=e[15];let R;e[16]!==v?(R=v==="desktop"?r.jsx(Dr,{}):r.jsx(Or,{}),e[16]=v,e[17]=R):R=e[17];let A;e[18]!==C||e[19]!==R?(A=r.jsx(ft,{label:C,onClick:O,children:R}),e[18]=C,e[19]=R,e[20]=A):A=e[20];let D;e[21]!==n||e[22]!==f?(D=f("sandbox.appPane.reload",{app:n}),e[21]=n,e[22]=f,e[23]=D):D=e[23];const _=!g||!l;let B,W;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=()=>b(Bd),W=r.jsx(fi,{}),e[24]=B,e[25]=W):(B=e[24],W=e[25]);let Z;e[26]!==D||e[27]!==_?(Z=r.jsx(ft,{label:D,disabled:_,onClick:B,children:W}),e[26]=D,e[27]=_,e[28]=Z):Z=e[28];let G;e[29]!==n||e[30]!==f?(G=f("sandbox.appPane.openInNewTab",{app:n}),e[29]=n,e[30]=f,e[31]=G):G=e[31];const J=!g||!l;let K;e[32]!==g?(K=()=>g&&window.open(g,"_blank","noopener"),e[32]=g,e[33]=K):K=e[33];let q;e[34]===Symbol.for("react.memo_cache_sentinel")?(q=r.jsx(Tr,{}),e[34]=q):q=e[34];let X;e[35]!==G||e[36]!==J||e[37]!==K?(X=r.jsx(ft,{label:G,disabled:J,onClick:K,children:q}),e[35]=G,e[36]=J,e[37]=K,e[38]=X):X=e[38];let L;e[39]!==n||e[40]!==m||e[41]!==f?(L=m&&r.jsx(ft,{label:f("sandbox.appPane.close",{app:n}),onClick:m,children:r.jsx(na,{})}),e[39]=n,e[40]=m,e[41]=f,e[42]=L):L=e[42];let M;e[43]!==Z||e[44]!==X||e[45]!==L||e[46]!==P||e[47]!==A?(M=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[P,A,Z,X,L]}),e[43]=Z,e[44]=X,e[45]=L,e[46]=P,e[47]=A,e[48]=M):M=e[48];let U;e[49]!==s||e[50]!==f?(U=f("sandbox.appPane.previewOnly",{app:s}),e[49]=s,e[50]=f,e[51]=U):U=e[51];let H;e[52]!==U?(H=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:U}),e[52]=U,e[53]=H):H=e[53];let F;e[54]!==v||e[55]!==c||e[56]!==s||e[57]!==n||e[58]!==o||e[59]!==i||e[60]!==l||e[61]!==h||e[62]!==g||e[63]!==f?(F=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:l&&o?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:f("sandbox.appPane.notStarted",{app:n})}),r.jsx($e,{size:"sm",variant:"outline",onClick:i,children:f("sandbox.appPane.start",{app:n})})]}):!l||!g?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:l?f("sandbox.appPane.noUrl"):c?f("sandbox.appPane.failed",{app:s}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:g,title:n,className:Fe("h-full bg-background",v==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${g}#${h}`)}),e[54]=v,e[55]=c,e[56]=s,e[57]=n,e[58]=o,e[59]=i,e[60]=l,e[61]=h,e[62]=g,e[63]=f,e[64]=F):F=e[64];let z;return e[65]!==n||e[66]!==N||e[67]!==M||e[68]!==H||e[69]!==F?(z=r.jsxs("section",{"aria-label":n,className:N,children:[M,H,F]}),e[65]=n,e[66]=N,e[67]=M,e[68]=H,e[69]=F,e[70]=z):z=e[70],z}function Bd(t){return t+1}function Md(t){return t==="desktop"?"mobile":"desktop"}function ft(t){const e=ue.c(11),{label:n,children:s,active:a,disabled:l,onClick:c}=t;let o;e[0]!==a||e[1]!==s||e[2]!==l||e[3]!==n||e[4]!==c?(o=r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{"aria-label":n,"aria-pressed":a,active:a,disabled:l,onClick:c,children:s})}),e[0]=a,e[1]=s,e[2]=l,e[3]=n,e[4]=c,e[5]=o):o=e[5];let i;e[6]!==n?(i=r.jsx(mt,{children:n}),e[6]=n,e[7]=i):i=e[7];let d;return e[8]!==o||e[9]!==i?(d=r.jsxs(ht,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=d):d=e[10],d}const Ud=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Id=1e4,zd=1e4,Kd=5e3,Hd=2;function Vd(t,e){return t&&e===0?zd:Math.min(1e3*2**Math.max(0,e-1),Kd)}function Wd(t,e,n){return e?!0:t===!0&&n<Hd}function qd(t,e){const n=ue.c(11),s=Ud,a=pi();let l;n[0]!==t?(l=Gn.localAppReachable(t??""),n[0]=t,n[1]=l):l=n[1];const c=l;let o;n[2]!==s||n[3]!==a||n[4]!==c||n[5]!==t?(o=async f=>{const{signal:p}=f,S=new AbortController,v=()=>S.abort();p.addEventListener("abort",v);const x=setTimeout(v,Id),h=await s(t,S.signal).catch(Jd);clearTimeout(x),p.removeEventListener("abort",v);const b=a.getQueryData(c),T=h?0:(b?.failures??0)+1;return{up:Wd(b?.up??null,h,T),failures:T}},n[2]=s,n[3]=a,n[4]=c,n[5]=t,n[6]=o):o=n[6];const i=!!t;let d;n[7]!==c||n[8]!==o||n[9]!==i?(d={queryKey:c,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:Gd},n[7]=c,n[8]=o,n[9]=i,n[10]=d):d=n[10];const{data:m}=Nr(d);return t?m?.up??null:null}function Gd(t){return t.state.data?Vd(t.state.data.up,t.state.data.failures):!1}function Jd(){return!1}function Yd(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Gu(t){const e=ue.c(53),{virtualMcpId:n}=t,s=Te(),a=Hi(n),{connection:l}=Gr(n),{activeTask:c,taskId:o,currentBranch:i}=Mt(),d=pl(o),[m,f]=j.useState(!1),p=fn(n,i);let S;e[0]!==p||e[1]!==l?(S=l?He(p):null,e[0]=p,e[1]=l,e[2]=S):S=e[2];const v=S,x=qd(v),h=ra(),b=il("multi_app_preview");if(cl({threadId:o,sandboxBranch:c?.branch??i,agentHasRepo:On(a?.metadata),threadHasRepo:On(d)||On(c?.metadata)})==="none"&&!l){let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx(lr,{className:"size-7 text-foreground"})}),e[3]=E):E=e[3];let k;e[4]!==s?(k=s("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=s,e[5]=k):k=e[5];let P;e[6]!==s?(P=s("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=s,e[7]=P):P=e[7];let C,O;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=()=>f(!0),O=r.jsx(lr,{className:"size-4"}),e[8]=C,e[9]=O):(C=e[8],O=e[9]);let R;e[10]!==s?(R=s("mainPanelTabs.previewTab.connectGithub"),e[10]=s,e[11]=R):R=e[11];let A;e[12]!==R?(A=r.jsxs($e,{onClick:C,children:[O,R]}),e[12]=R,e[13]=A):A=e[13];let D;e[14]!==k||e[15]!==P||e[16]!==A?(D=r.jsx(ol,{className:"h-full",image:E,title:k,description:P,actions:A}),e[14]=k,e[15]=P,e[16]=A,e[17]=D):D=e[17];let _;e[18]!==m?(_=r.jsx(ll,{open:m,onOpenChange:f,mode:"agent"}),e[18]=m,e[19]=_):_=e[19];let B;return e[20]!==_||e[21]!==D?(B=r.jsxs(r.Fragment,{children:[D,_]}),e[20]=_,e[21]=D,e[22]=B):B=e[22],B}if(l&&a&&!He(p)){let E;e[23]!==h||e[24]!==p?(E=Yd({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=E):E=e[25];let k;e[26]!==l.endpoint?(k=wo(l.endpoint),e[26]=l.endpoint,e[27]=k):k=e[27];let P;return e[28]!==E||e[29]!==k?(P=r.jsx(Xd,{status:E,host:k}),e[28]=E,e[29]=k,e[30]=P):P=e[30],P}if(v&&x!==!0){let E;e[31]!==s?(E=s("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=s,e[32]=E):E=e[32];let k;e[33]!==v||e[34]!==s?(k=s("mainPanelTabs.previewTab.localAppWaiting.body",{host:Qd(v)}),e[33]=v,e[34]=s,e[35]=k):k=e[35];let P;e[36]!==k?(P=r.jsx(ta,{text:k}),e[36]=k,e[37]=P):P=e[37];let C;e[38]!==s?(C=s("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=s,e[39]=C):C=e[39];let O;e[40]!==C?(O=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:C}),e[40]=C,e[41]=O):O=e[41];let R;return e[42]!==E||e[43]!==P||e[44]!==O?(R=r.jsx(un,{headingLevel:2,waiting:!0,title:E,lead:P,footer:O}),e[42]=E,e[43]=P,e[44]=O,e[45]=R):R=e[45],R}let y;e[46]!==n?(y=r.jsx(_d,{virtualMcpId:n}),e[46]=n,e[47]=y):y=e[47];const g=y;let N;return e[48]!==a||e[49]!==b||e[50]!==g||e[51]!==l?(N=r.jsx(Ei,{children:b&&a&&!l?r.jsx(Od,{project:a,maxApps:tl,children:g}):g}),e[48]=a,e[49]=b,e[50]=g,e[51]=l,e[52]=N):N=e[52],N}function Qd(t){try{return new URL(t).host}catch{return t}}function Xd(t){const e=ue.c(13),{status:n,host:s}=t,a=Te();if(n.kind==="connected"){let o;e[0]!==a?(o=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=o):o=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=i):i=e[3];let d;return e[4]!==o||e[5]!==i?(d=r.jsx(un,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=d):d=e[6],d}let l;e[7]!==s||e[8]!==n?(l=xl(n,s),e[7]=s,e[8]=n,e[9]=l):l=e[9];let c;return e[10]!==s||e[11]!==l?(c=r.jsx(vl,{wait:l,hosts:s}),e[10]=s,e[11]=l,e[12]=c):c=e[12],c}export{vl as L,Gu as P,un as S,qu as u};
|
|
551
|
+
`)}function Jl(t,e,n=320,s=44,a=12){const{x:l,y:c}=t,{width:o,height:i}=e,d=Math.max(a,Math.min(l-n/2,o-n-a)),f=c/i>.68?Math.max(a,c-s-18):Math.min(c+18,i-s-a);return{leftPct:d/o*100,topPct:f/i*100}}function Yl(t){const e=ue.c(45),{element:n,onDismiss:s}=t,[a,l]=j.useState(""),c=j.useRef(null),{sendMessage:o}=Ni(),{openSidePanel:i}=Bo(),d=Te();let m;e[0]!==n||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const W=Gl(n,a);i(),o({parts:[{type:"text",text:W}]}),s()},e[0]=n,e[1]=a,e[2]=s,e[3]=i,e[4]=o,e[5]=m):m=e[5];const f=m;let p;e[6]!==n.position||e[7]!==n.viewport?(p=Jl(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=p):p=e[8];const S=p,v=`${S.leftPct}%`,x=`${S.topPct}%`;let h;e[9]!==v||e[10]!==x?(h={left:v,top:x,width:"320px"},e[9]=v,e[10]=x,e[11]=h):h=e[11];let b;e[12]!==f?(b=W=>{W.preventDefault(),f()},e[12]=f,e[13]=b):b=e[13];let T;e[14]===Symbol.for("react.memo_cache_sentinel")?(T=W=>l(W.target.value),e[14]=T):T=e[14];let y;e[15]!==s?(y=W=>{W.key==="Escape"&&s()},e[15]=s,e[16]=y):y=e[16];let g;e[17]!==d?(g=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=g):g=e[18];let N;e[19]!==a||e[20]!==y||e[21]!==g?(N=r.jsx("input",{ref:c,autoFocus:!0,type:"text",value:a,onChange:T,onKeyDown:y,placeholder:g,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=y,e[21]=g,e[22]=N):N=e[22];let E;e[23]!==a?(E=a.trim(),e[23]=a,e[24]=E):E=e[24];const k=!E;let P;e[25]!==d?(P=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=P):P=e[26];let C;e[27]!==d?(C=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=C):C=e[28];let O;e[29]!==C?(O=r.jsx("title",{children:C}),e[29]=C,e[30]=O):O=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=R):R=e[31];let A;e[32]!==O?(A=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[O,R]}),e[32]=O,e[33]=A):A=e[33];let D;e[34]!==k||e[35]!==P||e[36]!==A?(D=r.jsx("button",{type:"submit",disabled:k,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:P,children:A}),e[34]=k,e[35]=P,e[36]=A,e[37]=D):D=e[37];let _;e[38]!==N||e[39]!==D||e[40]!==b?(_=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:b,children:[N,D]}),e[38]=N,e[39]=D,e[40]=b,e[41]=_):_=e[41];let B;return e[42]!==_||e[43]!==h?(B=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:_}),e[42]=_,e[43]=h,e[44]=B):B=e[44],B}const pr="site-links",Ql=/details?page|\bpdp\b/i,Xl=/listingpage|\bplp\b/i;function Zl(t,e,n){const s=new Set;for(const o of n)Ql.test(o)&&s.add("product"),Xl.test(o)&&s.add("category");const a=Bt(Qn(t)),l=a[a.length-1],c=a[a.length-2];return l?.type==="text"&&l.text==="/p"&&c?.type==="param"&&c.name===e&&s.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&s.add("category"),s}const ec=["rosa","preto","pink","black"];function an(t,e){const n=e.trim();return n?t(n):ec.flatMap(s=>t(s))}function tc(t,e){const n=e.trim(),s=[];/^\d+$/.test(n)&&s.push({resolveType:t,props:{ids:[n]}});const l=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return s.push({resolveType:t,props:{query:l,count:10}}),s}const aa=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Zn(t){return t.split("/")[0]??""}function nc(t){const e=new Set;for(const n of t){const s=Zn(n);aa.has(s)&&e.add(s)}return e}function sc(t,e){const n=Zn(t);return!aa.has(n)||e.size===0?!0:e.has(n)}const rc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>an(n=>tc(t,n),e),optionsFromPayload:on},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:on},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:on},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:on},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:uc}];function ac(t,e,n=new Set){const s=[...e],a=o=>{const i=[];for(const d of rc){if(d.kind!==o)continue;const m=s.find(f=>d.test(f)&&sc(f,n));m&&i.push({cand:d,resolveType:m})}return i.find(d=>n.has(Zn(d.resolveType)))??i[0]},l=(o,i,d)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:d,buildRequests:m=>o.buildRequests(i,m),optionsFromPayload:o.optionsFromPayload}),c=[];for(const o of["product","category"]){if(!t.has(o))continue;const i=a(o);i&&c.push(l(i.cand,i.resolveType,!1))}return t.size>0&&c.push(ic(t.has("category")?"category":"product")),c}function ic(t){return{kind:t,id:pr,resolveType:pr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>gc(e,n)}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function oc(t,e,n){const s=new Set,a=new Set,l=c=>{if(Array.isArray(c)){for(const d of c)l(d);return}const o=et(c);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(n(i))s.add(i);else if(i in e&&!a.has(i)){a.add(i);const d=et(e[i])?.__resolveType;typeof d=="string"&&n(d)&&s.add(i),l(e[i])}}for(const d of Object.values(o))l(d)};return l(t),s}function ia(t){const e=new Set,n=[];for(const s of t)for(const a of s)e.has(a.value)||(e.add(a.value),n.push(a));return n}function oa(t){try{return decodeURIComponent(t)}catch{return t}}function lc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cc(t){const e=[];let n="^";for(const s of t)s.type==="text"?n+=lc(s.text):(e.push(s.name),n+=s.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function la(t,e,n){if(typeof t!="string"||!t)return null;let s;try{s=new URL(t,"https://placeholder.invalid").pathname}catch{return null}s=s.replace(/\/+$/,"");const a=Bt(Qn(e)),{pattern:l,order:c}=cc(a),o=c.indexOf(n);if(o===-1)return null;const i=s.match(l);if(!i)return null;const d=i[o+1]?.replace(/^\/+|\/+$/g,"");return d?oa(d):null}function on(t,e){const n=et(t),s=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],a=[],l=new Set;for(const c of s){const o=et(c);if(!o)continue;const i=la(o.url,e.template,e.paramName);if(!i||l.has(i))continue;l.add(i);const d=et(o.isVariantOf),m=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||i,f=Array.isArray(o.image)?et(o.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;a.push({value:i,label:m,image:p})}return a}function dc(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?oa(n):null}function uc(t){const e=[],n=new Set,s=(a,l)=>{const c=et(a);if(!c)return;const o=typeof c.name=="string"&&c.name?c.name:"",i=o?[...l,o]:l,d=dc(c.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:i.join(" › ")||d})),Array.isArray(c.children))for(const m of c.children)s(m,i)};if(Array.isArray(t))for(const a of t)s(a,[]);return e}const fc=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function pc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function mc(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let s,a=0;for(;(s=n.exec(t))!==null&&a++<5e3;){const l=s[1]??"",c=(s[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:l,text:c})}return e}function hc(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,s=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let l,c=0;for(;(l=s.exec(t))!==null&&c++<3e3;){const o=(l[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const i=t.slice(l.index,l.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:l[2]??"",image:i||void 0})}return e}function gc(t,e){const n=[],s=new Set,a=(l,c,o,i)=>{if(n.length>=200)return;const d=la(l,e.template,e.paramName);!d||s.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&fc.has(d.split("/")[0]??"")||(s.add(d),n.push({value:d,label:c&&c.length<=80?c:pc(d),kind:o,image:i}))};for(const{url:l,name:c,image:o}of hc(t))a(l,c,"product",o);for(const{href:l,text:c}of mc(t))l.startsWith("/")&&!l.startsWith("//")&&a(l,c,"category");return n}function Dt(t,e,n=50){const s=e.trim().toLowerCase();return(s?t.filter(l=>l.label.toLowerCase().includes(s)||l.value.toLowerCase().includes(s)):t).slice(0,n)}const ca=1e4;function vc(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function xc(t,{resolveType:e,props:n}){const s=await fetch(Qi(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(ca)});if(!s.ok)throw new Error(`Failed to fetch options: ${s.status}`);return s.json()}async function mr(t,e){const n=await fetch(Xi(t,e),{signal:AbortSignal.timeout(ca)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function bc(t,e,n){const s=e.optionsFromPayload(await mr(t,"/"),n),a=s.find(c=>c.kind==="category");if(!a)return s;const l=Ve(n.template,{[n.paramName]:a.value});if(l==="/")return s;try{const c=e.optionsFromPayload(await mr(t,l),n).filter(o=>o.kind==="product");return ia([s,c])}catch{return s}}function wc(t,e,n){return Gn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function yc(t,e,n,s){if(e.homepageLinks)return bc(t,e,s);const a=e.buildRequests?.(n)??[];if(a.length===0)return[];const l=await Promise.allSettled(a.map(o=>xc(t,o))),c=l.filter(o=>o.status==="fulfilled").map(o=>o.value);if(c.length===0){const o=l.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return ia(c.map(o=>e.optionsFromPayload(o,s)))}function Wn(t,e,n,s,a){return{queryKey:wc(t,e,n),queryFn:()=>yc(t,e,n,s),enabled:a,staleTime:6e4,retry:1}}function Ft(t){const e=ue.c(16),{heading:n,iconKind:s,options:a,template:l,paramName:c,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let d;if(e[0]!==s||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==c||e[5]!==l){let f;e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==c||e[11]!==l?(f=p=>r.jsxs(ut,{value:`${o}:${p.value}`,className:"gap-3 py-2",onSelect:()=>i(p.value),children:[s==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.image?r.jsx("img",{src:p.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(_r,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:p.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(l,{[c]:p.value})})]})]},`${o}:${p.value}`),e[7]=s,e[8]=o,e[9]=i,e[10]=c,e[11]=l,e[12]=f):f=e[12],d=a.map(f),e[0]=s,e[1]=o,e[2]=i,e[3]=a,e[4]=c,e[5]=l,e[6]=d}else d=e[6];let m;return e[13]!==n||e[14]!==d?(m=r.jsx(dt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=m):m=e[15],m}function hr(t){const e=ue.c(2),{text:n}=t;let s;return e[0]!==n?(s=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=s):s=e[1],s}function kc(t){const e=ue.c(52),{sources:n,template:s,paramName:a,value:l,sandboxRef:c,onCommit:o}=t,i=Te(),[d,m]=j.useState(!1),[f,p]=j.useState(""),[S,v]=j.useState(""),x=j.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,b=vc(i),y=[...new Set(n.map(ee=>b[ee.kind].noun))].join(" or ");let g;e[0]!==i||e[1]!==y?(g=i("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=i,e[1]=y,e[2]=g):g=e[2];const N=g,E={template:s,paramName:a};let k;e[3]!==f?(k=(ee,ce)=>({source:ee,query:ce,options:ee.clientFilter?Dt(ce.data??[],f):ce.data??[]}),e[3]=f,e[4]=k):k=e[4];const P=k,C=n.filter(Rc),O=n.filter(Cc),R=Kn({queries:C.map(ee=>Wn(c,ee,S,E,d))});let A;e[5]!==R||e[6]!==P?(A=(ee,ce)=>P(ee,R[ce]),e[5]=R,e[6]=P,e[7]=A):A=e[7];const D=C.map(A),_=D.length===0||D.every(Tc),B=Kn({queries:O.map(ee=>Wn(c,ee,S,E,d&&_))});let W;e[8]!==B||e[9]!==P?(W=(ee,ce)=>P(ee,B[ce]),e[8]=B,e[9]=P,e[10]=W):W=e[10];const Z=O.map(W),G=_?Z:D,J=G.length===1&&G[0]?.source.homepageLinks?G[0]:null,q=J&&!J.query.isLoading&&!J.query.isError?J?.query.data??[]:[],X=Dt(q.filter(Nc),f),L=Dt(q.filter(Ec),f),M=X.length>0&&L.length>0,U=ee=>{m(ee),x.current&&clearTimeout(x.current),p(ee?l:""),v(ee?l:"")};let H;e[11]===Symbol.for("react.memo_cache_sentinel")?(H=ee=>{p(ee),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{v(ee)},300)},e[11]=H):H=e[11];const F=H,z=ee=>{o(ee),U(!1)},V=Yr(f),Q=Ve(s,{[a]:V}),ne=Pr,se=Sr,I="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",re=jc;let ae;e[12]!==h||e[13]!==i?(ae=i("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=i,e[14]=ae):ae=e[14];let ie;e[15]!==ae?(ie=r.jsx(jr,{className:"sr-only",children:r.jsx(Er,{children:ae})}),e[15]=ae,e[16]=ie):ie=e[16];let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=r.jsx(_r,{size:16,className:"shrink-0 text-foreground"}),e[17]=me):me=e[17];let pe;e[18]!==i?(pe=i("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=i,e[19]=pe):pe=e[19];let xe;e[20]!==h?(xe=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=xe):xe=e[21];let he;e[22]!==pe||e[23]!==xe?(he=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[me,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",xe]})]}),e[22]=pe,e[23]=xe,e[24]=he):he=e[24];const ve=Ir,Se=!1,fe="min-h-0 flex-1";let le;e[25]!==N||e[26]!==f?(le=r.jsx(zr,{autoFocus:!0,placeholder:N,value:f,onValueChange:F}),e[25]=N,e[26]=f,e[27]=le):le=e[27];const Re=Ur,Me="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ue;e[28]!==i?(Ue=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=Ue):Ue=e[29];let Be;e[30]!==Ue?(Be=r.jsx(Kr,{children:Ue}),e[30]=Ue,e[31]=Be):Be=e[31];const vt=V&&r.jsx(dt,{className:"shrink-0",children:r.jsxs(ut,{value:`__raw__:${V}`,className:"gap-3 py-2",onSelect:()=>z(V),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(Uo,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:i("sandbox.pathParamPickerChip.useRawValue",{rawTerm:V,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Q})]})]})}),ge=M?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(Ft,{heading:b.category.heading,iconKind:"category",options:X,template:s,paramName:a,keyPrefix:`${J?.source.id}:cat`,onSelect:z})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(Ft,{heading:b.product.heading,iconKind:"product",options:L,template:s,paramName:a,keyPrefix:`${J?.source.id}:prod`,onSelect:z})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:G.map(ee=>{const{source:ce,query:We,options:xt}=ee,{noun:qe}=b[ce.kind];if(We.isLoading)return r.jsx(hr,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},ce.id);if(We.isError)return r.jsx(hr,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},ce.id);if(ce.homepageLinks){const It=We.data??[];return r.jsxs(j.Fragment,{children:[r.jsx(Ft,{heading:b.category.heading,iconKind:"category",options:Dt(It.filter(Pc),f),template:s,paramName:a,keyPrefix:`${ce.id}:cat`,onSelect:z}),r.jsx(Ft,{heading:b.product.heading,iconKind:"product",options:Dt(It.filter(Sc),f),template:s,paramName:a,keyPrefix:`${ce.id}:prod`,onSelect:z})]},ce.id)}return r.jsx(Ft,{heading:G.length>1?b[ce.kind].heading:void 0,iconKind:ce.kind,options:xt,template:s,paramName:a,keyPrefix:ce.id,onSelect:z},ce.id)})});let _e;e[32]!==Re||e[33]!==Be||e[34]!==vt||e[35]!==ge?(_e=r.jsxs(Re,{className:Me,children:[Be,vt,ge]}),e[32]=Re,e[33]=Be,e[34]=vt,e[35]=ge,e[36]=_e):_e=e[36];let be;e[37]!==ve||e[38]!==le||e[39]!==_e?(be=r.jsxs(ve,{shouldFilter:Se,className:fe,children:[le,_e]}),e[37]=ve,e[38]=le,e[39]=_e,e[40]=be):be=e[40];let Ie;e[41]!==se||e[42]!==ie||e[43]!==he||e[44]!==be||e[45]!==re?(Ie=r.jsxs(se,{className:I,onClick:re,children:[ie,he,be]}),e[41]=se,e[42]=ie,e[43]=he,e[44]=be,e[45]=re,e[46]=Ie):Ie=e[46];let Le;return e[47]!==ne||e[48]!==U||e[49]!==d||e[50]!==Ie?(Le=r.jsx(ne,{open:d,onOpenChange:U,children:Ie}),e[47]=ne,e[48]=U,e[49]=d,e[50]=Ie,e[51]=Le):Le=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:i("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:ee=>{ee.stopPropagation(),U(!0)},children:l||h}),Le]})}function Sc(t){return t.kind==="product"}function Pc(t){return t.kind!=="product"}function jc(t){return t.stopPropagation()}function Ec(t){return t.kind==="product"}function Nc(t){return t.kind!=="product"}function Tc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Cc(t){return t.isFallback}function Rc(t){return!t.isFallback}function Lc(t){const e=ue.c(8),{sources:n,template:s,paramName:a,sandboxRef:l,onFill:c}=t;let o,i;if(e[0]!==a||e[1]!==l||e[2]!==n||e[3]!==s){const S={template:s,paramName:a},v=n.filter(Ac);i=Kn,o=v.map(x=>Wn(l,x,"",S,!0)),e[0]=a,e[1]=l,e[2]=n,e[3]=s,e[4]=o,e[5]=i}else o=e[4],i=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const m=i(d),[f,p]=j.useState(!1);if(!f)for(const S of m){if(S.isLoading)break;const v=S.data?.[0];if(v){p(!0),queueMicrotask(()=>c(v.value));break}}return null}function Ac(t){return!t.isFallback}function _c(t){const e=ue.c(31),{name:n,value:s,onCommit:a}=t,l=Te(),[c,o]=j.useState(s),[i,d]=j.useState(!1),m=j.useRef(!1);let f;e[0]!==n||e[1]!==l?(f=n==="*"?l("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=l,e[2]=f):f=e[2];const p=f,S=c||p;let v;e[3]!==S?(v=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:S}),e[3]=S,e[4]=v):v=e[4];let x;e[5]!==p||e[6]!==l?(x=l("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=l,e[7]=x):x=e[7];let h,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=P=>o(P.target.value),b=()=>d(!0),e[8]=h,e[9]=b):(h=e[8],b=e[9]);let T;e[10]!==s?(T=P=>{P.key==="Enter"&&P.currentTarget.blur(),P.key==="Escape"&&(m.current=!0,o(s),P.currentTarget.blur())},e[10]=s,e[11]=T):T=e[11];let y;e[12]!==c||e[13]!==a||e[14]!==s?(y=()=>{if(d(!1),m.current){m.current=!1;return}const P=Yr(c);o(P),P!==s&&a(P)},e[12]=c,e[13]=a,e[14]=s,e[15]=y):y=e[15];let g;e[16]!==c||e[17]!==p||e[18]!==x||e[19]!==T||e[20]!==y?(g=r.jsx("input",{type:"text",value:c,placeholder:p,title:x,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Oc,onChange:h,onFocus:b,onKeyDown:T,onBlur:y}),e[16]=c,e[17]=p,e[18]=x,e[19]=T,e[20]=y,e[21]=g):g=e[21];let N;e[22]!==v||e[23]!==g?(N=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,g]}),e[22]=v,e[23]=g,e[24]=N):N=e[24];let E;e[25]!==i||e[26]!==l?(E=i&&r.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[r.jsx(Oi,{size:10}),l("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=l,e[27]=E):E=e[27];let k;return e[28]!==E||e[29]!==N?(k=r.jsxs(r.Fragment,{children:[N,E]}),e[28]=E,e[29]=N,e[30]=k):k=e[30],k}function Oc(t){return t.stopPropagation()}function Dc(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),s=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${s}`}catch{return e}}function Fc(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function $c(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function Bc(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function Mc(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class da extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Uc(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new da;return n}async function Ic(t,e,n){return n?qs(t,e,await Uc(n.meta,n.loadMeta)):qs(t,e)}function zc(t){const e=ue.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const s=Cr(n);let a;return e[2]!==t||e[3]!==s?(a={mutationFn:async l=>{const{name:c,path:o,template:i,schema:d}=l;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=mi(c),f=i?{...i,name:c,path:o}:await Ic(c,o,d);return await s.mutateAsync({blockKey:m,data:f}),{key:m,name:c,path:o}}},e[2]=t,e[3]=s,e[4]=a):a=e[4],ii(a)}function Kc(t){const e=ue.c(89),{open:n,onOpenChange:s,isPending:a,error:l,templates:c,onSubmit:o}=t,i=a===void 0?!1:a,d=Te();let m;e[0]!==d?(m=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=m):m=e[1];const[f,p]=j.useState(m);let S;e[2]!==d?(S=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=S):S=e[3];const[v,x]=j.useState(S),[h,b]=j.useState(Rn),[T,y]=j.useState(null),[g,N]=j.useState(n);n!==g&&(N(n),n&&(p(d("sectionsEditor.createPageModal.defaultPageName")),x(d("sectionsEditor.createPageModal.defaultPagePath")),b(Rn),y(null)));const E=!!c?.length;let k;e[4]!==i||e[5]!==s?(k=pe=>{!pe&&!i&&(y(null),s(!1))},e[4]=i,e[5]=s,e[6]=k):k=e[6];const P=k;let C;e[7]!==i||e[8]!==f||e[9]!==o||e[10]!==v||e[11]!==E||e[12]!==h?(C=async pe=>{pe.preventDefault();const xe=f.trim(),he=v.trim();if(!xe||!he||i)return;const ve=Qr(he);if(ve){y(ve);return}y(null),await o({name:xe,path:he,templateKey:E&&h!==Rn?h:null})},e[7]=i,e[8]=f,e[9]=o,e[10]=v,e[11]=E,e[12]=h,e[13]=C):C=e[13];const O=C,R=T??l;let A;e[14]!==d?(A=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=A):A=e[15];let D;e[16]!==A?(D=r.jsx(jr,{children:r.jsx(Er,{children:A})}),e[16]=A,e[17]=D):D=e[17];let _;e[18]!==d?(_=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=_):_=e[19];let B;e[20]!==_?(B=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=B):B=e[21];let W;e[22]===Symbol.for("react.memo_cache_sentinel")?(W=pe=>p(pe.target.value),e[22]=W):W=e[22];let Z;e[23]!==d?(Z=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=Z):Z=e[24];let G;e[25]!==i||e[26]!==f||e[27]!==Z?(G=r.jsx(Mn,{id:"new-page-name",value:f,onChange:W,placeholder:Z,autoFocus:!0,disabled:i}),e[25]=i,e[26]=f,e[27]=Z,e[28]=G):G=e[28];let J;e[29]!==G||e[30]!==B?(J=r.jsxs("div",{className:"space-y-1.5",children:[B,G]}),e[29]=G,e[30]=B,e[31]=J):J=e[31];let K;e[32]!==d?(K=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=K):K=e[33];let q;e[34]!==K?(q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:K}),e[34]=K,e[35]=q):q=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=pe=>x(pe.target.value),e[36]=X):X=e[36];let L;e[37]!==d?(L=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=L):L=e[38];let M;e[39]!==i||e[40]!==v||e[41]!==L?(M=r.jsx(Mn,{id:"new-page-path",value:v,onChange:X,placeholder:L,disabled:i}),e[39]=i,e[40]=v,e[41]=L,e[42]=M):M=e[42];let U;e[43]!==q||e[44]!==M?(U=r.jsxs("div",{className:"space-y-1.5",children:[q,M]}),e[43]=q,e[44]=M,e[45]=U):U=e[45];let H;e[46]!==i||e[47]!==E||e[48]!==d||e[49]!==h||e[50]!==c?(H=E&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),r.jsx(hi,{id:"new-page-template",value:h,onChange:b,templates:c??[],disabled:i})]}),e[46]=i,e[47]=E,e[48]=d,e[49]=h,e[50]=c,e[51]=H):H=e[51];let F;e[52]!==R?(F=R&&r.jsx("p",{className:"text-xs text-destructive",children:R}),e[52]=R,e[53]=F):F=e[53];let z;e[54]!==J||e[55]!==U||e[56]!==H||e[57]!==F?(z=r.jsxs("div",{className:"space-y-4 py-4",children:[J,U,H,F]}),e[54]=J,e[55]=U,e[56]=H,e[57]=F,e[58]=z):z=e[58];let V;e[59]!==s?(V=()=>s(!1),e[59]=s,e[60]=V):V=e[60];let Q;e[61]!==d?(Q=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=Q):Q=e[62];let ne;e[63]!==i||e[64]!==V||e[65]!==Q?(ne=r.jsx($e,{type:"button",variant:"outline",onClick:V,disabled:i,children:Q}),e[63]=i,e[64]=V,e[65]=Q,e[66]=ne):ne=e[66];let se;e[67]!==i||e[68]!==f||e[69]!==v?(se=!f.trim()||!v.trim()||i,e[67]=i,e[68]=f,e[69]=v,e[70]=se):se=e[70];let I;e[71]!==i||e[72]!==d?(I=i?r.jsxs(r.Fragment,{children:[r.jsx(gt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=d,e[73]=I):I=e[73];let re;e[74]!==se||e[75]!==I?(re=r.jsx($e,{type:"submit",disabled:se,children:I}),e[74]=se,e[75]=I,e[76]=re):re=e[76];let ae;e[77]!==ne||e[78]!==re?(ae=r.jsxs(oi,{children:[ne,re]}),e[77]=ne,e[78]=re,e[79]=ae):ae=e[79];let ie;e[80]!==O||e[81]!==z||e[82]!==ae||e[83]!==D?(ie=r.jsx(Sr,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:O,children:[D,z,ae]})}),e[80]=O,e[81]=z,e[82]=ae,e[83]=D,e[84]=ie):ie=e[84];let me;return e[85]!==P||e[86]!==n||e[87]!==ie?(me=r.jsx(Pr,{open:n,onOpenChange:P,children:ie}),e[85]=P,e[86]=n,e[87]=ie,e[88]=me):me=e[88],me}function Hc(t){const e=ue.c(36),{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:c,decofile:o,blockKey:i}=t,d=Te();let m;e[0]!==a||e[1]!==n||e[2]!==s?(m={orgSlug:n,virtualMcpId:s,branch:a},e[0]=a,e[1]=n,e[2]=s,e[3]=m):m=e[3];const f=Cr(m);let p;e[4]!==f?(p=xi((k,P)=>f.mutate({blockKey:k,data:P})),e[4]=f,e[5]=p):p=e[5];const S=p;let v;e[6]!==i||e[7]!==o?(v=gi(o,i),e[6]=i,e[7]=o,e[8]=v):v=e[8];const{resolveType:x,props:h,title:b}=v;if(!x){let k;e[9]!==d?(k=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=k):k=e[10];let P;return e[11]!==k?(P=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:k}),e[11]=k,e[12]=P):P=e[12],P}const T=`loader:${i}`,y=`loader:${i}`;let g;e[13]!==i||e[14]!==x||e[15]!==b?(g={mode:"saved",blockKey:i,resolveType:x,title:b},e[13]=i,e[14]=x,e[15]=b,e[16]=g):g=e[16];let N;e[17]!==a||e[18]!==o||e[19]!==c||e[20]!==n||e[21]!==l||e[22]!==h||e[23]!==f.isPending||e[24]!==S||e[25]!==y||e[26]!==g||e[27]!==s?(N=r.jsx(vi,{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:c,decofile:o,kind:"loaders",target:g,initialValue:h,isCreating:f.isPending,onCreate:Vc,onSaveReferencedBlock:S,showRun:!1},y),e[17]=a,e[18]=o,e[19]=c,e[20]=n,e[21]=l,e[22]=h,e[23]=f.isPending,e[24]=S,e[25]=y,e[26]=g,e[27]=s,e[28]=N):N=e[28];let E;return e[29]!==i||e[30]!==a||e[31]!==n||e[32]!==T||e[33]!==N||e[34]!==s?(E=r.jsx(bi,{orgSlug:n,virtualMcpId:s,branch:a,blockKey:i,present:void 0,children:N},T),e[29]=i,e[30]=a,e[31]=n,e[32]=T,e[33]=N,e[34]=s,e[35]=E):E=e[35],E}async function Vc(){}function Wc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function gr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:Wc(t.error)}}function qc(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function Gc(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=qc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const Jc=j.lazy(()=>li(()=>import("./sections-editor-CxLQrocH.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])).then(t=>({default:t.SectionsEditor})));function vr(t){const e=ue.c(60),{virtualMcpId:n,externalSelection:s,onViewJsonFile:a}=t,l=s===void 0?null:s,{org:c}=Jn(),{currentBranch:o,taskId:i}=Mt(),d=Xn(),m=Ut(),f=ea(),p=d.lifecycle.phase==="running",S=m.previewUrl;let v;e[0]!==o||e[1]!==c||e[2]!==S||e[3]!==i||e[4]!==n?(v=o?{orgSlug:c.slug,virtualMcpId:n,branch:o,threadId:i??null,previewUrl:S}:null,e[0]=o,e[1]=c,e[2]=S,e[3]=i,e[4]=n,e[5]=v):v=e[5];const x=v,h=fn(n,o);let b;e[6]!==p?(b={fetchEnabled:p},e[6]=p,e[7]=b):b=e[7];const T=Yn(x,b);let y;e[8]!==p?(y={fetchEnabled:p},e[8]=p,e[9]=y):y=e[9];const g=Xr(x,y),N=Gc({lifecyclePhase:d.lifecycle.phase,decofile:gr(T),meta:gr(g),hasEditableContent:ko(T.data,g.data),fastPreviewActive:Hr(n).runtime==="cms"||Xe(h)}),E=Rr()===void 0,k=Yc;if(So(h)){let L;return e[10]===Symbol.for("react.memo_cache_sentinel")?(L=k(r.jsx(jo,{})),e[10]=L):L=e[10],L}if(h.kind==="pending"&&h.retrying){let L;return e[11]!==h?(L=k(r.jsx(Eo,{backend:h})),e[11]=h,e[12]=L):L=e[12],L}if(N.kind==="loading"||E){let L;return e[13]===Symbol.for("react.memo_cache_sentinel")?(L=k(r.jsx(ci,{})),e[13]=L):L=e[13],L}if(T.data&&Zi(g.data)){const L=f.state.target,M=L?.kind==="page"||L?.kind==="section"?L.key:null,U=M??"",H=o??"";let F;return e[14]!==T.data||e[15]!==M||e[16]!==c.slug||e[17]!==U||e[18]!==H||e[19]!==n?(F=k(r.jsx(wi,{orgSlug:c.slug,virtualMcpId:n,branch:H,decofile:T.data,initialKey:M,compact:!0},U)),e[14]=T.data,e[15]=M,e[16]=c.slug,e[17]=U,e[18]=H,e[19]=n,e[20]=F):F=e[20],F}if(N.kind==="empty"){let L;return e[21]===Symbol.for("react.memo_cache_sentinel")?(L=k(r.jsx(No,{})),e[21]=L):L=e[21],L}if(N.kind==="error"){let L;e[22]!==T||e[23]!==m||e[24]!==g||e[25]!==N.source?(L=()=>{if(N.source==="sandbox"){m.retry();return}Promise.all([T.refetch(),g.refetch()])},e[22]=T,e[23]=m,e[24]=g,e[25]=N.source,e[26]=L):L=e[26];const M=L;let U;return e[27]!==M||e[28]!==N.source?(U=k(r.jsx(Po,{source:N.source,onRetry:M})),e[27]=M,e[28]=N.source,e[29]=U):U=e[29],U}let P;e[30]===Symbol.for("react.memo_cache_sentinel")?(P=L=>k(r.jsx("div",{className:"h-full min-h-0",children:L})),e[30]=P):P=e[30];const C=P,O=f.state.target;if(O?.kind==="loader"&&T.data&&g.data){const L=o??"",M=S??null;let U;return e[31]!==T.data||e[32]!==g.data||e[33]!==c.slug||e[34]!==L||e[35]!==M||e[36]!==O.key||e[37]!==n?(U=C(r.jsx(Hc,{orgSlug:c.slug,virtualMcpId:n,branch:L,previewUrl:M,meta:g.data,decofile:T.data,blockKey:O.key})),e[31]=T.data,e[32]=g.data,e[33]=c.slug,e[34]=L,e[35]=M,e[36]=O.key,e[37]=n,e[38]=U):U=e[38],U}let R;e[39]!==o||e[40]!==c.slug||e[41]!==O||e[42]!==n?(R=O||!o?null:Lr(Ar(c.slug,n,o)),e[39]=o,e[40]=c.slug,e[41]=O,e[42]=n,e[43]=R):R=e[43];const A=R;let D="/",_=null,B=null;O?.kind==="page"?(D=O.path,_=O.key):O?.kind==="section"?B=O.key:A&&(D=A.path,_=A.pageKey);const W=_?`page:${_}`:B?`section:${B}`:`path:${D}`;let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=Z):Z=e[44];const G=o??"",J=S??void 0,K=B?null:l,q=!!_&&f.state.editSeoPageKey===_;let X;return e[45]!==B||e[46]!==_||e[47]!==D||e[48]!==W||e[49]!==a||e[50]!==c.slug||e[51]!==K||e[52]!==q||e[53]!==G||e[54]!==J||e[55]!==n||e[56]!==f.consumeEditSeo||e[57]!==f.setFocusedBlock||e[58]!==f.setVariantOverride?(X=C(r.jsx(j.Suspense,{fallback:Z,children:r.jsx(Jc,{orgSlug:c.slug,virtualMcpId:n,branch:G,previewReady:!0,previewUrl:J,currentPath:D,activePageBlockKey:_,activeGlobalBlockKey:B,externalSelection:K,initialEditSeo:q,onExitSeo:f.consumeEditSeo,onVariantPreviewOverride:f.setVariantOverride,onFocusedBlockChange:f.setFocusedBlock,onViewJsonFile:a},W)})),e[45]=B,e[46]=_,e[47]=D,e[48]=W,e[49]=a,e[50]=c.slug,e[51]=K,e[52]=q,e[53]=G,e[54]=J,e[55]=n,e[56]=f.consumeEditSeo,e[57]=f.setFocusedBlock,e[58]=f.setVariantOverride,e[59]=X):X=e[59],X}function Yc(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function xr(t){const e=ue.c(51),{virtualMcpId:n,pageKey:s,onClose:a,ref:l}=t,c=Te(),o=Rr(),i=o===!0,d=Vr(n);let m;e[0]!==d||e[1]!==s?(m=eo(d,qo(s)),e[0]=d,e[1]=s,e[2]=m):m=e[2];const f=m,{org:p}=Jn(),{currentBranch:S,taskId:v}=Mt(),h=Ut().previewUrl;let b;e[3]!==S||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==n?(b=S?{orgSlug:p.slug,virtualMcpId:n,branch:S,threadId:v??null,previewUrl:h}:null,e[3]=S,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=n,e[8]=b):b=e[8];const y=Yn(b),g=S??"";let N;e[9]!==p.slug||e[10]!==g||e[11]!==n?(N={orgSlug:p.slug,virtualMcpId:n,branch:g},e[9]=p.slug,e[10]=g,e[11]=n,e[12]=N):N=e[12];let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E={holdsCopy:!0},e[13]=E):E=e[13];const{save:k,flush:P,hold:C}=yi(N,E),O=S??"";let R;e[14]!==p.slug||e[15]!==O||e[16]!==n?(R=zo({orgSlug:p.slug,virtualMcpId:n,branch:O}),e[14]=p.slug,e[15]=O,e[16]=n,e[17]=R):R=e[17];const A=Ko(R);let D;e[18]!==s||e[19]!==A?(D=A(s),e[18]=s,e[19]=A,e[20]=D):D=e[20];const _=D;let B;e[21]!==_||e[22]!==s?(B={pageKey:s,copyEpoch:_},e[21]=_,e[22]=s,e[23]=B):B=e[23];const[W,Z]=j.useState(B);(W.pageKey!==s||W.copyEpoch!==_)&&(Z({pageKey:s,copyEpoch:_}),C(s));const G=y.data?.[s],J=y.data===void 0&&y.isLoading||o===void 0,K=y.data!==void 0&&G===void 0,q=!S||K||J;let X;e[24]!==G?(X=G===void 0?"":JSON.stringify(G,null,2),e[24]=G,e[25]=X):X=e[25];const L=X;let M;e[26]!==s||e[27]!==q||e[28]!==k?(M=Q=>{if(q)return;let ne;try{ne=JSON.parse(Q)}catch{return}ne===null||typeof ne!="object"||Array.isArray(ne)||k(s,ne)},e[26]=s,e[27]=q,e[28]=k,e[29]=M):M=e[29];const U=M;let H;e[30]!==P?(H=()=>({flush:P}),e[30]=P,e[31]=H):H=e[31],j.useImperativeHandle(l,H);let F;e[32]!==f||e[33]!==i||e[34]!==a||e[35]!==c?(F=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:c("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx($e,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":c("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(di,{size:14})})]}),e[32]=f,e[33]=i,e[34]=a,e[35]=c,e[36]=F):F=e[36];let z;e[37]!==_||e[38]!==y.data||e[39]!==P||e[40]!==L||e[41]!==J||e[42]!==K||e[43]!==s||e[44]!==q||e[45]!==U||e[46]!==c?(z=J?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}):K?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",c("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(Io,{code:L,language:"json",readOnly:q,height:"100%",onChange:Q=>U(Q??""),onSave:Q=>{U(Q),P()}},`${s}:${y.data===void 0?"loading":"ready"}:${_}`)}),e[37]=_,e[38]=y.data,e[39]=P,e[40]=L,e[41]=J,e[42]=K,e[43]=s,e[44]=q,e[45]=U,e[46]=c,e[47]=z):z=e[47];let V;return e[48]!==F||e[49]!==z?(V=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[F,z]}),e[48]=F,e[49]=z,e[50]=V):V=e[50],V}function ua(t){return t.contentEditingEnabled&&!t.isMobile}function Qc(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Xc(t,e){return t==="blocks"?"preview":e?"blocks":t}function Zc(t){return ua({contentEditingEnabled:Zr(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function ed(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function td(t){const e=to(t),{display:n}=t;let s=null;if(n.mode==="production"&&n.iframeBase)try{s=new URL(t.path,n.iframeBase).href}catch{s=null}const a=no(s,e);return{value:e,frame:a?Hn(a,t.device):null,newTab:a}}function nd(t){const e=ue.c(94),{tests:n,load:s,onOpen:a,options:l,onChange:c,available:o}=t,i=Te();let d;e[0]!==l?(d=Wr(l),e[0]=l,e[1]=d):d=e[1];const m=d;let f;e[2]!==l.tests?(f=l.tests??{},e[2]=l.tests,e[3]=f):f=e[3];const p=f;let S;e[4]!==c||e[5]!==l?(S=I=>{const re=I?Vo(I):null,{at:ae,...ie}=l;c(re?{...ie,at:re}:ie)},e[4]=c,e[5]=l,e[6]=S):S=e[6];const v=S;let x;e[7]!==p||e[8]!==c||e[9]!==l?(x=(I,re)=>{const ae={...p};re==="on"?ae[I]=!0:re==="off"?ae[I]=!1:delete ae[I];const{tests:ie,...me}=l;c(Object.keys(ae).length>0?{...me,tests:ae}:me)},e[7]=p,e[8]=c,e[9]=l,e[10]=x):x=e[10];const h=x;let b;e[11]!==a?(b=I=>{I&&a?.()},e[11]=a,e[12]=b):b=e[12];let T;e[13]!==i?(T=i("sandbox.previewAs.label"),e[13]=i,e[14]=T):T=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=r.jsx(Di,{size:16}),e[15]=y):y=e[15];let g;e[16]!==m||e[17]!==T?(g=r.jsx(pt,{asChild:!0,children:r.jsx($r,{asChild:!0,children:r.jsx(Ze,{"aria-label":T,active:m,"data-testid":"preview-as-trigger",children:y})})}),e[16]=m,e[17]=T,e[18]=g):g=e[18];let N;e[19]!==i?(N=i("sandbox.previewAs.label"),e[19]=i,e[20]=N):N=e[20];let E;e[21]!==N?(E=r.jsx(mt,{children:N}),e[21]=N,e[22]=E):E=e[22];let k;e[23]!==E||e[24]!==g?(k=r.jsxs(ht,{children:[g,E]}),e[23]=E,e[24]=g,e[25]=k):k=e[25];let P;e[26]!==i?(P=i("sandbox.previewAs.label"),e[26]=i,e[27]=P):P=e[27];let C;e[28]!==P?(C=r.jsx("h3",{className:"text-sm font-medium",children:P}),e[28]=P,e[29]=C):C=e[29];let O;e[30]!==o||e[31]!==i?(O=i(o?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=o,e[31]=i,e[32]=O):O=e[32];let R;e[33]!==O?(R=r.jsx("p",{className:"text-xs text-muted-foreground",children:O}),e[33]=O,e[34]=R):R=e[34];let A;e[35]!==C||e[36]!==R?(A=r.jsxs("div",{className:"flex flex-col gap-1",children:[C,R]}),e[35]=C,e[36]=R,e[37]=A):A=e[37];let D;e[38]!==i?(D=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=D):D=e[39];let _;e[40]!==D?(_=r.jsx(Qo,{htmlFor:"preview-as-moment",children:D}),e[40]=D,e[41]=_):_=e[41];let B;e[42]!==l.at?(B=Ho(l.at),e[42]=l.at,e[43]=B):B=e[43];let W;e[44]!==v?(W=I=>v(I.target.value),e[44]=v,e[45]=W):W=e[45];let Z;e[46]!==B||e[47]!==W?(Z=r.jsx(Mn,{id:"preview-as-moment",type:"datetime-local",className:Wo,value:B,onChange:W}),e[46]=B,e[47]=W,e[48]=Z):Z=e[48];const G=l.at===void 0;let J;e[49]!==v?(J=()=>v(""),e[49]=v,e[50]=J):J=e[50];let K;e[51]!==i?(K=i("sandbox.previewAs.now"),e[51]=i,e[52]=K):K=e[52];let q;e[53]!==G||e[54]!==J||e[55]!==K?(q=r.jsx($e,{type:"button",variant:"ghost",size:"sm",disabled:G,onClick:J,children:K}),e[53]=G,e[54]=J,e[55]=K,e[56]=q):q=e[56];let X;e[57]!==Z||e[58]!==q?(X=r.jsxs("div",{className:"flex items-center gap-2",children:[Z,q]}),e[57]=Z,e[58]=q,e[59]=X):X=e[59];let L;e[60]!==i?(L=i("sandbox.previewAs.momentHint"),e[60]=i,e[61]=L):L=e[61];let M;e[62]!==L?(M=r.jsx("p",{className:"text-xs text-muted-foreground",children:L}),e[62]=L,e[63]=M):M=e[63];let U;e[64]!==_||e[65]!==X||e[66]!==M?(U=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,X,M]}),e[64]=_,e[65]=X,e[66]=M,e[67]=U):U=e[67];let H;e[68]!==i?(H=i("sandbox.previewAs.testsLabel"),e[68]=i,e[69]=H):H=e[69];let F;e[70]!==H?(F=r.jsx("span",{className:"text-sm font-medium",children:H}),e[70]=H,e[71]=F):F=e[71];let z;e[72]!==p||e[73]!==s||e[74]!==h||e[75]!==i||e[76]!==n?(z=s&&!s.ready?s.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsLoadFailed")}),r.jsx($e,{type:"button",variant:"outline",size:"sm",onClick:s.retry,children:i("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(gt,{className:"size-4 text-muted-foreground"})}):n.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(I=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:I}),r.jsxs(Xo,{type:"single",variant:"outline",size:"sm",value:p[I]===void 0?"":p[I]?"on":"off",onValueChange:re=>h(I,re),"aria-label":I,children:[r.jsx(ir,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(ir,{value:"on",children:i("sandbox.previewAs.on")})]})]},I))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=s,e[74]=h,e[75]=i,e[76]=n,e[77]=z):z=e[77];let V;e[78]!==F||e[79]!==z?(V=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[F,z]}),e[78]=F,e[79]=z,e[80]=V):V=e[80];let Q;e[81]!==m||e[82]!==c||e[83]!==i?(Q=m&&r.jsx($e,{type:"button",variant:"outline",size:"sm",onClick:()=>c({}),children:i("sandbox.previewAs.reset")}),e[81]=m,e[82]=c,e[83]=i,e[84]=Q):Q=e[84];let ne;e[85]!==A||e[86]!==U||e[87]!==V||e[88]!==Q?(ne=r.jsxs(Br,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[A,U,V,Q]}),e[85]=A,e[86]=U,e[87]=V,e[88]=Q,e[89]=ne):ne=e[89];let se;return e[90]!==k||e[91]!==ne||e[92]!==b?(se=r.jsxs(Mr,{onOpenChange:b,children:[k,ne]}),e[90]=k,e[91]=ne,e[92]=b,e[93]=se):se=e[93],se}const sd=15e3;function rd(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function br(t){return t.loading?{...t,loading:!1}:t}function ad(t,e){try{const n=new URL(t),s=new URL(e);return n.origin===s.origin&&n.pathname===s.pathname}catch{return!1}}function id(t,{base:e,frameSrc:n,loadedSrc:s,wanted:a,canSwap:l}){const c=t?.base===e?t:null,o=c?.src??n,i=c?.shown??n;return!a||!o||!i?null:i===a?c:l&&s===o&&ad(i,a)?{base:e,src:o,shown:a}:null}const od=["next"],ld=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],fa=new Set(["tsx","ts","jsx","js","mdx"]),cd=new Set(["tsx","jsx"]),dd=new Set(["404","500"]);function ud(t){const e=new Set;if(!t||typeof t!="object")return e;const n=t;for(const s of["dependencies","devDependencies"]){const a=n[s];if(a&&typeof a=="object"&&!Array.isArray(a))for(const l of Object.keys(a))e.add(l)}return e}function fd(t){const e=ud(t);return od.some(n=>e.has(n))?"next":ld.some(n=>e.has(n))?"tanstack":null}function pa(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function pd(t,e){const n=s=>pa(e,s);switch(t){case"next":return[{router:"next-pages",dir:n("pages"),pattern:"**/*"},{router:"next-pages",dir:n("src/pages"),pattern:"**/*"},{router:"next-app",dir:n("app"),pattern:"**/page.*"},{router:"next-app",dir:n("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:n("src/routes"),pattern:"**/*"}];default:{const s=t;throw new Error(`Unknown framework: ${String(s)}`)}}}function es(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function md(t){const e=es(t.at(-1)??"");if(!e||!fa.has(e[1]))return null;const[n]=e;if(n.includes("."))return null;const s=[...t.slice(0,-1),n];return s[0]==="api"||s.length===1&&dd.has(n)||s.some(a=>a.startsWith("_")||a.includes("["))?null:(s.at(-1)==="index"&&s.pop(),`/${s.join("/")}`)}function hd(t){const e=es(t.at(-1)??"");if(!e||e[0]!=="page"||!fa.has(e[1]))return null;const n=[];for(const s of t.slice(0,-1)){if(s.startsWith("_")||s.startsWith("@")||/^\(\.{1,3}\)/.test(s)||s.includes("["))return null;s.startsWith("(")&&s.endsWith(")")||n.push(s)}return`/${n.join("/")}`}function gd(t){const e=[];let n="",s=!1;for(const a of t)a==="["?s=!0:a==="]"&&(s=!1),a==="."&&!s?(e.push(n),n=""):n+=a;return e.push(n),e}function vd(t){const e=es(t.at(-1)??"");if(!e||!cd.has(e[1]))return null;const n=[...t.slice(0,-1),...gd(e[0])].filter(Boolean);n.at(-1)==="lazy"&&n.pop();const s=n.at(-1);if(!s||s==="__root"||n.some(l=>l.startsWith("-"))||s.startsWith("_"))return null;(s==="index"||s==="route")&&n.pop();const a=[];for(const l of n){if(l.includes("$"))return null;if(l.startsWith("_")||l.startsWith("(")&&l.endsWith(")"))continue;const c=l.replace(/_$/,"").replace(/[[\]]/g,"");c&&a.push(c)}return`/${a.join("/")}`}function xd(t,e){const n=e.split("/").filter(Boolean);if(n.length===0)return null;switch(t){case"next-pages":return md(n);case"next-app":return hd(n);case"tanstack":return vd(n);default:{const s=t;throw new Error(`Unknown router: ${String(s)}`)}}}function bd(t){const e=new Set;for(const{root:n,files:s}of t){const a=`${n.dir}/`;for(const l of s){if(!l.startsWith(a))continue;const c=xd(n.router,l.slice(a.length));c&&e.add(c)}}return[...e].sort((n,s)=>n==="/"?-1:s==="/"?1:n.localeCompare(s))}const wd=5e3,yd=6e4;async function kd(t,e){const n=await fetch(Zo(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:wd})});if(!n.ok)throw new Error(`Failed to list ${e.dir}: ${n.status}`);const s=await n.json();return Array.isArray(s.files)?s.files.filter(a=>typeof a=="string"):[]}async function Sd(t,e){const n=await so(t,pa(e,"package.json"));if(n.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const s=n.kind==="data"?fd(n.data):null;if(!s)return[];const a=pd(s,e),l=await Promise.all(a.map(async c=>({root:c,files:await kd(t,c)})));return bd(l)}function Pd(t,e,n){const s=ue.c(12);let a;s[0]!==e||s[1]!==t?(a=t?Gn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],s[0]=e,s[1]=t,s[2]=a):a=s[2];let l;s[3]!==e||s[4]!==t?(l=()=>t?Sd(t,e):[],s[3]=e,s[4]=t,s[5]=l):l=s[5];const c=n&&!!t;let o;s[6]!==a||s[7]!==l||s[8]!==c?(o={queryKey:a,queryFn:l,enabled:c,staleTime:yd},s[6]=a,s[7]=l,s[8]=c,s[9]=o):o=s[9];const i=Nr(o);let d;return s[10]!==i.data?(d=i.data??[],s[10]=i.data,s[11]=d):d=s[11],d}const jd=500,Ed={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},wr=1,ln=["desktop","mobile","tablet"],Nd=["preview","visual","blocks"],yr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Td(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function $t(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Bn(t,e){try{return new URL(t,e).href}catch{return null}}function Cd(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function Rd(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Ld(t,e,n){const s=t.toLowerCase(),a=e.toLowerCase(),l=a.split("/").filter(Boolean),c=i=>{if(i===n)return 100;const d=i.indexOf(n);if(d===-1)return 0;let m=40;return d===0?m+=30:/[\s/-]/.test(i[d-1]??"")&&(m+=20),m+=Math.round(n.length/i.length*20),m};let o=Math.max(c(s),c(a));return l.at(-1)===n?o=Math.max(o,95):l.includes(n)&&(o=Math.max(o,90)),o}function Ad(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function _d({virtualMcpId:t}){const e=Te(),n=Jr(),{currentBranch:s,taskId:a,virtualMcpId:l}=Mt(),c=!!Ti(),o=ea(),i=zi(l===t?t:null),d=Hr(t),m=el(i?.metadata?.ui?.layout??null),f=Zr(m),p=ua({contentEditingEnabled:f,isMobile:n}),[S]=j.useState(()=>Zc({cmsMode:m,isMobile:n})),[v,x]=Un(In.previewEditingMode(t),u=>u&&Nd.includes(u)?u:null),h=v??S,[b,T]=Un(In.previewDeviceSize(t),u=>u&&ln.includes(u)?u:"desktop"),[y,g]=j.useState(null),[N,E]=j.useState(null),k=j.useRef(null),P=j.useRef(null),[C,O]=j.useState(!1),R=j.useRef(null),A=()=>{R.current?.flush(),O(!1)},D=()=>O(u=>(u&&R.current?.flush(),!u)),[_,B]=j.useState({width:0,height:0}),[W,Z]=j.useState(!1),[G,J]=j.useState({}),[K,q]=j.useState(""),X=j.useRef(null),[L,M]=j.useState(!1),[U,H]=j.useState(),[F,z]=j.useState(null),[V,Q]=j.useState(null),[ne,se]=j.useState(null),[I,re]=j.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[ae,ie]=j.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[me,pe]=j.useState({}),[xe,he]=j.useState(!1),ve=j.useRef(null),Se=()=>{he(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>he(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),he(!1)},{org:le}=Jn(),Re=Xn(),Me=Ut(),Ue=Me.vmEntry,Be=Re.lifecycle.phase,{url:vt}=qr(t),ge=fn(t,s),{connection:_e}=Gr(t),be=Go(t),Ie=ro({hasServeConnection:!!_e,runtime:d.runtime}),Le=!Xe(ge)&&ge.kind!=="pending",ee=He(ge)??vt,ce=ee??Me.previewUrl,We=!!ee||Be==="running",xt=i?.id===t?Vi(i.metadata):null,qe=!ee&&i?.id===t&&d.runtime==="cms",It=d.projectDefault==="cms",bt=Le?ao({sandboxUrl:ce,previewServerUrl:xt,fastPreviewActive:qe}):null,ts=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,threadId:a??null,previewUrl:ce}:null,ns=Yn(ts,{fetchEnabled:We}),pn=Xr(ts,{fetchEnabled:We}),de=ns.data,Pe=pn.data,Ge=de?To(de,Pe).sort((u,w)=>u.name.localeCompare(w.name)):[],zt=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s}:null,ss=zc(zt),ma=io(zt),mn=de&&Pe?Co(de,Pe):[],rs=Le&&de&&Pe?ki(Pe,de,"loaders"):[],as=K?(()=>{const u=K.toLowerCase();return Ge.map(w=>({page:w,score:Ld(w.name,w.path,u)})).filter(({score:w})=>w>0).sort((w,$)=>$.score-w.score||w.page.path.length-$.page.path.length).map(({page:w})=>w)})():Ge,is=mn.filter(u=>{if(!K)return!0;const w=K.toLowerCase();return u.name.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),os=p?rs:[],ls=os.filter(u=>{if(!K)return!0;const w=K.toLowerCase();return u.title.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),Kt=V?rs.find(u=>u.key===V)??null:null,Ee=Qn,hn=F||V?null:Ro(Ge,I,ae),oe=hn?.key??null,tt=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,Ht=hn?.path??null,nt=(oe?me[oe]:void 0)??{},Ce=Ve(I,nt),gn={};if(Le&&We&&ce&&Pe&&de){const u=Si(Pe,"loaders"),w=oe?de[oe]:void 0,$=oc(w,de,ye=>u.has(ye)),te=nc($);for(const ye of Bt(I)){if(ye.type!=="param")continue;const Ne=Zl(I,ye.name,$),ot=ac(Ne,u,te);ot.length>0&&(gn[ye.name]=ot)}}const wt=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,threadId:a??null}:null,cs=de&&oe?$o(de,oe,0):[],ds=Xe(ge),us=de?Pi(cs,de,ds):[],yt=us.map(u=>u.isSavedBlock?u.label:""),kt=us.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),St=cs.map(u=>Vn(u,de??{},ds)),st=j.useRef(null),Oe=j.useRef(null),ha=Re.status.state==="paused",vn=Re.phase,fs=ji({claimPhase:vn,lifecycle:Re.lifecycle}),Je=Me.previewState,ga=Me.userStopped,va=oo(le.slug,t??""),{url:ze}=Fo(qe&&t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,previewServerUrl:xt??null,path:Ce}:null),xa=It&&d.runtime==="sandbox",Ae=lo(ge,Ie,be),ps=co(Ae&&qe&&ge.kind==="protocol"&&t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s}:null),ms=Ae?ps.pointer:null,Y=Cl({previewState:Je,progressStatus:fs.status,previewServerUrl:xt,fastPreviewActive:qe,fastPreviewReady:!!ze,codingSession:xa,localPreviewUrl:ee,hostedDraft:Ae,hostedPointerPending:Ae&&(ge.kind==="pending"||ps.pending)}),hs=Y.showWakingPill||Ae&&Y.mode==="production"&&!ms,Pt=Y.mode!=="none",ba=Y.mode==="production"&&Y.iframeBase?$t(Y.iframeBase):null,rt=Y.mode==="production"?ba:$t(ce),wa=i?.id===t&&i.metadata?.fastPreviewInPlace===!0,jt=Le?ee?Y.mode==="sandbox"&&p&&h==="blocks":Y.mode==="production"&&qe&&wa&&p&&h==="blocks":!1,gs=j.useRef(null),{pin:ya,effective:ka}=Cd(gs.current,{inPlaceRenderActive:jt,draftPreviewUrl:ze,resolvedPath:Ce});gs.current=ya;const vs=o.state.variantOverride??[],Vt=Le?vs:[],Et=Le?[]:vs,Wt=Xe(ge)&&Lo.some(u=>Ao(Pe,u)==="available"),at=Wt?G:{},xs=Wr(at),Sa=Wt&&de?Object.keys(_o(de).experiments):[],[bs,Pa]=j.useState(!1),ws=uo(zt,Wt&&bs?Oo:[]),ja={...ws,ready:!(ge.kind==="protocol"&&ge.hosted)||bs&&ws.ready},Ye=t?Js(le.slug,t):null,Ea=fo(Ye),qt=Ae?td({display:Y,path:Ce,pointer:ms,heldRevision:Ea,device:b,forcedVariants:Et,previewOptions:at}):null,ys=JSON.stringify([Et,at]);j.useEffect(()=>{if(!Ae||!Ye)return;const[u,w]=JSON.parse(ys);Ys(Ye,{forcedVariants:u,previewOptions:w})},[Ae,Ye,ys]),j.useEffect(()=>{if(!(!Ae||!Ye))return()=>Ys(Ye,null)},[Ae,Ye]);const xn=_e&&He(ge)?po(_e.endpoint,Et,xs):null,Na=_e&&He(ge)?xn?mo(xn,at):Qs:null,Qe=Td(Y.mode==="sandbox"?nn(Hn(Xs(ne??Bn(Ce,Y.iframeBase)??Y.iframeBase,Na),b),Vt):Y.mode==="production"&&qt?.frame?qt.frame:Y.mode==="production"?nn(Hn(Zs(er(Xs(ne??ka??Bn(Ce,Y.iframeBase)??Y.iframeBase,hs?Qs:null),Et),at),b),Vt):null),ks=ze??(Y.iframeBase?Bn(Ce,Y.iframeBase):null),Ss=Y.mode==="production"&&qt?qt.newTab:Y.mode==="production"?ks?nn(Zs(er(ks,Et),at),Vt):null:Qe??Y.iframeBase,Ta=()=>{const u=Ss;u&&window.open(u,"_blank","noopener")},Nt=t&&s?Ar(le.slug,t,s):null,Tt=u=>{Nt&&Ri(Nt,u)},ke=o.state.target;j.useEffect(()=>{if(!(!ke||!bt||!Pe))if(ke.kind==="page"){const u=me[ke.key]??{};Oe.current=Ve(ke.path,u),z(null),Q(null),se(null),ie(ke.key),re(ke.path),Tt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")Oe.current=null,z(null),Q(ke.key),se(null);else{const u=mn.find(w=>w.key===ke.key);if(u){Oe.current=null;const w=nr(Pe);Q(null),z(u),se(tr(bt,w,u.key))}}},[ke,bt,Pe,me]),j.useEffect(()=>{!oe||Ht===null||ke?.kind==="page"&&ke.key===oe&&ke.path===Ht||o.selectTarget({kind:"page",key:oe,path:Ht})},[oe,Ht,ke]);const[Ps,Ca]=j.useState(null);if(Je.kind==="iframe"&&Ps!==Je.previewUrl){const u=Ps!==null;Ca(Je.previewUrl);const w=Nt?Lr(Nt):null;if(w){if(Oe.current=Ve(w.path,w.params),re(w.path),ie(w.pageKey),se(null),z(null),Q(null),w.pageKey&&Object.keys(w.params).length>0){const $=w.pageKey;pe(te=>({...te,[$]:w.params}))}}else u&&(Oe.current=null,re("/"),se(null),ie(null),z(null),Q(null))}st.current=Qe;const Ra=Y.mode==="production"&&!!ze&&!ee,[Gt,bn]=j.useState({src:Qe??void 0,loading:!1}),[La,wn]=j.useState(!1),[Aa,_a]=j.useState(),[js,Es]=j.useState(null),je=id(js,{base:Y.iframeBase??"",frameSrc:Gt.src,loadedSrc:Aa,wanted:Qe??void 0,canSwap:be&&La&&!Gt.loading});je!==js&&Es(je);const Jt=rd(Gt,je?je.src:Qe??void 0,Ra);Jt!==Gt&&bn(Jt);const it=Jt.src,Ns=Jt.loading,Ts=_l({iframeRef:k,src:Y.mode==="sandbox"?Qe:null,active:Y.mode==="sandbox"}),Cs=j.useRef(null);j.useEffect(()=>{const u=Ns?setTimeout(()=>bn(br),sd):null,w=()=>{u&&clearTimeout(u)};if(!ze||!it||Cs.current===ze)return w;Cs.current=ze;const $=k.current;return $&&$.getAttribute("src")!==it&&(Se(),$.src=it),w},[ze,it,Ns]);const Rs=()=>{const u=k.current?.contentWindow,w=rt;if(!u||!w||!de||!oe)return;const $=de[oe];if(!$||typeof $!="object")return;const te=bo({previewBaseUrl:w,pageBlock:$,decofile:de,path:Ce,pathTemplate:I});if(!te)return;const ye=nn(te.src,yo(Vt,oe));u.postMessage({type:"cms-editor::render",src:ye,body:te.body},w)},yn=j.useRef(null);j.useEffect(()=>{if(!jt||F||V||!oe||!de){yn.current=null;return}const u={nav:JSON.stringify({page:oe,path:Ce,pathTemplate:I}),content:JSON.stringify(de)},w=Rd(yn.current,u);yn.current=u,w&&Rs()},[de,jt,F,V,oe,Ce,I]);const kn=j.useRef(null);j.useEffect(()=>{if(!jt||F||V||!oe||!de){kn.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),w=kn.current;kn.current={page:oe,sig:u},!(!w||w.page!==oe||w.sig===u)&&Rs()},[o.state.variantOverride,jt,F,V,oe]);const Ls=!!t&&!!s&&!Re.notFound&&!ga&&!ha&&(vn?.kind==="ready"||Be!=="idle"),As=!Xe(ge),Oa=Vr(t??void 0),Da=Pd(wt,Oa,As&&Ls),Fa=new Set(Ge.map(u=>Ee(u.path))),Yt=As?Da.filter(u=>!Fa.has(Ee(u))):[],_s=K?Yt.filter(u=>u.toLowerCase().includes(K.toLowerCase())):Yt,we=ed({editingMode:h,sandboxDisplay:Y.mode==="sandbox",blocksEditingEnabled:p});j.useEffect(()=>{const u=rt;if(!u)return;const w=$=>{if($.origin===u)if($.data?.type==="visual-editor::element-clicked"){const te=$l.safeParse($.data.payload);te.success&&g(te.data)}else if($.data?.type==="cms-editor::section-clicked"){const te=Ul.safeParse($.data.payload);te.success&&E({index:te.data.sectionIndex,seq:te.data.clickSeq})}else $.data?.type==="cms-editor::render-start"?Se():$.data?.type==="cms-editor::render-end"?(fe(),k.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:yt,kinds:kt,keys:St},u)):$.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",w),()=>window.removeEventListener("message",w)},[rt,yt,kt,St]);const Os=()=>{const u=k.current?.contentWindow,w=$t(ce),$=Mc({v8:be,script:Bl});!u||!w||!$||u.postMessage($,w)},$a=()=>{if(be)return;const u=k.current?.contentWindow,w=$t(ce);!u||!w||u.postMessage({type:"visual-editor::deactivate"},w)},Ds=()=>{const u=Ke.current;u?.has("wireframe")&&(u.wireframe({type:"wireframe:sections",labels:yt,kinds:kt,keys:St}),u.wireframe({type:we==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Sn=()=>{if(be){Ds();return}const u=k.current?.contentWindow,w=rt,$=Bc({v8:be,production:Y.mode==="production",localPreview:!!ee,script:Il});!u||!w||!$||(u.postMessage($,w),u.postMessage({type:"cms-editor::set-labels",labels:yt,kinds:kt,keys:St},w))},Ba=()=>{if(be){Ke.current?.wireframe({type:"wireframe:deactivate"});return}const u=k.current?.contentWindow,w=rt;!u||!w||u.postMessage({type:"cms-editor::deactivate"},w)},Ma=()=>{if(Ke.current?.wireframe({type:"wireframe:clear-hover"}),be)return;const u=k.current?.contentWindow,w=rt;!u||!w||(u.postMessage({type:"cms-editor::clear-hover"},w),u.postMessage({type:"visual-editor::clear-hover"},w))},Qt=u=>{if(u==="blocks"&&!p)return;const w=h;!n&&u!==w&&(u==="blocks"?P.current?.resize("30%"):P.current?.collapse()),x(u),g(null),E(null),u!=="blocks"&&Q(null),w==="visual"&&$a(),u==="visual"&&Os(),w==="blocks"&&u!=="blocks"&&Ba(),u==="blocks"&&Sn()},Ua=()=>{Qt(Qc(h,p))},Ia=()=>{Qt(Xc(h,p))},Xt=()=>{const u=k.current;if(!u)return;Se();const w=document.activeElement,$=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Ad(u,st.current);let te;const ye=()=>{clearTimeout(te),u.tabIndex=$,u.style.pointerEvents="";const Ne=document.activeElement;(!Ne||Ne===document.body||Ne===u)&&w?.focus(),u.removeEventListener("load",ye)};u.addEventListener("load",ye),te=setTimeout(ye,3e3)};Mo(Xt);const Ke=j.useRef(null),Fs=j.useEffectEvent(Ds),za=j.useEffectEvent((u,w)=>{E({index:u,seq:w})}),Ka=j.useEffectEvent(()=>{fe(),je&&(Pn.current=je.shown),Rt&&An(Ct)}),$s=j.useEffectEvent(()=>{if(wn(!1),je&&Es(null),je&&je.src!==st.current){Se();return}Xt()});j.useEffect(()=>{if(!be)return;const u=new Wl({studioOrigin:window.location.origin,build:"4.565.1",frame:()=>k.current?.contentWindow??null,onWireframeReady:()=>Fs(),onWireframe:$=>{$.type==="wireframe:select"&&za($.sectionIndex,$.clickSeq)},onModulesChange:()=>wn(u.has("html-swap")),onSwapEnd:()=>Ka(),onSwapFailed:()=>$s()});Ke.current=u;const w=$=>{u.handle($)};return window.addEventListener("message",w),()=>{window.removeEventListener("message",w),u.dispose(),wn(!1),Ke.current===u&&(Ke.current=null)}},[be,Y.iframeBase]);const Bs=be?JSON.stringify([yt,kt,St,we]):"";j.useEffect(()=>{Bs&&Fs()},[Bs]);const Ms=j.useRef(null);j.useEffect(()=>{const u=Ms.current;if(Ms.current=je,je&&je!==u){Ke.current?.refresh(je.shown)?Se():$s();return}!je&&u&&u.shown!==u.src&&u.src===st.current&&Xt()},[je]);const Us=()=>{Ke.current?.refresh()||Xt()},Ct=Js(le.slug,t??""),Rt=Ae&&Pt&&!!t,Pn=j.useRef(null);j.useEffect(()=>{if(Rt)return ho(Ct)},[Rt,Ct]);const{reload:Lt}=go(le.slug,t??""),Is=j.useRef(Lt.seq);j.useEffect(()=>{if(Is.current!==Lt.seq&&(Is.current=Lt.seq,!!Rt&&Pn.current===st.current)){if(Lt.navigates){An(Ct);return}Us()}},[Lt.seq]);const Ha=vo(zt),At=xo(He(ge)?Ha:""),zs=j.useRef(At);j.useEffect(()=>{const u=zs.current;if(zs.current=At,!u||!At||u===At)return;const w=k.current;if(w)return Fl({iframe:w,reload:Us})},[At]);const Va=()=>{const u=ln.indexOf(b);T(ln[(u+1)%ln.length])},jn=(u,w)=>{if(!oe)return;const $=oe,te={...nt,[u]:w};Oe.current=Ve(I,te),pe(ye=>({...ye,[$]:te})),Tt({path:I,pageKey:$,params:te})},Wa=Dc({iframeBase:Y.iframeBase,resolvedPath:Ce,activeGlobalSectionName:F?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),En=u=>{const w=me[u.key]??{},$=Ve(u.path,w);(F||Ee($)!==Ee(Ce))&&Se(),Oe.current=$,z(null),Q(null),se(null),E(null),ie(u.key),re(u.path),Tt({path:u.path,pageKey:u.key,params:w}),o.selectTarget({kind:"page",key:u.key,path:u.path})},Ks=u=>{(F||Ee(u)!==Ee(Ce))&&Se(),Oe.current=u,z(null),Q(null),se(null),E(null),ie(null),re(u),Tt({path:u,pageKey:null,params:{}})};Ci(Nt,Ks);const qa=u=>{if(Xe(ge)){const te=de?Do(de,u.key,Pe):null;te?En(te):dn.info(e("sandbox.preview.blockOnNoPage"));return}if(!bt||!Pe){dn.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),Oe.current=null;const w=nr(Pe),$=tr(bt,w,u.key);z(u),Q(null),se($),E(null),o.selectTarget({kind:"section",key:u.key})},Ga=u=>{p&&(z(null),Q(u.key),se(null),Qt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},Ja=async({name:u,path:w,templateKey:$})=>{if(!t||!s)return;const te=Qr(w);if(te){H(te);return}const ye=w.trim().startsWith("/")?w.trim():`/${w.trim()}`;if(Ge.some(Ne=>Ee(Ne.path)===Ee(ye))){H(e("sandbox.preview.pageAlreadyExists",{path:ye}));return}H(void 0);try{const Ne=$?await ma(de,$):void 0;if($&&!Ne){H(e("sandbox.preview.templateNoLongerExists"));return}const ot=await ss.mutateAsync({name:u,path:ye,template:Ne,schema:Xe(ge)?{meta:Pe,loadMeta:async()=>(await pn.refetch()).data}:void 0});M(!1),dn.success(e("sandbox.preview.pageCreated",{name:u})),await nl(jd),En({key:ot.key,name:ot.name,path:ot.path}),Qt("blocks")}catch(Ne){H(Ne instanceof da?e("sandbox.preview.pageSchemaNotReady"):Ne instanceof Error?Ne.message:e("sandbox.preview.failedToCreatePage"))}},Zt=Fc({previewSurfaceActive:Pt,daemonReady:Ls,production:Y.mode==="production",servePreviewUrl:He(ge)}),Ya=$c({showPreviewToolbar:Zt,contentEditingEnabled:f}),_t=()=>{Z(!1),q("")},Nn=F?.name??Kt?.title??hn?.name,Tn=ns.isPending||pn.isPending,Cn=Tn?$t(Y.iframeBase):Nn,Ot=F?`section:${F.key}`:V?`loader:${V}`:oe?`page:${oe}`:Yt.includes(Ee(I))?`route:${Ee(I)}`:void 0,Qa=Zt?Ya?r.jsxs(Mr,{open:W,onOpenChange:u=>{Z(u),u||q("")},children:[r.jsx($r,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:Tn?Cn??void 0:F||Kt?Nn:[Nn,I].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[F&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[r.jsx(Fi,{size:11}),e("sandbox.preview.globalBadge")]}),Kt&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[r.jsx($i,{size:11}),e("sandbox.preview.loaderBadge")]}),Cn&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:Cn}),!Tn&&!F&&!Kt&&r.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:I}),r.jsx(Li,{size:12,className:Fe("shrink-0 transition-transform",W&&"rotate-180")})]})})}),r.jsxs(Br,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(Ir,{shouldFilter:!1,defaultValue:Ot,children:[r.jsx(zr,{value:K,onValueChange:u=>{q(u),X.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Ur,{ref:X,className:"max-h-80",children:[r.jsx(Kr,{children:Ge.length===0&&Yt.length===0&&mn.length===0&&os.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),as.length>0&&r.jsx(dt,{children:as.map(u=>r.jsxs(ut,{value:`page:${u.key}`,"aria-current":Ot===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{_t(),En(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),_s.length>0&&r.jsx(dt,{heading:e("sandbox.preview.siteRoutes"),children:_s.map(u=>r.jsx(ut,{value:`route:${u}`,"aria-current":Ot===`route:${u}`||void 0,title:u,onSelect:()=>{_t(),Ks(u)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:u})},u))}),is.length>0&&r.jsx(dt,{heading:e("sandbox.preview.globalComponents"),children:is.map(u=>r.jsx(ut,{value:`section:${u.key}`,"aria-current":Ot===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{_t(),qa(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),ls.length>0&&r.jsx(dt,{heading:e("sandbox.preview.globalLoaders"),children:ls.map(u=>r.jsx(ut,{value:`loader:${u.key}`,"aria-current":Ot===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{_t(),Ga(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!F&&!V&&Bt(I).some(u=>u.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Bt(I).map((u,w)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${w}`);const $=gn[u.name];return $&&wt?r.jsx(kc,{sources:$,template:I,paramName:u.name,value:nt[u.name]??"",sandboxRef:wt,onCommit:te=>jn(u.name,te)},`${oe}:${u.name}`):r.jsx(_c,{name:u.name,value:nt[u.name]??"",onCommit:te=>jn(u.name,te)},`${oe}:${u.name}`)})}),r.jsx("div",{className:"border-t p-1.5",children:r.jsxs($e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{_t(),H(void 0),M(!0)},children:[r.jsx(Fr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Wa}):null,Hs=Zt||f?r.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:Va,"aria-label":e(yr[b]),children:b==="mobile"?r.jsx(Or,{size:16}):b==="tablet"?r.jsx(Bi,{size:16}):r.jsx(Dr,{size:16})})}),r.jsx(mt,{children:e(yr[b])})]}),Qa,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Wt&&r.jsx(nd,{tests:Sa,load:ja,onOpen:()=>Pa(!0),options:G,onChange:u=>{J(u),o.previewAsChanged()},available:!!xn||!hs||!xs}),r.jsx(Ze,{onClick:Ta,disabled:Ae&&!Ss,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Tr,{size:16})})]})]}):null,Xa=(Le||c)&&Y.mode==="sandbox",en=Ed[b],tn=b==="desktop"&&(_.width===0||_.width>=en.width+2*wr),Vs=tn?1:Math.min(_.width>0?_.width/(en.width+2*wr):1,1),Za=tn?{width:"100%",height:"100%"}:{width:`${en.width}px`,height:_.height>0?`${_.height/Vs}px`:`${en.height}px`,transform:`scale(${Vs})`,transformOrigin:"top center"},Ws=r.jsxs(r.Fragment,{children:[Xa&&(Zt||f)&&r.jsx(Ze,{onClick:Ua,"aria-pressed":we==="visual","aria-label":e("sandbox.preview.visualEditor"),active:we==="visual",children:r.jsx(Gs,{size:16})}),p&&r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:Ia,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:r.jsx(Ui,{size:16})})}),r.jsx(mt,{children:e("sandbox.preview.blocksEditor")})]}),tt&&r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:D,"aria-pressed":C,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:C,children:r.jsx(Mi,{size:16})})}),r.jsx(mt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ei=!!V&&we==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(gn).map(([u,w])=>(nt[u]??"")===""?r.jsx(Lc,{sources:w,template:I,paramName:u,sandboxRef:wt,onFill:$=>jn(u,$)},`${oe}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(zn.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Hs}),children:Hs}),r.jsx(zn.Toolbar.Right.Portal,{fallback:Ws,children:Ws})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:ei?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(vr,{virtualMcpId:t,externalSelection:N,onViewJsonFile:D}),C&&tt&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(xr,{ref:R,virtualMcpId:t,pageKey:tt,onClose:A})})]}):r.jsxs(sr,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[r.jsx(sn,{ref:P,id:"preview-blocks-editor",defaultSize:we==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:we==="blocks"&&r.jsx(vr,{virtualMcpId:t,externalSelection:N,onViewJsonFile:D})}),we==="blocks"&&r.jsx(rr,{withHandle:!0}),r.jsx(sn,{id:"preview-canvas",defaultSize:we==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(sr,{orientation:"horizontal",disabled:!(C&&tt),children:[r.jsx(sn,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:u=>{if(!u)return;const w=()=>B(te=>te.width===u.clientWidth&&te.height===u.clientHeight?te:{width:u.clientWidth,height:u.clientHeight});w();const $=new ResizeObserver(w);return $.observe(u),()=>$.disconnect()},className:Fe("h-full relative overflow-clip flex justify-center",Pt&&!tn&&"bg-muted/30"),children:[(xe||va)&&Pt&&r.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:r.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),Y.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}),Y.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"starting",progress:fs,claimPhase:vn})}),!ee&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"suspended",onResume:Me.resume})}),!ee&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"errored",error:Je.error,onRetry:Me.retry,connectionsHref:`/${le.slug}/settings/connections`})}),Y.showWakingPill&&r.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[r.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),we==="visual"&&!y&&r.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[r.jsx(Gs,{size:12}),e("sandbox.preview.clickElementToAsk")]}),we==="visual"&&y&&r.jsx(Yl,{element:y,onDismiss:()=>g(null)}),Pt&&Qe&&r.jsx("div",{className:Fe("shrink-0",!tn&&"bg-background shadow-edge"),style:Za,onMouseLeave:Ma,children:r.jsx("iframe",{ref:k,src:it,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Ts.handleError,onLoad:()=>{if(bn(br),_a(it),Ts.handleLoad(),fe(),Pn.current=st.current,Rt&&An(Ct),Y.mode!=="sandbox"||ee){(Y.mode==="production"&&!Y.showWakingPill||ee)&&we==="blocks"&&Sn();return}if(ui("vm_preview_loaded",{view_mode:we,vm_id:Ue?.sandboxHandle??null}),!F)try{const u=k.current?.contentWindow?.location?.pathname;if(!u)return;const w=Oe.current;if(w!==null&&(Oe.current=null,Ee(u)!==Ee(w))||Ee(u)===Ee(Ce))return;re(u),Tt({path:u,pageKey:ae,params:nt})}catch{}we==="visual"&&Os(),we==="blocks"&&Sn()}},Y.iframeBase)})]})}),C&&tt&&r.jsxs(r.Fragment,{children:[r.jsx(rr,{withHandle:!0}),r.jsx(sn,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(xr,{ref:R,virtualMcpId:t,pageKey:tt,onClose:A})})]})]})})]})}),r.jsx(Kc,{open:L,onOpenChange:M,isPending:ss.isPending,error:U,templates:Ge,onSubmit:Ja})]})}const qn={app:null,split:!1};function Od(t){const e=ue.c(24),{project:n,maxApps:s,children:a}=t,l=Te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={silent:!0},e[0]=c):c=e[0];const o=Ki(c),i=Ut();let d;e[1]!==n.metadata.runtime?(d=n.metadata.runtime??{},e[1]=n.metadata.runtime,e[2]=d):d=e[2];const m=d;let f;e[3]!==m.apps?(f=m.apps??[],e[3]=m.apps,e[4]=f):f=e[4];const p=f;let S;e[5]!==o.update||e[6]!==i||e[7]!==n.id||e[8]!==n.metadata||e[9]!==m||e[10]!==l?(S=y=>o.update.mutate({id:n.id,data:{metadata:{...sl(n.metadata),runtime:{...m,apps:y.length?y:null}}}},{onSuccess:()=>i.start(),onError:()=>dn.error(l("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=n.id,e[8]=n.metadata,e[9]=m,e[10]=l,e[11]=S):S=e[11];const v=S,x=m.path??null;let h,b;e[12]!==p||e[13]!==v?(h=y=>v([...p,{path:y}]),b=y=>v(p.filter(g=>g.path!==y)),e[12]=p,e[13]=v,e[14]=h,e[15]=b):(h=e[14],b=e[15]);let T;return e[16]!==p||e[17]!==a||e[18]!==s||e[19]!==n.id||e[20]!==x||e[21]!==h||e[22]!==b?(T=r.jsx(Dd,{virtualMcpId:n.id,mainPath:x,apps:p,maxApps:s,onAddApp:h,onRemoveApp:b,children:a}),e[16]=p,e[17]=a,e[18]=s,e[19]=n.id,e[20]=x,e[21]=h,e[22]=b,e[23]=T):T=e[23],T}function Dd(t){const e=ue.c(102),{virtualMcpId:n,mainPath:s,apps:a,maxApps:l,onAddApp:c,onRemoveApp:o,children:i}=t,d=Te(),m=Jr(),{currentBranch:f}=Mt(),p=Ut(),S=Xn().lifecycle.phase,v=fn(n,f),{url:x}=qr(n);let h;e[0]!==v||e[1]!==x?(h=He(v)??x,e[0]=v,e[1]=x,e[2]=h):h=e[2];const b=h,T=b??p.previewUrl,y=!!b||S==="running",g=!y&&p.status==="errored";let N;e[3]!==p.vmEntry?.startedWith?.apps?(N=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=N):N=e[4];const E=N;let k;e[5]!==n?(k=In.previewAppLayout(n),e[5]=n,e[6]=k):k=e[6];const[P,C]=Un(k,Fd);let O;e[7]!==a||e[8]!==P?(O=a.some(fe=>fe.path===P.app)?P.app:null,e[7]=a,e[8]=P,e[9]=O):O=e[9];const R=O,A=R!==null&&P.split&&!m,D=R===null||A,_=R??a[0]?.path??null,[B,W]=j.useState(null),[Z,G]=j.useState(!1);let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{W(null),G(!1)},e[10]=J):J=e[10];const K=J;let q;e[11]!==a||e[12]!==B||e[13]!==m||e[14]!==s||e[15]!==c||e[16]!==C?(q=()=>{if(B===null)return;const fe=or(B);if(!fe){K();return}if(fe===or(s??"")||a.some(le=>le.path===fe)){G(!0);return}c(fe),C({app:fe,split:!m}),K()},e[11]=a,e[12]=B,e[13]=m,e[14]=s,e[15]=c,e[16]=C,e[17]=q):q=e[17];const X=q;let L;e[18]!==s||e[19]!==d?(L=s?_n(s):d("sandbox.appTabs.root"),e[18]=s,e[19]=d,e[20]=L):L=e[20];const M=L;let U;e[21]!==A||e[22]!==d?(U=d(A?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=A,e[22]=d,e[23]=U):U=e[23];const H=U;let F;e[24]!==d?(F=d("sandbox.appTabs.label"),e[24]=d,e[25]=F):F=e[25];let z;e[26]!==d?(z=d("sandbox.appTabs.main"),e[26]=d,e[27]=z):z=e[27];let V;e[28]!==d?(V=d("sandbox.appTabs.mainHint"),e[28]=d,e[29]=V):V=e[29];let Q;e[30]!==C?(Q=()=>C(qn),e[30]=C,e[31]=Q):Q=e[31];let ne;e[32]!==g||e[33]!==M||e[34]!==y||e[35]!==D||e[36]!==z||e[37]!==V||e[38]!==Q?(ne=r.jsx(kr,{label:M,badge:z,hint:V,ready:y,failed:g,onScreen:D,onSelect:Q}),e[32]=g,e[33]=M,e[34]=y,e[35]=D,e[36]=z,e[37]=V,e[38]=Q,e[39]=ne):ne=e[39];let se;if(e[40]!==a||e[41]!==R||e[42]!==g||e[43]!==M||e[44]!==o||e[45]!==y||e[46]!==C||e[47]!==A||e[48]!==d){let fe;e[50]!==R||e[51]!==g||e[52]!==M||e[53]!==o||e[54]!==y||e[55]!==C||e[56]!==A||e[57]!==d?(fe=le=>{const Re=_n(le.path);return r.jsx(kr,{label:Re,hint:d("sandbox.appTabs.extraHint",{app:M}),ready:y,failed:g,onScreen:le.path===R,onSelect:()=>C({app:le.path,split:A}),onRemove:()=>o(le.path),removeLabel:d("sandbox.appTabs.remove",{app:Re})},le.path)},e[50]=R,e[51]=g,e[52]=M,e[53]=o,e[54]=y,e[55]=C,e[56]=A,e[57]=d,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=R,e[42]=g,e[43]=M,e[44]=o,e[45]=y,e[46]=C,e[47]=A,e[48]=d,e[49]=se}else se=e[49];let I;e[59]!==ne||e[60]!==se||e[61]!==F?(I=r.jsxs("div",{role:"tablist","aria-label":F,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[ne,se]}),e[59]=ne,e[60]=se,e[61]=F,e[62]=I):I=e[62];let re;e[63]!==a.length||e[64]!==X||e[65]!==B||e[66]!==Z||e[67]!==l||e[68]!==d?(re=B!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),X()},children:r.jsx("input",{autoFocus:!0,value:B,placeholder:"apps/checkout","aria-label":d("sandbox.appTabs.pathLabel"),"aria-invalid":Z,onChange:fe=>{W(fe.target.value),G(!1)},onBlur:K,onKeyDown:fe=>{fe.key==="Escape"&&K()},className:Fe("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",Z?"border-destructive":"border-border")})}):a.length<l&&r.jsx(ft,{label:d("sandbox.appTabs.add"),onClick:()=>W(""),children:r.jsx(Fr,{})}),e[63]=a.length,e[64]=X,e[65]=B,e[66]=Z,e[67]=l,e[68]=d,e[69]=re):re=e[69];let ae;e[70]!==m||e[71]!==C||e[72]!==A||e[73]!==H||e[74]!==_?(ae=!m&&_&&r.jsx(ft,{label:H,active:A,onClick:()=>C(A?qn:{app:_,split:!0}),children:r.jsx(Ii,{})}),e[70]=m,e[71]=C,e[72]=A,e[73]=H,e[74]=_,e[75]=ae):ae=e[75];let ie;e[76]!==I||e[77]!==re||e[78]!==ae?(ie=r.jsxs(r.Fragment,{children:[I,re,ae]}),e[76]=I,e[77]=re,e[78]=ae,e[79]=ie):ie=e[79];const me=ie;let pe;e[80]!==me?(pe=r.jsx(zn.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:me}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:me})}),e[80]=me,e[81]=pe):pe=e[81];let xe;e[82]!==i||e[83]!==D?(xe=D&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=D,e[84]=xe):xe=e[84];let he;e[85]!==R||e[86]!==g||e[87]!==p.start||e[88]!==b||e[89]!==M||e[90]!==T||e[91]!==y||e[92]!==C||e[93]!==A||e[94]!==E?(he=R!==null&&r.jsx($d,{name:_n(R),mainName:M,appUrl:T?rl(T,R):null,ready:y,failed:g,notStarted:!b&&!E.includes(R),onStart:p.start,className:Fe(A&&"border-l border-border"),onClose:A?()=>C({app:R,split:!1}):void 0},R),e[85]=R,e[86]=g,e[87]=p.start,e[88]=b,e[89]=M,e[90]=T,e[91]=y,e[92]=C,e[93]=A,e[94]=E,e[95]=he):he=e[95];let ve;e[96]!==xe||e[97]!==he?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[xe,he]}),e[96]=xe,e[97]=he,e[98]=ve):ve=e[98];let Se;return e[99]!==pe||e[100]!==ve?(Se=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Se):Se=e[101],Se}function Fd(t){return t??qn}function kr(t){const e=ue.c(28),{label:n,badge:s,hint:a,ready:l,failed:c,onScreen:o,onSelect:i,onRemove:d,removeLabel:m}=t,f=o?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let p;e[0]!==f?(p=Fe("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",f),e[0]=f,e[1]=p):p=e[1];const S=l?"bg-success":c?"bg-destructive":"animate-pulse bg-warning";let v;e[2]!==S?(v=Fe("size-1.5 rounded-full",S),e[2]=S,e[3]=v):v=e[3];let x;e[4]!==v?(x=r.jsx("span",{"aria-hidden":!0,className:v}),e[4]=v,e[5]=x):x=e[5];let h;e[6]!==n?(h=r.jsx("span",{className:"max-w-40 truncate",children:n}),e[6]=n,e[7]=h):h=e[7];let b;e[8]!==s?(b=s&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),e[8]=s,e[9]=b):b=e[9];let T;e[10]!==o||e[11]!==i||e[12]!==x||e[13]!==h||e[14]!==b?(T=r.jsx(pt,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:i,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[x,h,b]})}),e[10]=o,e[11]=i,e[12]=x,e[13]=h,e[14]=b,e[15]=T):T=e[15];let y;e[16]!==a?(y=r.jsx(mt,{className:"max-w-64",children:a}),e[16]=a,e[17]=y):y=e[17];let g;e[18]!==T||e[19]!==y?(g=r.jsxs(ht,{children:[T,y]}),e[18]=T,e[19]=y,e[20]=g):g=e[20];let N;e[21]!==d||e[22]!==m?(N=d&&r.jsx("button",{type:"button","aria-label":m,onClick:d,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(na,{className:"size-3"})}),e[21]=d,e[22]=m,e[23]=N):N=e[23];let E;return e[24]!==g||e[25]!==N||e[26]!==p?(E=r.jsxs("div",{className:p,children:[g,N]}),e[24]=g,e[25]=N,e[26]=p,e[27]=E):E=e[27],E}function $d(t){const e=ue.c(71),{name:n,mainName:s,appUrl:a,ready:l,failed:c,notStarted:o,onStart:i,className:d,onClose:m}=t,f=Te(),[p,S]=j.useState("/"),[v,x]=j.useState("desktop"),[h,b]=j.useState(0),T=j.useRef(null);let y;e[0]!==a||e[1]!==p?(y=a?al(a,p):null,e[0]=a,e[1]=p,e[2]=y):y=e[2];const g=y;let N;e[3]!==d?(N=Fe("flex min-h-0 min-w-0 flex-1 flex-col",d),e[3]=d,e[4]=N):N=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=V=>{V.preventDefault(),S(T.current?.value||"/")},e[5]=E):E=e[5];let k;e[6]!==n||e[7]!==f?(k=f("sandbox.appPane.path",{app:n}),e[6]=n,e[7]=f,e[8]=k):k=e[8];let P;e[9]!==p||e[10]!==k?(P=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:E,children:r.jsx("input",{ref:T,defaultValue:p,"aria-label":k,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=p,e[10]=k,e[11]=P):P=e[11];let C;e[12]!==v||e[13]!==f?(C=f(v==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=v,e[13]=f,e[14]=C):C=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=()=>x(Md),e[15]=O):O=e[15];let R;e[16]!==v?(R=v==="desktop"?r.jsx(Dr,{}):r.jsx(Or,{}),e[16]=v,e[17]=R):R=e[17];let A;e[18]!==C||e[19]!==R?(A=r.jsx(ft,{label:C,onClick:O,children:R}),e[18]=C,e[19]=R,e[20]=A):A=e[20];let D;e[21]!==n||e[22]!==f?(D=f("sandbox.appPane.reload",{app:n}),e[21]=n,e[22]=f,e[23]=D):D=e[23];const _=!g||!l;let B,W;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=()=>b(Bd),W=r.jsx(fi,{}),e[24]=B,e[25]=W):(B=e[24],W=e[25]);let Z;e[26]!==D||e[27]!==_?(Z=r.jsx(ft,{label:D,disabled:_,onClick:B,children:W}),e[26]=D,e[27]=_,e[28]=Z):Z=e[28];let G;e[29]!==n||e[30]!==f?(G=f("sandbox.appPane.openInNewTab",{app:n}),e[29]=n,e[30]=f,e[31]=G):G=e[31];const J=!g||!l;let K;e[32]!==g?(K=()=>g&&window.open(g,"_blank","noopener"),e[32]=g,e[33]=K):K=e[33];let q;e[34]===Symbol.for("react.memo_cache_sentinel")?(q=r.jsx(Tr,{}),e[34]=q):q=e[34];let X;e[35]!==G||e[36]!==J||e[37]!==K?(X=r.jsx(ft,{label:G,disabled:J,onClick:K,children:q}),e[35]=G,e[36]=J,e[37]=K,e[38]=X):X=e[38];let L;e[39]!==n||e[40]!==m||e[41]!==f?(L=m&&r.jsx(ft,{label:f("sandbox.appPane.close",{app:n}),onClick:m,children:r.jsx(na,{})}),e[39]=n,e[40]=m,e[41]=f,e[42]=L):L=e[42];let M;e[43]!==Z||e[44]!==X||e[45]!==L||e[46]!==P||e[47]!==A?(M=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[P,A,Z,X,L]}),e[43]=Z,e[44]=X,e[45]=L,e[46]=P,e[47]=A,e[48]=M):M=e[48];let U;e[49]!==s||e[50]!==f?(U=f("sandbox.appPane.previewOnly",{app:s}),e[49]=s,e[50]=f,e[51]=U):U=e[51];let H;e[52]!==U?(H=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:U}),e[52]=U,e[53]=H):H=e[53];let F;e[54]!==v||e[55]!==c||e[56]!==s||e[57]!==n||e[58]!==o||e[59]!==i||e[60]!==l||e[61]!==h||e[62]!==g||e[63]!==f?(F=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:l&&o?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:f("sandbox.appPane.notStarted",{app:n})}),r.jsx($e,{size:"sm",variant:"outline",onClick:i,children:f("sandbox.appPane.start",{app:n})})]}):!l||!g?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:l?f("sandbox.appPane.noUrl"):c?f("sandbox.appPane.failed",{app:s}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:g,title:n,className:Fe("h-full bg-background",v==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${g}#${h}`)}),e[54]=v,e[55]=c,e[56]=s,e[57]=n,e[58]=o,e[59]=i,e[60]=l,e[61]=h,e[62]=g,e[63]=f,e[64]=F):F=e[64];let z;return e[65]!==n||e[66]!==N||e[67]!==M||e[68]!==H||e[69]!==F?(z=r.jsxs("section",{"aria-label":n,className:N,children:[M,H,F]}),e[65]=n,e[66]=N,e[67]=M,e[68]=H,e[69]=F,e[70]=z):z=e[70],z}function Bd(t){return t+1}function Md(t){return t==="desktop"?"mobile":"desktop"}function ft(t){const e=ue.c(11),{label:n,children:s,active:a,disabled:l,onClick:c}=t;let o;e[0]!==a||e[1]!==s||e[2]!==l||e[3]!==n||e[4]!==c?(o=r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{"aria-label":n,"aria-pressed":a,active:a,disabled:l,onClick:c,children:s})}),e[0]=a,e[1]=s,e[2]=l,e[3]=n,e[4]=c,e[5]=o):o=e[5];let i;e[6]!==n?(i=r.jsx(mt,{children:n}),e[6]=n,e[7]=i):i=e[7];let d;return e[8]!==o||e[9]!==i?(d=r.jsxs(ht,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=d):d=e[10],d}const Ud=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Id=1e4,zd=1e4,Kd=5e3,Hd=2;function Vd(t,e){return t&&e===0?zd:Math.min(1e3*2**Math.max(0,e-1),Kd)}function Wd(t,e,n){return e?!0:t===!0&&n<Hd}function qd(t,e){const n=ue.c(11),s=Ud,a=pi();let l;n[0]!==t?(l=Gn.localAppReachable(t??""),n[0]=t,n[1]=l):l=n[1];const c=l;let o;n[2]!==s||n[3]!==a||n[4]!==c||n[5]!==t?(o=async f=>{const{signal:p}=f,S=new AbortController,v=()=>S.abort();p.addEventListener("abort",v);const x=setTimeout(v,Id),h=await s(t,S.signal).catch(Jd);clearTimeout(x),p.removeEventListener("abort",v);const b=a.getQueryData(c),T=h?0:(b?.failures??0)+1;return{up:Wd(b?.up??null,h,T),failures:T}},n[2]=s,n[3]=a,n[4]=c,n[5]=t,n[6]=o):o=n[6];const i=!!t;let d;n[7]!==c||n[8]!==o||n[9]!==i?(d={queryKey:c,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:Gd},n[7]=c,n[8]=o,n[9]=i,n[10]=d):d=n[10];const{data:m}=Nr(d);return t?m?.up??null:null}function Gd(t){return t.state.data?Vd(t.state.data.up,t.state.data.failures):!1}function Jd(){return!1}function Yd(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Gu(t){const e=ue.c(53),{virtualMcpId:n}=t,s=Te(),a=Hi(n),{connection:l}=Gr(n),{activeTask:c,taskId:o,currentBranch:i}=Mt(),d=pl(o),[m,f]=j.useState(!1),p=fn(n,i);let S;e[0]!==p||e[1]!==l?(S=l?He(p):null,e[0]=p,e[1]=l,e[2]=S):S=e[2];const v=S,x=qd(v),h=ra(),b=il("multi_app_preview");if(cl({threadId:o,sandboxBranch:c?.branch??i,agentHasRepo:On(a?.metadata),threadHasRepo:On(d)||On(c?.metadata)})==="none"&&!l){let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx(lr,{className:"size-7 text-foreground"})}),e[3]=E):E=e[3];let k;e[4]!==s?(k=s("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=s,e[5]=k):k=e[5];let P;e[6]!==s?(P=s("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=s,e[7]=P):P=e[7];let C,O;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=()=>f(!0),O=r.jsx(lr,{className:"size-4"}),e[8]=C,e[9]=O):(C=e[8],O=e[9]);let R;e[10]!==s?(R=s("mainPanelTabs.previewTab.connectGithub"),e[10]=s,e[11]=R):R=e[11];let A;e[12]!==R?(A=r.jsxs($e,{onClick:C,children:[O,R]}),e[12]=R,e[13]=A):A=e[13];let D;e[14]!==k||e[15]!==P||e[16]!==A?(D=r.jsx(ol,{className:"h-full",image:E,title:k,description:P,actions:A}),e[14]=k,e[15]=P,e[16]=A,e[17]=D):D=e[17];let _;e[18]!==m?(_=r.jsx(ll,{open:m,onOpenChange:f,mode:"agent"}),e[18]=m,e[19]=_):_=e[19];let B;return e[20]!==_||e[21]!==D?(B=r.jsxs(r.Fragment,{children:[D,_]}),e[20]=_,e[21]=D,e[22]=B):B=e[22],B}if(l&&a&&!He(p)){let E;e[23]!==h||e[24]!==p?(E=Yd({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=E):E=e[25];let k;e[26]!==l.endpoint?(k=wo(l.endpoint),e[26]=l.endpoint,e[27]=k):k=e[27];let P;return e[28]!==E||e[29]!==k?(P=r.jsx(Xd,{status:E,host:k}),e[28]=E,e[29]=k,e[30]=P):P=e[30],P}if(v&&x!==!0){let E;e[31]!==s?(E=s("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=s,e[32]=E):E=e[32];let k;e[33]!==v||e[34]!==s?(k=s("mainPanelTabs.previewTab.localAppWaiting.body",{host:Qd(v)}),e[33]=v,e[34]=s,e[35]=k):k=e[35];let P;e[36]!==k?(P=r.jsx(ta,{text:k}),e[36]=k,e[37]=P):P=e[37];let C;e[38]!==s?(C=s("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=s,e[39]=C):C=e[39];let O;e[40]!==C?(O=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:C}),e[40]=C,e[41]=O):O=e[41];let R;return e[42]!==E||e[43]!==P||e[44]!==O?(R=r.jsx(un,{headingLevel:2,waiting:!0,title:E,lead:P,footer:O}),e[42]=E,e[43]=P,e[44]=O,e[45]=R):R=e[45],R}let y;e[46]!==n?(y=r.jsx(_d,{virtualMcpId:n}),e[46]=n,e[47]=y):y=e[47];const g=y;let N;return e[48]!==a||e[49]!==b||e[50]!==g||e[51]!==l?(N=r.jsx(Ei,{children:b&&a&&!l?r.jsx(Od,{project:a,maxApps:tl,children:g}):g}),e[48]=a,e[49]=b,e[50]=g,e[51]=l,e[52]=N):N=e[52],N}function Qd(t){try{return new URL(t).host}catch{return t}}function Xd(t){const e=ue.c(13),{status:n,host:s}=t,a=Te();if(n.kind==="connected"){let o;e[0]!==a?(o=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=o):o=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=i):i=e[3];let d;return e[4]!==o||e[5]!==i?(d=r.jsx(un,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=d):d=e[6],d}let l;e[7]!==s||e[8]!==n?(l=xl(n,s),e[7]=s,e[8]=n,e[9]=l):l=e[9];let c;return e[10]!==s||e[11]!==l?(c=r.jsx(vl,{wait:l,hosts:s}),e[10]=s,e[11]=l,e[12]=c):c=e[12],c}export{vl as L,Gu as P,un as S,qu as u};
|