decocms 4.562.0 → 4.563.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BMgOinVw.js → AlertCircle-2LbzMVC9.js} +1 -1
- package/dist/client/assets/{AreaChart-BcZi16Vr.js → AreaChart-qBz2MFzD.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BJMjlG4g.js → ArrowLeft-BeuQwyHa.js} +1 -1
- package/dist/client/assets/{ArrowUp-DcJMRdNb.js → ArrowUp-DmxAfWhF.js} +1 -1
- package/dist/client/assets/{CartesianChart-C8LrSJIS.js → CartesianChart-BSwxZ1ZU.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CUR_9ZiJ.js → CategoricalChart-DVdTZlRq.js} +1 -1
- package/dist/client/assets/{CheckCircle-By2z0uOx.js → CheckCircle-BzNTGMCW.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BTg7xsL3.js → ChevronSelectorVertical-XdbRnSsi.js} +1 -1
- package/dist/client/assets/{ChevronUp-BCfBdjs4.js → ChevronUp-aYmfXYet.js} +1 -1
- package/dist/client/assets/{CreditCard01-kxqKIkVq.js → CreditCard01-yFcUZGe-.js} +1 -1
- package/dist/client/assets/{Globe04-ri2PR4JW.js → Globe04-RPMmcIuy.js} +1 -1
- package/dist/client/assets/{Key01-By4BziN_.js → Key01-jvDltRrN.js} +1 -1
- package/dist/client/assets/{LinkBroken01-znJYLaVP.js → LinkBroken01-Jybptj_M.js} +1 -1
- package/dist/client/assets/{Minus-Biy1YWEX.js → Minus-BqtyYKKc.js} +1 -1
- package/dist/client/assets/{Monitor01-DcAryzmn.js → Monitor01-As0zpJLy.js} +1 -1
- package/dist/client/assets/{Play-BkYxzt1r.js → Play-CdlorRHF.js} +1 -1
- package/dist/client/assets/{Plus-BhRQRaas.js → Plus-CzoopYlU.js} +1 -1
- package/dist/client/assets/ReferenceLine-CJng4Q0_.js +1 -0
- package/dist/client/assets/{SearchMd-DqnvtcaB.js → SearchMd-By2dNUiw.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DYcJDT4V.js → ShoppingBag01-DhegylE0.js} +1 -1
- package/dist/client/assets/{Sun-tnCpymBL.js → Sun-Hd0LHTxB.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D2vRhNhF.js → SwitchHorizontal01-Czrqzt6f.js} +1 -1
- package/dist/client/assets/{Tool01-B8q2F7hW.js → Tool01-D38zOT0h.js} +1 -1
- package/dist/client/assets/{Tooltip-B6aZIxiB.js → Tooltip-Dxjn-_yM.js} +1 -1
- package/dist/client/assets/{Trash01-Ccl1EX2p.js → Trash01-BxSWir9J.js} +1 -1
- package/dist/client/assets/{Upload01-DOAyGyLP.js → Upload01-C8sapTWh.js} +1 -1
- package/dist/client/assets/{UserSquare-Cbfe91aH.js → UserSquare-CEg-eLCw.js} +1 -1
- package/dist/client/assets/{Users01-C1OYrFY1.js → Users01-CMreTMtq.js} +1 -1
- package/dist/client/assets/{XClose-p8-Q8v8l.js → XClose-DGifUqyQ.js} +1 -1
- package/dist/client/assets/{Zap-DyRXLCnm.js → Zap-BLaVFWQx.js} +1 -1
- package/dist/client/assets/{access-gate-BAXdhF61.js → access-gate-BJSZ7nU5.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-I3R6bOX6.js → add-connection-dialog-Dpu5ecJP.js} +1 -1
- package/dist/client/assets/agent-app-CHKycGm0.js +1 -0
- package/dist/client/assets/agent-assets-7nArEuts.js +1 -0
- package/dist/client/assets/{agent-automation-TykMN0zp.js → agent-automation-Dq1UMpQM.js} +3 -3
- package/dist/client/assets/{agent-automations-axy_S6Px.js → agent-automations-DF3vcb3-.js} +1 -1
- package/dist/client/assets/agent-calendar-CsvxRBRw.js +1 -0
- package/dist/client/assets/agent-capabilities-CaXbVMop.js +1 -0
- package/dist/client/assets/{agent-connect-sources-YnQ0oiMQ.js → agent-connect-sources-84FLUgzX.js} +1 -1
- package/dist/client/assets/agent-deck-DEx4qeYv.js +1 -0
- package/dist/client/assets/agent-e2e-CfTkWgUa.js +1 -0
- package/dist/client/assets/agent-experiments-BMy2QOPP.js +1 -0
- package/dist/client/assets/agent-file-C7mhhKFK.js +1 -0
- package/dist/client/assets/agent-hosting-BmtgVBqV.js +1 -0
- package/dist/client/assets/{agent-icon-FkFyvRCX.js → agent-icon-U2nlXoBG.js} +1 -1
- package/dist/client/assets/agent-library-DIxeSWXa.js +1 -0
- package/dist/client/assets/agent-library-file-DQB6i5_0.js +1 -0
- package/dist/client/assets/agent-overview-D8ZTdoEM.js +1 -0
- package/dist/client/assets/agent-releases-DOPovy0S.js +2 -0
- package/dist/client/assets/agent-settings-x3yUV6x9.js +1 -0
- package/dist/client/assets/{agent-site-editor-iOr_R9Ca.js → agent-site-editor-Pg_WHlnv.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-DDscaXHP.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CBj6Azpl.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Doqukvwz.js +1 -0
- package/dist/client/assets/agent-view-CvpQlU18.js +1 -0
- package/dist/client/assets/{agent-view-guard-CTg_3K6Q.js → agent-view-guard-BFnkZyhp.js} +1 -1
- package/dist/client/assets/{ai-providers-SquUsRRR.js → ai-providers-tFJSU00y.js} +1 -1
- package/dist/client/assets/{alert-BcGEYE9G.js → alert-B52lXsYB.js} +1 -1
- package/dist/client/assets/{analytics-sections-C3xfRdmO.js → analytics-sections-DgZGw207.js} +1 -1
- package/dist/client/assets/api-keys-BEFmsf3L.js +1 -0
- package/dist/client/assets/{api-keys-6xNcEC8t.js → api-keys-Bc1E8umo.js} +1 -1
- package/dist/client/assets/app-editor-a13s_yZZ.js +1 -0
- package/dist/client/assets/{asset-utils-Bq_dJbYP.js → asset-utils-DxOK6Cj3.js} +1 -1
- package/dist/client/assets/{auth-BsX6ur7b.js → auth-D991fBKg.js} +1 -1
- package/dist/client/assets/{auth-catchall-BwwwkN3O.js → auth-catchall-CO4eQSBG.js} +1 -1
- package/dist/client/assets/{auth-entry-D3WJl0FC.js → auth-entry-IOobChfY.js} +1 -1
- package/dist/client/assets/{auth-split-layout-J4KMjvhP.js → auth-split-layout-Dn_4EroD.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Cu0VrSF5.js → authenticate-and-persist-oauth-CM3iiCDW.js} +1 -1
- package/dist/client/assets/{automation-list-row-QpXtin0Q.js → automation-list-row-sEGCpgiC.js} +1 -1
- package/dist/client/assets/{automation-runs-aImufYAH.js → automation-runs-DnhCJL7r.js} +1 -1
- package/dist/client/assets/{automations-DLgpPcdB.js → automations-BopJHgke.js} +1 -1
- package/dist/client/assets/{autosend-ce5-FRC2.js → autosend-D6GGYoeu.js} +1 -1
- package/dist/client/assets/{badge-2xhZ-r-l.js → badge-C9w1KAGQ.js} +1 -1
- package/dist/client/assets/{block-document-DI7cHMPV.js → block-document-ExA3sDvi.js} +2 -2
- package/dist/client/assets/{blocks-preview-workspace-context-DbUsPnrw.js → blocks-preview-workspace-context-Gbv7_zq8.js} +1 -1
- package/dist/client/assets/blocks-tab-states-oXZbJa9b.js +1 -0
- package/dist/client/assets/{blog-schema-CHW5Pxv_.js → blog-schema-4OEvCOpU.js} +1 -1
- package/dist/client/assets/{buckets-BDCTPQpG.js → buckets-DsGf5D8D.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-5IZRp812.js → build-improve-prompt-doc-BpZBupFA.js} +1 -1
- package/dist/client/assets/{calendar-D-rfd7JY.js → calendar-ahGH-Iwe.js} +1 -1
- package/dist/client/assets/{capability-load-error-BKCZfLTa.js → capability-load-error-BG7LprlO.js} +1 -1
- package/dist/client/assets/category-editor-Ctbp0oQy.js +1 -0
- package/dist/client/assets/{chart-wyCy3WJz.js → chart-DnblhNHq.js} +1 -1
- package/dist/client/assets/{chat-context-GsXpI-Rk.js → chat-context-CCj5lauv.js} +2 -2
- package/dist/client/assets/{chat-draft-CnA31cek.js → chat-draft-BtMWyLm7.js} +1 -1
- package/dist/client/assets/{checkbox-LWvsDQWZ.js → checkbox-DB14k3TQ.js} +1 -1
- package/dist/client/assets/{choose-editor-oX8cTiL9.js → choose-editor-D4zx1UJt.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dal5M4-w.js → cli-auth-success-DeaH4VUx.js} +1 -1
- package/dist/client/assets/{client-icons-BUnl0ZXy.js → client-icons-C4W9Kqhd.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CcuLaEnU.js +1 -0
- package/dist/client/assets/cms-store-drafts-BumH78UY.js +1 -0
- package/dist/client/assets/{collapsible-DwneXnWl.js → collapsible-BPEhSNLz.js} +1 -1
- package/dist/client/assets/{collection-detail-DWuKEvHr.js → collection-detail-ralZDDkv.js} +1 -1
- package/dist/client/assets/{collection-display-button-BcvxnzA7.js → collection-display-button-CigTGx80.js} +1 -1
- package/dist/client/assets/{collection-search-BXhJDy4i.js → collection-search-D_oD-yY0.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CsjezWAk.js → collection-table-wrapper-C2dK4p_4.js} +1 -1
- package/dist/client/assets/{collection-tabs-R5zZyWuQ.js → collection-tabs-SAUXvS4g.js} +1 -1
- package/dist/client/assets/{combobox-M_E9pRSg.js → combobox-hVgdYGtQ.js} +1 -1
- package/dist/client/assets/{command-D1ggU7uN.js → command-DiccrIM8.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-5tiqlnPW.js → companion-mcps-section-BUEyDlWy.js} +1 -1
- package/dist/client/assets/{config-BwOe4khb.js → config-DgUlbPLE.js} +1 -1
- package/dist/client/assets/{connect-CZDT3prT.js → connect-DhpQ_i5Y.js} +3 -3
- package/dist/client/assets/{connect-layout-BlfzEMXx.js → connect-layout-Dgb_j_Nn.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Bu2QM8b1.js → connect-source-dialog-Dga8Dh15.js} +1 -1
- package/dist/client/assets/{connection-BWg4pBgr.js → connection-DF20RpK_.js} +1 -1
- package/dist/client/assets/{connection-card-D8rA98h7.js → connection-card-DeCnJCAi.js} +1 -1
- package/dist/client/assets/{connection-detail-DSD-1Pdd.js → connection-detail-Dn5XmXHk.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CTdld_FZ.js → connection-form-helpers-B4MG2Fy2.js} +1 -1
- package/dist/client/assets/{connection-slug-xnxqKZgT.js → connection-slug-tS8GnOSc.js} +1 -1
- package/dist/client/assets/{connections-CZPMCaga.js → connections-DREB4U2P.js} +1 -1
- package/dist/client/assets/{content-tab-B2fyj6Jh.js → content-tab-kF-GtTU9.js} +8 -8
- package/dist/client/assets/context-Gpy7m9cw.js +1 -0
- package/dist/client/assets/{context-menu-DPGth7tq.js → context-menu-vUs3I8Wh.js} +1 -1
- package/dist/client/assets/{context-shell-tkTYv2bR.js → context-shell-vU2YMH1K.js} +3 -3
- package/dist/client/assets/{core.esm-DnEwZVMw.js → core.esm-CWyzckxm.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-UgMN3Pp1.js → create-organization-dialog-qsB5dfrW.js} +1 -1
- package/dist/client/assets/device-hint-DMMaEP-p.js +1 -0
- package/dist/client/assets/{discover-Cpqi_nZO.js → discover-DN-I6i-O.js} +1 -1
- package/dist/client/assets/{domain-settings-DJSixqz2.js → domain-settings-FZeIPnhT.js} +1 -1
- package/dist/client/assets/{drawer-BnPszJPZ.js → drawer-CMTReHxa.js} +1 -1
- package/dist/client/assets/{editor-zE4VnGLI.js → editor-C6CE2FNQ.js} +1 -1
- package/dist/client/assets/{editor-classes-BnzpZOY5.js → editor-classes-DbMPYB4Z.js} +1 -1
- package/dist/client/assets/{empty-state-BFLQtSFV.js → empty-state-DF9St1T6.js} +1 -1
- package/dist/client/assets/{empty-state-DLrHPsXZ.js → empty-state-ovRL7NEK.js} +1 -1
- package/dist/client/assets/experiments-tab-choice-BXlwzycK.js +1 -0
- package/dist/client/assets/{extract-connection-data-KiTWYSx4.js → extract-connection-data-Q1k0ncm3.js} +1 -1
- package/dist/client/assets/{feature-gate-C27q-aIj.js → feature-gate-DKF86Lcy.js} +1 -1
- package/dist/client/assets/{feature-paywall-CJwXTzME.js → feature-paywall-BoU9TII8.js} +1 -1
- package/dist/client/assets/{feedback-zQMybfa1.js → feedback-f3MT17uD.js} +1 -1
- package/dist/client/assets/{file-explorer-C_MMeMcX.js → file-explorer-DmvPCizi.js} +2 -2
- package/dist/client/assets/{file-preview-F9XVmctL.js → file-preview-aD0sVwV5.js} +1 -1
- package/dist/client/assets/{file-share-button-A6RgU4RK.js → file-share-button-agT85qGG.js} +2 -2
- package/dist/client/assets/{file-type-icon-DoyEf2kQ.js → file-type-icon-CflTIvHJ.js} +1 -1
- package/dist/client/assets/{folder-icon-CsH9NIDq.js → folder-icon-BKhbsJwX.js} +1 -1
- package/dist/client/assets/{form-cx1UDyF2.js → form-B_3ZthF3.js} +1 -1
- package/dist/client/assets/{general-YmXk3hPt.js → general-BdjsCK2j.js} +1 -1
- package/dist/client/assets/{github-icon-DNe7j1PY.js → github-icon-M-2WiP3Y.js} +1 -1
- package/dist/client/assets/home-dTYjLEfm.js +1 -0
- package/dist/client/assets/{home-overview-CFwm7iMO.js → home-overview-BAVfF6qS.js} +1 -1
- package/dist/client/assets/hosted-reconcile-B3o4dv7j.js +1 -0
- package/dist/client/assets/{icon-button-CmFwjZ_m.js → icon-button-DQuPTgIB.js} +1 -1
- package/dist/client/assets/{index-BmYeIRlv.js → index-0kopV6YP.js} +2 -2
- package/dist/client/assets/{index-DM3inxPC.js → index-2bmOBUEF.js} +1 -1
- package/dist/client/assets/{index-C9A_N0M0.js → index-BM0DSfBG.js} +1 -1
- package/dist/client/assets/{index-DGn-FPge.js → index-BZX-7ipZ.js} +45 -45
- package/dist/client/assets/index-BlTJ0I-U.js +4 -0
- package/dist/client/assets/{index-BCXxtUlh.js → index-BvJNHE6H.js} +6 -6
- package/dist/client/assets/{index-ffdfMTh-.js → index-C2-s3ia2.js} +1 -1
- package/dist/client/assets/{index-CN8uFy5p.js → index-C81DBcO6.js} +1 -1
- package/dist/client/assets/{index-DisXhcWe.js → index-Cjc_aSrk.js} +1 -1
- package/dist/client/assets/{index-B5lnCLuB.js → index-D7Mi9FGh.js} +1 -1
- package/dist/client/assets/{index-qMWmRmW0.js → index-DHMhIfTt.js} +1 -1
- package/dist/client/assets/{index-WwIqmvy-.js → index-DT3lYd1R.js} +1 -1
- package/dist/client/assets/{index-hZylT09v.js → index-DzmcFP3y.js} +1 -1
- package/dist/client/assets/index-SmuiYnIl.css +1 -0
- package/dist/client/assets/{index-DuD6FLZ3.js → index-cmF_qGuq.js} +1 -1
- package/dist/client/assets/{index-CmGLs6T5.js → index-iezPx7cK.js} +1 -1
- package/dist/client/assets/index-mtR249ru.js +1 -0
- package/dist/client/assets/{index-redirect-eX7nEWSl.js → index-redirect-ay83YA5a.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B_P9W4Zx.js → infiniteQueryObserver-CQGSlzKO.js} +1 -1
- package/dist/client/assets/{infra-billing-BatrrG1f.js → infra-billing-DUjivW_p.js} +1 -1
- package/dist/client/assets/{input-BEManHLB.js → input-3OyhKW_c.js} +1 -1
- package/dist/client/assets/input-CcFFY__7.js +17 -0
- package/dist/client/assets/{integration-icon-BHx1ytyX.js → integration-icon-Btk7lWbK.js} +1 -1
- package/dist/client/assets/{jira-icon-DQhFl4az.js → jira-icon-TeK8CaRV.js} +1 -1
- package/dist/client/assets/{label-CHRzCbuP.js → label-BGCn7A0y.js} +1 -1
- package/dist/client/assets/{layout-CvFeIpHB.js → layout-XVKa9Y6f.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-B-RkQsR1.js → legacy-agents-deep-DksTbOzF.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-f_YEwDUU.js → legacy-main-redirect-8kA2UC85.js} +1 -1
- package/dist/client/assets/library-O1-Gs4qz.js +1 -0
- package/dist/client/assets/{library-tab-DrpEkybg.js → library-tab-DJKD7rUC.js} +3 -3
- package/dist/client/assets/{login-DtH52R3F.js → login-CH5yud2M.js} +1 -1
- package/dist/client/assets/{markdown-C7Kie5ev.js → markdown-B6eeRWQb.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CO8LOFxq.js → mcp-app-renderer-DwuRGgZk.js} +1 -1
- package/dist/client/assets/{mcp-oauth-iB4K_uoY.js → mcp-oauth-BvqIKSqR.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-mc4e6m.js → mcp-oauth-Bz1Lo9Pk.js} +1 -1
- package/dist/client/assets/{members-yfLvIIIT.js → members-FYjquUkN.js} +1 -1
- package/dist/client/assets/{memory-aeBofHaH.js → memory-CoUl94G3.js} +1 -1
- package/dist/client/assets/{mock-board-B5SFWfb2.js → mock-board-DvOE8ZQh.js} +4 -4
- package/dist/client/assets/{monaco-editor-BRY87vsh.js → monaco-editor-vUgphdkE.js} +1 -1
- package/dist/client/assets/monitoring-UUQquQf7.js +2 -0
- package/dist/client/assets/{monitoring-stats-row-DZcqSbnv.js → monitoring-stats-row-BY92i-Bt.js} +1 -1
- package/dist/client/assets/{multi-select-C-iHSsuJ.js → multi-select-9ieJQPsD.js} +1 -1
- package/dist/client/assets/mustache-CgF6ozKS.js +4 -0
- package/dist/client/assets/named-rule-view-CdhLqAy7.js +1 -0
- package/dist/client/assets/{new-project-dialog-UvI58my0.js → new-project-dialog-EK9WMEhp.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bg-Twulk.js → oauth-callback-Cuv6PAYs.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CuXrUeR4.js → oauth-callback-ai-provider-BGc97raN.js} +1 -1
- package/dist/client/assets/{oauth-consent-BdD4CLIL.js → oauth-consent-fGbsmdGY.js} +1 -1
- package/dist/client/assets/{onboarding-DAlZ_ijb.js → onboarding-DF5AGUdi.js} +1 -1
- package/dist/client/assets/openai-conversation-CMIme_Ur.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-uJohOkF6.js → optimistic-project-sidebar-views-mQ0HUqGi.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BIbj8jXM.js → order-monitor-day-BPx4Aihv.js} +1 -1
- package/dist/client/assets/{organization-choice-9Sf7qdAX.js → organization-choice-KNGQur5O.js} +1 -1
- package/dist/client/assets/{orgs-DuQRavym.js → orgs-C5Zlwg3I.js} +1 -1
- package/dist/client/assets/{own-accounts-section-n50adHNX.js → own-accounts-section-C_F0-lzr.js} +1 -1
- package/dist/client/assets/{pair-1hov1KDD.js → pair-C5KKQk8r.js} +7 -7
- package/dist/client/assets/{parse-sections-BNf6_EjY.js → parse-sections-DE2O_vev.js} +7 -7
- package/dist/client/assets/{plan-Dq5q5bsx.js → plan-DdvgvWt2.js} +1 -1
- package/dist/client/assets/{plan-ladder-DJg9yABt.js → plan-ladder-BQ0gcfdF.js} +1 -1
- package/dist/client/assets/{plan-usage-card-D4SynKK4.js → plan-usage-card-8-3zMqsW.js} +2 -2
- package/dist/client/assets/{popover-CE0A3Qit.js → popover-CkuSZicN.js} +1 -1
- package/dist/client/assets/post-calendar-DVrcXuZq.js +1 -0
- package/dist/client/assets/{post-editor-CeOdXCzo.js → post-editor-CG6NXsGN.js} +2 -2
- package/dist/client/assets/{preview-content-CyH9JuG-.js → preview-content-xRBU7B3O.js} +1 -1
- package/dist/client/assets/{preview-dialog-FVFjchHr.js → preview-dialog-D36kXBk6.js} +1 -1
- package/dist/client/assets/{preview-panel-eL-KdUlb.js → preview-panel-Cp7F1lqp.js} +1 -1
- package/dist/client/assets/preview-tab-Dn0RGnhj.js +551 -0
- package/dist/client/assets/{product-picker-dialog-oaL2Geio.js → product-picker-dialog-C2KLekZA.js} +1 -1
- package/dist/client/assets/{profile-DhXoBixo.js → profile-BfDfzRPA.js} +1 -1
- package/dist/client/assets/project-app-view-DVhAuH9N.js +1 -0
- package/dist/client/assets/project-apps-D47w7eJj.js +1 -0
- package/dist/client/assets/{project-icon-reyc_nNY.js → project-icon-ofE-LDok.js} +1 -1
- package/dist/client/assets/{project-index-CeS8PQv7.js → project-index-PpuyCKHe.js} +1 -1
- package/dist/client/assets/project-reports-BuJS86vH.js +1 -0
- package/dist/client/assets/project-sidebar-views-Dew_3OKS.js +1 -0
- package/dist/client/assets/project-tasks-CZtVWSYo.js +1 -0
- package/dist/client/assets/{projects-QRnnQxmB.js → projects-Be7d593_.js} +1 -1
- package/dist/client/assets/{projects-empty-state-B2R3HC7E.js → projects-empty-state-DpmH0sch.js} +1 -1
- package/dist/client/assets/{prompts-Cp6YboL1.js → prompts-ClmMS_OK.js} +1 -1
- package/dist/client/assets/record-editor-OoLxSu9R.js +1 -0
- package/dist/client/assets/redirect-editor-W9B4A_h8.js +1 -0
- package/dist/client/assets/{reports-BtW4mY0K.js → reports-DCsJlho1.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CtEi6opy.js → reports-onboarding-CMTzWUTp.js} +1 -1
- package/dist/client/assets/reports-s2E9cwFc.js +1 -0
- package/dist/client/assets/{reports-tab-DhrTVeTc.js → reports-tab-BKnG1JmX.js} +2 -2
- package/dist/client/assets/repositories-Dj2kaTIN.js +1 -0
- package/dist/client/assets/{repositories-CGGnfQiR.js → repositories-KlUH4dUR.js} +1 -1
- package/dist/client/assets/{repository-binding-DHN5ihZA.js → repository-binding-CqOunspI.js} +1 -1
- package/dist/client/assets/{repository-picker-BVa6TfGc.js → repository-picker-DNdEQtlZ.js} +1 -1
- package/dist/client/assets/{require-capability-CVoJcu7H.js → require-capability-RYn3iksk.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BQmhUScr.js → required-auth-layout-Dfyc4Zas.js} +1 -1
- package/dist/client/assets/{reset-password-BLOlZYb5.js → reset-password-CTGJ7V-t.js} +1 -1
- package/dist/client/assets/{resizable-CdFCM71r.js → resizable-BCGqPRic.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-BnqDq-fY.js +1 -0
- package/dist/client/assets/{review-settings-Deyxg2o8.js → review-settings-DvoYyrmi.js} +1 -1
- package/dist/client/assets/{role-color-DfmSCdD1.js → role-color-cUMHSMVi.js} +1 -1
- package/dist/client/assets/{roles-DGxZsr14.js → roles-x3B4vLKU.js} +1 -1
- package/dist/client/assets/route-PbputQp9.js +1 -0
- package/dist/client/assets/route-h-Fc_oVe.js +1 -0
- package/dist/client/assets/route-wINBwrny.js +1 -0
- package/dist/client/assets/sandbox-lifecycle-context-CXwLCWvJ.js +1 -0
- package/dist/client/assets/{schema-C2e4bOOh.js → schema-C1bLOk3P.js} +1 -1
- package/dist/client/assets/{schema-77LyfVRl.js → schema-DHLwjAWR.js} +1 -1
- package/dist/client/assets/{scroll-area-DOPuQKg_.js → scroll-area-rELMi4e6.js} +1 -1
- package/dist/client/assets/{search-input-Bo9D0b2l.js → search-input-Crult1Qo.js} +1 -1
- package/dist/client/assets/{search-toggle-D227Ek9d.js → search-toggle-DzMf9QP4.js} +1 -1
- package/dist/client/assets/{secret-picker-ChOT2LaB.js → secret-picker-CimF9dsx.js} +1 -1
- package/dist/client/assets/{secrets-TvEnuoeS.js → secrets-CZCnF6s4.js} +1 -1
- package/dist/client/assets/section-array-field-C3Tpx16b.js +1 -0
- package/dist/client/assets/{sections-tdmo3LjO.js → sections-346PcP2T.js} +1 -1
- package/dist/client/assets/sections-editor-DwV32_3f.js +1 -0
- package/dist/client/assets/{select-Di2sLm_-.js → select-CwDmbwEv.js} +1 -1
- package/dist/client/assets/{select-model-Do4joh93.js → select-model-B1ocDBwF.js} +1 -1
- package/dist/client/assets/seo-editor-D1gGpMMF.js +1 -0
- package/dist/client/assets/{separator-Bu1wQRuA.js → separator-C05SxAdn.js} +1 -1
- package/dist/client/assets/settings-tab-BImv5HgS.js +1 -0
- package/dist/client/assets/{sheet-pl7zdRHn.js → sheet-BYgfxL9i.js} +1 -1
- package/dist/client/assets/{shell-layout-DzQA4K-b.js → shell-layout-BvJfyzsq.js} +1 -1
- package/dist/client/assets/site-draft-actions-CgeV78uL.js +3 -0
- package/dist/client/assets/site-draft-view-Dkq2XweK.js +1 -0
- package/dist/client/assets/site-editor-B9ARkCiN.js +1 -0
- package/dist/client/assets/site-editor-toast-D83gMpdg.js +1 -0
- package/dist/client/assets/{skills-Bh5rPXC6.js → skills-OVV2oEwU.js} +1 -1
- package/dist/client/assets/{slider-CwE675ao.js → slider-Ipy9G5jv.js} +1 -1
- package/dist/client/assets/{sortable.esm-CIP-w8Te.js → sortable.esm-DgwAq-fn.js} +1 -1
- package/dist/client/assets/{sso-DpryG3cU.js → sso-C9cutlah.js} +1 -1
- package/dist/client/assets/{suggestion-Dr321Cmr.js → suggestion-Dwy6qysF.js} +1 -1
- package/dist/client/assets/{switch-D-6AqAnT.js → switch-BLkpF22m.js} +1 -1
- package/dist/client/assets/{synced-repos-CwCJZfKG.js → synced-repos-orJHnVxs.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CMWJQvgX.js → tab-icon-glyph-Co1M723I.js} +1 -1
- package/dist/client/assets/{table-DpJo1vAx.js → table-DPFxRA7S.js} +1 -1
- package/dist/client/assets/{tabs-DNziA2dZ.js → tabs--wmPR0cZ.js} +1 -1
- package/dist/client/assets/{task-board-BuKyXp11.js → task-board-DJtwkz3O.js} +1 -1
- package/dist/client/assets/{task-route-DlvmNWcQ.js → task-route-vCMrJPp9.js} +1 -1
- package/dist/client/assets/{task-status-B4eBo5Md.js → task-status-msgu5x2s.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-C-zvSFMs.js → taskboard-analytics-5nxg7YXN.js} +1 -1
- package/dist/client/assets/{tasks-BHN9oqEC.js → tasks-DpWVcTLT.js} +1 -1
- package/dist/client/assets/tasks-hbXv3hSd.js +1 -0
- package/dist/client/assets/{textarea-HAezEU3R.js → textarea-D5OF_Tld.js} +1 -1
- package/dist/client/assets/{thread-analytics-DWnZrs9k.js → thread-analytics-CVsji2MZ.js} +1 -1
- package/dist/client/assets/{thread-intent-C084ju5m.js → thread-intent-DIce2mks.js} +2 -2
- package/dist/client/assets/{thread-route-C-GRt_yL.js → thread-route-CGqDFJ1K.js} +1 -1
- package/dist/client/assets/{thread-route-Dt42HUQv.js → thread-route-CP2TR6nw.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Ck1Bv0_3.js → thread-sheet-body-Cba15kJF.js} +1 -1
- package/dist/client/assets/{time-range-picker-CS9tika7.js → time-range-picker-OdWLHy9U.js} +1 -1
- package/dist/client/assets/{toggle-group-CFojpTQB.js → toggle-group-DbLOGwe7.js} +1 -1
- package/dist/client/assets/{tool-namespace-Fc2c0QC4.js → tool-namespace-BQhkJpu9.js} +1 -1
- package/dist/client/assets/{tool-set-selector-B8ePlhyl.js → tool-set-selector-BmAnaEsw.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-GjI5vOKF.js → toolbar-icon-button-BzIcnxXk.js} +1 -1
- package/dist/client/assets/{tooltip-BojzNY2M.js → tooltip--uPFG1gb.js} +1 -1
- package/dist/client/assets/{tooltipContext-m-9QMOrS.js → tooltipContext-C8ArdkXW.js} +1 -1
- package/dist/client/assets/{track-Bclp3q8c.js → track-Bb4064-s.js} +1 -1
- package/dist/client/assets/{types-CdXMwNZg.js → types-EjHtXl5u.js} +1 -1
- package/dist/client/assets/{url-slug-BkV5QJiU.js → url-slug-rCJqhuIp.js} +1 -1
- package/dist/client/assets/{usage-stats-B39QZ3Cn.js → usage-stats-DaOtdhEm.js} +2 -2
- package/dist/client/assets/{use-ai-providers-hjEpjXQ2.js → use-ai-providers-C5rCFpU_.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-vuCkiknA.js → use-apply-named-rule-zZmpVvRd.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BaG9i0zc.js +1 -0
- package/dist/client/assets/{use-automations-DJWCjg8T.js → use-automations-CI7vvUzE.js} +1 -1
- package/dist/client/assets/{use-autosave-DzjuxKy7.js → use-autosave-DUBcsRSH.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-CXrKL60y.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-DGf4-J1Z.js → use-chat-layout-state-CZaSk8YF.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-JZTNoXFa.js → use-cms-publish-actions-BV2nwL3g.js} +5 -5
- package/dist/client/assets/{use-connect-companion-DZPybU6m.js → use-connect-companion-DC6UOpxV.js} +1 -1
- package/dist/client/assets/{use-connection-BonBiP4H.js → use-connection-BEb786wf.js} +1 -1
- package/dist/client/assets/{use-content-sync-C-LYfyy7.js → use-content-sync-CtHfpBJp.js} +1 -1
- package/dist/client/assets/{use-copy-1IxNCkh9.js → use-copy-DccRTYvG.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-KQxxLRHa.js → use-date-fns-locale-DD1YxYKP.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Eo1C-w5U.js → use-debounced-autosave-clO2CzWE.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CzxhSP8l.js → use-debounced-value-CJpdUTvG.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CEMj3JGY.js → use-deco-credits-DtE2LNZs.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CTD6ZdaA.js → use-decopilot-events-DxBT3zOC.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CKqCkN-k.js → use-delete-connection-COvFjvtJ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BCIDPeyj.js → use-deployment-admin-BSEuekHe.js} +1 -1
- package/dist/client/assets/{use-entitlements-DxVD_uCH.js → use-entitlements-CWXMyUT0.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-BCmBxVQg.js +1 -0
- package/dist/client/assets/{use-file-configs-D87qhE2e.js → use-file-configs-DsyBYIJw.js} +1 -1
- package/dist/client/assets/{use-id-selection-FN7gA0OQ.js → use-id-selection-6CmUdc1s.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-DglRSmH4.js → use-inbox-feed-okLCp4Pp.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-4LyFv3hi.js → use-infinite-scroll-4e7tB3Vz.js} +1 -1
- package/dist/client/assets/{use-join-requests-czJryNA9.js → use-join-requests-muPMmn0O.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-BcP_qZl8.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-D_TqnxnH.js +1 -0
- package/dist/client/assets/{use-mcp-client-BeYM-3mp.js → use-mcp-client-CrdyqnFt.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-IjFHP0w8.js → use-mcp-prompts-C3SHzM_d.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Bi0gClZp.js → use-mcp-tools-DQIJMlw-.js} +1 -1
- package/dist/client/assets/{use-mobile-D6y1UaCv.js → use-mobile-BDWitdax.js} +1 -1
- package/dist/client/assets/use-move-blocks-B48xFUbp.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-DP0a6y9z.js → use-navigate-to-agent-C3sX18jI.js} +1 -1
- package/dist/client/assets/{use-org-fs-CfPaWD_N.js → use-org-fs-BRERSVus.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-TOw0XlBk.js → use-org-repo-syncs-BFFdo3jR.js} +1 -1
- package/dist/client/assets/{use-org-sso-BK0CtdSD.js → use-org-sso-BHDTii7j.js} +1 -1
- package/dist/client/assets/{use-organization-settings--v2ov5jL.js → use-organization-settings-DPCrcu8e.js} +1 -1
- package/dist/client/assets/{use-project-scope-BJA0ds2S.js → use-project-scope-k7OaKjIm.js} +1 -1
- package/dist/client/assets/{use-recent-apps--67lnzqC.js → use-recent-apps-Buo9cWvj.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-81WxcUY9.js → use-reports-diagnostic-B1lbI319.js} +1 -1
- package/dist/client/assets/use-sandbox-events-BRJYKM54.js +2 -0
- package/dist/client/assets/{use-secrets-DEeK7thW.js → use-secrets-DlNiP0j4.js} +1 -1
- package/dist/client/assets/use-section-preview-base-CL9U3MEc.js +1 -0
- package/dist/client/assets/use-sidebar-collapsed-ByMTBVZc.js +1 -0
- package/dist/client/assets/{use-tags-DEr2TlgW.js → use-tags-CcJayzHf.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DxH9-ih7.js → use-task-board-analytics-0-6_3j_2.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BZToXVGj.js → use-task-board-events-CzDIUBok.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-B2japofE.js → use-task-board-item-prs-DbHC-4Ry.js} +1 -1
- package/dist/client/assets/{use-task-board-items-Puwxrpek.js → use-task-board-items-COxHF7_K.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-C5iC-R_g.js → use-task-board-prompts-CKi9j8wF.js} +1 -1
- package/dist/client/assets/{use-task-metadata-jDPe6d5C.js → use-task-metadata-BxcNhivS.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DnX9RgWT.js → use-thread-outputs-lMVF4bT2.js} +1 -1
- package/dist/client/assets/use-voice-input-DsJxHyTh.js +1 -0
- package/dist/client/assets/useInfiniteQuery-B313haH3.js +1 -0
- package/dist/client/assets/{useQueries-BbqzFtkh.js → useQueries-BO8pZ9q-.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-07GrICuv.js +1 -0
- package/dist/client/assets/{users-DFMP_wOE.js → users-DCPPe9Uo.js} +1 -1
- package/dist/client/assets/{utils-BU-nucb-.js → utils-D0xixM8q.js} +3 -3
- package/dist/client/assets/{variant-calendar-DKhL8Mk2.js → variant-calendar-C5r0ak32.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CgElSjwL.js → variant-matcher-override-QQd3tA7f.js} +1 -1
- package/dist/client/assets/{view-header-i70JKW9C.js → view-header-BPAnt0vh.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CsY6ukOa.js → virtual-mcp-Dzr3mFmO.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-D3b7K3Uo.js → watch-sse-pool-j0K-nQ0i.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +464 -464
- package/package.json +1 -1
- package/dist/client/assets/ReferenceLine-DfxOOnGv.js +0 -1
- package/dist/client/assets/agent-app-Djt3nisA.js +0 -1
- package/dist/client/assets/agent-assets-BytEk-0l.js +0 -1
- package/dist/client/assets/agent-calendar-BaUCHDte.js +0 -1
- package/dist/client/assets/agent-capabilities-DUEnZmC-.js +0 -1
- package/dist/client/assets/agent-deck-BZptRfb2.js +0 -1
- package/dist/client/assets/agent-e2e-CN8oCbtP.js +0 -1
- package/dist/client/assets/agent-file-C58LYJBC.js +0 -1
- package/dist/client/assets/agent-hosting-C-Xgv5CR.js +0 -1
- package/dist/client/assets/agent-library-CxsAEqgy.js +0 -1
- package/dist/client/assets/agent-library-file-BfEsr2cm.js +0 -1
- package/dist/client/assets/agent-overview-yBV3P4Kd.js +0 -1
- package/dist/client/assets/agent-releases-DXvHySgn.js +0 -2
- package/dist/client/assets/agent-settings-C7JVa4hp.js +0 -1
- package/dist/client/assets/agent-site-editor-code-0Rkb_Rlf.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CKdTDsIv.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DY2uCsMf.js +0 -1
- package/dist/client/assets/agent-view-CMZiQIOU.js +0 -1
- package/dist/client/assets/api-keys-DzWt-NPK.js +0 -1
- package/dist/client/assets/app-editor-CoHcQkjL.js +0 -1
- package/dist/client/assets/blocks-tab-states-Oy4QesXy.js +0 -1
- package/dist/client/assets/category-editor-BuIyetQS.js +0 -1
- package/dist/client/assets/cms-settings-editor-T8KTji6O.js +0 -1
- package/dist/client/assets/cms-store-drafts-49wrBNXT.js +0 -1
- package/dist/client/assets/context-CUmhz6yH.js +0 -1
- package/dist/client/assets/device-hint-DHQmntIa.js +0 -1
- package/dist/client/assets/home-DgapTseA.js +0 -1
- package/dist/client/assets/hosted-reconcile-BJXH2g7a.js +0 -1
- package/dist/client/assets/index-CxEOaGFH.js +0 -2
- package/dist/client/assets/index-D5uF1VH5.js +0 -4
- package/dist/client/assets/index-ug7KC70Z.css +0 -1
- package/dist/client/assets/input-Di6BJ4Zo.js +0 -17
- package/dist/client/assets/library-DQMyWPTm.js +0 -1
- package/dist/client/assets/monitoring-WRX4s2Md.js +0 -2
- package/dist/client/assets/mustache-WHgo2S29.js +0 -4
- package/dist/client/assets/named-rule-view-ChTlMWf5.js +0 -1
- package/dist/client/assets/openai-conversation-DChbcEJV.js +0 -3
- package/dist/client/assets/post-calendar-EtCAYSiT.js +0 -1
- package/dist/client/assets/preview-tab-Cuhy4gb6.js +0 -551
- package/dist/client/assets/project-app-view-CFDNRbPF.js +0 -1
- package/dist/client/assets/project-apps-B-5TAX2o.js +0 -1
- package/dist/client/assets/project-reports-DxSY0pyo.js +0 -1
- package/dist/client/assets/project-sidebar-views-DYKp64W4.js +0 -1
- package/dist/client/assets/project-tasks-joh7axEQ.js +0 -1
- package/dist/client/assets/record-editor-DzEJNlA8.js +0 -1
- package/dist/client/assets/redirect-editor-Bf8VmZQx.js +0 -1
- package/dist/client/assets/reports-5kgLKYGo.js +0 -1
- package/dist/client/assets/repositories-D0xZPdow.js +0 -1
- package/dist/client/assets/resolve-tab-icon-DJ5Ncrbw.js +0 -1
- package/dist/client/assets/route-C6jiJ2GR.js +0 -1
- package/dist/client/assets/route-Cf6qLb88.js +0 -1
- package/dist/client/assets/route-Dq3q8mSL.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-Dp2Dt1TA.js +0 -1
- package/dist/client/assets/sections-editor-C7sTzFTf.js +0 -1
- package/dist/client/assets/seo-editor-BK7SzGFy.js +0 -1
- package/dist/client/assets/settings-tab-B2_rrm2f.js +0 -1
- package/dist/client/assets/site-draft-view-Ca1ao55E.js +0 -3
- package/dist/client/assets/site-editor-DR8x2KPW.js +0 -1
- package/dist/client/assets/site-editor-toast-BUVxT4JG.js +0 -1
- package/dist/client/assets/tasks-DqD-0E5O.js +0 -1
- package/dist/client/assets/use-ask-in-chat-oQGHyTZE.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-o_WDZuY-.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-BeQ-NkWh.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-_QM-6kc-.js +0 -1
- package/dist/client/assets/use-move-blocks-DItjAQsv.js +0 -1
- package/dist/client/assets/use-section-preview-base-BO-qsUKf.js +0 -1
- package/dist/client/assets/use-sidebar-collapsed-DuLHdlSz.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CCkoNUSG.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CDBL11js.js +0 -1
|
@@ -1,551 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-C7sTzFTf.js","assets/index-DGn-FPge.js","assets/index-ug7KC70Z.css","assets/chat-context-GsXpI-Rk.js","assets/autosend-ce5-FRC2.js","assets/thread-route-Dt42HUQv.js","assets/use-project-scope-BJA0ds2S.js","assets/repository-binding-DHN5ihZA.js","assets/use-mcp-client-BeYM-3mp.js","assets/auth-BsX6ur7b.js","assets/thread-intent-C084ju5m.js","assets/delay-CnY5UFtP.js","assets/watch-sse-pool-D3b7K3Uo.js","assets/task-board-BuKyXp11.js","assets/schema-C2e4bOOh.js","assets/use-entitlements-DxVD_uCH.js","assets/use-ai-providers-hjEpjXQ2.js","assets/use-decopilot-events-CTD6ZdaA.js","assets/use-organization-settings--v2ov5jL.js","assets/parse-sections-BNf6_EjY.js","assets/utils-BU-nucb-.js","assets/agent-icon-FkFyvRCX.js","assets/AlertCircle-BMgOinVw.js","assets/Tool01-B8q2F7hW.js","assets/ArrowUp-DcJMRdNb.js","assets/ArrowLeft-BJMjlG4g.js","assets/LinkBroken01-znJYLaVP.js","assets/ShoppingBag01-DYcJDT4V.js","assets/Globe04-ri2PR4JW.js","assets/CheckCircle-By2z0uOx.js","assets/ChevronUp-BCfBdjs4.js","assets/ChevronSelectorVertical-BTg7xsL3.js","assets/UserSquare-Cbfe91aH.js","assets/CreditCard01-kxqKIkVq.js","assets/SwitchHorizontal01-D2vRhNhF.js","assets/Key01-By4BziN_.js","assets/Minus-Biy1YWEX.js","assets/Monitor01-DcAryzmn.js","assets/Sun-tnCpymBL.js","assets/Play-BkYxzt1r.js","assets/Plus-BhRQRaas.js","assets/SearchMd-DqnvtcaB.js","assets/Trash01-Ccl1EX2p.js","assets/Upload01-DOAyGyLP.js","assets/Users01-C1OYrFY1.js","assets/XClose-p8-Q8v8l.js","assets/Zap-DyRXLCnm.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-1hov1KDD.js","assets/collapsible-DwneXnWl.js","assets/use-copy-1IxNCkh9.js","assets/usage-stats-B39QZ3Cn.js","assets/tool-namespace-Fc2c0QC4.js","assets/form-cx1UDyF2.js","assets/label-CHRzCbuP.js","assets/utils-CVEq3hMx.js","assets/markdown-C7Kie5ev.js","assets/use-mobile-D6y1UaCv.js","assets/tooltip-BojzNY2M.js","assets/index-C9A_N0M0.js","assets/shell-layout-DzQA4K-b.js","assets/use-deployment-admin-BCIDPeyj.js","assets/admin-fetch-BhTJlAsX.js","assets/command-D1ggU7uN.js","assets/index-DuD6FLZ3.js","assets/integration-icon-BHx1ytyX.js","assets/project-icon-reyc_nNY.js","assets/use-navigate-to-agent-DP0a6y9z.js","assets/new-project-dialog-UvI58my0.js","assets/repository-picker-BVa6TfGc.js","assets/github-icon-DNe7j1PY.js","assets/useInfiniteQuery-CCkoNUSG.js","assets/infiniteQueryObserver-B_P9W4Zx.js","assets/collection-search-BXhJDy4i.js","assets/use-debounced-value-CzxhSP8l.js","assets/required-auth-layout-BQmhUScr.js","assets/use-org-sso-BK0CtdSD.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CO8LOFxq.js","assets/types-CdXMwNZg.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-pl7zdRHn.js","assets/use-connection-BonBiP4H.js","assets/use-mcp-prompts-IjFHP0w8.js","assets/use-thread-outputs-DnX9RgWT.js","assets/file-type-icon-DoyEf2kQ.js","assets/blocks-tab-states-Oy4QesXy.js","assets/site-editor-toast-BUVxT4JG.js","assets/input-Di6BJ4Zo.js","assets/icon-button-CmFwjZ_m.js","assets/chat-draft-CnA31cek.js","assets/select-Di2sLm_-.js","assets/index-BdQq_4o_.js","assets/tabs-DNziA2dZ.js","assets/active-indicator-CCMhAsc_.js","assets/use-deco-credits-CEMj3JGY.js","assets/toggle-group-CFojpTQB.js","assets/index-WwIqmvy-.js","assets/checkbox-LWvsDQWZ.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/popover-CE0A3Qit.js","assets/drawer-BnPszJPZ.js","assets/input-BEManHLB.js","assets/suggestion-Dr321Cmr.js","assets/use-org-fs-CfPaWD_N.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-CJwXTzME.js","assets/plan-ladder-DJg9yABt.js","assets/add-connection-dialog-I3R6bOX6.js","assets/extract-connection-data-KiTWYSx4.js","assets/metadata-D72DunRR.js","assets/connection-BWg4pBgr.js","assets/url-slug-BkV5QJiU.js","assets/connection-card-D8rA98h7.js","assets/connection-slug-xnxqKZgT.js","assets/textarea-HAezEU3R.js","assets/schema-77LyfVRl.js","assets/connection-form-helpers-CTdld_FZ.js","assets/authenticate-and-persist-oauth-Cu0VrSF5.js","assets/mcp-oauth-iB4K_uoY.js","assets/mcp-oauth-C-mc4e6m.js","assets/collection-tabs-R5zZyWuQ.js","assets/badge-2xhZ-r-l.js","assets/use-infinite-scroll-4LyFv3hi.js","assets/useSuspenseInfiniteQuery-CDBL11js.js","assets/use-task-board-events-BZToXVGj.js","assets/use-chat-layout-state-DGf4-J1Z.js","assets/input-Bwd_JSM8.css","assets/agent-capabilities-DUEnZmC-.js","assets/sandbox-url-D3mC8qhT.js","assets/index-CxEOaGFH.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-BFLQtSFV.js","assets/hosted-reconcile-BJXH2g7a.js","assets/slider-CwE675ao.js","assets/index-CmGLs6T5.js","assets/tooltipContext-m-9QMOrS.js","assets/CategoricalChart-CUR_9ZiJ.js","assets/index-B5lnCLuB.js","assets/switch-D-6AqAnT.js","assets/scroll-area-DOPuQKg_.js","assets/monaco-editor-BRY87vsh.js","assets/editor-zE4VnGLI.js","assets/calendar-D-rfd7JY.js","assets/editor-classes-BnzpZOY5.js","assets/core.esm-DnEwZVMw.js","assets/sortable.esm-CIP-w8Te.js","assets/combobox-M_E9pRSg.js","assets/search-input-Bo9D0b2l.js","assets/use-file-configs-D87qhE2e.js","assets/asset-utils-Bq_dJbYP.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-WHgo2S29.js","assets/use-section-preview-base-BO-qsUKf.js","assets/seo-editor-BK7SzGFy.js","assets/use-apply-named-rule-vuCkiknA.js","assets/use-move-blocks-DItjAQsv.js","assets/variant-matcher-override-CgElSjwL.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as ue,j as r,r as j,m as Fe,b as Ne,B as $e,a3 as ei,aF as ln,b4 as ct,aG as De,b5 as ti,b6 as ni,b7 as si,b8 as ri,v as Sr,D as Pr,K as Gn,w as jr,x as Er,e as ai,h as gt,I as Mn,y as ii,b9 as oi,a5 as Jn,aZ as li,b2 as ci,i as Nr,ar as In,at as Un,a8 as Tr,P as zn,E as di,t as cn,b3 as ui,q as fi}from"./index-DGn-FPge.js";import{u as Cr,g as pi,c as qs,B as Rn,P as mi,r as hi,R as gi,a as vi,H as xi,b as Rr,S as bi,d as wi,l as yi,m as ki,p as Si,e as Pi,f as Ln,N as ji}from"./parse-sections-BNf6_EjY.js";import{b as Ei,c as Mt,r as Lr,l as Ar,f as Ni,g as Ti,w as Ci}from"./chat-context-GsXpI-Rk.js";import{t as Ri}from"./ChevronUp-BCfBdjs4.js";import{O as Li,P as Ai,I as _r,Q as _i,R as Oi,b as Di,S as Fi,T as Or,U as $i,V as Dr,W as Gs,X as Bi}from"./agent-icon-FkFyvRCX.js";import{a as Mi,n as Ii}from"./UserSquare-Cbfe91aH.js";import{s as Fr}from"./Plus-BhRQRaas.js";import{a as $r,b as Br,P as Mr}from"./popover-CE0A3Qit.js";import{e as dt,b as ut,c as Ir,f as Ur,a as zr,C as Kr}from"./command-D1ggU7uN.js";import{b as Ui,c as zi,u as Ki}from"./repository-binding-DHN5ihZA.js";import{a as It}from"./sandbox-lifecycle-context-Dp2Dt1TA.js";import{r as Hi}from"./thread-intent-C084ju5m.js";import{a as Hr}from"./input-Di6BJ4Zo.js";import{d as Vi,f as Wi,i as qi,g as Gi,h as Ji,j as Yi,k as Qi,u as un,l as Yn,m as Ze,n as Xi,o as Vr,q as Zi,t as eo,v as to,w as Wr,x as no,c as qr,b as Gr,y as so,z as Ve,A as ro,B as ao,C as io,D as oo,E as lo,F as Js,G as co,H as Ys,I as uo,J as fo,K as Qs,L as Xs,M as Zs,N as er,O as tr,P as An,Q as po,R as mo,S as ho,U as go,V as vo,e as xo}from"./site-editor-toast-BUVxT4JG.js";import{u as Jr}from"./use-mobile-D6y1UaCv.js";import{T as pt,a as mt,c as ht}from"./tooltip-BojzNY2M.js";import{T as et}from"./toolbar-icon-button-GjI5vOKF.js";import{w as tn,i as bo}from"./variant-matcher-override-CgElSjwL.js";import{s as Bt,n as Qn,a as Yr,f as We,v as Qr,u as Xr,h as wo,i as yo,B as ko,S as So,C as Po,b as jo,e as Eo,c as No,d as To,g as Co,N as Ro,j as Lo,r as Ao,k as _o,l as nr,p as Oo}from"./blocks-tab-states-Oy4QesXy.js";import{u as Do}from"./use-fast-preview-draft-url-o_WDZuY-.js";import{a as Fo,c as Zr}from"./shell-layout-DzQA4K-b.js";import{u as Xn,b as $o}from"./index-CxEOaGFH.js";import{u as Kn}from"./useQueries-BbqzFtkh.js";import{i as Bo}from"./LinkBroken01-znJYLaVP.js";import{u as ea}from"./blocks-preview-workspace-context-DbUsPnrw.js";import{MonacoCodeEditor as Mo}from"./monaco-editor-BRY87vsh.js";import{c as Io,u as Uo,i as zo,l as Ko,D as Ho}from"./hosted-reconcile-BJXH2g7a.js";import{d as Vo}from"./utils-BU-nucb-.js";import{R as sr,a as nn,b as rr}from"./resizable-CdFCM71r.js";import{u as Wo,a as _n}from"./agent-capabilities-DUEnZmC-.js";import{s as qo,L as Go,R as ta,D as ar,w as Hn}from"./device-hint-DHQmntIa.js";import{L as Jo}from"./label-CHRzCbuP.js";import{a as Yo,T as ir}from"./toggle-group-CFojpTQB.js";import{b as Qo}from"./sandbox-url-D3mC8qhT.js";import{r as Xo,R as Zo}from"./virtual-mcp-CsY6ukOa.js";import{d as el}from"./delay-CnY5UFtP.js";import{s as na}from"./XClose-p8-Q8v8l.js";import{o as tl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as On,b as nl,w as sl,n as or}from"./app-preview-url-9Od4s8Sz.js";import{a as rl}from"./use-organization-settings--v2ov5jL.js";import{E as al}from"./empty-state-BFLQtSFV.js";import{G as lr}from"./github-icon-DNe7j1PY.js";import{R as il}from"./new-project-dialog-UvI58my0.js";import{r as ol}from"./preview-source-BsRLGWUP.js";import{A as ll,a as cl,b as dl}from"./alert-BcGEYE9G.js";import{u as ul}from"./use-task-metadata-jDPe6d5C.js";function fl(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(Li,{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(Ai,{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 pl(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 ml=[];function dn(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?ml: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(fl,{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(pl,{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 hl(t){const e=ue.c(43),{wait:n,hosts:s,invalidLink:a}=t,l=a===void 0?!1:a,c=Ne();let o;e[0]!==l||e[1]!==c?(o=l&&r.jsx(ll,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(cl,{className:"line-clamp-none text-foreground",children:c("decoServe.link.invalidTitle")}),r.jsx(dl,{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=qo(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(dn,{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(Go,{})]}),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(dn,{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 gl(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 vl=15e3,xl=3e3;function bl(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=xl}=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=Wi(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()},Vi(p,vl))}}};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 wl(t,e){return Gi(Ji({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const yl=["loopback-network","local-network-access"];async function kl(){if(qi(window.location.origin))return null;for(const t of yl)try{return await navigator.permissions.query({name:t})}catch{}return null}let sa=null,cr=!1;const Dn=new Set;function Sl(t){if(Dn.add(t),!cr){cr=!0;const e=n=>{sa=n;for(const s of Dn)s()};kl().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Dn.delete(t)}const Pl={status:"stopped",firstRoundDone:!1,problem:null},Fn=new Map;function jl(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??=bl({candidates:t.split(" "),probe:wl,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(Sl,ur,ur)}const El=()=>()=>{},dr=()=>Pl,ur=()=>sa;function Ku(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?jl(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??El,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 Nl(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 Tl=1e4,Cl=1e3,Rl=3e4;function Ll({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()},Tl)},m=()=>{if(!o.current||!c.current)return;l.current&&clearTimeout(l.current);const S=ei(Rl,Cl,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 Al=1500,_l=500;function Ol({iframe:t,reload:e,waitMs:n=Al,confirmMs:s=_l}){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 Dl=ln({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:ln({width:ct(),height:ct()}),position:ln({x:ct(),y:ct()})}),Fl=`(function() {
|
|
3
|
-
if (window.__visualEditorActive) return;
|
|
4
|
-
window.__visualEditorActive = true;
|
|
5
|
-
|
|
6
|
-
var cursorStyle = document.createElement("style");
|
|
7
|
-
cursorStyle.textContent = "* { cursor: default !important; }";
|
|
8
|
-
document.head.appendChild(cursorStyle);
|
|
9
|
-
|
|
10
|
-
var highlight = document.createElement("div");
|
|
11
|
-
highlight.style.cssText = "position:fixed;pointer-events:none;outline:2px solid #a855f7;background:rgba(168,85,247,0.08);border-radius:2px;z-index:2147483647;display:none;";
|
|
12
|
-
document.body.appendChild(highlight);
|
|
13
|
-
|
|
14
|
-
var badge = document.createElement("div");
|
|
15
|
-
badge.style.cssText = "position:fixed;pointer-events:none;background:#a855f7;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
|
|
16
|
-
document.body.appendChild(badge);
|
|
17
|
-
|
|
18
|
-
var lastTarget = null;
|
|
19
|
-
var rafPending = false;
|
|
20
|
-
var moveHandler = function(e) {
|
|
21
|
-
if (rafPending) return;
|
|
22
|
-
rafPending = true;
|
|
23
|
-
var target = e.target;
|
|
24
|
-
requestAnimationFrame(function() {
|
|
25
|
-
rafPending = false;
|
|
26
|
-
var el = target;
|
|
27
|
-
if (!el || el === highlight || el === badge) return;
|
|
28
|
-
if (el === lastTarget) return;
|
|
29
|
-
lastTarget = el;
|
|
30
|
-
var r = el.getBoundingClientRect();
|
|
31
|
-
highlight.style.display = "block";
|
|
32
|
-
highlight.style.top = r.top + "px";
|
|
33
|
-
highlight.style.left = r.left + "px";
|
|
34
|
-
highlight.style.width = r.width + "px";
|
|
35
|
-
highlight.style.height = r.height + "px";
|
|
36
|
-
var tag = el.tagName.toLowerCase();
|
|
37
|
-
var id = el.id ? "#" + el.id : "";
|
|
38
|
-
var cls = el.className && typeof el.className === "string"
|
|
39
|
-
? "." + el.className.trim().split(/\\s+/).slice(0, 2).join(".")
|
|
40
|
-
: "";
|
|
41
|
-
badge.textContent = tag + id + cls;
|
|
42
|
-
badge.style.display = "block";
|
|
43
|
-
badge.style.top = Math.max(0, r.top - 20) + "px";
|
|
44
|
-
badge.style.left = r.left + "px";
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
document.addEventListener("mousemove", moveHandler, true);
|
|
48
|
-
|
|
49
|
-
var outHandler = function(e) {
|
|
50
|
-
if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
|
|
51
|
-
highlight.style.display = "none";
|
|
52
|
-
badge.style.display = "none";
|
|
53
|
-
lastTarget = null;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
document.addEventListener("mouseout", outHandler, true);
|
|
57
|
-
|
|
58
|
-
var clickHandler = function(e) {
|
|
59
|
-
e.preventDefault();
|
|
60
|
-
e.stopImmediatePropagation();
|
|
61
|
-
var el = e.target;
|
|
62
|
-
if (!el || el === highlight || el === badge) return;
|
|
63
|
-
|
|
64
|
-
highlight.style.outline = "2px solid #a855f7";
|
|
65
|
-
highlight.style.background = "rgba(168,85,247,0.15)";
|
|
66
|
-
setTimeout(function() {
|
|
67
|
-
highlight.style.outline = "2px solid #a855f7";
|
|
68
|
-
highlight.style.background = "rgba(168,85,247,0.08)";
|
|
69
|
-
}, 400);
|
|
70
|
-
|
|
71
|
-
var tag = el.tagName.toLowerCase();
|
|
72
|
-
var id = el.id || "";
|
|
73
|
-
var classes = el.className && typeof el.className === "string" ? el.className.trim() : "";
|
|
74
|
-
var text = (el.textContent || "").trim().slice(0, 200);
|
|
75
|
-
var html = (el.outerHTML || "").slice(0, 800).replace(/\\svalue=("[^"]*"|'[^']*'|\\S+)/gi, "");
|
|
76
|
-
|
|
77
|
-
var closestSection = el.closest("section[data-manifest-key]");
|
|
78
|
-
var manifestKey = closestSection ? closestSection.getAttribute("data-manifest-key") : null;
|
|
79
|
-
|
|
80
|
-
var ancestor = el;
|
|
81
|
-
var componentName = null;
|
|
82
|
-
for (var i = 0; i < 10 && ancestor; i++) {
|
|
83
|
-
if (ancestor.dataset) componentName = ancestor.dataset.componentName || componentName;
|
|
84
|
-
ancestor = ancestor.parentElement;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
var parents = [];
|
|
88
|
-
var p = el.parentElement;
|
|
89
|
-
for (var j = 0; j < 4 && p && p !== document.body; j++) {
|
|
90
|
-
var pTag = p.tagName ? p.tagName.toLowerCase() : "";
|
|
91
|
-
var pId = p.id ? "#" + p.id : "";
|
|
92
|
-
var pCls = p.className && typeof p.className === "string"
|
|
93
|
-
? "." + p.className.trim().split(/\\s+/)[0]
|
|
94
|
-
: "";
|
|
95
|
-
parents.unshift(pTag + pId + pCls);
|
|
96
|
-
p = p.parentElement;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
window.parent.postMessage({
|
|
100
|
-
type: "visual-editor::element-clicked",
|
|
101
|
-
payload: {
|
|
102
|
-
tag: tag, id: id, classes: classes, text: text, html: html,
|
|
103
|
-
manifestKey: manifestKey, componentName: componentName,
|
|
104
|
-
parents: parents.join(" > "),
|
|
105
|
-
url: window.location.href, path: window.location.pathname,
|
|
106
|
-
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
107
|
-
position: { x: Math.round(e.clientX), y: Math.round(e.clientY) }
|
|
108
|
-
}
|
|
109
|
-
}, "*");
|
|
110
|
-
};
|
|
111
|
-
document.addEventListener("click", clickHandler, true);
|
|
112
|
-
|
|
113
|
-
window.addEventListener("message", function(e) {
|
|
114
|
-
// Only Studio's own postMessage (source === this frame's parent) may drive the bridge — a nested/downstream frame's forged message can't deactivate the editor.
|
|
115
|
-
if (e.source !== window.parent) return;
|
|
116
|
-
// Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
|
|
117
|
-
if (e.data && e.data.type === "visual-editor::clear-hover") {
|
|
118
|
-
highlight.style.display = "none";
|
|
119
|
-
badge.style.display = "none";
|
|
120
|
-
lastTarget = null;
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (e.data && e.data.type === "visual-editor::deactivate") {
|
|
124
|
-
highlight.remove();
|
|
125
|
-
badge.remove();
|
|
126
|
-
cursorStyle.remove();
|
|
127
|
-
document.removeEventListener("mousemove", moveHandler, true);
|
|
128
|
-
document.removeEventListener("mouseout", outHandler, true);
|
|
129
|
-
document.removeEventListener("click", clickHandler, true);
|
|
130
|
-
window.__visualEditorActive = false;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
})();`;function $l(t,e){const n=t.map(()=>null),s=[];for(let x=0;x<t.length;x++)t[x]!==null&&s.push(x);const a=s.length,l=e.length;if(!a||!l)return n;const c=(x,h)=>{const b=t[s[x]??0];return!b||!b.length?1:b.indexOf(e[h]??"")>=0?2:0},o=[],i=[];for(let x=0;x<=a;x++)o.push(new Array(l+1).fill(0)),i.push(new Array(l+1).fill(2));for(let x=1;x<=a;x++){const h=o[x-1]??[],b=o[x]??[],T=i[x]??[];for(let y=1;y<=l;y++){let g=h[y]??0,N=2;const E=b[y-1]??0;E>g&&(g=E,N=0);const k=c(x-1,y-1),P=(h[y-1]??0)+k;k>0&&P>g&&(g=P,N=1),b[y]=g,T[y]=N}}let d=0,m=a,f=l;for(;m>0&&f>0;){const x=i[m]?.[f]??2;x===1?(n[s[m-1]??0]=f-1,d++,m--,f--):x===0?f--:m--}const p=new Array(l).fill(!1);for(const x of s){const h=n[x];h!=null&&(p[h]=!0)}const S=(x,h)=>{const b=t[x];return!!b&&b.length>0&&b.indexOf(e[h]??"")>=0},v=(x,h)=>{for(const b of s){const T=n[b];if(!(T==null||e[T]!==e[h])&&b<x!=T<h)return!1}return!0};for(const x of s)if(n[x]===null){for(let h=0;h<l;h++)if(!p[h]&&S(x,h)&&v(x,h)){n[x]=h,p[h]=!0,d++;break}}if(d===0&&l===a)for(let x=0;x<a;x++)n[s[x]??0]=x;return n}const Bl=ln({sectionIndex:ct(),manifestKey:De(),clickSeq:ct()}),Ml=`(function() {
|
|
134
|
-
if (window.__cmsEditorActive) return;
|
|
135
|
-
window.__cmsEditorActive = true;
|
|
136
|
-
|
|
137
|
-
// Preserve scroll across variant-override navigations and save-reloads.
|
|
138
|
-
// Selecting a variant rebuilds the iframe src (new x-deco-matchers-override)
|
|
139
|
-
// or reloads it, which would otherwise jump to the top. We persist the scroll
|
|
140
|
-
// offset to sessionStorage (survives reload, same-origin) keyed by pathname
|
|
141
|
-
// (the override only changes the query, so the key is stable), then restore it
|
|
142
|
-
// on the next load — retried for ~1s so it outlasts re-hydration and lazy
|
|
143
|
-
// sections that grow the page after load. The recency guard avoids restoring a
|
|
144
|
-
// stale offset on a genuinely fresh visit.
|
|
145
|
-
var SCROLL_KEY = "__cms_preview_scroll:" + location.pathname;
|
|
146
|
-
var saveScroll = function() {
|
|
147
|
-
try {
|
|
148
|
-
sessionStorage.setItem(SCROLL_KEY, JSON.stringify({
|
|
149
|
-
x: window.scrollX, y: window.scrollY, t: Date.now()
|
|
150
|
-
}));
|
|
151
|
-
} catch (_) {}
|
|
152
|
-
};
|
|
153
|
-
var saveScrollPending = false;
|
|
154
|
-
window.addEventListener("scroll", function() {
|
|
155
|
-
if (saveScrollPending) return;
|
|
156
|
-
saveScrollPending = true;
|
|
157
|
-
requestAnimationFrame(function() { saveScrollPending = false; saveScroll(); });
|
|
158
|
-
}, { passive: true });
|
|
159
|
-
(function restoreScroll() {
|
|
160
|
-
var raw = null;
|
|
161
|
-
try { raw = sessionStorage.getItem(SCROLL_KEY); } catch (_) {}
|
|
162
|
-
if (!raw) return;
|
|
163
|
-
var saved = null;
|
|
164
|
-
try { saved = JSON.parse(raw); } catch (_) { return; }
|
|
165
|
-
if (!saved || (Date.now() - saved.t) > 10000) return;
|
|
166
|
-
if (!saved.x && !saved.y) return;
|
|
167
|
-
var attempts = 0;
|
|
168
|
-
var apply = function() {
|
|
169
|
-
attempts++;
|
|
170
|
-
window.scrollTo(saved.x || 0, saved.y || 0);
|
|
171
|
-
if (attempts < 8) setTimeout(apply, 120);
|
|
172
|
-
};
|
|
173
|
-
apply();
|
|
174
|
-
})();
|
|
175
|
-
|
|
176
|
-
var highlight = document.createElement("div");
|
|
177
|
-
highlight.style.cssText = "position:absolute;pointer-events:none;outline:2px solid #06b6d4;background:rgba(6,182,212,0.06);border-radius:2px;z-index:2147483647;display:none;";
|
|
178
|
-
document.body.appendChild(highlight);
|
|
179
|
-
|
|
180
|
-
var badge = document.createElement("div");
|
|
181
|
-
badge.style.cssText = "position:absolute;pointer-events:none;background:#06b6d4;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
|
|
182
|
-
document.body.appendChild(badge);
|
|
183
|
-
|
|
184
|
-
var isTopLevelSection = function(el) {
|
|
185
|
-
return el && el.parentElement
|
|
186
|
-
? !el.parentElement.closest("section[data-manifest-key]")
|
|
187
|
-
: true;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
// All top-level page sections in DOM order (deco renders page sections as
|
|
191
|
-
// <section data-manifest-key>; nested islands/sections carry the attribute
|
|
192
|
-
// too, hence the top-level filter). This is the full DOM run, framework
|
|
193
|
-
// sections included — getAllSections() narrows it to the editable window.
|
|
194
|
-
var topLevelSections = function() {
|
|
195
|
-
return Array.from(document.querySelectorAll("section[data-manifest-key]"))
|
|
196
|
-
.filter(isTopLevelSection);
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
// Acceptable DOM keys per section; [] = wildcard, null = renders nothing.
|
|
200
|
-
var sectionCandidates = [];
|
|
201
|
-
|
|
202
|
-
// Stringified from section-alignment.ts so both sides share one copy.
|
|
203
|
-
var alignSections = ${$l.toString()};
|
|
204
|
-
|
|
205
|
-
// Indexed like the decofile array; unmapped entries stay null (not clickable).
|
|
206
|
-
var computeAlignment = function(tops) {
|
|
207
|
-
var domKeys = tops.map(function(s) { return s.getAttribute("data-manifest-key"); });
|
|
208
|
-
return alignSections(sectionCandidates, domKeys).map(function(idx) {
|
|
209
|
-
return idx === null ? null : tops[idx];
|
|
210
|
-
});
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
// Editable sections, indexed to match the decofile array the panel uses.
|
|
214
|
-
// Recomputed from the live DOM each call (cheap, rAF-throttled) so it
|
|
215
|
-
// self-heals as client-rendered/lazy sections mount. Until the editor sends
|
|
216
|
-
// candidates, fall back to the full top-level run.
|
|
217
|
-
var getAllSections = function() {
|
|
218
|
-
var tops = topLevelSections();
|
|
219
|
-
return sectionCandidates.length ? computeAlignment(tops) : tops;
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
// Resolve to the OUTERMOST page-level section (clicking nested content still
|
|
223
|
-
// maps to the top-level section the panel indexes); null if it isn't in the
|
|
224
|
-
// aligned editable set (a framework section deco injected).
|
|
225
|
-
var findSection = function(el, out) {
|
|
226
|
-
var node = el;
|
|
227
|
-
var found = null;
|
|
228
|
-
while (node && node !== document.body) {
|
|
229
|
-
if (node.tagName === "SECTION" && node.hasAttribute && node.hasAttribute("data-manifest-key")) {
|
|
230
|
-
found = node;
|
|
231
|
-
}
|
|
232
|
-
node = node.parentElement;
|
|
233
|
-
}
|
|
234
|
-
if (!found) return null;
|
|
235
|
-
var sections = getAllSections();
|
|
236
|
-
if (out) out.sections = sections;
|
|
237
|
-
return sections.indexOf(found) >= 0 ? found : null;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
// A Lazy wrapper's key is just the loader — show the inner section's instead.
|
|
241
|
-
var LAZY_KEYS = [
|
|
242
|
-
"website/sections/Rendering/Lazy.tsx",
|
|
243
|
-
"website/sections/Rendering/SingleDeferred.tsx"
|
|
244
|
-
];
|
|
245
|
-
var isLazyKey = function(key) {
|
|
246
|
-
return LAZY_KEYS.some(function(s) { return key.endsWith(s); });
|
|
247
|
-
};
|
|
248
|
-
var displayKey = function(section) {
|
|
249
|
-
var key = section.getAttribute("data-manifest-key") || "section";
|
|
250
|
-
if (isLazyKey(key)) {
|
|
251
|
-
var inner = section.querySelector("section[data-manifest-key]");
|
|
252
|
-
if (inner) return inner.getAttribute("data-manifest-key") || key;
|
|
253
|
-
}
|
|
254
|
-
return key;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
// Per-section metadata sent by the editor, aligned by index with
|
|
258
|
-
// getAllSections(). labels: names the DOM can't carry (a global section or a
|
|
259
|
-
// global inside async rendering); kinds: section type that drives the color.
|
|
260
|
-
var sectionLabels = [];
|
|
261
|
-
var sectionKinds = [];
|
|
262
|
-
var labelFor = function(section, sections) {
|
|
263
|
-
var idx = (sections || getAllSections()).indexOf(section);
|
|
264
|
-
if (idx >= 0 && sectionLabels[idx]) return sectionLabels[idx];
|
|
265
|
-
return displayKey(section);
|
|
266
|
-
};
|
|
267
|
-
var kindFor = function(section, sections) {
|
|
268
|
-
var idx = (sections || getAllSections()).indexOf(section);
|
|
269
|
-
return (idx >= 0 && sectionKinds[idx]) || "normal";
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
// Highlight palette by section kind: global = light purple, variant = green,
|
|
273
|
-
// normal = blue.
|
|
274
|
-
var COLORS = {
|
|
275
|
-
normal: { solid: "#06b6d4", bg: "rgba(6,182,212,0.06)", active: "rgba(6,182,212,0.18)" },
|
|
276
|
-
global: { solid: "#c084fc", bg: "rgba(192,132,252,0.10)", active: "rgba(192,132,252,0.22)" },
|
|
277
|
-
variant: { solid: "#22c55e", bg: "rgba(34,197,94,0.08)", active: "rgba(34,197,94,0.20)" }
|
|
278
|
-
};
|
|
279
|
-
var applyColor = function(kind) {
|
|
280
|
-
var c = COLORS[kind] || COLORS.normal;
|
|
281
|
-
highlight.style.outline = "2px solid " + c.solid;
|
|
282
|
-
highlight.style.background = c.bg;
|
|
283
|
-
badge.style.background = c.solid;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
var lastSection = null;
|
|
287
|
-
var lastLabel = "";
|
|
288
|
-
var lastKind = "normal";
|
|
289
|
-
var rafPending = false;
|
|
290
|
-
// True while an in-place render fetch/swap is in flight; suppresses hover so it can't re-show the overlay right before the swap snapshots it.
|
|
291
|
-
var renderPending = false;
|
|
292
|
-
|
|
293
|
-
// Document-relative coordinates (rect + scroll) on absolutely-positioned
|
|
294
|
-
// nodes, so the browser scrolls the highlight together with the page
|
|
295
|
-
// natively — no per-frame JS repositioning, no scroll lag.
|
|
296
|
-
var positionHighlight = function(section) {
|
|
297
|
-
var r = section.getBoundingClientRect();
|
|
298
|
-
var top = r.top + window.scrollY;
|
|
299
|
-
var left = r.left + window.scrollX;
|
|
300
|
-
highlight.style.display = "block";
|
|
301
|
-
highlight.style.top = top + "px";
|
|
302
|
-
highlight.style.left = left + "px";
|
|
303
|
-
highlight.style.width = r.width + "px";
|
|
304
|
-
highlight.style.height = r.height + "px";
|
|
305
|
-
badge.textContent = lastLabel || displayKey(section);
|
|
306
|
-
badge.style.display = "block";
|
|
307
|
-
badge.style.top = Math.max(0, top - 20) + "px";
|
|
308
|
-
badge.style.left = left + "px";
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
var moveHandler = function(e) {
|
|
312
|
-
if (renderPending || rafPending) return;
|
|
313
|
-
rafPending = true;
|
|
314
|
-
var target = e.target;
|
|
315
|
-
requestAnimationFrame(function() {
|
|
316
|
-
rafPending = false;
|
|
317
|
-
if (renderPending) return;
|
|
318
|
-
if (!target || target === highlight || target === badge) return;
|
|
319
|
-
var out = {};
|
|
320
|
-
var section = findSection(target, out);
|
|
321
|
-
if (section === lastSection) return;
|
|
322
|
-
lastSection = section;
|
|
323
|
-
if (!section) {
|
|
324
|
-
highlight.style.display = "none";
|
|
325
|
-
badge.style.display = "none";
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
lastLabel = labelFor(section, out.sections);
|
|
329
|
-
lastKind = kindFor(section, out.sections);
|
|
330
|
-
applyColor(lastKind);
|
|
331
|
-
positionHighlight(section);
|
|
332
|
-
});
|
|
333
|
-
};
|
|
334
|
-
document.addEventListener("mousemove", moveHandler, true);
|
|
335
|
-
|
|
336
|
-
// Window scroll is handled natively by the absolute positioning above; this
|
|
337
|
-
// only re-syncs on resize and on scrolls inside nested scroll containers
|
|
338
|
-
// (capture=true catches those), where document coordinates do shift.
|
|
339
|
-
var reposition = function() {
|
|
340
|
-
if (!lastSection || highlight.style.display === "none") return;
|
|
341
|
-
if (rafPending) return;
|
|
342
|
-
rafPending = true;
|
|
343
|
-
requestAnimationFrame(function() {
|
|
344
|
-
rafPending = false;
|
|
345
|
-
if (lastSection && highlight.style.display !== "none") positionHighlight(lastSection);
|
|
346
|
-
});
|
|
347
|
-
};
|
|
348
|
-
window.addEventListener("scroll", reposition, { capture: true, passive: true });
|
|
349
|
-
window.addEventListener("resize", reposition, { passive: true });
|
|
350
|
-
|
|
351
|
-
var outHandler = function(e) {
|
|
352
|
-
if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
|
|
353
|
-
highlight.style.display = "none";
|
|
354
|
-
badge.style.display = "none";
|
|
355
|
-
lastSection = null;
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
document.addEventListener("mouseout", outHandler, true);
|
|
359
|
-
|
|
360
|
-
var clickSeq = 0;
|
|
361
|
-
|
|
362
|
-
// Blocks observes clicks to select sections in the side panel; it must not
|
|
363
|
-
// cancel the iframe page's own handlers or native control behavior.
|
|
364
|
-
var clickHandler = function(e) {
|
|
365
|
-
var target = e.target;
|
|
366
|
-
if (!target || target === highlight || target === badge) return;
|
|
367
|
-
var out = {};
|
|
368
|
-
var section = findSection(target, out);
|
|
369
|
-
if (!section) return;
|
|
370
|
-
|
|
371
|
-
var sectionIndex = out.sections.indexOf(section);
|
|
372
|
-
var manifestKey = section.getAttribute("data-manifest-key") || "";
|
|
373
|
-
|
|
374
|
-
var c = COLORS[lastKind] || COLORS.normal;
|
|
375
|
-
highlight.style.outline = "2px solid " + c.solid;
|
|
376
|
-
highlight.style.background = c.active;
|
|
377
|
-
setTimeout(function() {
|
|
378
|
-
highlight.style.background = c.bg;
|
|
379
|
-
}, 400);
|
|
380
|
-
|
|
381
|
-
clickSeq++;
|
|
382
|
-
window.parent.postMessage({
|
|
383
|
-
type: "cms-editor::section-clicked",
|
|
384
|
-
payload: { sectionIndex: sectionIndex, manifestKey: manifestKey, clickSeq: clickSeq }
|
|
385
|
-
}, "*");
|
|
386
|
-
};
|
|
387
|
-
document.addEventListener("click", clickHandler, true);
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* Navigation is disabled while editing: leaving the page would leave the
|
|
391
|
-
* panel editing the previous page's sections. Only the default action of a
|
|
392
|
-
* real navigation is cancelled, never propagation — in-page controls must
|
|
393
|
-
* keep working (#5567).
|
|
394
|
-
*/
|
|
395
|
-
var isNavigatingAnchor = function(a) {
|
|
396
|
-
if (!a) return false;
|
|
397
|
-
var href = a.getAttribute("href");
|
|
398
|
-
if (!href) return false;
|
|
399
|
-
var trimmed = href.trim();
|
|
400
|
-
if (!trimmed || trimmed.charAt(0) === "#") return false;
|
|
401
|
-
if (/^javascript:/i.test(trimmed)) return false;
|
|
402
|
-
// Same document + fragment only scrolls.
|
|
403
|
-
try {
|
|
404
|
-
var url = new URL(a.href, location.href);
|
|
405
|
-
if (url.href.split("#")[0] === location.href.split("#")[0]) return false;
|
|
406
|
-
} catch (_) {}
|
|
407
|
-
return true;
|
|
408
|
-
};
|
|
409
|
-
var navBlocker = function(e) {
|
|
410
|
-
var el = e.target;
|
|
411
|
-
var a = el && el.closest ? el.closest("a") : null;
|
|
412
|
-
if (!isNavigatingAnchor(a)) return;
|
|
413
|
-
e.preventDefault();
|
|
414
|
-
};
|
|
415
|
-
document.addEventListener("click", navBlocker, true);
|
|
416
|
-
|
|
417
|
-
var submitBlocker = function(e) { e.preventDefault(); };
|
|
418
|
-
document.addEventListener("submit", submitBlocker, true);
|
|
419
|
-
|
|
420
|
-
// Fast Preview in-place render: POST merged decofile to /live/previews, swap the HTML in (document/window listeners survive; overlay nodes get re-attached).
|
|
421
|
-
var renderCtrl = null;
|
|
422
|
-
var renderQueue = Promise.resolve();
|
|
423
|
-
var TRANSITION_TAG =
|
|
424
|
-
"<style id=\\"deco-disable-transitions\\">* { transition: none !important; }</style></head>";
|
|
425
|
-
|
|
426
|
-
// A skipped view transition rejects its promises with "AbortError:
|
|
427
|
-
// Transition was skipped"; nobody else waits on them, so they are settled
|
|
428
|
-
// here rather than left as uncaught errors in the page's console.
|
|
429
|
-
var settleTransition = function(vt) {
|
|
430
|
-
if (!vt) return;
|
|
431
|
-
var ignore = function() {};
|
|
432
|
-
if (vt.ready) vt.ready.catch(ignore);
|
|
433
|
-
if (vt.updateCallbackDone) vt.updateCallbackDone.catch(ignore);
|
|
434
|
-
if (vt.finished) vt.finished.catch(ignore);
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
// A site that opts into cross-document view transitions
|
|
438
|
-
// (@view-transition { navigation: auto }) gets one on every reload a save
|
|
439
|
-
// makes. When the next save navigates the frame before that transition
|
|
440
|
-
// starts, the browser skips it and rejects the outgoing page's ready
|
|
441
|
-
// promise, which only a pageswap listener can reach. Kept after deactivate:
|
|
442
|
-
// settling changes nothing else, and the frame may still navigate.
|
|
443
|
-
if (!window.__cmsEditorPageSwap) {
|
|
444
|
-
window.__cmsEditorPageSwap = true;
|
|
445
|
-
window.addEventListener("pageswap", function(e) {
|
|
446
|
-
settleTransition(e.viewTransition);
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
// A quick second save skips the running transition. Only finished says
|
|
451
|
-
// when the swap is over, so the chain waits on it; the rest is settled.
|
|
452
|
-
var runSwapTransition = function(swap) {
|
|
453
|
-
if (typeof document.startViewTransition !== "function") {
|
|
454
|
-
swap();
|
|
455
|
-
return Promise.resolve();
|
|
456
|
-
}
|
|
457
|
-
var vt = document.startViewTransition(swap);
|
|
458
|
-
settleTransition(vt);
|
|
459
|
-
return vt.finished;
|
|
460
|
-
};
|
|
461
|
-
var renderInPlace = function(src, body) {
|
|
462
|
-
if (renderCtrl) renderCtrl.abort();
|
|
463
|
-
var ctrl = new AbortController();
|
|
464
|
-
renderCtrl = ctrl;
|
|
465
|
-
renderPending = true;
|
|
466
|
-
highlight.style.display = "none";
|
|
467
|
-
badge.style.display = "none";
|
|
468
|
-
window.parent.postMessage({ type: "cms-editor::render-start" }, "*");
|
|
469
|
-
renderQueue = renderQueue.then(function() {
|
|
470
|
-
return fetch(src, {
|
|
471
|
-
method: "POST",
|
|
472
|
-
body: body,
|
|
473
|
-
signal: ctrl.signal,
|
|
474
|
-
headers: { accept: "text/html", "content-type": "application/json" }
|
|
475
|
-
}).then(function(res) {
|
|
476
|
-
if (!res.ok) throw new Error("render " + res.status);
|
|
477
|
-
return res.text();
|
|
478
|
-
}).then(function(html) {
|
|
479
|
-
var swap = function() {
|
|
480
|
-
document.documentElement.innerHTML = html.replace("</head>", TRANSITION_TAG);
|
|
481
|
-
document.body.appendChild(highlight);
|
|
482
|
-
document.body.appendChild(badge);
|
|
483
|
-
// Old section is gone; hide the overlay until the next hover repositions it.
|
|
484
|
-
highlight.style.display = "none";
|
|
485
|
-
badge.style.display = "none";
|
|
486
|
-
lastSection = null;
|
|
487
|
-
};
|
|
488
|
-
var headHtml = html.slice(html.indexOf("<head>"), html.indexOf("</head>") + 7);
|
|
489
|
-
var doc = new DOMParser().parseFromString(headHtml, "text/html");
|
|
490
|
-
var sheets = Array.prototype.map.call(
|
|
491
|
-
doc.head.querySelectorAll("link[rel=\\"stylesheet\\"]"),
|
|
492
|
-
function(el) { return el.href ? fetch(el.href).catch(function() {}) : null; }
|
|
493
|
-
);
|
|
494
|
-
return Promise.all(sheets).then(function() {
|
|
495
|
-
return runSwapTransition(swap);
|
|
496
|
-
});
|
|
497
|
-
}).then(function() {
|
|
498
|
-
var t = document.getElementById("deco-disable-transitions");
|
|
499
|
-
if (t) t.remove();
|
|
500
|
-
if (ctrl === renderCtrl) renderPending = false;
|
|
501
|
-
window.parent.postMessage({ type: "cms-editor::render-end" }, "*");
|
|
502
|
-
}).catch(function(err) {
|
|
503
|
-
if (ctrl === renderCtrl) renderPending = false;
|
|
504
|
-
if (err && err.name === "AbortError") return;
|
|
505
|
-
window.parent.postMessage({ type: "cms-editor::render-error" }, "*");
|
|
506
|
-
});
|
|
507
|
-
});
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
window.addEventListener("message", function(e) {
|
|
511
|
-
// Only Studio's own postMessage (source === this frame's parent) may drive the bridge — forged senders can't trigger the render fetch/swap.
|
|
512
|
-
if (e.source !== window.parent) return;
|
|
513
|
-
if (e.data && e.data.type === "cms-editor::render" && typeof e.data.src === "string") {
|
|
514
|
-
renderInPlace(e.data.src, e.data.body);
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
if (e.data && e.data.type === "cms-editor::set-labels" && Array.isArray(e.data.labels)) {
|
|
518
|
-
sectionLabels = e.data.labels;
|
|
519
|
-
if (Array.isArray(e.data.kinds)) sectionKinds = e.data.kinds;
|
|
520
|
-
if (Array.isArray(e.data.keys)) sectionCandidates = e.data.keys;
|
|
521
|
-
if (lastSection) {
|
|
522
|
-
lastLabel = labelFor(lastSection);
|
|
523
|
-
lastKind = kindFor(lastSection);
|
|
524
|
-
applyColor(lastKind);
|
|
525
|
-
if (highlight.style.display !== "none") positionHighlight(lastSection);
|
|
526
|
-
}
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
// Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
|
|
530
|
-
if (e.data && e.data.type === "cms-editor::clear-hover") {
|
|
531
|
-
highlight.style.display = "none";
|
|
532
|
-
badge.style.display = "none";
|
|
533
|
-
lastSection = null;
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
if (e.data && e.data.type === "cms-editor::deactivate") {
|
|
537
|
-
highlight.remove();
|
|
538
|
-
badge.remove();
|
|
539
|
-
document.removeEventListener("mousemove", moveHandler, true);
|
|
540
|
-
document.removeEventListener("mouseout", outHandler, true);
|
|
541
|
-
document.removeEventListener("click", clickHandler, true);
|
|
542
|
-
// Or the page stays unnavigable after leaving Blocks mode.
|
|
543
|
-
document.removeEventListener("click", navBlocker, true);
|
|
544
|
-
document.removeEventListener("submit", submitBlocker, true);
|
|
545
|
-
window.removeEventListener("scroll", reposition, { capture: true });
|
|
546
|
-
window.removeEventListener("resize", reposition);
|
|
547
|
-
window.__cmsEditorActive = false;
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
})();`,sn=Object.freeze({ready:"deco:ready",load:"deco:load",loaded:"deco:loaded",loadError:"deco:load-error"}),Il="v1",Ul="/studio-modules",$n=["wireframe","html-swap"];function zl(t,e,n){const s=new URL(`${Ul}/${Il}/${e}.js`,t);return n&&s.searchParams.set("build",n),s.href}const Kl=2e3;class Hl{constructor(e){this.options=e,this.urls=Object.fromEntries($n.map(n=>[n,zl(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===sn.ready)return Vl(e.origin)?(this.ready(e.origin),!0):!1;if(e.origin!==this.origin)return!1;const a=s;switch(a.type){case sn.loaded:{const l=this.nameOf(a.url);return l&&(this.loaded.add(l),this.options.onModulesChange?.(),l==="wireframe"&&this.options.onWireframeReady?.()),!0}case sn.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()},Kl),!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:sn.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 Vl(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&&ti(a,n)){const l=Array.isArray(s.variants)?s.variants:[];if(l.length===0||l.every(i=>{const d=i?.rule;return ni(d?.__resolveType,n)}))return null;const o=[];for(const i of l){const d=si(i,n);if(d&&typeof d=="object")for(const m of Vn(d,e,n)??[])o.includes(m)||o.push(m)}return o}if(ri(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 Wl(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 ql(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 Gl(t){const e=ue.c(45),{element:n,onDismiss:s}=t,[a,l]=j.useState(""),c=j.useRef(null),{sendMessage:o}=Ei(),{openSidePanel:i}=Fo(),d=Ne();let m;e[0]!==n||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const W=Wl(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=ql(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",Jl=/details?page|\bpdp\b/i,Yl=/listingpage|\bplp\b/i;function Ql(t,e,n){const s=new Set;for(const o of n)Jl.test(o)&&s.add("product"),Yl.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 Xl=["rosa","preto","pink","black"];function rn(t,e){const n=e.trim();return n?t(n):Xl.flatMap(s=>t(s))}function Zl(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 ec(t){const e=new Set;for(const n of t){const s=Zn(n);aa.has(s)&&e.add(s)}return e}function tc(t,e){const n=Zn(t);return!aa.has(n)||e.size===0?!0:e.has(n)}const nc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>rn(n=>Zl(t,n),e),optionsFromPayload:an},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>rn(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:an},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>rn(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:an},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>rn(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:an},{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:cc}];function sc(t,e,n=new Set){const s=[...e],a=o=>{const i=[];for(const d of nc){if(d.kind!==o)continue;const m=s.find(f=>d.test(f)&&tc(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(rc(t.has("category")?"category":"product")),c}function rc(t){return{kind:t,id:pr,resolveType:pr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>mc(e,n)}}function tt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ac(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=tt(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=tt(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 ic(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function oc(t){const e=[];let n="^";for(const s of t)s.type==="text"?n+=ic(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}=oc(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 an(t,e){const n=tt(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=tt(c);if(!o)continue;const i=la(o.url,e.template,e.paramName);if(!i||l.has(i))continue;l.add(i);const d=tt(o.isVariantOf),m=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||i,f=Array.isArray(o.image)?tt(o.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;a.push({value:i,label:m,image:p})}return a}function lc(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 cc(t){const e=[],n=new Set,s=(a,l)=>{const c=tt(a);if(!c)return;const o=typeof c.name=="string"&&c.name?c.name:"",i=o?[...l,o]:l,d=lc(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 dc=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 uc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function fc(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 pc(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 mc(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"&&dc.has(d.split("/")[0]??"")||(s.add(d),n.push({value:d,label:c&&c.length<=80?c:uc(d),kind:o,image:i}))};for(const{url:l,name:c,image:o}of pc(t))a(l,c,"product",o);for(const{href:l,text:c}of fc(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 hc(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 gc(t,{resolveType:e,props:n}){const s=await fetch(Yi(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(Qi(t,e),{signal:AbortSignal.timeout(ca)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function vc(t,e,n){const s=e.optionsFromPayload(await mr(t,"/"),n),a=s.find(c=>c.kind==="category");if(!a)return s;const l=We(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 xc(t,e,n){return Gn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function bc(t,e,n,s){if(e.homepageLinks)return vc(t,e,s);const a=e.buildRequests?.(n)??[];if(a.length===0)return[];const l=await Promise.allSettled(a.map(o=>gc(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:xc(t,e,n),queryFn:()=>bc(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:We(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 wc(t){const e=ue.c(52),{sources:n,template:s,paramName:a,value:l,sandboxRef:c,onCommit:o}=t,i=Ne(),[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=hc(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(Tc),O=n.filter(Nc),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(Ec),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(jc),f),L=Dt(q.filter(Pc),f),M=X.length>0&&L.length>0,I=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),I(!1)},V=Yr(f),Q=We(s,{[a]:V}),ne=Pr,se=Sr,U="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",re=Sc;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=Ur,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 Ce=Ir,Ie="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(Bo,{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:qe,options:xt}=ee,{noun:Ge}=b[ce.kind];if(qe.isLoading)return r.jsx(hr,{text:i("sandbox.pathParamPickerChip.loading",{noun:Ge})},ce.id);if(qe.isError)return r.jsx(hr,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},ce.id);if(ce.homepageLinks){const Ut=qe.data??[];return r.jsxs(j.Fragment,{children:[r.jsx(Ft,{heading:b.category.heading,iconKind:"category",options:Dt(Ut.filter(kc),f),template:s,paramName:a,keyPrefix:`${ce.id}:cat`,onSelect:z}),r.jsx(Ft,{heading:b.product.heading,iconKind:"product",options:Dt(Ut.filter(yc),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]!==Ce||e[33]!==Be||e[34]!==vt||e[35]!==ge?(_e=r.jsxs(Ce,{className:Ie,children:[Be,vt,ge]}),e[32]=Ce,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 ze;e[41]!==se||e[42]!==ie||e[43]!==he||e[44]!==be||e[45]!==re?(ze=r.jsxs(se,{className:U,onClick:re,children:[ie,he,be]}),e[41]=se,e[42]=ie,e[43]=he,e[44]=be,e[45]=re,e[46]=ze):ze=e[46];let Re;return e[47]!==ne||e[48]!==I||e[49]!==d||e[50]!==ze?(Re=r.jsx(ne,{open:d,onOpenChange:I,children:ze}),e[47]=ne,e[48]=I,e[49]=d,e[50]=ze,e[51]=Re):Re=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(),I(!0)},children:l||h}),Re]})}function yc(t){return t.kind==="product"}function kc(t){return t.kind!=="product"}function Sc(t){return t.stopPropagation()}function Pc(t){return t.kind==="product"}function jc(t){return t.kind!=="product"}function Ec(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Nc(t){return t.isFallback}function Tc(t){return!t.isFallback}function Cc(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(Rc);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 Rc(t){return!t.isFallback}function Lc(t){const e=ue.c(31),{name:n,value:s,onCommit:a}=t,l=Ne(),[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:Ac,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(_i,{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 Ac(t){return t.stopPropagation()}function _c(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 Oc(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Dc(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function Fc(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function $c(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 Bc(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new da;return n}async function Mc(t,e,n){return n?qs(t,e,await Bc(n.meta,n.loadMeta)):qs(t,e)}function Ic(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=pi(c),f=i?{...i,name:c,path:o}:await Mc(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],ai(a)}function Uc(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=Ne();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 I;e[43]!==q||e[44]!==M?(I=r.jsxs("div",{className:"space-y-1.5",children:[q,M]}),e[43]=q,e[44]=M,e[45]=I):I=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(mi,{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]!==I||e[56]!==H||e[57]!==F?(z=r.jsxs("div",{className:"space-y-4 py-4",children:[J,I,H,F]}),e[54]=J,e[55]=I,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 U;e[71]!==i||e[72]!==d?(U=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]=U):U=e[73];let re;e[74]!==se||e[75]!==U?(re=r.jsx($e,{type:"submit",disabled:se,children:U}),e[74]=se,e[75]=U,e[76]=re):re=e[76];let ae;e[77]!==ne||e[78]!==re?(ae=r.jsxs(ii,{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 zc(t){const e=ue.c(36),{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:c,decofile:o,blockKey:i}=t,d=Ne();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=vi((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=hi(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(gi,{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:c,decofile:o,kind:"loaders",target:g,initialValue:h,isCreating:f.isPending,onCreate:Kc,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(xi,{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 Kc(){}function Hc(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:Hc(t.error)}}function Vc(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 Wc(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=Vc(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 qc=j.lazy(()=>oi(()=>import("./sections-editor-C7sTzFTf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159])).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=It(),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=un(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=Wc({lifecyclePhase:d.lifecycle.phase,decofile:gr(T),meta:gr(g),hasEditableContent:wo(T.data,g.data),fastPreviewActive:Hr(n).runtime==="cms"||Ze(h)}),E=Rr()===void 0,k=Gc;if(yo(h)){let L;return e[10]===Symbol.for("react.memo_cache_sentinel")?(L=k(r.jsx(So,{})),e[10]=L):L=e[10],L}if(h.kind==="pending"&&h.retrying){let L;return e[11]!==h?(L=k(r.jsx(Po,{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(li,{})),e[13]=L):L=e[13],L}if(T.data&&Xi(g.data)){const L=f.state.target,M=L?.kind==="page"||L?.kind==="section"?L.key:null,I=M??"",H=o??"";let F;return e[14]!==T.data||e[15]!==M||e[16]!==c.slug||e[17]!==I||e[18]!==H||e[19]!==n?(F=k(r.jsx(bi,{orgSlug:c.slug,virtualMcpId:n,branch:H,decofile:T.data,initialKey:M,compact:!0},I)),e[14]=T.data,e[15]=M,e[16]=c.slug,e[17]=I,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(jo,{})),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 I;return e[27]!==M||e[28]!==N.source?(I=k(r.jsx(ko,{source:N.source,onRetry:M})),e[27]=M,e[28]=N.source,e[29]=I):I=e[29],I}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 I;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?(I=C(r.jsx(zc,{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]=I):I=e[38],I}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(qc,{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 Gc(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=Ne(),o=Rr(),i=o===!0,d=Vr(n);let m;e[0]!==d||e[1]!==s?(m=Zi(d,Vo(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=It().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}=wi(N,E),O=S??"";let R;e[14]!==p.slug||e[15]!==O||e[16]!==n?(R=Io({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=Uo(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 I=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(ci,{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]!==I||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(Mo,{code:L,language:"json",readOnly:q,height:"100%",onChange:Q=>I(Q??""),onSave:Q=>{I(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]=I,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 Jc(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Yc(t,e){return t==="blocks"?"preview":e?"blocks":t}function Qc(t){return ua({contentEditingEnabled:Zr(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function Xc(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function Zc(t){const e=eo(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=to(s,e);return{value:e,frame:a?Hn(a,t.device):null,newTab:a}}function ed(t){const e=ue.c(94),{tests:n,load:s,onOpen:a,options:l,onChange:c,available:o}=t,i=Ne();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=U=>{const re=U?Ko(U):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=(U,re)=>{const ae={...p};re==="on"?ae[U]=!0:re==="off"?ae[U]=!1:delete ae[U];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=U=>{U&&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(Oi,{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(et,{"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(Jo,{htmlFor:"preview-as-moment",children:D}),e[40]=D,e[41]=_):_=e[41];let B;e[42]!==l.at?(B=zo(l.at),e[42]=l.at,e[43]=B):B=e[43];let W;e[44]!==v?(W=U=>v(U.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:Ho,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 I;e[64]!==_||e[65]!==X||e[66]!==M?(I=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,X,M]}),e[64]=_,e[65]=X,e[66]=M,e[67]=I):I=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(U=>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:U}),r.jsxs(Yo,{type:"single",variant:"outline",size:"sm",value:p[U]===void 0?"":p[U]?"on":"off",onValueChange:re=>h(U,re),"aria-label":U,children:[r.jsx(ir,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(ir,{value:"on",children:i("sandbox.previewAs.on")})]})]},U))}),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]!==I||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,I,V,Q]}),e[85]=A,e[86]=I,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 td=15e3;function nd(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 sd(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 rd(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&&sd(i,a)?{base:e,src:o,shown:a}:null}const ad=["next"],id=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],fa=new Set(["tsx","ts","jsx","js","mdx"]),od=new Set(["tsx","jsx"]),ld=new Set(["404","500"]);function cd(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 dd(t){const e=cd(t);return ad.some(n=>e.has(n))?"next":id.some(n=>e.has(n))?"tanstack":null}function pa(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function ud(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 fd(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&&ld.has(n)||s.some(a=>a.startsWith("_")||a.includes("["))?null:(s.at(-1)==="index"&&s.pop(),`/${s.join("/")}`)}function pd(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 md(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 hd(t){const e=es(t.at(-1)??"");if(!e||!od.has(e[1]))return null;const n=[...t.slice(0,-1),...md(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 gd(t,e){const n=e.split("/").filter(Boolean);if(n.length===0)return null;switch(t){case"next-pages":return fd(n);case"next-app":return pd(n);case"tanstack":return hd(n);default:{const s=t;throw new Error(`Unknown router: ${String(s)}`)}}}function vd(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=gd(n.router,l.slice(a.length));c&&e.add(c)}}return[...e].sort((n,s)=>n==="/"?-1:s==="/"?1:n.localeCompare(s))}const xd=5e3,bd=6e4;async function wd(t,e){const n=await fetch(Qo(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:xd})});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 yd(t,e){const n=await no(t,pa(e,"package.json"));if(n.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const s=n.kind==="data"?dd(n.data):null;if(!s)return[];const a=ud(s,e),l=await Promise.all(a.map(async c=>({root:c,files:await wd(t,c)})));return vd(l)}function kd(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?yd(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:bd},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 Sd=500,Pd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},wr=1,on=["desktop","mobile","tablet"],jd=["preview","visual","blocks"],yr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Ed(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 Nd(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 Td(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Cd(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 Rd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Ld({virtualMcpId:t}){const e=Ne(),n=Jr(),{currentBranch:s,taskId:a,virtualMcpId:l}=Mt(),c=!!Ni(),o=ea(),i=Ui(l===t?t:null),d=Hr(t),m=Xo(i?.metadata?.ui?.layout??null),f=Zr(m),p=ua({contentEditingEnabled:f,isMobile:n}),[S]=j.useState(()=>Qc({cmsMode:m,isMobile:n})),[v,x]=In(Un.previewEditingMode(t),u=>u&&jd.includes(u)?u:null),h=v??S,[b,T]=In(Un.previewDeviceSize(t),u=>u&&on.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),[I,H]=j.useState(),[F,z]=j.useState(null),[V,Q]=j.useState(null),[ne,se]=j.useState(null),[U,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(),Ce=Xn(),Ie=It(),Ue=Ie.vmEntry,Be=Ce.lifecycle.phase,{url:vt}=qr(t),ge=un(t,s),{connection:_e}=Gr(t),be=Wo(t),ze=so({hasServeConnection:!!_e,runtime:d.runtime}),Re=!Ze(ge)&&ge.kind!=="pending",ee=Ve(ge)??vt,ce=ee??Ie.previewUrl,qe=!!ee||Be==="running",xt=i?.id===t?Hi(i.metadata):null,Ge=!ee&&i?.id===t&&d.runtime==="cms",Ut=d.projectDefault==="cms",bt=Re?ro({sandboxUrl:ce,previewServerUrl:xt,fastPreviewActive:Ge}):null,ts=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,threadId:a??null,previewUrl:ce}:null,ns=Yn(ts,{fetchEnabled:qe}),fn=Xr(ts,{fetchEnabled:qe}),de=ns.data,Pe=fn.data,Je=de?Eo(de,Pe).sort((u,w)=>u.name.localeCompare(w.name)):[],pn=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s}:null,ss=Ic(pn),mn=de&&Pe?No(de,Pe):[],rs=Re&&de&&Pe?yi(Pe,de,"loaders"):[],as=K?(()=>{const u=K.toLowerCase();return Je.map(w=>({page:w,score:Cd(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)})():Je,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)}),zt=V?rs.find(u=>u.key===V)??null:null,Ee=Qn,hn=F||V?null:To(Je,U,ae),oe=hn?.key??null,nt=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,Kt=hn?.path??null,st=(oe?me[oe]:void 0)??{},Te=We(U,st),gn={};if(Re&&qe&&ce&&Pe&&de){const u=ki(Pe,"loaders"),w=oe?de[oe]:void 0,$=ac(w,de,ye=>u.has(ye)),te=ec($);for(const ye of Bt(U)){if(ye.type!=="param")continue;const Me=Ql(U,ye.name,$),Ae=sc(Me,u,te);Ae.length>0&&(gn[ye.name]=Ae)}}const wt=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,threadId:a??null}:null,cs=de&&oe?Co(de,oe,0):[],ds=Ze(ge),us=de?Si(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)),rt=j.useRef(null),Oe=j.useRef(null),ma=Ce.status.state==="paused",vn=Ce.phase,fs=Pi({claimPhase:vn,lifecycle:Ce.lifecycle}),Ye=Ie.previewState,ha=Ie.userStopped,ga=ao(le.slug,t??""),{url:Ke}=Do(Ge&&t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,previewServerUrl:xt??null,path:Te}:null),va=Ut&&d.runtime==="sandbox",Le=io(ge,ze,be),ps=oo(Le&&Ge&&ge.kind==="protocol"&&t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s}:null),ms=Le?ps.pointer:null,Y=Nl({previewState:Ye,progressStatus:fs.status,previewServerUrl:xt,fastPreviewActive:Ge,fastPreviewReady:!!Ke,codingSession:va,localPreviewUrl:ee,hostedDraft:Le,hostedPointerPending:Le&&(ge.kind==="pending"||ps.pending)}),hs=Y.showWakingPill||Le&&Y.mode==="production"&&!ms,Pt=Y.mode!=="none",xa=Y.mode==="production"&&Y.iframeBase?$t(Y.iframeBase):null,at=Y.mode==="production"?xa:$t(ce),ba=i?.id===t&&i.metadata?.fastPreviewInPlace===!0,jt=Re?ee?Y.mode==="sandbox"&&p&&h==="blocks":Y.mode==="production"&&Ge&&ba&&p&&h==="blocks":!1,gs=j.useRef(null),{pin:wa,effective:ya}=Nd(gs.current,{inPlaceRenderActive:jt,draftPreviewUrl:Ke,resolvedPath:Te});gs.current=wa;const vs=o.state.variantOverride??[],Ht=Re?vs:[],Et=Re?[]:vs,Vt=Ze(ge)&&Ro.some(u=>Lo(Pe,u)==="available"),it=Vt?G:{},xs=Wr(it),ka=Vt&&de?Object.keys(Ao(de).experiments):[],[bs,Sa]=j.useState(!1),ws=lo(pn,Vt&&bs?_o:[]),Pa={...ws,ready:!(ge.kind==="protocol"&&ge.hosted)||bs&&ws.ready},Qe=t?Js(le.slug,t):null,ja=co(Qe),Wt=Le?Zc({display:Y,path:Te,pointer:ms,heldRevision:ja,device:b,forcedVariants:Et,previewOptions:it}):null,ys=JSON.stringify([Et,it]);j.useEffect(()=>{if(!Le||!Qe)return;const[u,w]=JSON.parse(ys);Ys(Qe,{forcedVariants:u,previewOptions:w})},[Le,Qe,ys]),j.useEffect(()=>{if(!(!Le||!Qe))return()=>Ys(Qe,null)},[Le,Qe]);const xn=_e&&Ve(ge)?uo(_e.endpoint,Et,xs):null,Ea=_e&&Ve(ge)?xn?fo(xn,it):Qs:null,Xe=Ed(Y.mode==="sandbox"?tn(Hn(Xs(ne??Bn(Te,Y.iframeBase)??Y.iframeBase,Ea),b),Ht):Y.mode==="production"&&Wt?.frame?Wt.frame:Y.mode==="production"?tn(Hn(Zs(er(Xs(ne??ya??Bn(Te,Y.iframeBase)??Y.iframeBase,hs?Qs:null),Et),it),b),Ht):null),ks=Ke??(Y.iframeBase?Bn(Te,Y.iframeBase):null),Ss=Y.mode==="production"&&Wt?Wt.newTab:Y.mode==="production"?ks?tn(Zs(er(ks,Et),it),Ht):null:Xe??Y.iframeBase,Na=()=>{const u=Ss;u&&window.open(u,"_blank","noopener")},Nt=t&&s?Ar(le.slug,t,s):null,Tt=u=>{Nt&&Ci(Nt,u)},ke=o.state.target;j.useEffect(()=>{if(!(!ke||!bt||!Pe))if(ke.kind==="page"){const u=me[ke.key]??{};Oe.current=We(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||Kt===null||ke?.kind==="page"&&ke.key===oe&&ke.path===Kt||o.selectTarget({kind:"page",key:oe,path:Kt})},[oe,Kt,ke]);const[Ps,Ta]=j.useState(null);if(Ye.kind==="iframe"&&Ps!==Ye.previewUrl){const u=Ps!==null;Ta(Ye.previewUrl);const w=Nt?Lr(Nt):null;if(w){if(Oe.current=We(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))}rt.current=Xe;const Ca=Y.mode==="production"&&!!Ke&&!ee,[qt,bn]=j.useState({src:Xe??void 0,loading:!1}),[Ra,wn]=j.useState(!1),[La,Aa]=j.useState(),[js,Es]=j.useState(null),je=rd(js,{base:Y.iframeBase??"",frameSrc:qt.src,loadedSrc:La,wanted:Xe??void 0,canSwap:be&&Ra&&!qt.loading});je!==js&&Es(je);const Gt=nd(qt,je?je.src:Xe??void 0,Ca);Gt!==qt&&bn(Gt);const ot=Gt.src,Ns=Gt.loading,Ts=Ll({iframeRef:k,src:Y.mode==="sandbox"?Xe:null,active:Y.mode==="sandbox"}),Cs=j.useRef(null);j.useEffect(()=>{const u=Ns?setTimeout(()=>bn(br),td):null,w=()=>{u&&clearTimeout(u)};if(!Ke||!ot||Cs.current===Ke)return w;Cs.current=Ke;const $=k.current;return $&&$.getAttribute("src")!==ot&&(Se(),$.src=ot),w},[Ke,ot,Ns]);const Rs=()=>{const u=k.current?.contentWindow,w=at;if(!u||!w||!de||!oe)return;const $=de[oe];if(!$||typeof $!="object")return;const te=vo({previewBaseUrl:w,pageBlock:$,decofile:de,path:Te,pathTemplate:U});if(!te)return;const ye=tn(te.src,bo(Ht,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:Te,pathTemplate:U}),content:JSON.stringify(de)},w=Td(yn.current,u);yn.current=u,w&&Rs()},[de,jt,F,V,oe,Te,U]);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&&!Ce.notFound&&!ha&&!ma&&(vn?.kind==="ready"||Be!=="idle"),As=!Ze(ge),_a=Vr(t??void 0),Oa=kd(wt,_a,As&&Ls),Da=new Set(Je.map(u=>Ee(u.path))),Jt=As?Oa.filter(u=>!Da.has(Ee(u))):[],_s=K?Jt.filter(u=>u.toLowerCase().includes(K.toLowerCase())):Jt,we=Xc({editingMode:h,sandboxDisplay:Y.mode==="sandbox",blocksEditingEnabled:p});j.useEffect(()=>{const u=at;if(!u)return;const w=$=>{if($.origin===u)if($.data?.type==="visual-editor::element-clicked"){const te=Dl.safeParse($.data.payload);te.success&&g(te.data)}else if($.data?.type==="cms-editor::section-clicked"){const te=Bl.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)},[at,yt,kt,St]);const Os=()=>{const u=k.current?.contentWindow,w=$t(ce),$=$c({v8:be,script:Fl});!u||!w||!$||u.postMessage($,w)},Fa=()=>{if(be)return;const u=k.current?.contentWindow,w=$t(ce);!u||!w||u.postMessage({type:"visual-editor::deactivate"},w)},Ds=()=>{const u=He.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=at,$=Fc({v8:be,production:Y.mode==="production",localPreview:!!ee,script:Ml});!u||!w||!$||(u.postMessage($,w),u.postMessage({type:"cms-editor::set-labels",labels:yt,kinds:kt,keys:St},w))},$a=()=>{if(be){He.current?.wireframe({type:"wireframe:deactivate"});return}const u=k.current?.contentWindow,w=at;!u||!w||u.postMessage({type:"cms-editor::deactivate"},w)},Ba=()=>{if(He.current?.wireframe({type:"wireframe:clear-hover"}),be)return;const u=k.current?.contentWindow,w=at;!u||!w||(u.postMessage({type:"cms-editor::clear-hover"},w),u.postMessage({type:"visual-editor::clear-hover"},w))},Yt=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"&&Fa(),u==="visual"&&Os(),w==="blocks"&&u!=="blocks"&&$a(),u==="blocks"&&Sn()},Ma=()=>{Yt(Jc(h,p))},Ia=()=>{Yt(Yc(h,p))},Qt=()=>{const u=k.current;if(!u)return;Se();const w=document.activeElement,$=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Rd(u,rt.current);let te;const ye=()=>{clearTimeout(te),u.tabIndex=$,u.style.pointerEvents="";const Me=document.activeElement;(!Me||Me===document.body||Me===u)&&w?.focus(),u.removeEventListener("load",ye)};u.addEventListener("load",ye),te=setTimeout(ye,3e3)};$o(Qt);const He=j.useRef(null),Fs=j.useEffectEvent(Ds),Ua=j.useEffectEvent((u,w)=>{E({index:u,seq:w})}),za=j.useEffectEvent(()=>{fe(),je&&(Pn.current=je.shown),Rt&&An(Ct)}),$s=j.useEffectEvent(()=>{if(wn(!1),je&&Es(null),je&&je.src!==rt.current){Se();return}Qt()});j.useEffect(()=>{if(!be)return;const u=new Hl({studioOrigin:window.location.origin,build:"4.562.0",frame:()=>k.current?.contentWindow??null,onWireframeReady:()=>Fs(),onWireframe:$=>{$.type==="wireframe:select"&&Ua($.sectionIndex,$.clickSeq)},onModulesChange:()=>wn(u.has("html-swap")),onSwapEnd:()=>za(),onSwapFailed:()=>$s()});He.current=u;const w=$=>{u.handle($)};return window.addEventListener("message",w),()=>{window.removeEventListener("message",w),u.dispose(),wn(!1),He.current===u&&(He.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){He.current?.refresh(je.shown)?Se():$s();return}!je&&u&&u.shown!==u.src&&u.src===rt.current&&Qt()},[je]);const Is=()=>{He.current?.refresh()||Qt()},Ct=Js(le.slug,t??""),Rt=Le&&Pt&&!!t,Pn=j.useRef(null);j.useEffect(()=>{if(Rt)return po(Ct)},[Rt,Ct]);const{reload:Lt}=mo(le.slug,t??""),Us=j.useRef(Lt.seq);j.useEffect(()=>{if(Us.current!==Lt.seq&&(Us.current=Lt.seq,!!Rt&&Pn.current===rt.current)){if(Lt.navigates){An(Ct);return}Is()}},[Lt.seq]);const Ka=ho(pn),At=go(Ve(ge)?Ka:""),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 Ol({iframe:w,reload:Is})},[At]);const Ha=()=>{const u=on.indexOf(b);T(on[(u+1)%on.length])},jn=(u,w)=>{if(!oe)return;const $=oe,te={...st,[u]:w};Oe.current=We(U,te),pe(ye=>({...ye,[$]:te})),Tt({path:U,pageKey:$,params:te})},Va=_c({iframeBase:Y.iframeBase,resolvedPath:Te,activeGlobalSectionName:F?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),En=u=>{const w=me[u.key]??{},$=We(u.path,w);(F||Ee($)!==Ee(Te))&&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(Te))&&Se(),Oe.current=u,z(null),Q(null),se(null),E(null),ie(null),re(u),Tt({path:u,pageKey:null,params:{}})};Ti(Nt,Ks);const Wa=u=>{if(Ze(ge)){const te=de?Oo(de,u.key,Pe):null;te?En(te):cn.info(e("sandbox.preview.blockOnNoPage"));return}if(!bt||!Pe){cn.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})},qa=u=>{p&&(z(null),Q(u.key),se(null),Yt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},Ga=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(Je.some(Ae=>Ee(Ae.path)===Ee(ye))){H(e("sandbox.preview.pageAlreadyExists",{path:ye}));return}let Me;if($&&(Me=de?.[$],!Me)){H(e("sandbox.preview.templateNoLongerExists"));return}H(void 0);try{const Ae=await ss.mutateAsync({name:u,path:ye,template:Me,schema:Ze(ge)?{meta:Pe,loadMeta:async()=>(await fn.refetch()).data}:void 0});M(!1),cn.success(e("sandbox.preview.pageCreated",{name:u})),await el(Sd),En({key:Ae.key,name:Ae.name,path:Ae.path}),Yt("blocks")}catch(Ae){H(Ae instanceof da?e("sandbox.preview.pageSchemaNotReady"):Ae instanceof Error?Ae.message:e("sandbox.preview.failedToCreatePage"))}},Xt=Oc({previewSurfaceActive:Pt,daemonReady:Ls,production:Y.mode==="production",servePreviewUrl:Ve(ge)}),Ja=Dc({showPreviewToolbar:Xt,contentEditingEnabled:f}),_t=()=>{Z(!1),q("")},Nn=F?.name??zt?.title??hn?.name,Tn=ns.isPending||fn.isPending,Cn=Tn?$t(Y.iframeBase):Nn,Ot=F?`section:${F.key}`:V?`loader:${V}`:oe?`page:${oe}`:Jt.includes(Ee(U))?`route:${Ee(U)}`:void 0,Ya=Xt?Ja?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||zt?Nn:[Nn,U].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(Di,{size:11}),e("sandbox.preview.globalBadge")]}),zt&&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(Fi,{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&&!zt&&r.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:U}),r.jsx(Ri,{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(Ur,{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(Ir,{ref:X,className:"max-h-80",children:[r.jsx(Kr,{children:Je.length===0&&Jt.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(),Wa(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(),qa(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!F&&!V&&Bt(U).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(U).map((u,w)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${w}`);const $=gn[u.name];return $&&wt?r.jsx(wc,{sources:$,template:U,paramName:u.name,value:st[u.name]??"",sandboxRef:wt,onCommit:te=>jn(u.name,te)},`${oe}:${u.name}`):r.jsx(Lc,{name:u.name,value:st[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:Va}):null,Hs=Xt||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(et,{onClick:Ha,"aria-label":e(yr[b]),children:b==="mobile"?r.jsx(Or,{size:16}):b==="tablet"?r.jsx($i,{size:16}):r.jsx(Dr,{size:16})})}),r.jsx(mt,{children:e(yr[b])})]}),Ya,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Vt&&r.jsx(ed,{tests:ka,load:Pa,onOpen:()=>Sa(!0),options:G,onChange:u=>{J(u),o.previewAsChanged()},available:!!xn||!hs||!xs}),r.jsx(et,{onClick:Na,disabled:Le&&!Ss,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Tr,{size:16})})]})]}):null,Qa=(Re||c)&&Y.mode==="sandbox",Zt=Pd[b],en=b==="desktop"&&(_.width===0||_.width>=Zt.width+2*wr),Vs=en?1:Math.min(_.width>0?_.width/(Zt.width+2*wr):1,1),Xa=en?{width:"100%",height:"100%"}:{width:`${Zt.width}px`,height:_.height>0?`${_.height/Vs}px`:`${Zt.height}px`,transform:`scale(${Vs})`,transformOrigin:"top center"},Ws=r.jsxs(r.Fragment,{children:[Qa&&(Xt||f)&&r.jsx(et,{onClick:Ma,"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(et,{onClick:Ia,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:r.jsx(Mi,{size:16})})}),r.jsx(mt,{children:e("sandbox.preview.blocksEditor")})]}),nt&&r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(et,{onClick:D,"aria-pressed":C,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:C,children:r.jsx(Bi,{size:16})})}),r.jsx(mt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),Za=!!V&&we==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(gn).map(([u,w])=>(st[u]??"")===""?r.jsx(Cc,{sources:w,template:U,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:Za?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(vr,{virtualMcpId:t,externalSelection:N,onViewJsonFile:D}),C&&nt&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(xr,{ref:R,virtualMcpId:t,pageKey:nt,onClose:A})})]}):r.jsxs(sr,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[r.jsx(nn,{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(nn,{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&&nt),children:[r.jsx(nn,{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&&!en&&"bg-muted/30"),children:[(xe||ga)&&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&&Ye.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"suspended",onResume:Ie.resume})}),!ee&&Ye.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"errored",error:Ye.error,onRetry:Ie.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(Gl,{element:y,onDismiss:()=>g(null)}),Pt&&Xe&&r.jsx("div",{className:Fe("shrink-0",!en&&"bg-background shadow-edge"),style:Xa,onMouseLeave:Ba,children:r.jsx("iframe",{ref:k,src:ot,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Ts.handleError,onLoad:()=>{if(bn(br),Aa(ot),Ts.handleLoad(),fe(),Pn.current=rt.current,Rt&&An(Ct),Y.mode!=="sandbox"||ee){(Y.mode==="production"&&!Y.showWakingPill||ee)&&we==="blocks"&&Sn();return}if(di("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(Te))return;re(u),Tt({path:u,pageKey:ae,params:st})}catch{}we==="visual"&&Os(),we==="blocks"&&Sn()}},Y.iframeBase)})]})}),C&&nt&&r.jsxs(r.Fragment,{children:[r.jsx(rr,{withHandle:!0}),r.jsx(nn,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(xr,{ref:R,virtualMcpId:t,pageKey:nt,onClose:A})})]})]})})]})}),r.jsx(Uc,{open:L,onOpenChange:M,isPending:ss.isPending,error:I,templates:Je,onSubmit:Ga})]})}const qn={app:null,split:!1};function Ad(t){const e=ue.c(24),{project:n,maxApps:s,children:a}=t,l=Ne();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={silent:!0},e[0]=c):c=e[0];const o=zi(c),i=It();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:{...tl(n.metadata),runtime:{...m,apps:y.length?y:null}}}},{onSuccess:()=>i.start(),onError:()=>cn.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(_d,{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 _d(t){const e=ue.c(102),{virtualMcpId:n,mainPath:s,apps:a,maxApps:l,onAddApp:c,onRemoveApp:o,children:i}=t,d=Ne(),m=Jr(),{currentBranch:f}=Mt(),p=It(),S=Xn().lifecycle.phase,v=un(n,f),{url:x}=qr(n);let h;e[0]!==v||e[1]!==x?(h=Ve(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=Un.previewAppLayout(n),e[5]=n,e[6]=k):k=e[6];const[P,C]=In(k,Od);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?On(s):d("sandbox.appTabs.root"),e[18]=s,e[19]=d,e[20]=L):L=e[20];const M=L;let I;e[21]!==A||e[22]!==d?(I=d(A?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=A,e[22]=d,e[23]=I):I=e[23];const H=I;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 Ce=On(le.path);return r.jsx(kr,{label:Ce,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:Ce})},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 U;e[59]!==ne||e[60]!==se||e[61]!==F?(U=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]=U):U=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]!==U||e[77]!==re||e[78]!==ae?(ie=r.jsxs(r.Fragment,{children:[U,re,ae]}),e[76]=U,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(Dd,{name:On(R),mainName:M,appUrl:T?nl(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 Od(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 Dd(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=Ne(),[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?sl(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($d),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(Fd),W=r.jsx(ui,{}),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 I;e[49]!==s||e[50]!==f?(I=f("sandbox.appPane.previewOnly",{app:s}),e[49]=s,e[50]=f,e[51]=I):I=e[51];let H;e[52]!==I?(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:I}),e[52]=I,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 Fd(t){return t+1}function $d(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(et,{"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 Bd=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Md=1e4,Id=1e4,Ud=5e3,zd=2;function Kd(t,e){return t&&e===0?Id:Math.min(1e3*2**Math.max(0,e-1),Ud)}function Hd(t,e,n){return e?!0:t===!0&&n<zd}function Vd(t,e){const n=ue.c(11),s=Bd,a=fi();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,Md),h=await s(t,S.signal).catch(qd);clearTimeout(x),p.removeEventListener("abort",v);const b=a.getQueryData(c),T=h?0:(b?.failures??0)+1;return{up:Hd(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:Wd},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 Wd(t){return t.state.data?Kd(t.state.data.up,t.state.data.failures):!1}function qd(){return!1}function Gd(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 Hu(t){const e=ue.c(53),{virtualMcpId:n}=t,s=Ne(),a=Ki(n),{connection:l}=Gr(n),{activeTask:c,taskId:o,currentBranch:i}=Mt(),d=ul(o),[m,f]=j.useState(!1),p=un(n,i);let S;e[0]!==p||e[1]!==l?(S=l?Ve(p):null,e[0]=p,e[1]=l,e[2]=S):S=e[2];const v=S,x=Vd(v),h=ra(),b=rl("multi_app_preview");if(ol({threadId:o,sandboxBranch:c?.branch??i,agentHasRepo:_n(a?.metadata),threadHasRepo:_n(d)||_n(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(al,{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(il,{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&&!Ve(p)){let E;e[23]!==h||e[24]!==p?(E=Gd({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=E):E=e[25];let k;e[26]!==l.endpoint?(k=xo(l.endpoint),e[26]=l.endpoint,e[27]=k):k=e[27];let P;return e[28]!==E||e[29]!==k?(P=r.jsx(Yd,{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:Jd(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(dn,{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(Ld,{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(ji,{children:b&&a&&!l?r.jsx(Ad,{project:a,maxApps:Zo,children:g}):g}),e[48]=a,e[49]=b,e[50]=g,e[51]=l,e[52]=N):N=e[52],N}function Jd(t){try{return new URL(t).host}catch{return t}}function Yd(t){const e=ue.c(13),{status:n,host:s}=t,a=Ne();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(dn,{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=gl(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(hl,{wait:l,hosts:s}),e[10]=s,e[11]=l,e[12]=c):c=e[12],c}export{hl as L,Hu as P,dn as S,Ku as u};
|