decocms 4.513.3 → 4.513.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-CV2gQvF0.js → ActiveShapeUtils-CAxkWTE7.js} +1 -1
- package/dist/client/assets/{AlertCircle-Czw3GOXM.js → AlertCircle-iwRSZJFi.js} +1 -1
- package/dist/client/assets/{AreaChart-BhM70eeA.js → AreaChart-BCUK2U_v.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CBNZ6Kc8.js → ArrowLeft-_QxYwR3P.js} +1 -1
- package/dist/client/assets/{ArrowUp-D1TV4x6T.js → ArrowUp-CWx4kMsV.js} +1 -1
- package/dist/client/assets/{BarChart-BV8WJLUg.js → BarChart-BFfaTlE7.js} +1 -1
- package/dist/client/assets/{Building02-BufOoi54.js → Building02-Dcs_HLaa.js} +1 -1
- package/dist/client/assets/{CartesianChart-ButQNI6T.js → CartesianChart-DxoYDxJN.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CU6wjw2Q.js → CategoricalChart-BWxwmOFO.js} +1 -1
- package/dist/client/assets/{CheckCircle-C6kHCEBQ.js → CheckCircle-X3D4eq-V.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CREWgR2i.js → ChevronSelectorVertical-7X_EL11G.js} +1 -1
- package/dist/client/assets/{ChevronUp-DZ6u-CDn.js → ChevronUp-BlFhjumO.js} +1 -1
- package/dist/client/assets/{Copy01-Br8MuAU9.js → Copy01-CsyaL0tc.js} +1 -1
- package/dist/client/assets/{CreditCard01-BLe5-9IQ.js → CreditCard01-DZn9m-o1.js} +1 -1
- package/dist/client/assets/{DotsVertical-DgdCLmlp.js → DotsVertical-H16dBinG.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-D8FHRXZQ.js → ErrorBarContext-IXpluzmX.js} +1 -1
- package/dist/client/assets/{Globe04-BkNwdwoM.js → Globe04-B5AbE2NG.js} +1 -1
- package/dist/client/assets/{Image01-DxuLkpjX.js → Image01-C-r__mWH.js} +1 -1
- package/dist/client/assets/{Key01-Qdm6kw39.js → Key01-D8PhPz3k.js} +1 -1
- package/dist/client/assets/{Link01-B4M7ojFg.js → Link01-BZlTJYwG.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CJN7aOrV.js → LinkBroken01-y64X2SC-.js} +1 -1
- package/dist/client/assets/{Monitor01-CHS3e170.js → Monitor01-Ccoz_3RV.js} +1 -1
- package/dist/client/assets/{Play-Da27xlG_.js → Play-B8dkIMIB.js} +1 -1
- package/dist/client/assets/{Plus-D0ucptrV.js → Plus-D_siv_aA.js} +1 -1
- package/dist/client/assets/{ReferenceLine-CoS52beo.js → ReferenceLine-DBHRjJZR.js} +1 -1
- package/dist/client/assets/{SearchMd-0qnilUuy.js → SearchMd-KKuAy3kv.js} +1 -1
- package/dist/client/assets/{Sector-CKh2L0yG.js → Sector-BpwYW3Qx.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DV74WoBV.js → ShoppingBag01-COYAkOJY.js} +1 -1
- package/dist/client/assets/{Sun-D0O3J2yf.js → Sun-s_f7cajm.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Ba0pyLay.js → SwitchHorizontal01-ZjaXGph0.js} +1 -1
- package/dist/client/assets/{Tool01-C0454p2c.js → Tool01-Bsd9MAXv.js} +1 -1
- package/dist/client/assets/{Trash01-CyxedK0n.js → Trash01-CqbCnp4Y.js} +1 -1
- package/dist/client/assets/{Upload01-BWpYXx52.js → Upload01-BuL02EP8.js} +1 -1
- package/dist/client/assets/{User01-Bb04dh7g.js → User01-DOqRt8wn.js} +1 -1
- package/dist/client/assets/{UserSquare-B_weldPC.js → UserSquare-CEX9DbWl.js} +1 -1
- package/dist/client/assets/{Users01-CNd-hMC8.js → Users01-n5qz8jdG.js} +1 -1
- package/dist/client/assets/{XClose-BeqwQ2Ei.js → XClose-BQ9Dlu1I.js} +1 -1
- package/dist/client/assets/{ZoomOut-DWT1qHXA.js → ZoomOut-CYcrWaFo.js} +1 -1
- package/dist/client/assets/{access-gate-mycOF7cD.js → access-gate-CCU3Jeds.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BkWp2fK0.js → add-connection-dialog-CJKZey2r.js} +1 -1
- package/dist/client/assets/{agent-analytics-B5byH36W.js → agent-analytics-BpgXx7qA.js} +1 -1
- package/dist/client/assets/agent-app-DDRmQd75.js +1 -0
- package/dist/client/assets/{agent-assets-pGTlMleF.js → agent-assets-BsicbZIc.js} +1 -1
- package/dist/client/assets/{agent-automation-D5u89G2_.js → agent-automation-BSqPTL3r.js} +1 -1
- package/dist/client/assets/{agent-automations-C4_XXiyv.js → agent-automations-CORWjDg5.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-C5p-0QMu.js → agent-connect-sources-nNFgzgd5.js} +1 -1
- package/dist/client/assets/agent-deck-sUBVFl57.js +1 -0
- package/dist/client/assets/{agent-e2e-Ce5bkH9z.js → agent-e2e-Q2mMYbFI.js} +1 -1
- package/dist/client/assets/{agent-experiments-D4NapCfE.js → agent-experiments-GpUhBLmP.js} +1 -1
- package/dist/client/assets/agent-file-Ay2rdSNY.js +1 -0
- package/dist/client/assets/{agent-hosting-ftgEMkT0.js → agent-hosting-B2Nl1zb-.js} +1 -1
- package/dist/client/assets/{agent-icon-C0Cpk_fI.js → agent-icon-DMH8Ftve.js} +1 -1
- package/dist/client/assets/agent-library-DQTTsoBq.js +1 -0
- package/dist/client/assets/agent-library-file-CoPN3Dl5.js +1 -0
- package/dist/client/assets/{agent-monitor-C-1u284m.js → agent-monitor-CvRpbef5.js} +1 -1
- package/dist/client/assets/{agent-overview-B5DYE-Ji.js → agent-overview-CIwIxcfm.js} +1 -1
- package/dist/client/assets/{agent-releases-aHzQJT8R.js → agent-releases-BX6W8KKx.js} +1 -1
- package/dist/client/assets/agent-settings-Da0_9JGD.js +1 -0
- package/dist/client/assets/{agent-site-editor-CPMVDSTZ.js → agent-site-editor-0D-T7ieN.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B98Bnadv.js +2 -0
- package/dist/client/assets/agent-site-editor-content-87ZLW9rs.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DD0qYhLr.js +1 -0
- package/dist/client/assets/agent-view-BPSlOxjt.js +1 -0
- package/dist/client/assets/{agent-view-guard-DNE4CXyR.js → agent-view-guard-DG6ZTgu0.js} +1 -1
- package/dist/client/assets/{agents-list-BeohBYvm.js → agents-list-DJAFMczy.js} +1 -1
- package/dist/client/assets/{ai-providers-BYfFnvED.js → ai-providers-CkTtAKoL.js} +1 -1
- package/dist/client/assets/{alert-fFwi0Rct.js → alert-BpKmtk7d.js} +1 -1
- package/dist/client/assets/{alert-dialog-DBOmU5EL.js → alert-dialog-CgRaXWeG.js} +1 -1
- package/dist/client/assets/{analytics-sections-BSFzvx60.js → analytics-sections-DmbiPFV0.js} +1 -1
- package/dist/client/assets/{api-keys-CjBRjWKE.js → api-keys-B8qmKYTS.js} +1 -1
- package/dist/client/assets/api-keys-CigsOsqY.js +1 -0
- package/dist/client/assets/{app-editor-9oqlCdGz.js → app-editor-BQE1NaFI.js} +1 -1
- package/dist/client/assets/{asset-utils-DRLxCAgr.js → asset-utils-CW4a0Tss.js} +1 -1
- package/dist/client/assets/{auth-BPJq9uZN.js → auth-Bjnc521y.js} +1 -1
- package/dist/client/assets/{auth-catchall-D2arJj-l.js → auth-catchall-CJDXycwe.js} +1 -1
- package/dist/client/assets/{auth-entry-BUYS1aRG.js → auth-entry-DKyMW2UQ.js} +1 -1
- package/dist/client/assets/{auth-split-layout-B60d6um2.js → auth-split-layout-BJfKUnO6.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CEKJsXYr.js → authenticate-and-persist-oauth-DK-E6e3Z.js} +1 -1
- package/dist/client/assets/{automation-list-row-BKl9kQg2.js → automation-list-row-DybT-MIG.js} +1 -1
- package/dist/client/assets/{automation-runs-Bc4ZG8Cd.js → automation-runs-DvbgOsZD.js} +1 -1
- package/dist/client/assets/{automations-Byx2iIlC.js → automations-DEtpbM4Z.js} +1 -1
- package/dist/client/assets/{autosend-BRrz2Y4f.js → autosend-D1RPfsoi.js} +1 -1
- package/dist/client/assets/{avatar--bVWjvdf.js → avatar-B2nFfSHv.js} +1 -1
- package/dist/client/assets/{badge-O9zNBxIS.js → badge-CRNAVwfV.js} +1 -1
- package/dist/client/assets/{block-document-EMb4OAJD.js → block-document-9nzhTDhY.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CswMFv9v.js → blocks-preview-workspace-context-BGEsHkZW.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CXGOEMTq.js → blocks-tab-states-7xd0L-RH.js} +3 -3
- package/dist/client/assets/{blog-schema-BBgfoIQP.js → blog-schema-CPbtg-YY.js} +1 -1
- package/dist/client/assets/{board-analytics-BnyzhqyI.js → board-analytics-DfcXMGIx.js} +1 -1
- package/dist/client/assets/{buckets-CScAlRwn.js → buckets-CmybaOoN.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DZKU2eq8.js → build-improve-prompt-doc-C4jIZJDS.js} +1 -1
- package/dist/client/assets/{calendar-DsjGYQg2.js → calendar-CBcRt8Oe.js} +1 -1
- package/dist/client/assets/{capability-load-error-D5sZmG67.js → capability-load-error-CKIgKs8S.js} +1 -1
- package/dist/client/assets/{category-editor-TdrhQc2d.js → category-editor-WcaRs-tk.js} +1 -1
- package/dist/client/assets/{chart-CdJbyFrF.js → chart-k_AUhfu2.js} +1 -1
- package/dist/client/assets/{chat-context-Dnn7Mdeu.js → chat-context-70xHoaxp.js} +1 -1
- package/dist/client/assets/{chat-draft-QF0rnEVx.js → chat-draft-Nb1SIeYI.js} +1 -1
- package/dist/client/assets/{checkbox-_9cHZuVh.js → checkbox-CwspTWv-.js} +1 -1
- package/dist/client/assets/{choose-editor-DjeEuPt0.js → choose-editor-B_p_lpqj.js} +1 -1
- package/dist/client/assets/{cli-auth-success-s_E43D3X.js → cli-auth-success-DWqeUnva.js} +1 -1
- package/dist/client/assets/{client-icons-CnZ15Laz.js → client-icons-DYkySYk1.js} +1 -1
- package/dist/client/assets/cms-settings-editor-BGIEXOlq.js +1 -0
- package/dist/client/assets/{collapsible-CzHslCH_.js → collapsible-CKlYJ7JC.js} +1 -1
- package/dist/client/assets/{collection-detail-DRUItL6q.js → collection-detail-FEHQdrUM.js} +1 -1
- package/dist/client/assets/{collection-display-button-BLKqGGaY.js → collection-display-button-CEiwIbk0.js} +1 -1
- package/dist/client/assets/{collection-search-BiaY0GVT.js → collection-search-ZGgli3wR.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-ymUDH0Iy.js → collection-table-wrapper-BJKQfvlr.js} +1 -1
- package/dist/client/assets/{collection-tabs-BLEBGgk-.js → collection-tabs-C331r2n4.js} +1 -1
- package/dist/client/assets/{column-rules-B7xl4xQZ.js → column-rules-CoEiTMWe.js} +1 -1
- package/dist/client/assets/{combobox-CdVSN4C-.js → combobox-D7TXxp7o.js} +1 -1
- package/dist/client/assets/{coming-soon-page-DU1ARjbb.js → coming-soon-page-CUty8r32.js} +1 -1
- package/dist/client/assets/{command-BwFTVPCg.js → command-CAYMLhJL.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-wyIo_eN7.js → companion-mcps-section-BHQ5YIJi.js} +1 -1
- package/dist/client/assets/{config-D3pVqIKI.js → config-B5hUFPIX.js} +1 -1
- package/dist/client/assets/{connect-DBOmX-8C.js → connect-Cj4-EZJC.js} +1 -1
- package/dist/client/assets/{connect-layout-BI0GOmFg.js → connect-layout-CmN5RxRi.js} +1 -1
- package/dist/client/assets/{connection-DdsAVMED.js → connection-CEjWhO8M.js} +1 -1
- package/dist/client/assets/{connection-card-DquRZmyq.js → connection-card-Qtm3n_hS.js} +1 -1
- package/dist/client/assets/{connection-detail-C2_9jZRg.js → connection-detail-Du-3dW0g.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CppaGv96.js → connection-form-helpers-C8PcIQLm.js} +1 -1
- package/dist/client/assets/{connections-CPYwbOBM.js → connections-CrNA73Wo.js} +1 -1
- package/dist/client/assets/{content-tab-BGK1XaKL.js → content-tab-CRvcTJJ2.js} +3 -3
- package/dist/client/assets/{context-D2VrQMS2.js → context-BqWdy054.js} +1 -1
- package/dist/client/assets/{context-menu-D1SjU6l-.js → context-menu-CdwmTDFy.js} +1 -1
- package/dist/client/assets/{context-shell-CKI9uW2C.js → context-shell-CwudT8OH.js} +3 -3
- package/dist/client/assets/{core.esm-DnTbXhD8.js → core.esm-uZtRM3l4.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BIJBsiHg.js → create-organization-dialog-CJin8Jxw.js} +1 -1
- package/dist/client/assets/{daily-pulse-Drk3CnaM.js → daily-pulse-DTkBeVsw.js} +1 -1
- package/dist/client/assets/{discover-BDubv_ZJ.js → discover-DGpiIGQv.js} +1 -1
- package/dist/client/assets/{domain-settings-CCe7QH7l.js → domain-settings-BmE4V_Yd.js} +1 -1
- package/dist/client/assets/{drawer-CTSig7Vj.js → drawer-CkgkUBCk.js} +1 -1
- package/dist/client/assets/{editor-B8TTVjFi.js → editor-B2CFLfaQ.js} +1 -1
- package/dist/client/assets/{editor-classes-BUSqIt7e.js → editor-classes-DcYQ4Aap.js} +1 -1
- package/dist/client/assets/{empty-state-DIpCFPkI.js → empty-state-BZa0U-xG.js} +1 -1
- package/dist/client/assets/{empty-state-DweMe7pE.js → empty-state-DAdNQg6Y.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C2M3P64h.js → extract-connection-data-BpdUae_j.js} +1 -1
- package/dist/client/assets/{feature-gate-hxH8uzOp.js → feature-gate-DKD0xNwQ.js} +1 -1
- package/dist/client/assets/{feature-paywall-5JkjVbP-.js → feature-paywall-BqNVafLn.js} +1 -1
- package/dist/client/assets/{file-explorer-CsGruqCR.js → file-explorer-BrcXVEUy.js} +1 -1
- package/dist/client/assets/{file-preview-ySEcJuT1.js → file-preview-pejw4DEs.js} +1 -1
- package/dist/client/assets/{file-share-button-BcJLFZEu.js → file-share-button-AFuoJHS8.js} +1 -1
- package/dist/client/assets/{file-type-icon-CBmuqe9u.js → file-type-icon-2Asg9IKB.js} +1 -1
- package/dist/client/assets/flat-project-COKm-_lB.js +1 -0
- package/dist/client/assets/{folder-icon-BbG7eONI.js → folder-icon-DqT7qo5j.js} +1 -1
- package/dist/client/assets/{form-CGiGUgzW.js → form-DidHa5sD.js} +1 -1
- package/dist/client/assets/{general-40Wry3sr.js → general-BF4C2ZJb.js} +1 -1
- package/dist/client/assets/{home-CuekDzCb.js → home-fSRcvGJQ.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-Dj41Gksp.js → hosted-publish-feedback-DbuE45Er.js} +1 -1
- package/dist/client/assets/{icon-button-D0a6m1Sz.js → icon-button-iwZ3O0_B.js} +1 -1
- package/dist/client/assets/{index-Ct79h6Jq.js → index-B2vL4Txo.js} +1 -1
- package/dist/client/assets/{index-fdN8eXM2.js → index-BdqfOdIE.js} +1 -1
- package/dist/client/assets/{index-CEYZyBqV.js → index-BjUY_TPp.js} +1 -1
- package/dist/client/assets/{index-Cn8WHbCR.js → index-BpuRA4Yb.js} +1 -1
- package/dist/client/assets/{index-C5AhGK9V.js → index-CUOlm63w.js} +3 -3
- package/dist/client/assets/{index-BL53jR3y.js → index-Cex7aoHx.js} +1 -1
- package/dist/client/assets/{index-eirpwNKj.js → index-Cmhl3zNb.js} +2 -2
- package/dist/client/assets/{index-BgaKQ-Q-.js → index-CzrtR5Z7.js} +1 -1
- package/dist/client/assets/{index-C1nhsm_w.js → index-D-4AgGmD.js} +1 -1
- package/dist/client/assets/{index-YSmMnHTP.js → index-D2R52OCR.js} +1 -1
- package/dist/client/assets/{index-DZWoZhT5.js → index-D69M9S-D.js} +1 -1
- package/dist/client/assets/{index-D_cOu6AK.js → index-DL_AHT72.js} +1 -1
- package/dist/client/assets/{index-DOjuGDiB.js → index-DNlGRld6.js} +1 -1
- package/dist/client/assets/{index-FsB7lUoK.js → index-DVqdGkOX.js} +1 -1
- package/dist/client/assets/{index-CQodxdYF.js → index-DhA7J1aJ.js} +1 -1
- package/dist/client/assets/{index-DMApSpFV.js → index-lwornGU3.js} +1 -1
- package/dist/client/assets/{index-redirect-Dk2uc0Gh.js → index-redirect-CZXJxQAy.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-47K3Cxqe.js → infiniteQueryObserver-978TY1hh.js} +1 -1
- package/dist/client/assets/{infra-billing-CE_ELMRw.js → infra-billing-C59D5YaM.js} +1 -1
- package/dist/client/assets/{input-BH9IvcPC.js → input-CbMPZsxE.js} +1 -1
- package/dist/client/assets/{input-DdEOORL2.js → input-DVPmZILt.js} +3 -3
- package/dist/client/assets/{integration-icon-CKknGZhR.js → integration-icon-CktagpLu.js} +1 -1
- package/dist/client/assets/{jira-icon-DreVKI44.js → jira-icon-eYd_xfOx.js} +1 -1
- package/dist/client/assets/{label-BL4W2KPI.js → label-COA0amPU.js} +1 -1
- package/dist/client/assets/{layout-B6GTwWgR.js → layout-C-tE3imG.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-h-k8kxkI.js → legacy-agents-deep-CPmss93q.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-D6Wq6vr4.js → legacy-main-redirect-B8hjRkjB.js} +1 -1
- package/dist/client/assets/library-OhQHeeUu.js +1 -0
- package/dist/client/assets/{library-tab-6tliBei-.js → library-tab-CHu062C1.js} +1 -1
- package/dist/client/assets/{login-2dWlgBxu.js → login-BN5lalgG.js} +1 -1
- package/dist/client/assets/{markdown-BjPIZk-u.js → markdown-DntfPEgK.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-afmtzlAD.js → mcp-app-renderer-CFqAYLtv.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DJh33UXx.js → mcp-oauth-DqjrYGbv.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DqMHjHip.js → mcp-oauth-jIbhs8wE.js} +1 -1
- package/dist/client/assets/{members-De3ITOSK.js → members-CikLEMEO.js} +1 -1
- package/dist/client/assets/{memory-Bd-agrjz.js → memory-CTulcnPs.js} +1 -1
- package/dist/client/assets/{mini-report-page-qugNBWyG.js → mini-report-page-C4z6zUee.js} +1 -1
- package/dist/client/assets/{mock-board-DsyG_BKd.js → mock-board-C-bx3LOx.js} +1 -1
- package/dist/client/assets/{monaco-editor-frZbpSC4.js → monaco-editor-94ag9h78.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CbmvtcQ8.js → monitoring-stats-row-BiBXmqEX.js} +1 -1
- package/dist/client/assets/monitoring-zFjmyWaK.js +1 -0
- package/dist/client/assets/{multi-select-mMhkiaxx.js → multi-select-CknX6tqH.js} +1 -1
- package/dist/client/assets/{mustache-BE_jNzrX.js → mustache-CHjvX4mG.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BMxQGh6T.js → new-project-dialog-Y_XjAxS_.js} +1 -1
- package/dist/client/assets/{oauth-callback-NxseMyYt.js → oauth-callback-CuyXteK1.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-JHRZj7cm.js → oauth-callback-ai-provider-mmuJSvU9.js} +1 -1
- package/dist/client/assets/{onboarding-BNSpsBHl.js → onboarding-rJV8oAVf.js} +1 -1
- package/dist/client/assets/{openai-conversation-B9wySkKU.js → openai-conversation-DMiHuV_M.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DqJuR4Ij.js → optimistic-project-sidebar-views-CGSVQMMQ.js} +1 -1
- package/dist/client/assets/{order-monitor-day-DTRXFSPm.js → order-monitor-day-BYmFkC3g.js} +1 -1
- package/dist/client/assets/{organization-choice-D_pQMc9T.js → organization-choice-uNKN81tq.js} +1 -1
- package/dist/client/assets/{orgs-CsIZaTyi.js → orgs-DsslXidX.js} +1 -1
- package/dist/client/assets/{page-seo-form-DAN_oC73.js → page-seo-form-ysYceart.js} +1 -1
- package/dist/client/assets/{pair-BERDoCro.js → pair-CCzeqHVB.js} +1 -1
- package/dist/client/assets/plan-DirWo8wP.js +1 -0
- package/dist/client/assets/{plan-ladder-DL1JtpvS.js → plan-ladder-DYIZDWtc.js} +1 -1
- package/dist/client/assets/{popover-oZJ3oDMA.js → popover-YaXt6bOC.js} +1 -1
- package/dist/client/assets/{post-calendar-DfH5svUX.js → post-calendar-BT_Rw0Q6.js} +1 -1
- package/dist/client/assets/{post-editor-hWgegmwE.js → post-editor-COleSFOD.js} +1 -1
- package/dist/client/assets/{preview-content-PTYjaSyC.js → preview-content-C1Rk597M.js} +1 -1
- package/dist/client/assets/{preview-dialog-4ft9O22y.js → preview-dialog-BTsQwEhu.js} +1 -1
- package/dist/client/assets/{preview-panel-DM51Fpvo.js → preview-panel-HJZsRhmr.js} +1 -1
- package/dist/client/assets/{preview-tab-CNeiDQgU.js → preview-tab-DVJzXKEK.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-BDff_MLx.js → product-picker-dialog-B0S08IE6.js} +1 -1
- package/dist/client/assets/{profile-_0v0w_uk.js → profile-BAcwiajI.js} +1 -1
- package/dist/client/assets/{project-app-view-D_QJpB96.js → project-app-view-e6WdBuWR.js} +1 -1
- package/dist/client/assets/{project-apps-BRjQ6ES3.js → project-apps-bT8vigK2.js} +1 -1
- package/dist/client/assets/{project-feed-CYGKnY4Q.js → project-feed-qY5aN-GD.js} +1 -1
- package/dist/client/assets/{project-icon-D_aSXDOt.js → project-icon-CIzqFWaQ.js} +1 -1
- package/dist/client/assets/project-reports-DQGUzueG.js +1 -0
- package/dist/client/assets/project-tasks-B1VrMiAq.js +1 -0
- package/dist/client/assets/{projects-BmIdJmG4.js → projects-BsK-2g1X.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BdoV9-x8.js → projects-empty-state-Bw7Hl-T4.js} +1 -1
- package/dist/client/assets/{prompts-BSkHwl6y.js → prompts-BN3p2ELV.js} +1 -1
- package/dist/client/assets/record-editor-DD50VfEv.js +1 -0
- package/dist/client/assets/{redirect-editor-CtFVIrY2.js → redirect-editor-CVdnjBHw.js} +1 -1
- package/dist/client/assets/{reports-CLhp1Pr5.js → reports-DB2vUJ0m.js} +1 -1
- package/dist/client/assets/reports-DCFnios-.js +1 -0
- package/dist/client/assets/{reports-onboarding-C8PLHLPc.js → reports-onboarding-DG16InmK.js} +1 -1
- package/dist/client/assets/{reports-tab-DDrFZP3m.js → reports-tab-CiJ9MhGs.js} +2 -2
- package/dist/client/assets/repositories-CuvgQNAy.js +1 -0
- package/dist/client/assets/{repositories-DoNhvU-g.js → repositories-DVlGH0wi.js} +1 -1
- package/dist/client/assets/{repository-binding-BNbbDYQQ.js → repository-binding-X3TRktCN.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CMsE5EOk.js → repository-import-picker-DVf3Vnm6.js} +1 -1
- package/dist/client/assets/{repository-picker-DOtWfpYo.js → repository-picker-B8x2K0Wa.js} +1 -1
- package/dist/client/assets/{require-capability-CBG6rA7o.js → require-capability-sXOC3J02.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dz1OowhH.js → required-auth-layout-Dxnpn4YU.js} +1 -1
- package/dist/client/assets/{reset-password-v_UkU5Xg.js → reset-password-CZ33ExeQ.js} +1 -1
- package/dist/client/assets/{resizable-CWaYgp8D.js → resizable-DKp6vSsG.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-B2EU-8BB.js → resolve-tab-icon-SxG6TPRU.js} +1 -1
- package/dist/client/assets/{review-settings-BZhzjgRq.js → review-settings-g25PFo2o.js} +1 -1
- package/dist/client/assets/{roles-Y2HKVQnL.js → roles-C_YmoM1c.js} +1 -1
- package/dist/client/assets/route-BsG_rQz2.js +1 -0
- package/dist/client/assets/{route-7L_TW384.js → route-DKuH8vLv.js} +1 -1
- package/dist/client/assets/{route-DPCqrSJX.js → route-DeOeP4Wq.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Pb8-9nPA.js → sandbox-lifecycle-context-CrtkjvLt.js} +1 -1
- package/dist/client/assets/{schema-C1o97tHt.js → schema-ChwlN9B2.js} +1 -1
- package/dist/client/assets/{schema-CviV2OeO.js → schema-nN2fVtd3.js} +1 -1
- package/dist/client/assets/{scroll-area-D2V3l6oK.js → scroll-area-DDy8s3Ss.js} +1 -1
- package/dist/client/assets/{search-input-Bq9urCGV.js → search-input-DBKGcZuw.js} +1 -1
- package/dist/client/assets/{search-toggle-DwZ6dTB5.js → search-toggle-CLG4gmKJ.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-BkXDtxC6.js → secret-ciphertext-COE-QTj7.js} +1 -1
- package/dist/client/assets/{secret-picker-BoK4uSMi.js → secret-picker-DHJiW7t8.js} +1 -1
- package/dist/client/assets/{secrets-C0qlLAI4.js → secrets-Br2wfWxI.js} +1 -1
- package/dist/client/assets/{sections-CR_pzMlx.js → sections-DeEHL6VG.js} +1 -1
- package/dist/client/assets/{sections-editor-BK3_J9sX.js → sections-editor-A_RH8q6f.js} +1 -1
- package/dist/client/assets/{select-C5-hj9Ts.js → select-BFXL8R1G.js} +1 -1
- package/dist/client/assets/{select-model-CwXefPFG.js → select-model-BEL7Tbo9.js} +1 -1
- package/dist/client/assets/{seo-editor-CSy5-rpo.js → seo-editor--98cMxSm.js} +1 -1
- package/dist/client/assets/{separator-BD6ld_rn.js → separator-gsO2sYby.js} +1 -1
- package/dist/client/assets/settings-tab-BXdif76g.js +1 -0
- package/dist/client/assets/{sheet-s29eirRf.js → sheet-CYoLylxA.js} +1 -1
- package/dist/client/assets/{shell-layout-DS0Ye6S1.js → shell-layout-CtdsDlSz.js} +1 -1
- package/dist/client/assets/site-editor-BojLUeGp.js +1 -0
- package/dist/client/assets/{site-editor-toast-C5e-1uEv.js → site-editor-toast-g-4xfmJ4.js} +1 -1
- package/dist/client/assets/{skills-pQpcosHp.js → skills-BRiGDde6.js} +1 -1
- package/dist/client/assets/{slider-P84DbLvc.js → slider-CpXtUVDi.js} +1 -1
- package/dist/client/assets/{sortable.esm-DMQ-WncJ.js → sortable.esm-CwAjqrb2.js} +1 -1
- package/dist/client/assets/{sso-BaZj_16B.js → sso-D0IDI51o.js} +1 -1
- package/dist/client/assets/{suggestion-BtCYsnHk.js → suggestion-Bv3b6MxU.js} +1 -1
- package/dist/client/assets/{switch-COyvKYHV.js → switch-CvZlxlV0.js} +1 -1
- package/dist/client/assets/{symbol-DE4EJv1h.js → symbol-BmpW8_Es.js} +1 -1
- package/dist/client/assets/{synced-repos-BchTuYeZ.js → synced-repos-_e-rYrNS.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Bd77emAf.js → tab-icon-glyph-CHxD5oom.js} +1 -1
- package/dist/client/assets/{table-E7GbRtTD.js → table-B26a0ePo.js} +1 -1
- package/dist/client/assets/{tabs-DWtBgLg_.js → tabs-BEPPtBqO.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-DTLURih6.js → task-assignee-avatar-BUQ0pMCX.js} +1 -1
- package/dist/client/assets/{task-board-fU-Cl8m2.js → task-board-C1s59vKR.js} +1 -1
- package/dist/client/assets/{task-route-DuNmXwWp.js → task-route-BzBoe3sC.js} +1 -1
- package/dist/client/assets/{task-status-wpuxJDO5.js → task-status-CErsPlHV.js} +1 -1
- package/dist/client/assets/taskboard-analytics-h_2DA62k.js +1 -0
- package/dist/client/assets/tasks-BkgOKiT9.js +1 -0
- package/dist/client/assets/{tasks-B4X2VVxT.js → tasks-tr_d8SW4.js} +1 -1
- package/dist/client/assets/{textarea-BDL4MHBS.js → textarea-CMJRBl6x.js} +1 -1
- package/dist/client/assets/{thread-analytics-0ZqqwnzE.js → thread-analytics-CeNaBD4e.js} +1 -1
- package/dist/client/assets/{thread-intent-DzC9Ji46.js → thread-intent-CCu0BEYJ.js} +1 -1
- package/dist/client/assets/{thread-route-DuRhXh4I.js → thread-route--bdvrJML.js} +1 -1
- package/dist/client/assets/{thread-route-D0aLhRkR.js → thread-route-C2rii--a.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-VXXOBFly.js → thread-sheet-body-BVs76jnQ.js} +1 -1
- package/dist/client/assets/{time-range-picker-vYJ0Kk8S.js → time-range-picker-CMbmxxqv.js} +1 -1
- package/dist/client/assets/{toggle-group-CRigS0R4.js → toggle-group-a7j08s-f.js} +1 -1
- package/dist/client/assets/{tool-namespace-DPiptzHh.js → tool-namespace-CRTO9xOA.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-uuYUYVtr.js → toolbar-icon-button-BsOv6rvJ.js} +1 -1
- package/dist/client/assets/{tooltip-DX3EibzC.js → tooltip-kZk2wAMk.js} +1 -1
- package/dist/client/assets/{tooltipContext-DiSBImQr.js → tooltipContext-DIsnCXpc.js} +1 -1
- package/dist/client/assets/{track-D-YCF_rE.js → track-C_ZVQYs-.js} +1 -1
- package/dist/client/assets/{types-BmDn-Bmr.js → types-CD9jRVDk.js} +1 -1
- package/dist/client/assets/{url-slug-BjYL2qGa.js → url-slug-CXYaPIEX.js} +1 -1
- package/dist/client/assets/{usage-stats-DViGt9Z5.js → usage-stats-B3aY2c0l.js} +1 -1
- package/dist/client/assets/{use-ai-providers-XvM2-sU7.js → use-ai-providers-D84PtMSN.js} +1 -1
- package/dist/client/assets/{use-automations-BP7Qo80Q.js → use-automations-CAJcdhxV.js} +1 -1
- package/dist/client/assets/{use-autosave-DLpdlg6z.js → use-autosave-Cve7LmNN.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BEn27bqi.js → use-chat-layout-state-4I8rtQwF.js} +1 -1
- package/dist/client/assets/{use-clock-tick--0G9fYV8.js → use-clock-tick-CgUj6u2i.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Byfe_uLr.js → use-connect-companion-CCaa-yxn.js} +1 -1
- package/dist/client/assets/{use-connection-C4wyl2ru.js → use-connection-CikB9KcW.js} +1 -1
- package/dist/client/assets/{use-content-sync-BdbVP04j.js → use-content-sync-DX7UAl_W.js} +1 -1
- package/dist/client/assets/{use-copy-BS5soA37.js → use-copy-DzgBkNLT.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bgr2d-1k.js → use-create-virtual-mcp-BCKaQYpl.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-D_SHRVT8.js → use-date-fns-locale-Dy4Oeqx-.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CteI237O.js → use-debounced-autosave-DR5Ahrkc.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DGbphRsM.js → use-debounced-value-C7Ih1llI.js} +1 -1
- package/dist/client/assets/{use-deco-credits-B7vnPi2P.js → use-deco-credits-ByP4Of99.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DTU6iW_4.js → use-decopilot-events-CBhHAjRY.js} +1 -1
- package/dist/client/assets/{use-delete-connection-v7vjwrBf.js → use-delete-connection-CjpOj4k7.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Cr49Ea_9.js → use-deployment-admin-CqgXaT_z.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-BiBJcIU0.js → use-ensure-project-folder-BzFrwFoN.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CUkbW62G.js → use-fast-preview-draft-url-R7ofHb_D.js} +1 -1
- package/dist/client/assets/{use-file-configs-dTlYe09H.js → use-file-configs-DhEp4msd.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-d4Pg1vDp.js → use-inbox-feed-CZjjQk7K.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DYPYtqG2.js → use-infinite-scroll-DQl4a0Bs.js} +1 -1
- package/dist/client/assets/{use-join-requests-CgaNoIHU.js → use-join-requests-BIuh8dt2.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-bEgIKNUF.js → use-main-panel-tabs-BS-Dp3CX.js} +1 -1
- package/dist/client/assets/{use-main-schema-v8-BpRBE2if.js → use-main-schema-v8-DmthzehD.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-XO9Yp1aB.js → use-mcp-auth-status-BQFxszTc.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DA050uNw.js → use-mcp-client-CedU4dWV.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C_C6tlAY.js → use-mcp-prompts-CdDNTlaE.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DDRwYO6T.js → use-mcp-tools-CcHLNRd3.js} +1 -1
- package/dist/client/assets/{use-members-C4ay671C.js → use-members-BI_Z9G2i.js} +1 -1
- package/dist/client/assets/{use-mobile-BsNhhNj1.js → use-mobile-CY0Djv_M.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-y0z5Ii2q.js → use-navigate-to-agent-cdHnGUXB.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-B2tbuRiV.js → use-open-billing-url-C9VcD5z_.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cn5Gs8uE.js → use-org-auth-client-Cy7UT2_Z.js} +1 -1
- package/dist/client/assets/{use-org-fs-QKl-Epzm.js → use-org-fs-BzlMLYdA.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DkE7BEdc.js → use-org-repo-syncs-Bbiq7vxl.js} +1 -1
- package/dist/client/assets/{use-org-sso-fQ5NHD0A.js → use-org-sso-Dz08CIcx.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DDX-q-Qm.js → use-organization-roles-D5QmscBE.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BAyreMqm.js → use-organization-settings-BhbyABaR.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CYHQ9H_T.js → use-panel-navigate-Cs4na-V_.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DG_OsicQ.js → use-project-native-view-presence-F2BIVVKN.js} +1 -1
- package/dist/client/assets/{use-project-scope-DTa66aFc.js → use-project-scope-COiEpk7r.js} +1 -1
- package/dist/client/assets/{use-recent-apps-BkiI05bl.js → use-recent-apps-CQPv5LK_.js} +1 -1
- package/dist/client/assets/{use-releases-3QZUJcU8.js → use-releases-CYsXvho_.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CFGQSOke.js → use-reports-diagnostic-D9AFmVnx.js} +1 -1
- package/dist/client/assets/{use-secrets-CFDBcYIs.js → use-secrets-C4QpZA2A.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Bi0fZdk_.js → use-section-preview-base-Dp3nLlkj.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-BDC4KJoA.js → use-sidebar-collapsed-BdewWuhH.js} +1 -1
- package/dist/client/assets/{use-tags-Ck-mty1R.js → use-tags-B1Z7-48J.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-K9XTOq2z.js → use-task-board-analytics-G6UBxSrP.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Jz6kbe9R.js → use-task-board-events-CQVfQw81.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BGCAD4bx.js → use-task-board-item-prs-CTNtD0OU.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CkrB-bRy.js → use-task-metadata-2qdE9S5L.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BNcqqwBS.js → use-thread-analytics-C0QELsJp.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-LnnMQYmj.js → use-thread-outputs-BRiZLmB3.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BLA_teXl.js +1 -0
- package/dist/client/assets/{useQueries-DsTjk3mN.js → useQueries-BaTjPT3P.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cu40gYv3.js +1 -0
- package/dist/client/assets/{users-CnjGVWpi.js → users-hzXXTZtN.js} +1 -1
- package/dist/client/assets/{utils-CetO33tt.js → utils-D_iIHZov.js} +1 -1
- package/dist/client/assets/{variant-calendar-BVQKG7Pz.js → variant-calendar-BsY2CF48.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-1XzXcLtg.js → variant-draft-pointer-Di3PGFGj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BuqrnQGM.js → view-mode-toggle-dGCnwIOo.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Ux8j-_02.js → virtual-mcp-Cm_JxjLS.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-YHoQCS1I.js → watch-sse-pool-DnJO6AZk.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +193 -193
- package/package.json +1 -1
- package/dist/client/assets/agent-app-C8Q8eJy6.js +0 -1
- package/dist/client/assets/agent-deck-XMMtyHjd.js +0 -1
- package/dist/client/assets/agent-file-BNo94gQC.js +0 -1
- package/dist/client/assets/agent-library-GkmC1ahU.js +0 -1
- package/dist/client/assets/agent-library-file-6MKr5gfE.js +0 -1
- package/dist/client/assets/agent-settings-5nByAqOM.js +0 -1
- package/dist/client/assets/agent-site-editor-code-0fxD14rb.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BN4VoKnm.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BXzeSsT8.js +0 -1
- package/dist/client/assets/agent-view-hlAx7Qgd.js +0 -1
- package/dist/client/assets/api-keys-Dvm1thDW.js +0 -1
- package/dist/client/assets/cms-settings-editor-DLURX7ZR.js +0 -1
- package/dist/client/assets/flat-project-CcO2Ar9k.js +0 -1
- package/dist/client/assets/library-0gJacikj.js +0 -1
- package/dist/client/assets/monitoring-D5Nohicc.js +0 -1
- package/dist/client/assets/plan-N5Xy4KXF.js +0 -1
- package/dist/client/assets/project-reports-s2VJkQN9.js +0 -1
- package/dist/client/assets/project-tasks-DqRp61Xr.js +0 -1
- package/dist/client/assets/record-editor-BakkGf1Y.js +0 -1
- package/dist/client/assets/reports-DzmhhR-x.js +0 -1
- package/dist/client/assets/repositories-6gZ6hUD8.js +0 -1
- package/dist/client/assets/route-DXMOqHVl.js +0 -1
- package/dist/client/assets/settings-tab-DHN7ZjAa.js +0 -1
- package/dist/client/assets/site-editor-BfEYXklV.js +0 -1
- package/dist/client/assets/taskboard-analytics-jASQU8UF.js +0 -1
- package/dist/client/assets/tasks-DLjtcYlA.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DhVIMVRh.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BVpu0vkd.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-
|
|
2
|
-
import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aY as Ye,aG as Ne,q as Os,D as Ds,K as Bs,s as Fs,v as Ms,e as Ir,h as gt,I as rs,w as Ur,aZ as Hr,a2 as Sn,a_ as Vr,aX as qr,au as as,aw as os,a5 as Wr,P as is,y as Gr,t as cn,o as Jr,m as Yr}from"./index-eirpwNKj.js";import{u as $s,g as Qr,c as Xr,B as dn,P as Zr,r as ea,R as ta,a as na,b as Ks,d as zs,i as sa,S as ra,e as aa,f as oa,C as ia,h as la,j as ca,l as da,m as ua,p as fa,k as ma,n as un,N as pa}from"./blocks-tab-states-CXGOEMTq.js";import{b as ha,c as It,r as Is,l as Us,f as ga,g as va,w as ba}from"./chat-context-Dnn7Mdeu.js";import{t as xa}from"./ChevronUp-DZ6u-CDn.js";import{V as ya,W as wa,L as Hs,X as ka,b as Sa,Y as Pa,Z as Ea,_ as ja,$ as Na,a0 as ls,a1 as Ta}from"./agent-icon-C0Cpk_fI.js";import{a as Ca}from"./UserSquare-B_weldPC.js";import{s as Ra}from"./Plus-D0ucptrV.js";import{P as La,a as _a,b as Aa}from"./popover-oZJ3oDMA.js";import{a as mt,b as pt,c as Vs,d as qs,e as Ws,C as Gs}from"./command-BwFTVPCg.js";import{c as Oa,a as Da}from"./repository-binding-BNbbDYQQ.js";import{b as Pn}from"./sandbox-lifecycle-context-Pb8-9nPA.js";import{e as Ba}from"./backoff-CrEUbyZT.js";import{f as Fa}from"./thread-intent-DzC9Ji46.js";import{a as Js}from"./input-DdEOORL2.js";import{S as Ys,A as Ma,B as $a,C as Ka,F as za,G as Ia,H as Ua,I as Ha,u as En,J as jn,K as xn,L as Va,M as qa,N as Wa,c as Ga,b as Qs,O as Ja,P as Qe,z as Ya,Q as Qa,R as Xa,U as Za,x as eo,V as cs,w as to,W as no,e as so}from"./site-editor-toast-C5e-1uEv.js";import{u as ro}from"./use-mobile-BsNhhNj1.js";import{c as fn,T as mn,a as pn}from"./tooltip-DX3EibzC.js";import{T as ct}from"./toolbar-icon-button-uuYUYVtr.js";import{b as ao,w as At,a as ds,i as oo}from"./variant-draft-pointer-1XzXcLtg.js";import{h as io,s as lo,L as co,R as Kt,j as us,N as uo,k as fo,l as ht,n as Nn,m as Xs,f as Fe,v as Zs,o as mo,q as po,r as ho,t as go,u as vo,w as fs,d as bo}from"./secret-ciphertext-BkXDtxC6.js";import{r as xo,D as ms,w as ps,b as hs,a as yo}from"./section-preview-url-7zfngvgW.js";import{u as wo}from"./use-fast-preview-draft-url-CUkbW62G.js";import{a as ko,c as er}from"./shell-layout-DS0Ye6S1.js";import{u as tr,b as So}from"./index-DOjuGDiB.js";import{u as yn}from"./useQueries-DsTjk3mN.js";import{i as Po}from"./LinkBroken01-CJN7aOrV.js";import{u as nr}from"./blocks-preview-workspace-context-CswMFv9v.js";import{MonacoCodeEditor as Eo}from"./monaco-editor-frZbpSC4.js";import{a as jo}from"./utils-CetO33tt.js";import{R as gs,a as Ot,b as vs}from"./resizable-CWaYgp8D.js";import{u as No,a as hn}from"./use-main-schema-v8-BpRBE2if.js";import{w as bs}from"./device-hint-SeLRi17j.js";import{r as To}from"./virtual-mcp-Ux8j-_02.js";import{d as Co}from"./delay-CnY5UFtP.js";import{E as Ro}from"./empty-state-DIpCFPkI.js";import{G as xs}from"./repository-picker-DOtWfpYo.js";import{R as Lo}from"./repository-import-picker-CMsE5EOk.js";import{r as _o}from"./preview-source-BsRLGWUP.js";import{A as Ao,a as Oo,b as Do}from"./alert-fFwi0Rct.js";import{u as Bo}from"./use-task-metadata-CkrB-bRy.js";function Fo(t){const e=ne.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(ya,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.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]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(wa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function Mo(t){const e=ne.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.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]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Mt("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let x;e[14]!==i.command?(x=i.command&&s.jsx(io,{command:i.command}),e[14]=i.command,e[15]=x):x=e[15];let v;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==x?(v=s.jsxs("div",{className:m,children:[f,x,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=x,e[20]=v):v=e[20];let E;return e[21]!==a||e[22]!==d||e[23]!==v?(E=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,v]}),e[21]=a,e[22]=d,e[23]=v,e[24]=E):E=e[24],E}const $o=[];function zt(t){const e=ne.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?$o:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let x;e[0]!==i?(x=s.jsx(Fo,{waiting:i}),e[0]=i,e[1]=x):x=e[1];let v;e[2]!==m||e[3]!==n?(v=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=v):v=e[4];let E;e[5]!==r?(E=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=E):E=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==v||e[10]!==E?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,v,E]}),e[7]=f,e[8]=x,e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,b)=>s.jsx(Mo,{index:b+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let j;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(j=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.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:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=j):j=e[19],j}function Ko(t){const e=ne.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=_e();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(Ao,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(Oo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(Do,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let B;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(B=lo(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=B):B=e[6];const{title:R,body:D}=B;let O;e[7]!==D?(O=s.jsx(Kt,{text:D}),e[7]=D,e[8]=O):O=e[8];let F;e[9]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(us,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=F):F=e[9];let _;return e[10]!==l||e[11]!==O||e[12]!==R?(_=s.jsx(zt,{headingLevel:2,waiting:!1,title:R,lead:O,alerts:l,footer:F}),e[10]=l,e[11]=O,e[12]=R,e[13]=_):_=e[13],_}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let x;e[18]!==l||e[19]!==n.kind?(x=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(co,{})]}),e[18]=l,e[19]=n.kind,e[20]=x):x=e[20];let v;e[21]!==a?(v=a("decoServe.guide.step1.title"),e[21]=a,e[22]=v):v=e[22];let E;e[23]!==a?(E=a("decoServe.guide.step1.body"),e[23]=a,e[24]=E):E=e[24];let g;e[25]!==E?(g=s.jsx(Kt,{text:E}),e[25]=E,e[26]=g):g=e[26];let k;e[27]!==v||e[28]!==g?(k={title:v,body:g,command:Ys},e[27]=v,e[28]=g,e[29]=k):k=e[29];let j;e[30]!==a?(j=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=j):j=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let b;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(b=n.kind==="needs-gesture"?s.jsx(Xe,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=b):b=e[40];let w;e[41]!==j||e[42]!==y||e[43]!==b?(w={title:j,body:y,after:b},e[41]=j,e[42]=y,e[43]=b,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(us,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==x?(N=s.jsx(zt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:x,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=x,e[54]=N):N=e[54],N}function zo(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 Io=15e3,Uo=3e3;function Ho(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(b,w)=>setTimeout(b,w),clearTimer:o=b=>clearTimeout(b),timeoutMs:l=Uo}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,x=null,v=null;const E=()=>u.visibilityState==="hidden",g=b=>{d={...d,...b},i(d)},k=async b=>{v=new AbortController;const w=v,T=a(()=>w.abort(),l);try{return await n(b,w.signal),!0}catch(P){if(p)return!1;const N=$a(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:b}}):d.problem?.endpoint===b&&g({problem:null}),!1}finally{o(T),v=null}},j=async()=>{if(x=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(E()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const b of e){if(p)break;if(await k(b)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(b);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),E()){g({status:"paused"});return}x=a(()=>{j()},Ma(f,Io))}}};function y(){if(!p){if(E()){x!==null&&(o(x),x=null),m||g({status:"paused"});return}x!==null&&o(x),f=0,j()}}return u.addEventListener("visibilitychange",y),i(d),j(),()=>{p=!0,x!==null&&o(x),v?.abort(),u.removeEventListener("visibilitychange",y)}}function Vo(t,e){return za(Ia({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const qo=["loopback-network","local-network-access"];async function Wo(){if(Ka(window.location.origin))return null;for(const t of qo)try{return await navigator.permissions.query({name:t})}catch{}return null}let sr=null,ys=!1;const gn=new Set;function Go(t){if(gn.add(t),!ys){ys=!0;const e=n=>{sr=n;for(const r of gn)r()};Wo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>gn.delete(t)}const Jo={status:"stopped",firstRoundDone:!1,problem:null},vn=new Map;function Yo(t){const e=vn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=Ho({candidates:t.split(" "),probe:Vo,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,vn.delete(t))})};return vn.set(t,u),u}function rr(){return S.useSyncExternalStore(Go,ks,ks)}const Qo=()=>()=>{},ws=()=>Jo,ks=()=>sr;function Pc(t){const e=ne.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=rr(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Yo(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Qo,d?.getSnapshot??ws,d?.getSnapshot??ws),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let x;return e[5]!==a||e[6]!==p||e[7]!==m?(x={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=x):x=e[8],x}const Ss={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Xo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...Ss,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ss:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&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 Zo=1e4,ei=1e3,ti=3e4;function ni({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Zo)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const x=Ba(ti,ei,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const v=t.current,E=a.current;!v||!E||!o.current||(v.src=E,d())},x)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const si=1500,ri=500;function ai({iframe:t,reload:e,waitMs:n=si,confirmMs:r=ri}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const oi=$t({tag:Ne(),id:Ne(),classes:Ne(),text:Ne(),html:Ne(),manifestKey:Ne().nullable(),componentName:Ne().nullable(),parents:Ne(),url:Ne(),path:Ne(),viewport:$t({width:Ye(),height:Ye()}),position:$t({x:Ye(),y:Ye()})}),ii=`(function() {
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-A_RH8q6f.js","assets/index-Cmhl3zNb.js","assets/index-pFm7t22i.css","assets/chat-context-70xHoaxp.js","assets/use-panel-navigate-Cs4na-V_.js","assets/thread-route-C2rii--a.js","assets/use-project-scope-COiEpk7r.js","assets/repository-binding-X3TRktCN.js","assets/use-mcp-client-CedU4dWV.js","assets/auth-Bjnc521y.js","assets/autosend-D1RPfsoi.js","assets/thread-intent-CCu0BEYJ.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-DnJO6AZk.js","assets/task-board-C1s59vKR.js","assets/schema-nN2fVtd3.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-CBhHAjRY.js","assets/use-ai-providers-D84PtMSN.js","assets/location-BjlyegC2.js","assets/use-organization-settings-BhbyABaR.js","assets/blocks-tab-states-7xd0L-RH.js","assets/site-editor-toast-g-4xfmJ4.js","assets/input-DVPmZILt.js","assets/usage-stats-B3aY2c0l.js","assets/tool-namespace-CRTO9xOA.js","assets/form-DidHa5sD.js","assets/label-COA0amPU.js","assets/utils-CVEq3hMx.js","assets/markdown-DntfPEgK.js","assets/use-copy-DzgBkNLT.js","assets/Copy01-CsyaL0tc.js","assets/ZoomOut-CYcrWaFo.js","assets/use-mobile-CY0Djv_M.js","assets/tooltip-kZk2wAMk.js","assets/index-D69M9S-D.js","assets/agent-icon-DMH8Ftve.js","assets/AlertCircle-iwRSZJFi.js","assets/Tool01-Bsd9MAXv.js","assets/ArrowUp-CWx4kMsV.js","assets/ArrowLeft-_QxYwR3P.js","assets/LinkBroken01-y64X2SC-.js","assets/ShoppingBag01-COYAkOJY.js","assets/Building02-Dcs_HLaa.js","assets/CheckCircle-X3D4eq-V.js","assets/ChevronUp-BlFhjumO.js","assets/ChevronSelectorVertical-7X_EL11G.js","assets/UserSquare-CEX9DbWl.js","assets/CreditCard01-DZn9m-o1.js","assets/DotsVertical-H16dBinG.js","assets/Image01-C-r__mWH.js","assets/Globe04-B5AbE2NG.js","assets/SwitchHorizontal01-ZjaXGph0.js","assets/Key01-D8PhPz3k.js","assets/Link01-BZlTJYwG.js","assets/Monitor01-Ccoz_3RV.js","assets/Sun-s_f7cajm.js","assets/Play-B8dkIMIB.js","assets/Plus-D_siv_aA.js","assets/SearchMd-KKuAy3kv.js","assets/Trash01-CqbCnp4Y.js","assets/Upload01-BuL02EP8.js","assets/User01-DOqRt8wn.js","assets/Users01-n5qz8jdG.js","assets/XClose-BQ9Dlu1I.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/icon-button-iwZ3O0_B.js","assets/file-type-icon-2Asg9IKB.js","assets/shell-layout-CtdsDlSz.js","assets/avatar-B2nFfSHv.js","assets/use-clock-tick-CgUj6u2i.js","assets/command-CAYMLhJL.js","assets/index-B2vL4Txo.js","assets/integration-icon-CktagpLu.js","assets/project-icon-CIzqFWaQ.js","assets/new-project-dialog-Y_XjAxS_.js","assets/repository-import-picker-DVf3Vnm6.js","assets/use-navigate-to-agent-cdHnGUXB.js","assets/repository-picker-B8x2K0Wa.js","assets/useInfiniteQuery-BLA_teXl.js","assets/infiniteQueryObserver-978TY1hh.js","assets/collection-search-ZGgli3wR.js","assets/use-debounced-value-C7Ih1llI.js","assets/required-auth-layout-Dxnpn4YU.js","assets/use-org-sso-Dz08CIcx.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-Nb1SIeYI.js","assets/select-BFXL8R1G.js","assets/index-BdQq_4o_.js","assets/tabs-BEPPtBqO.js","assets/use-deco-credits-ByP4Of99.js","assets/toggle-group-a7j08s-f.js","assets/use-open-billing-url-C9VcD5z_.js","assets/index-DVqdGkOX.js","assets/checkbox-CwspTWv-.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-YaXt6bOC.js","assets/drawer-CkgkUBCk.js","assets/input-CbMPZsxE.js","assets/suggestion-Bv3b6MxU.js","assets/use-mcp-prompts-CdDNTlaE.js","assets/use-org-fs-BzlMLYdA.js","assets/question-004-sINsf4GQ.js","assets/use-members-BI_Z9G2i.js","assets/use-org-auth-client-Cy7UT2_Z.js","assets/feature-paywall-BqNVafLn.js","assets/plan-ladder-DYIZDWtc.js","assets/add-connection-dialog-CJKZey2r.js","assets/extract-connection-data-BpdUae_j.js","assets/metadata-D72DunRR.js","assets/connection-CEjWhO8M.js","assets/url-slug-CXYaPIEX.js","assets/connection-card-Qtm3n_hS.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-CMJRBl6x.js","assets/use-connection-CikB9KcW.js","assets/schema-ChwlN9B2.js","assets/connection-form-helpers-C8PcIQLm.js","assets/authenticate-and-persist-oauth-DK-E6e3Z.js","assets/mcp-oauth-DqjrYGbv.js","assets/mcp-oauth-jIbhs8wE.js","assets/collection-tabs-C331r2n4.js","assets/badge-CRNAVwfV.js","assets/use-infinite-scroll-DQl4a0Bs.js","assets/useSuspenseInfiniteQuery-Cu40gYv3.js","assets/use-task-board-events-CQVfQw81.js","assets/use-chat-layout-state-4I8rtQwF.js","assets/input-Bwd_JSM8.css","assets/use-main-schema-v8-DmthzehD.js","assets/sandbox-url-D3mC8qhT.js","assets/utils-D_iIHZov.js","assets/index-DNlGRld6.js","assets/pair-CCzeqHVB.js","assets/collapsible-CKlYJ7JC.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CFqAYLtv.js","assets/types-CD9jRVDk.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-CYoLylxA.js","assets/use-thread-outputs-BRiZLmB3.js","assets/sandbox-git-api-CRxdlhrN.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/secret-ciphertext-COE-QTj7.js","assets/alert-BpKmtk7d.js","assets/switch-CvZlxlV0.js","assets/scroll-area-DDy8s3Ss.js","assets/monaco-editor-94ag9h78.js","assets/editor-B2CFLfaQ.js","assets/calendar-CBcRt8Oe.js","assets/editor-classes-DcYQ4Aap.js","assets/core.esm-uZtRM3l4.js","assets/sortable.esm-CwAjqrb2.js","assets/view-mode-toggle-dGCnwIOo.js","assets/combobox-D7TXxp7o.js","assets/alert-dialog-CgRaXWeG.js","assets/search-input-DBKGcZuw.js","assets/use-file-configs-DhEp4msd.js","assets/asset-utils-CW4a0Tss.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/empty-state-BZa0U-xG.js","assets/mustache-CHjvX4mG.js","assets/use-section-preview-base-Dp3nLlkj.js","assets/section-preview-url-7zfngvgW.js","assets/page-seo-form-ysYceart.js","assets/variant-draft-pointer-Di3PGFGj.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aY as Ye,aG as Ne,q as Os,D as Ds,K as Bs,s as Fs,v as Ms,e as Ir,h as gt,I as rs,w as Ur,aZ as Hr,a2 as Sn,a_ as Vr,aX as qr,au as as,aw as os,a5 as Wr,P as is,y as Gr,t as cn,o as Jr,m as Yr}from"./index-Cmhl3zNb.js";import{u as $s,g as Qr,c as Xr,B as dn,P as Zr,r as ea,R as ta,a as na,b as Ks,d as zs,i as sa,S as ra,e as aa,f as oa,C as ia,h as la,j as ca,l as da,m as ua,p as fa,k as ma,n as un,N as pa}from"./blocks-tab-states-7xd0L-RH.js";import{b as ha,c as It,r as Is,l as Us,f as ga,g as va,w as ba}from"./chat-context-70xHoaxp.js";import{t as xa}from"./ChevronUp-BlFhjumO.js";import{V as ya,W as wa,L as Hs,X as ka,b as Sa,Y as Pa,Z as Ea,_ as ja,$ as Na,a0 as ls,a1 as Ta}from"./agent-icon-DMH8Ftve.js";import{a as Ca}from"./UserSquare-CEX9DbWl.js";import{s as Ra}from"./Plus-D_siv_aA.js";import{P as La,a as _a,b as Aa}from"./popover-YaXt6bOC.js";import{a as mt,b as pt,c as Vs,d as qs,e as Ws,C as Gs}from"./command-CAYMLhJL.js";import{c as Oa,a as Da}from"./repository-binding-X3TRktCN.js";import{b as Pn}from"./sandbox-lifecycle-context-CrtkjvLt.js";import{e as Ba}from"./backoff-CrEUbyZT.js";import{f as Fa}from"./thread-intent-CCu0BEYJ.js";import{a as Js}from"./input-DVPmZILt.js";import{S as Ys,A as Ma,B as $a,C as Ka,F as za,G as Ia,H as Ua,I as Ha,u as En,J as jn,K as xn,L as Va,M as qa,N as Wa,c as Ga,b as Qs,O as Ja,P as Qe,z as Ya,Q as Qa,R as Xa,U as Za,x as eo,V as cs,w as to,W as no,e as so}from"./site-editor-toast-g-4xfmJ4.js";import{u as ro}from"./use-mobile-CY0Djv_M.js";import{c as fn,T as mn,a as pn}from"./tooltip-kZk2wAMk.js";import{T as ct}from"./toolbar-icon-button-BsOv6rvJ.js";import{b as ao,w as At,a as ds,i as oo}from"./variant-draft-pointer-Di3PGFGj.js";import{h as io,s as lo,L as co,R as Kt,j as us,N as uo,k as fo,l as ht,n as Nn,m as Xs,f as Fe,v as Zs,o as mo,q as po,r as ho,t as go,u as vo,w as fs,d as bo}from"./secret-ciphertext-COE-QTj7.js";import{r as xo,D as ms,w as ps,b as hs,a as yo}from"./section-preview-url-7zfngvgW.js";import{u as wo}from"./use-fast-preview-draft-url-R7ofHb_D.js";import{a as ko,c as er}from"./shell-layout-CtdsDlSz.js";import{u as tr,b as So}from"./index-DNlGRld6.js";import{u as yn}from"./useQueries-BaTjPT3P.js";import{i as Po}from"./LinkBroken01-y64X2SC-.js";import{u as nr}from"./blocks-preview-workspace-context-BGEsHkZW.js";import{MonacoCodeEditor as Eo}from"./monaco-editor-94ag9h78.js";import{a as jo}from"./utils-D_iIHZov.js";import{R as gs,a as Ot,b as vs}from"./resizable-DKp6vSsG.js";import{u as No,a as hn}from"./use-main-schema-v8-DmthzehD.js";import{w as bs}from"./device-hint-SeLRi17j.js";import{r as To}from"./virtual-mcp-Cm_JxjLS.js";import{d as Co}from"./delay-CnY5UFtP.js";import{E as Ro}from"./empty-state-BZa0U-xG.js";import{G as xs}from"./repository-picker-B8x2K0Wa.js";import{R as Lo}from"./repository-import-picker-DVf3Vnm6.js";import{r as _o}from"./preview-source-BsRLGWUP.js";import{A as Ao,a as Oo,b as Do}from"./alert-BpKmtk7d.js";import{u as Bo}from"./use-task-metadata-2qdE9S5L.js";function Fo(t){const e=ne.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(ya,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.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]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(wa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function Mo(t){const e=ne.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.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]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Mt("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let x;e[14]!==i.command?(x=i.command&&s.jsx(io,{command:i.command}),e[14]=i.command,e[15]=x):x=e[15];let v;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==x?(v=s.jsxs("div",{className:m,children:[f,x,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=x,e[20]=v):v=e[20];let E;return e[21]!==a||e[22]!==d||e[23]!==v?(E=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,v]}),e[21]=a,e[22]=d,e[23]=v,e[24]=E):E=e[24],E}const $o=[];function zt(t){const e=ne.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?$o:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let x;e[0]!==i?(x=s.jsx(Fo,{waiting:i}),e[0]=i,e[1]=x):x=e[1];let v;e[2]!==m||e[3]!==n?(v=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=v):v=e[4];let E;e[5]!==r?(E=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=E):E=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==v||e[10]!==E?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,v,E]}),e[7]=f,e[8]=x,e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,b)=>s.jsx(Mo,{index:b+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let j;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(j=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.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:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=j):j=e[19],j}function Ko(t){const e=ne.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=_e();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(Ao,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(Oo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(Do,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let B;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(B=lo(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=B):B=e[6];const{title:R,body:D}=B;let O;e[7]!==D?(O=s.jsx(Kt,{text:D}),e[7]=D,e[8]=O):O=e[8];let F;e[9]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(us,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=F):F=e[9];let _;return e[10]!==l||e[11]!==O||e[12]!==R?(_=s.jsx(zt,{headingLevel:2,waiting:!1,title:R,lead:O,alerts:l,footer:F}),e[10]=l,e[11]=O,e[12]=R,e[13]=_):_=e[13],_}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let x;e[18]!==l||e[19]!==n.kind?(x=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(co,{})]}),e[18]=l,e[19]=n.kind,e[20]=x):x=e[20];let v;e[21]!==a?(v=a("decoServe.guide.step1.title"),e[21]=a,e[22]=v):v=e[22];let E;e[23]!==a?(E=a("decoServe.guide.step1.body"),e[23]=a,e[24]=E):E=e[24];let g;e[25]!==E?(g=s.jsx(Kt,{text:E}),e[25]=E,e[26]=g):g=e[26];let k;e[27]!==v||e[28]!==g?(k={title:v,body:g,command:Ys},e[27]=v,e[28]=g,e[29]=k):k=e[29];let j;e[30]!==a?(j=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=j):j=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let b;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(b=n.kind==="needs-gesture"?s.jsx(Xe,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=b):b=e[40];let w;e[41]!==j||e[42]!==y||e[43]!==b?(w={title:j,body:y,after:b},e[41]=j,e[42]=y,e[43]=b,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(us,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==x?(N=s.jsx(zt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:x,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=x,e[54]=N):N=e[54],N}function zo(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 Io=15e3,Uo=3e3;function Ho(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(b,w)=>setTimeout(b,w),clearTimer:o=b=>clearTimeout(b),timeoutMs:l=Uo}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,x=null,v=null;const E=()=>u.visibilityState==="hidden",g=b=>{d={...d,...b},i(d)},k=async b=>{v=new AbortController;const w=v,T=a(()=>w.abort(),l);try{return await n(b,w.signal),!0}catch(P){if(p)return!1;const N=$a(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:b}}):d.problem?.endpoint===b&&g({problem:null}),!1}finally{o(T),v=null}},j=async()=>{if(x=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(E()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const b of e){if(p)break;if(await k(b)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(b);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),E()){g({status:"paused"});return}x=a(()=>{j()},Ma(f,Io))}}};function y(){if(!p){if(E()){x!==null&&(o(x),x=null),m||g({status:"paused"});return}x!==null&&o(x),f=0,j()}}return u.addEventListener("visibilitychange",y),i(d),j(),()=>{p=!0,x!==null&&o(x),v?.abort(),u.removeEventListener("visibilitychange",y)}}function Vo(t,e){return za(Ia({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const qo=["loopback-network","local-network-access"];async function Wo(){if(Ka(window.location.origin))return null;for(const t of qo)try{return await navigator.permissions.query({name:t})}catch{}return null}let sr=null,ys=!1;const gn=new Set;function Go(t){if(gn.add(t),!ys){ys=!0;const e=n=>{sr=n;for(const r of gn)r()};Wo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>gn.delete(t)}const Jo={status:"stopped",firstRoundDone:!1,problem:null},vn=new Map;function Yo(t){const e=vn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=Ho({candidates:t.split(" "),probe:Vo,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,vn.delete(t))})};return vn.set(t,u),u}function rr(){return S.useSyncExternalStore(Go,ks,ks)}const Qo=()=>()=>{},ws=()=>Jo,ks=()=>sr;function Pc(t){const e=ne.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=rr(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Yo(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Qo,d?.getSnapshot??ws,d?.getSnapshot??ws),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let x;return e[5]!==a||e[6]!==p||e[7]!==m?(x={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=x):x=e[8],x}const Ss={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Xo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...Ss,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ss:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&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 Zo=1e4,ei=1e3,ti=3e4;function ni({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Zo)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const x=Ba(ti,ei,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const v=t.current,E=a.current;!v||!E||!o.current||(v.src=E,d())},x)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const si=1500,ri=500;function ai({iframe:t,reload:e,waitMs:n=si,confirmMs:r=ri}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const oi=$t({tag:Ne(),id:Ne(),classes:Ne(),text:Ne(),html:Ne(),manifestKey:Ne().nullable(),componentName:Ne().nullable(),parents:Ne(),url:Ne(),path:Ne(),viewport:$t({width:Ye(),height:Ye()}),position:$t({x:Ye(),y:Ye()})}),ii=`(function() {
|
|
3
3
|
if (window.__visualEditorActive) return;
|
|
4
4
|
window.__visualEditorActive = true;
|
|
5
5
|
|
|
@@ -548,4 +548,4 @@ import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aY as Ye,aG as Ne,
|
|
|
548
548
|
}
|
|
549
549
|
});
|
|
550
550
|
})();`;function wn(t,e){let n=t,r=typeof n?.__resolveType=="string"?n.__resolveType:"";for(let i=0;r&&i<5;i++){const u=e[r];if(u&&typeof u=="object"&&"__resolveType"in u){const a=u.__resolveType;if(typeof a=="string"&&a&&a!==r){n=u,r=a;continue}}break}if(!r)return[];if(r.includes("flags/multivariate")){const i=Array.isArray(n.variants)?n.variants:[];if(i.length===0||i.every(o=>o?.rule?.__resolveType===uo))return null;const a=[];for(const o of i){const l=o?.value;if(l&&typeof l=="object")for(const d of wn(l,e)??[])a.includes(d)||a.push(d)}return a}if(fo(r)){const i=n.section&&typeof n.section=="object"?wn(n.section,e):[];return i===null?null:i.length?[r,...i]:[r]}return[r]}function Je(t){return t.replace(/[`*_]/g,"\\$&")}function di(t,e){const n=[`The user selected an element on the live preview and asked: **"${Je(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:** \`${Je(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 r=`<${t.tag}${t.classes?` class="${Je(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${r}\``),t.parents&&n.push(`**DOM breadcrumb:** ${Je(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${Je(t.text)}"`),t.componentName&&n.push(`**Component name:** ${Je(t.componentName)}`);const i=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",i,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
|
|
551
|
-
`)}function ui(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function fi(t){const e=ne.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=ha(),{openSidePanel:l}=ko(),d=_e();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const U=di(n,i);l(),o({parts:[{type:"text",text:U}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=ui(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const x=f,v=`${x.leftPct}%`,E=`${x.topPct}%`;let g;e[9]!==v||e[10]!==E?(g={left:v,top:E,width:"320px"},e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==m?(k=U=>{U.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=U=>u(U.target.value),e[14]=j):j=e[14];let y;e[15]!==r?(y=U=>{U.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let b;e[17]!==d?(b=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==b?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:j,onKeyDown:y,placeholder:b,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=b,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let B;e[27]!==d?(B=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=B):B=e[28];let R;e[29]!==B?(R=s.jsx("title",{children:B}),e[29]=B,e[30]=R):R=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=D):D=e[31];let O;e[32]!==R?(O=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,D]}),e[32]=R,e[33]=O):O=e[33];let F;e[34]!==P||e[35]!==N||e[36]!==O?(F=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:O}),e[34]=P,e[35]=N,e[36]=O,e[37]=F):F=e[37];let _;e[38]!==w||e[39]!==F||e[40]!==k?(_=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:k,children:[w,F]}),e[38]=w,e[39]=F,e[40]=k,e[41]=_):_=e[41];let I;return e[42]!==_||e[43]!==g?(I=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:_}),e[42]=_,e[43]=g,e[44]=I):I=e[44],I}const Es="site-links",mi=/details?page|\bpdp\b/i,pi=/listingpage|\bplp\b/i;function hi(t,e,n){const r=new Set;for(const o of n)mi.test(o)&&r.add("product"),pi.test(o)&&r.add("category");const i=ht(Nn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const gi=["rosa","preto","pink","black"];function Dt(t,e){const n=e.trim();return n?t(n):gi.flatMap(r=>t(r))}function vi(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const ar=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Tn(t){return t.split("/")[0]??""}function bi(t){const e=new Set;for(const n of t){const r=Tn(n);ar.has(r)&&e.add(r)}return e}function xi(t,e){const n=Tn(t);return!ar.has(n)||e.size===0?!0:e.has(n)}const yi=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Dt(n=>vi(t,n),e),optionsFromPayload:Bt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Bt},{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:Ni}];function wi(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of yi){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&xi(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Tn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(ki(t.has("category")?"category":"product")),a}function ki(t){return{kind:t,id:Es,resolveType:Es,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>_i(e,n)}}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Si(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=Ie(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=Ie(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function or(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function ir(t){try{return decodeURIComponent(t)}catch{return t}}function Pi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=Pi(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function lr(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=ht(Nn(e)),{pattern:u,order:a}=Ei(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?ir(d):null}function Bt(t,e){const n=Ie(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=Ie(a);if(!o)continue;const l=lr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=Ie(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?Ie(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function ji(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?ir(n):null}function Ni(t){const e=[],n=new Set,r=(i,u)=>{const a=Ie(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=ji(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const Ti=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 Ci(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function Ri(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function Li(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function _i(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=lr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&Ti.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:Ci(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of Li(t))i(u,a,"product",o);for(const{href:u,text:a}of Ri(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function dt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const cr=1e4;function Ai(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 Oi(t,{resolveType:e,props:n}){const r=await fetch(Ua(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(cr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function js(t,e){const n=await fetch(Ha(t,e),{signal:AbortSignal.timeout(cr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function Di(t,e,n){const r=e.optionsFromPayload(await js(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Fe(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await js(t,u),n).filter(o=>o.kind==="product");return or([r,a])}catch{return r}}function Bi(t,e,n){return Bs.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function Fi(t,e,n,r){if(e.homepageLinks)return Di(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>Oi(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return or(a.map(o=>e.optionsFromPayload(o,r)))}function kn(t,e,n,r,i){return{queryKey:Bi(t,e,n),queryFn:()=>Fi(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function ut(t){const e=ne.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(Hs,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Fe(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(mt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Ns(t){const e=ne.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Mi(t){const e=ne.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=_e(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[x,v]=S.useState(""),E=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=Ai(l),y=[...new Set(n.map(M=>k[M.kind].noun))].join(" or ");let b;e[0]!==l||e[1]!==y?(b=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=b):b=e[2];const w=b,T={template:r,paramName:i};let P;e[3]!==m?(P=(M,G)=>({source:M,query:G,options:M.clientFilter?dt(G.data??[],m):G.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,B=n.filter(qi),R=n.filter(Vi),D=yn({queries:B.map(M=>kn(a,M,x,T,d))});let O;e[5]!==D||e[6]!==N?(O=(M,G)=>N(M,D[G]),e[5]=D,e[6]=N,e[7]=O):O=e[7];const F=B.map(O),_=F.length===0||F.every(Hi),I=yn({queries:R.map(M=>kn(a,M,x,T,d&&_))});let U;e[8]!==I||e[9]!==N?(U=(M,G)=>N(M,I[G]),e[8]=I,e[9]=N,e[10]=U):U=e[10];const Z=R.map(U),z=_?Z:F,q=z.length===1&&z[0]?.source.homepageLinks?z[0]:null,ee=q&&!q.query.isLoading&&!q.query.isError?q?.query.data??[]:[],ce=dt(ee.filter(Ui),m),C=dt(ee.filter(Ii),m),H=ce.length>0&&C.length>0,A=M=>{p(M),E.current&&clearTimeout(E.current),f(M?u:""),v(M?u:"")};let J;e[11]===Symbol.for("react.memo_cache_sentinel")?(J=M=>{f(M),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{v(M)},300)},e[11]=J):J=e[11];const Y=J,Q=M=>{o(M),A(!1)},he=Xs(m),se=Fe(r,{[i]:he}),W=Ds,oe=Os,we="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",de=zi;let re;e[12]!==g||e[13]!==l?(re=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=re):re=e[14];let ue;e[15]!==re?(ue=s.jsx(Fs,{className:"sr-only",children:s.jsx(Ms,{children:re})}),e[15]=re,e[16]=ue):ue=e[16];let ke;e[17]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Hs,{size:16,className:"shrink-0 text-foreground"}),e[17]=ke):ke=e[17];let ae;e[18]!==l?(ae=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=ae):ae=e[19];let fe;e[20]!==g?(fe=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-[12px] text-special",children:g}),e[20]=g,e[21]=fe):fe=e[21];let ie;e[22]!==ae||e[23]!==fe?(ie=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ke,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ae," ",fe]})]}),e[22]=ae,e[23]=fe,e[24]=ie):ie=e[24];const Te=qs,Se=!1,Me="min-h-0 flex-1";let ge;e[25]!==w||e[26]!==m?(ge=s.jsx(Ws,{autoFocus:!0,placeholder:w,value:m,onValueChange:Y}),e[25]=w,e[26]=m,e[27]=ge):ge=e[27];const Ze=Vs,vt="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Be;e[28]!==l?(Be=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Be):Be=e[29];let Ae;e[30]!==Be?(Ae=s.jsx(Gs,{children:Be}),e[30]=Be,e[31]=Ae):Ae=e[31];const be=he&&s.jsx(mt,{className:"shrink-0",children:s.jsxs(pt,{value:`__raw__:${he}`,className:"gap-3 py-2",onSelect:()=>Q(he),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Po,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:he,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:se})]})]})}),$e=H?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:ce,template:r,paramName:i,keyPrefix:`${q?.source.id}:cat`,onSelect:Q})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${q?.source.id}:prod`,onSelect:Q})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:z.map(M=>{const{source:G,query:Ke,options:et}=M,{noun:Ue}=k[G.kind];if(Ke.isLoading)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.loading",{noun:Ue})},G.id);if(Ke.isError)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},G.id);if(G.homepageLinks){const bt=Ke.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:dt(bt.filter(Ki),m),template:r,paramName:i,keyPrefix:`${G.id}:cat`,onSelect:Q}),s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:dt(bt.filter($i),m),template:r,paramName:i,keyPrefix:`${G.id}:prod`,onSelect:Q})]},G.id)}return s.jsx(ut,{heading:z.length>1?k[G.kind].heading:void 0,iconKind:G.kind,options:et,template:r,paramName:i,keyPrefix:G.id,onSelect:Q},G.id)})});let Ce;e[32]!==Ze||e[33]!==Ae||e[34]!==be||e[35]!==$e?(Ce=s.jsxs(Ze,{className:vt,children:[Ae,be,$e]}),e[32]=Ze,e[33]=Ae,e[34]=be,e[35]=$e,e[36]=Ce):Ce=e[36];let Re;e[37]!==Te||e[38]!==ge||e[39]!==Ce?(Re=s.jsxs(Te,{shouldFilter:Se,className:Me,children:[ge,Ce]}),e[37]=Te,e[38]=ge,e[39]=Ce,e[40]=Re):Re=e[40];let Pe;e[41]!==oe||e[42]!==ue||e[43]!==ie||e[44]!==Re||e[45]!==de?(Pe=s.jsxs(oe,{className:we,onClick:de,children:[ue,ie,Re]}),e[41]=oe,e[42]=ue,e[43]=ie,e[44]=Re,e[45]=de,e[46]=Pe):Pe=e[46];let xe;return e[47]!==W||e[48]!==A||e[49]!==d||e[50]!==Pe?(xe=s.jsx(W,{open:d,onOpenChange:A,children:Pe}),e[47]=W,e[48]=A,e[49]=d,e[50]=Pe,e[51]=xe):xe=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-[12px] text-special hover:bg-special/25",onClick:M=>{M.stopPropagation(),A(!0)},children:u||g}),xe]})}function $i(t){return t.kind==="product"}function Ki(t){return t.kind!=="product"}function zi(t){return t.stopPropagation()}function Ii(t){return t.kind==="product"}function Ui(t){return t.kind!=="product"}function Hi(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Vi(t){return t.isFallback}function qi(t){return!t.isFallback}function Wi(t){const e=ne.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const x={template:r,paramName:i},v=n.filter(Gi);l=yn,o=v.map(E=>kn(u,E,"",x,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const x of p){if(x.isLoading)break;const v=x.data?.[0];if(v){f(!0),queueMicrotask(()=>a(v.value));break}}return null}function Gi(t){return!t.isFallback}function Ji(t){const e=ne.c(31),{name:n,value:r,onCommit:i}=t,u=_e(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,x=a||f;let v;e[3]!==x?(v=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-[12px]",children:x}),e[3]=x,e[4]=v):v=e[4];let E;e[5]!==f||e[6]!==u?(E=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=E):E=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let j;e[10]!==r?(j=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=j):j=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=Xs(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let b;e[16]!==a||e[17]!==f||e[18]!==E||e[19]!==j||e[20]!==y?(b=s.jsx("input",{type:"text",value:a,placeholder:f,title:E,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-[12px] text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Yi,onChange:g,onFocus:k,onKeyDown:j,onBlur:y}),e[16]=a,e[17]=f,e[18]=E,e[19]=j,e[20]=y,e[21]=b):b=e[21];let w;e[22]!==v||e[23]!==b?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,b]}),e[22]=v,e[23]=b,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.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-[10px] text-muted-foreground",children:[s.jsx(ka,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Yi(t){return t.stopPropagation()}function Qi(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Xi(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Zi(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function el(t){const e=ne.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=$s(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const d=Qr(a),p=l?{...l,name:a,path:o}:Xr(a,o);return await r.mutateAsync({blockKey:d,data:p}),{key:d,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],Ir(i)}function tl(t){const e=ne.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=_e();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let x;e[2]!==d?(x=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=x):x=e[3];const[v,E]=S.useState(x),[g,k]=S.useState(dn),[j,y]=S.useState(null),[b,w]=S.useState(n);n!==b&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),E(d("sectionsEditor.createPageModal.defaultPagePath")),k(dn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=ae=>{!ae&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let B;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==v||e[11]!==T||e[12]!==g?(B=async ae=>{ae.preventDefault();const fe=m.trim(),ie=v.trim();if(!fe||!ie||l)return;const Te=Zs(ie);if(Te){y(Te);return}y(null),await o({name:fe,path:ie,templateKey:T&&g!==dn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=v,e[11]=T,e[12]=g,e[13]=B):B=e[13];const R=B,D=j??u;let O;e[14]!==d?(O=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=O):O=e[15];let F;e[16]!==O?(F=s.jsx(Fs,{children:s.jsx(Ms,{children:O})}),e[16]=O,e[17]=F):F=e[17];let _;e[18]!==d?(_=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=_):_=e[19];let I;e[20]!==_?(I=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=I):I=e[21];let U;e[22]===Symbol.for("react.memo_cache_sentinel")?(U=ae=>f(ae.target.value),e[22]=U):U=e[22];let Z;e[23]!==d?(Z=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=Z):Z=e[24];let z;e[25]!==l||e[26]!==m||e[27]!==Z?(z=s.jsx(rs,{id:"new-page-name",value:m,onChange:U,placeholder:Z,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=Z,e[28]=z):z=e[28];let q;e[29]!==z||e[30]!==I?(q=s.jsxs("div",{className:"space-y-1.5",children:[I,z]}),e[29]=z,e[30]=I,e[31]=q):q=e[31];let te;e[32]!==d?(te=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=te):te=e[33];let ee;e[34]!==te?(ee=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:te}),e[34]=te,e[35]=ee):ee=e[35];let ce;e[36]===Symbol.for("react.memo_cache_sentinel")?(ce=ae=>E(ae.target.value),e[36]=ce):ce=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let H;e[39]!==l||e[40]!==v||e[41]!==C?(H=s.jsx(rs,{id:"new-page-path",value:v,onChange:ce,placeholder:C,disabled:l}),e[39]=l,e[40]=v,e[41]=C,e[42]=H):H=e[42];let A;e[43]!==ee||e[44]!==H?(A=s.jsxs("div",{className:"space-y-1.5",children:[ee,H]}),e[43]=ee,e[44]=H,e[45]=A):A=e[45];let J;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(J=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(Zr,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=J):J=e[51];let Y;e[52]!==D?(Y=D&&s.jsx("p",{className:"text-xs text-destructive",children:D}),e[52]=D,e[53]=Y):Y=e[53];let Q;e[54]!==q||e[55]!==A||e[56]!==J||e[57]!==Y?(Q=s.jsxs("div",{className:"space-y-4 py-4",children:[q,A,J,Y]}),e[54]=q,e[55]=A,e[56]=J,e[57]=Y,e[58]=Q):Q=e[58];let he;e[59]!==r?(he=()=>r(!1),e[59]=r,e[60]=he):he=e[60];let se;e[61]!==d?(se=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=se):se=e[62];let W;e[63]!==l||e[64]!==he||e[65]!==se?(W=s.jsx(Xe,{type:"button",variant:"outline",onClick:he,disabled:l,children:se}),e[63]=l,e[64]=he,e[65]=se,e[66]=W):W=e[66];let oe;e[67]!==l||e[68]!==m||e[69]!==v?(oe=!m.trim()||!v.trim()||l,e[67]=l,e[68]=m,e[69]=v,e[70]=oe):oe=e[70];let we;e[71]!==l||e[72]!==d?(we=l?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=we):we=e[73];let de;e[74]!==oe||e[75]!==we?(de=s.jsx(Xe,{type:"submit",disabled:oe,children:we}),e[74]=oe,e[75]=we,e[76]=de):de=e[76];let re;e[77]!==W||e[78]!==de?(re=s.jsxs(Ur,{children:[W,de]}),e[77]=W,e[78]=de,e[79]=re):re=e[79];let ue;e[80]!==R||e[81]!==Q||e[82]!==re||e[83]!==F?(ue=s.jsx(Os,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[F,Q,re]})}),e[80]=R,e[81]=Q,e[82]=re,e[83]=F,e[84]=ue):ue=e[84];let ke;return e[85]!==N||e[86]!==n||e[87]!==ue?(ke=s.jsx(Ds,{open:n,onOpenChange:N,children:ue}),e[85]=N,e[86]=n,e[87]=ue,e[88]=ke):ke=e[88],ke}function nl(t){const e=ne.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=_e();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=$s(p);let f;e[4]!==m?(f=na((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const x=f;let v;e[6]!==l||e[7]!==o?(v=ea(o,l),e[6]=l,e[7]=o,e[8]=v):v=e[8];const{resolveType:E,props:g,title:k}=v;if(!E){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const j=`loader:${l}`;let y;e[13]!==l||e[14]!==E||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:E,title:k},e[13]=l,e[14]=E,e[15]=k,e[16]=y):y=e[16];let b;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==x||e[25]!==j||e[26]!==y||e[27]!==r?(b=s.jsx(ta,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:sl,onSaveReferencedBlock:x,showRun:!1},j),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=x,e[25]=j,e[26]=y,e[27]=r,e[28]=b):b=e[28],b}async function sl(){}function rl(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Ts(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:rl(t.error)}}function al(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 ol(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=al(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(i=>i.status==="error"&&!i.hasData&&i.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 il=S.lazy(()=>Hr(()=>import("./sections-editor-BK3_J9sX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])).then(t=>({default:t.SectionsEditor})));function Cs(t){const e=ne.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=Sn(),{currentBranch:o,taskId:l}=It(),d=tr(),p=Pn(),m=nr(),f=d.lifecycle.phase==="running",x=p.previewUrl;let v;e[0]!==o||e[1]!==a||e[2]!==x||e[3]!==l||e[4]!==n?(v=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:x}:null,e[0]=o,e[1]=a,e[2]=x,e[3]=l,e[4]=n,e[5]=v):v=e[5];const E=v,g=En(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const j=jn(E,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const b=Ks(E,y),w=ol({lifecyclePhase:d.lifecycle.phase,decofile:Ts(j),meta:Ts(b),hasEditableContent:mo(j.data,b.data),fastPreviewActive:Js(n).runtime==="cms"||xn(g)}),T=zs()===void 0,P=ll;if(sa(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(oa,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(ia,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Vr,{})),e[13]=C):C=e[13],C}if(j.data&&Va(b.data)){const C=m.state.target,H=C?.kind==="page"||C?.kind==="section"?C.key:null,A=H??"",J=o??"";let Y;return e[14]!==j.data||e[15]!==H||e[16]!==a.slug||e[17]!==A||e[18]!==J||e[19]!==n?(Y=P(s.jsx(ra,{orgSlug:a.slug,virtualMcpId:n,branch:J,decofile:j.data,initialKey:H,compact:!0},A)),e[14]=j.data,e[15]=H,e[16]=a.slug,e[17]=A,e[18]=J,e[19]=n,e[20]=Y):Y=e[20],Y}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(la,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==j||e[23]!==p||e[24]!==b||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([j.refetch(),b.refetch()])},e[22]=j,e[23]=p,e[24]=b,e[25]=w.source,e[26]=C):C=e[26];const H=C;let A;return e[27]!==H||e[28]!==w.source?(A=P(s.jsx(aa,{source:w.source,onRetry:H})),e[27]=H,e[28]=w.source,e[29]=A):A=e[29],A}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const B=N,R=m.state.target;if(R?.kind==="loader"&&j.data&&b.data){const C=o??"",H=x??null;let A;return e[31]!==j.data||e[32]!==b.data||e[33]!==a.slug||e[34]!==C||e[35]!==H||e[36]!==R.key||e[37]!==n?(A=B(s.jsx(nl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:H,meta:b.data,decofile:j.data,blockKey:R.key})),e[31]=j.data,e[32]=b.data,e[33]=a.slug,e[34]=C,e[35]=H,e[36]=R.key,e[37]=n,e[38]=A):A=e[38],A}let D;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(D=R||!o?null:Is(Us(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=D):D=e[43];const O=D;let F="/",_=null,I=null;R?.kind==="page"?(F=R.path,_=R.key):R?.kind==="section"?I=R.key:O&&(F=O.path,_=O.pageKey);const U=_?`page:${_}`:I?`section:${I}`:`path:${F}`;let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=Z):Z=e[44];const z=o??"",q=x??void 0,te=I?null:u,ee=!!_&&m.state.editSeoPageKey===_;let ce;return e[45]!==I||e[46]!==_||e[47]!==F||e[48]!==U||e[49]!==i||e[50]!==a.slug||e[51]!==te||e[52]!==ee||e[53]!==z||e[54]!==q||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ce=B(s.jsx(S.Suspense,{fallback:Z,children:s.jsx(il,{orgSlug:a.slug,virtualMcpId:n,branch:z,previewReady:!0,previewUrl:q,currentPath:F,activePageBlockKey:_,activeGlobalBlockKey:I,externalSelection:te,initialEditSeo:ee,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},U)})),e[45]=I,e[46]=_,e[47]=F,e[48]=U,e[49]=i,e[50]=a.slug,e[51]=te,e[52]=ee,e[53]=z,e[54]=q,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ce):ce=e[59],ce}function ll(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Rs(t){const e=ne.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=_e(),o=zs(),l=o===!0,d=qa(n);let p;e[0]!==d||e[1]!==r?(p=Wa(d,jo(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=Sn(),{currentBranch:x,taskId:v}=It(),g=Pn().previewUrl;let k;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==v||e[7]!==n?(k=x?{orgSlug:f.slug,virtualMcpId:n,branch:x,threadId:v??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=v,e[7]=n,e[8]=k):k=e[8];const y=jn(k),b=x??"";let w;e[9]!==f.slug||e[10]!==b||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:b},e[9]=f.slug,e[10]=b,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=ca(w),N=y.data?.[r],B=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,D=!x||R||B;let O;e[13]!==N?(O=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=O):O=e[14];const F=O;let _;e[15]!==r||e[16]!==D||e[17]!==T?(_=te=>{if(D)return;let ee;try{ee=JSON.parse(te)}catch{return}ee===null||typeof ee!="object"||Array.isArray(ee)||T(r,ee)},e[15]=r,e[16]=D,e[17]=T,e[18]=_):_=e[18];const I=_;let U;e[19]!==P?(U=()=>({flush:P}),e[19]=P,e[20]=U):U=e[20],S.useImperativeHandle(u,U);let Z;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(Z=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Xe,{variant:"ghost",size:"icon",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"size-7 shrink-0",children:s.jsx(qr,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=Z):Z=e[25];let z;e[26]!==y.data||e[27]!==P||e[28]!==F||e[29]!==B||e[30]!==R||e[31]!==r||e[32]!==D||e[33]!==I||e[34]!==a?(z=B?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Eo,{code:F,language:"json",readOnly:D,height:"100%",onChange:te=>I(te??""),onSave:te=>{I(te),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=F,e[29]=B,e[30]=R,e[31]=r,e[32]=D,e[33]=I,e[34]=a,e[35]=z):z=e[35];let q;return e[36]!==Z||e[37]!==z?(q=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,z]}),e[36]=Z,e[37]=z,e[38]=q):q=e[38],q}function dr(t){return t.contentEditingEnabled&&!t.isMobile}function cl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function dl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ul(t){return dr({contentEditingEnabled:er(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function fl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}const ml=15e3;function pl(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 Ls(t){return t.loading?{...t,loading:!1}:t}const hl=500,gl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},_s=1,Ft=["desktop","mobile","tablet"],vl=["preview","visual","blocks"],As={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function bl(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 ft(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 xl(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 yl(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wl(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function kl(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sl({virtualMcpId:t}){const e=_e(),n=ro(),{currentBranch:r,taskId:i,virtualMcpId:u}=It(),a=!!ga(),o=nr(),l=Oa(u===t?t:null),d=Js(t),p=To(l?.metadata?.ui?.layout??null),m=er(p),f=dr({contentEditingEnabled:m,isMobile:n}),[x]=S.useState(()=>ul({cmsMode:p,isMobile:n})),[v,E]=as(os.previewEditingMode(t),c=>c&&vl.includes(c)?c:null),g=v??x,[k,j]=as(os.previewDeviceSize(t),c=>c&&Ft.includes(c)?c:"desktop"),[y,b]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[B,R]=S.useState(!1),D=S.useRef(null),O=()=>{D.current?.flush(),R(!1)},F=()=>R(c=>(c&&D.current?.flush(),!c)),[_,I]=S.useState({width:0,height:0}),[U,Z]=S.useState(!1),[z,q]=S.useState(""),te=S.useRef(null),[ee,ce]=S.useState(!1),[C,H]=S.useState(),[A,J]=S.useState(null),[Y,Q]=S.useState(null),[he,se]=S.useState(null),[W,oe]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[we,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[re,ue]=S.useState({}),[ke,ae]=S.useState(!1),fe=S.useRef(null),ie=()=>{ae(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>ae(!1),15e3)},Te=()=>{fe.current&&(clearTimeout(fe.current),fe.current=null),ae(!1)},{org:Se}=Sn(),Me=tr(),ge=Pn(),Ze=ge.vmEntry,vt=Me.lifecycle.phase,{url:Be,undecided:Ae}=Ga(t),be=En(t,r),{connection:$e}=Qs(t),Ce=No(t),Re=Ja({hasServeConnection:!!$e,runtime:d.runtime}),Pe=Ae||Re==="github"&&(Ce==="loading"||Ce==="error"),xe=!xn(be)&&!Pe&&!(Re==="github"&&be.kind==="pending"),M=Qe(be)??Be,G=M??ge.previewUrl,Ke=!!M||vt==="running",et=l?.id===t?Fa(l.metadata):null,Ue=!M&&!Ae&&l?.id===t&&d.runtime==="cms",bt=d.projectDefault==="cms",tt=xe?xo({sandboxUrl:G,previewServerUrl:et,fastPreviewActive:Ue}):null,Cn=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:G}:null,Rn=jn(Cn,{fetchEnabled:Ke}),Ln=Ks(Cn,{fetchEnabled:Ke}),X=Rn.data,ve=Ln.data,He=X?po(X,ve).sort((c,h)=>c.name.localeCompare(h.name)):[],_n=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r}:null,An=el(_n),Ut=X&&ve?ho(X,ve):[],On=xe&&X&&ve?da(ve,X,"loaders"):[],Dn=z?(()=>{const c=z.toLowerCase();return He.map(h=>({page:h,score:wl(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,L)=>L.score-h.score||h.page.path.length-L.page.path.length).map(({page:h})=>h)})():He,Bn=Ut.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),Fn=f?On:[],Mn=Fn.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),xt=Y?On.find(c=>c.key===Y)??null:null,Le=Nn,Ht=A||Y?null:go(He,W,we),V=Ht?.key??null,Ve=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??V,yt=Ht?.path??null,qe=(V?re[V]:void 0)??{},ye=Fe(W,qe),Vt={};if(xe&&Ke&&G&&ve&&X){const c=ua(ve,"loaders"),h=V?X[V]:void 0,L=Si(h,X,le=>c.has(le)),$=bi(L);for(const le of ht(W)){if(le.type!=="param")continue;const De=hi(W,le.name,L),je=wi(De,c,$);je.length>0&&(Vt[le.name]=je)}}const wt=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,$n=X&&V?vo(X,V,0):[],Kn=X?fa($n,X):[],qt=Kn.map(c=>c.isSavedBlock?c.label:""),Wt=Kn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),Gt=$n.map(c=>wn(c,X??{})),kt=S.useRef(null),Ee=S.useRef(null),ur=Me.status.state==="paused",Jt=Me.phase,zn=ma({claimPhase:Jt,lifecycle:Me.lifecycle}),ze=ge.previewState,fr=ge.userStopped,mr=Ya(Se.slug,t??""),{url:Oe}=wo(Ue&&t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,previewServerUrl:et??null,path:ye}:null),pr=bt&&d.runtime==="sandbox",Yt=Qa(be,Re,Ce),K=Xo({previewState:ze,progressStatus:zn.status,previewServerUrl:et,fastPreviewActive:Ue,fastPreviewReady:!!Oe,codingSession:pr,localPreviewUrl:M,hostedDraft:Yt,deciding:Pe}),hr=K.showWakingPill||Yt&&K.mode==="production"&&!Oe,nt=K.mode!=="none",gr=K.mode==="production"&&K.iframeBase?ft(K.iframeBase):null,We=K.mode==="production"?gr:ft(G),vr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,st=xe?M?K.mode==="sandbox"&&f&&g==="blocks":K.mode==="production"&&Ue&&vr&&f&&g==="blocks":!1,In=S.useRef(null),{pin:br,effective:xr}=xl(In.current,{inPlaceRenderActive:st,draftPreviewUrl:Oe,resolvedPath:ye});In.current=br;const Un=o.state.variantOverride??[],St=xe?Un:[],Qt=xe?[]:Un,yr=$e&&Qe(be)?ao($e.endpoint,Qt)??ms:null,Ge=bl(K.mode==="sandbox"?At(bs(ps(he??bn(ye,K.iframeBase)??K.iframeBase,yr),k),St):K.mode==="production"?At(bs(ds(ps(he??xr??bn(ye,K.iframeBase)??K.iframeBase,hr?ms:null),Qt),k),St):null),Hn=Oe??(K.iframeBase?bn(ye,K.iframeBase):null),wr=K.mode==="production"?Hn?At(ds(Hn,Qt),St):null:Ge??K.iframeBase,kr=()=>{const c=wr;c&&window.open(c,"_blank","noopener")},rt=t&&r?Us(Se.slug,t,r):null,at=c=>{rt&&ba(rt,c)},me=o.state.target;S.useEffect(()=>{if(!(!me||!tt||!ve))if(me.kind==="page"){const c=re[me.key]??{};Ee.current=Fe(me.path,c),J(null),Q(null),se(null),de(me.key),oe(me.path),at({path:me.path,pageKey:me.key,params:c})}else if(me.kind==="loader")Ee.current=null,J(null),Q(me.key),se(null);else{const c=Ut.find(h=>h.key===me.key);if(c){Ee.current=null;const h=fs(ve);Q(null),J(c),se(hs(tt,h,c.key))}}},[me,tt,ve,re]),S.useEffect(()=>{!V||yt===null||me?.kind==="page"&&me.key===V&&me.path===yt||o.selectTarget({kind:"page",key:V,path:yt})},[V,yt,me]);const[Vn,Sr]=S.useState(null);if(ze.kind==="iframe"&&Vn!==ze.previewUrl){const c=Vn!==null;Sr(ze.previewUrl);const h=rt?Is(rt):null;if(h){if(Ee.current=Fe(h.path,h.params),oe(h.path),de(h.pageKey),se(null),J(null),Q(null),h.pageKey&&Object.keys(h.params).length>0){const L=h.pageKey;ue($=>({...$,[L]:h.params}))}}else c&&(Ee.current=null,oe("/"),se(null),de(null),J(null),Q(null))}kt.current=Ge;const Pr=K.mode==="production"&&!!Oe&&!M,[qn,Xt]=S.useState({src:Ge??void 0,loading:!1}),Pt=pl(qn,Ge??void 0,Pr);Pt!==qn&&Xt(Pt);const ot=Pt.src,Wn=Pt.loading,Gn=ni({iframeRef:P,src:K.mode==="sandbox"?Ge:null,active:K.mode==="sandbox"}),Jn=S.useRef(null);S.useEffect(()=>{const c=Wn?setTimeout(()=>Xt(Ls),ml):null,h=()=>{c&&clearTimeout(c)};if(!Oe||!ot||Jn.current===Oe)return h;Jn.current=Oe;const L=P.current;return L&&L.getAttribute("src")!==ot&&(ie(),L.src=ot),h},[Oe,ot,Wn]);const Yn=()=>{const c=P.current?.contentWindow,h=We;if(!c||!h||!X||!V)return;const L=X[V];if(!L||typeof L!="object")return;const $=yo({previewBaseUrl:h,pageBlock:L,decofile:X,path:ye,pathTemplate:W});if(!$)return;const le=At($.src,oo(St,V));c.postMessage({type:"cms-editor::render",src:le,body:$.body},h)},Zt=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){Zt.current=null;return}const c={nav:JSON.stringify({page:V,path:ye,pathTemplate:W}),content:JSON.stringify(X)},h=yl(Zt.current,c);Zt.current=c,h&&Yn()},[X,st,A,Y,V,ye,W]);const en=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){en.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=en.current;en.current={page:V,sig:c},!(!h||h.page!==V||h.sig===c)&&Yn()},[o.state.variantOverride,st,A,Y,V]);const Er=!!t&&!!r&&!Me.notFound&&!fr&&!ur&&(Jt?.kind==="ready"||vt!=="idle"),pe=fl({editingMode:g,sandboxDisplay:K.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=We;if(!c)return;const h=L=>{if(L.origin===c)if(L.data?.type==="visual-editor::element-clicked"){const $=oi.safeParse(L.data.payload);$.success&&b($.data)}else if(L.data?.type==="cms-editor::section-clicked"){const $=ci.safeParse(L.data.payload);$.success&&T({index:$.data.sectionIndex,seq:$.data.clickSeq})}else L.data?.type==="cms-editor::render-start"?ie():L.data?.type==="cms-editor::render-end"?(Te(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},c)):L.data?.type==="cms-editor::render-error"&&Te()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[We,qt,Wt,Gt]);const Qn=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::activate",script:ii},h)},jr=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},tn=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage(K.mode==="production"||M?{type:"editor::inject",args:{script:Ps}}:{type:"visual-editor::activate",script:Ps},h),c.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},h))},Nr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Tr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},Et=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),E(c),b(null),T(null),c!=="blocks"&&Q(null),h==="visual"&&jr(),c==="visual"&&Qn(),h==="blocks"&&c!=="blocks"&&Nr(),c==="blocks"&&tn()},Cr=()=>{Et(cl(g,f))},Rr=()=>{Et(dl(g,f))},nn=()=>{const c=P.current;if(!c)return;ie();const h=document.activeElement,L=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),kl(c,kt.current);let $;const le=()=>{clearTimeout($),c.tabIndex=L,c.style.pointerEvents="";const De=document.activeElement;(!De||De===document.body||De===c)&&h?.focus(),c.removeEventListener("load",le)};c.addEventListener("load",le),$=setTimeout(le,3e3)};So(nn);const jt=Xa(Se.slug,t??""),Nt=Yt&&nt&&!!t,Xn=S.useRef(null);S.useEffect(()=>{if(Nt)return Za(jt)},[Nt,jt]);const{reload:it}=eo(Se.slug,t??""),Zn=S.useRef(it.seq);S.useEffect(()=>{if(Zn.current!==it.seq&&(Zn.current=it.seq,!!Nt&&Xn.current===kt.current)){if(it.navigates){cs(jt);return}nn()}},[it.seq]);const Lr=to(_n),lt=no(Qe(be)?Lr:""),es=S.useRef(lt);S.useEffect(()=>{const c=es.current;if(es.current=lt,!c||!lt||c===lt)return;const h=P.current;if(h)return ai({iframe:h,reload:nn})},[lt]);const _r=()=>{const c=Ft.indexOf(k);j(Ft[(c+1)%Ft.length])},sn=(c,h)=>{if(!V)return;const L=V,$={...qe,[c]:h};Ee.current=Fe(W,$),ue(le=>({...le,[L]:$})),at({path:W,pageKey:L,params:$})},Ar=Qi({iframeBase:K.iframeBase,resolvedPath:ye,activeGlobalSectionName:A?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),rn=c=>{const h=re[c.key]??{},L=Fe(c.path,h);(A||Le(L)!==Le(ye))&&ie(),Ee.current=L,J(null),Q(null),se(null),T(null),de(c.key),oe(c.path),at({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};va(rt,c=>{(A||Le(c)!==Le(ye))&&ie(),Ee.current=c,J(null),Q(null),se(null),T(null),de(null),oe(c),at({path:c,pageKey:null,params:{}})});const Or=c=>{if(xn(be)){const $=X?bo(X,c.key,ve):null;$?rn($):cn.info(e("sandbox.preview.blockOnNoPage"));return}if(!tt||!ve){cn.error(e("sandbox.preview.previewMetadataNotReady"));return}ie(),Ee.current=null;const h=fs(ve),L=hs(tt,h,c.key);J(c),Q(null),se(L),T(null),o.selectTarget({kind:"section",key:c.key})},Dr=c=>{f&&(J(null),Q(c.key),se(null),Et("blocks"),o.selectTarget({kind:"loader",key:c.key}))},Br=async({name:c,path:h,templateKey:L})=>{if(!t||!r)return;const $=Zs(h);if($){H($);return}const le=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(He.some(je=>Le(je.path)===Le(le))){H(e("sandbox.preview.pageAlreadyExists",{path:le}));return}let De;if(L&&(De=X?.[L],!De)){H(e("sandbox.preview.templateNoLongerExists"));return}H(void 0);try{const je=await An.mutateAsync({name:c,path:le,template:De});ce(!1),cn.success(e("sandbox.preview.pageCreated",{name:c})),await Co(hl),rn({key:je.key,name:je.name,path:je.path}),Et("blocks")}catch(je){H(je instanceof Error?je.message:e("sandbox.preview.failedToCreatePage"))}},Tt=Xi({previewSurfaceActive:nt,daemonReady:Er,production:K.mode==="production",servePreviewUrl:Qe(be)}),Fr=Zi({showPreviewToolbar:Tt,contentEditingEnabled:m}),Ct=()=>{Z(!1),q("")},an=A?.name??xt?.title??Ht?.name,on=Rn.isPending||Ln.isPending,ln=on?ft(K.iframeBase):an,Rt=A?`section:${A.key}`:Y?`loader:${Y}`:V?`page:${V}`:void 0,Mr=Tt?Fr?s.jsxs(La,{open:U,onOpenChange:c=>{Z(c),c||q("")},children:[s.jsx(_a,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:on?ln??void 0:A||xt?an:[an,W].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-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:s.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:[A&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(Sa,{size:11}),e("sandbox.preview.globalBadge")]}),xt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:[s.jsx(Pa,{size:11}),e("sandbox.preview.loaderBadge")]}),ln&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ln}),!on&&!A&&!xt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:W}),s.jsx(xa,{size:12,className:Mt("shrink-0 transition-transform",U&&"rotate-180")})]})})}),s.jsxs(Aa,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(qs,{shouldFilter:!1,defaultValue:Rt,children:[s.jsx(Ws,{value:z,onValueChange:c=>{q(c),te.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(Vs,{ref:te,className:"max-h-80",children:[s.jsx(Gs,{children:He.length===0&&Ut.length===0&&Fn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Dn.length>0&&s.jsx(mt,{children:Dn.map(c=>s.jsxs(pt,{value:`page:${c.key}`,"aria-current":Rt===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Ct(),rn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Bn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalComponents"),children:Bn.map(c=>s.jsx(pt,{value:`section:${c.key}`,"aria-current":Rt===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Or(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Mn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalLoaders"),children:Mn.map(c=>s.jsx(pt,{value:`loader:${c.key}`,"aria-current":Rt===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Dr(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!A&&!Y&&ht(W).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:ht(W).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const L=Vt[c.name];return L&&wt?s.jsx(Mi,{sources:L,template:W,paramName:c.name,value:qe[c.name]??"",sandboxRef:wt,onCommit:$=>sn(c.name,$)},`${V}:${c.name}`):s.jsx(Ji,{name:c.name,value:qe[c.name]??"",onCommit:$=>sn(c.name,$)},`${V}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Xe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ct(),H(void 0),ce(!0)},children:[s.jsx(Ra,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Ar}):null,ts=Tt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:_r,"aria-label":e(As[k]),children:k==="mobile"?s.jsx(Ea,{size:16}):k==="tablet"?s.jsx(ja,{size:16}):s.jsx(Na,{size:16})})}),s.jsx(pn,{children:e(As[k])})]}),Mr,s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.jsx(ct,{onClick:kr,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(Wr,{size:16})})})]}):null,$r=(xe||a)&&K.mode==="sandbox",Lt=gl[k],_t=k==="desktop"&&(_.width===0||_.width>=Lt.width+2*_s),ns=_t?1:Math.min(_.width>0?_.width/(Lt.width+2*_s):1,1),Kr=_t?{width:"100%",height:"100%"}:{width:`${Lt.width}px`,height:_.height>0?`${_.height/ns}px`:`${Lt.height}px`,transform:`scale(${ns})`,transformOrigin:"top center"},ss=s.jsxs(s.Fragment,{children:[$r&&(Tt||m)&&s.jsx(ct,{onClick:Cr,"aria-pressed":pe==="visual","aria-label":e("sandbox.preview.visualEditor"),active:pe==="visual",children:s.jsx(ls,{size:16})}),f&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:Rr,"aria-pressed":pe==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:pe==="blocks",children:s.jsx(Ca,{size:16})})}),s.jsx(pn,{children:e("sandbox.preview.blocksEditor")})]}),Ve&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:F,"aria-pressed":B,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:B,children:s.jsx(Ta,{size:16})})}),s.jsx(pn,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),zr=!!Y&&pe==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(Vt).map(([c,h])=>(qe[c]??"")===""?s.jsx(Wi,{sources:h,template:W,paramName:c,sandboxRef:wt,onFill:L=>sn(c,L)},`${V}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(is.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:ts}),children:ts}),s.jsx(is.Toolbar.Right.Portal,{fallback:ss,children:ss})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:zr?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F}),B&&Ve&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]}):s.jsxs(gs,{orientation:"horizontal",disabled:pe!=="blocks",className:"relative isolate",children:[s.jsx(Ot,{ref:N,id:"preview-blocks-editor",defaultSize:pe==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:pe==="blocks"&&s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F})}),pe==="blocks"&&s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-canvas",defaultSize:pe==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(gs,{orientation:"horizontal",disabled:!(B&&Ve),children:[s.jsx(Ot,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>I($=>$.width===c.clientWidth&&$.height===c.clientHeight?$:{width:c.clientWidth,height:c.clientHeight});h();const L=new ResizeObserver(h);return L.observe(c),()=>L.disconnect()},className:Mt("h-full relative overflow-clip flex justify-center",nt&&!_t&&"bg-muted/30"),children:[(ke||mr)&&nt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),K.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),K.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"starting",progress:zn,claimPhase:Jt})}),!M&&!Pe&&ze.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"suspended",onResume:ge.resume})}),!M&&!Pe&&ze.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"errored",error:ze.error,onRetry:ge.retry,connectionsHref:`/${Se.slug}/settings/connections`})}),K.showWakingPill&&s.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 border border-border bg-muted px-4 py-3 shadow-lg pointer-events-none select-none",children:[s.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),pe==="visual"&&!y&&s.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-violet-400/40 bg-violet-500/90 px-3 py-1 text-xs font-medium text-white shadow-md backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(ls,{size:12}),e("sandbox.preview.clickElementToAsk")]}),pe==="visual"&&y&&s.jsx(fi,{element:y,onDismiss:()=>b(null)}),nt&&Ge&&s.jsx("div",{className:Mt("shrink-0",!_t&&"border-x border-border bg-background shadow-sm"),style:Kr,onMouseLeave:Tr,children:s.jsx("iframe",{ref:P,src:ot,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Gn.handleError,onLoad:()=>{if(Xt(Ls),Gn.handleLoad(),Te(),Xn.current=kt.current,Nt&&cs(jt),K.mode!=="sandbox"||M){(K.mode==="production"&&!K.showWakingPill||M)&&pe==="blocks"&&tn();return}if(Gr("vm_preview_loaded",{view_mode:pe,vm_id:Ze?.sandboxHandle??null}),!A)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ee.current;if(h!==null&&(Ee.current=null,Le(c)!==Le(h))||Le(c)===Le(ye))return;oe(c),at({path:c,pageKey:we,params:qe})}catch{}pe==="visual"&&Qn(),pe==="blocks"&&tn()}},K.iframeBase)})]})}),B&&Ve&&s.jsxs(s.Fragment,{children:[s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]})]})})]})}),s.jsx(tl,{open:ee,onOpenChange:ce,isPending:An.isPending,error:C,templates:He,onSubmit:Br})]})}const Pl=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},El=1e4,jl=1e4,Nl=5e3,Tl=2;function Cl(t,e){return t&&e===0?jl:Math.min(1e3*2**Math.max(0,e-1),Nl)}function Rl(t,e,n){return e?!0:t===!0&&n<Tl}function Ll(t,e){const n=ne.c(11),r=Pl,i=Jr();let u;n[0]!==t?(u=Bs.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,x=new AbortController,v=()=>x.abort();f.addEventListener("abort",v);const E=setTimeout(v,El),g=await r(t,x.signal).catch(Al);clearTimeout(E),f.removeEventListener("abort",v);const k=i.getQueryData(a),j=g?0:(k?.failures??0)+1;return{up:Rl(k?.up??null,g,j),failures:j}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:_l},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=Yr(d);return t?p?.up??null:null}function _l(t){return t.state.data?Cl(t.state.data.up,t.state.data.failures):!1}function Al(){return!1}function Ol(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 Ec(t){const e=ne.c(48),{virtualMcpId:n}=t,r=_e(),i=Da(n),{connection:u}=Qs(n),{activeTask:a,taskId:o,currentBranch:l}=It(),d=Bo(o),[p,m]=S.useState(!1),f=En(n,l);let x;e[0]!==f||e[1]!==u?(x=u?Qe(f):null,e[0]=f,e[1]=u,e[2]=x):x=e[2];const v=x,E=Ll(v),g=rr();if(_o({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:hn(i?.metadata),threadHasRepo:hn(d)||hn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(xs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let b;e[4]!==r?(b=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=b):b=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(xs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let B;e[12]!==N?(B=s.jsxs(Xe,{onClick:T,children:[P,N]}),e[12]=N,e[13]=B):B=e[13];let R;e[14]!==b||e[15]!==w||e[16]!==B?(R=s.jsx(Ro,{className:"h-full",image:y,title:b,description:w,actions:B}),e[14]=b,e[15]=w,e[16]=B,e[17]=R):R=e[17];let D;e[18]!==p?(D=s.jsx(Lo,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=D):D=e[19];let O;return e[20]!==D||e[21]!==R?(O=s.jsxs(s.Fragment,{children:[R,D]}),e[20]=D,e[21]=R,e[22]=O):O=e[22],O}if(u&&i&&!Qe(f)){let y;e[23]!==g||e[24]!==f?(y=Ol({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let b;e[26]!==u.endpoint?(b=so(u.endpoint),e[26]=u.endpoint,e[27]=b):b=e[27];let w;return e[28]!==y||e[29]!==b?(w=s.jsx(Bl,{status:y,host:b}),e[28]=y,e[29]=b,e[30]=w):w=e[30],w}if(v&&E!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let b;e[33]!==v||e[34]!==r?(b=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Dl(v)}),e[33]=v,e[34]=r,e[35]=b):b=e[35];let w;e[36]!==b?(w=s.jsx(Kt,{text:b}),e[36]=b,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(zt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let j;return e[46]!==n?(j=s.jsx(pa,{children:s.jsx(Sl,{virtualMcpId:n})}),e[46]=n,e[47]=j):j=e[47],j}function Dl(t){try{return new URL(t).host}catch{return t}}function Bl(t){const e=ne.c(20),{status:n,host:r}=t,i=_e();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Kt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${Ys} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(zt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=zo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(Ko,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{Ko as L,Ec as P,zt as S,Pc as u};
|
|
551
|
+
`)}function ui(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function fi(t){const e=ne.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=ha(),{openSidePanel:l}=ko(),d=_e();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const U=di(n,i);l(),o({parts:[{type:"text",text:U}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=ui(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const x=f,v=`${x.leftPct}%`,E=`${x.topPct}%`;let g;e[9]!==v||e[10]!==E?(g={left:v,top:E,width:"320px"},e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==m?(k=U=>{U.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=U=>u(U.target.value),e[14]=j):j=e[14];let y;e[15]!==r?(y=U=>{U.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let b;e[17]!==d?(b=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==b?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:j,onKeyDown:y,placeholder:b,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=b,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let B;e[27]!==d?(B=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=B):B=e[28];let R;e[29]!==B?(R=s.jsx("title",{children:B}),e[29]=B,e[30]=R):R=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=D):D=e[31];let O;e[32]!==R?(O=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,D]}),e[32]=R,e[33]=O):O=e[33];let F;e[34]!==P||e[35]!==N||e[36]!==O?(F=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:O}),e[34]=P,e[35]=N,e[36]=O,e[37]=F):F=e[37];let _;e[38]!==w||e[39]!==F||e[40]!==k?(_=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:k,children:[w,F]}),e[38]=w,e[39]=F,e[40]=k,e[41]=_):_=e[41];let I;return e[42]!==_||e[43]!==g?(I=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:_}),e[42]=_,e[43]=g,e[44]=I):I=e[44],I}const Es="site-links",mi=/details?page|\bpdp\b/i,pi=/listingpage|\bplp\b/i;function hi(t,e,n){const r=new Set;for(const o of n)mi.test(o)&&r.add("product"),pi.test(o)&&r.add("category");const i=ht(Nn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const gi=["rosa","preto","pink","black"];function Dt(t,e){const n=e.trim();return n?t(n):gi.flatMap(r=>t(r))}function vi(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const ar=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Tn(t){return t.split("/")[0]??""}function bi(t){const e=new Set;for(const n of t){const r=Tn(n);ar.has(r)&&e.add(r)}return e}function xi(t,e){const n=Tn(t);return!ar.has(n)||e.size===0?!0:e.has(n)}const yi=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Dt(n=>vi(t,n),e),optionsFromPayload:Bt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Bt},{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:Ni}];function wi(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of yi){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&xi(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Tn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(ki(t.has("category")?"category":"product")),a}function ki(t){return{kind:t,id:Es,resolveType:Es,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>_i(e,n)}}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Si(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=Ie(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=Ie(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function or(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function ir(t){try{return decodeURIComponent(t)}catch{return t}}function Pi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=Pi(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function lr(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=ht(Nn(e)),{pattern:u,order:a}=Ei(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?ir(d):null}function Bt(t,e){const n=Ie(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=Ie(a);if(!o)continue;const l=lr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=Ie(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?Ie(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function ji(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?ir(n):null}function Ni(t){const e=[],n=new Set,r=(i,u)=>{const a=Ie(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=ji(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const Ti=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 Ci(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function Ri(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function Li(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function _i(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=lr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&Ti.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:Ci(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of Li(t))i(u,a,"product",o);for(const{href:u,text:a}of Ri(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function dt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const cr=1e4;function Ai(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 Oi(t,{resolveType:e,props:n}){const r=await fetch(Ua(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(cr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function js(t,e){const n=await fetch(Ha(t,e),{signal:AbortSignal.timeout(cr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function Di(t,e,n){const r=e.optionsFromPayload(await js(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Fe(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await js(t,u),n).filter(o=>o.kind==="product");return or([r,a])}catch{return r}}function Bi(t,e,n){return Bs.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function Fi(t,e,n,r){if(e.homepageLinks)return Di(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>Oi(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return or(a.map(o=>e.optionsFromPayload(o,r)))}function kn(t,e,n,r,i){return{queryKey:Bi(t,e,n),queryFn:()=>Fi(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function ut(t){const e=ne.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(Hs,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Fe(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(mt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Ns(t){const e=ne.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Mi(t){const e=ne.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=_e(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[x,v]=S.useState(""),E=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=Ai(l),y=[...new Set(n.map(M=>k[M.kind].noun))].join(" or ");let b;e[0]!==l||e[1]!==y?(b=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=b):b=e[2];const w=b,T={template:r,paramName:i};let P;e[3]!==m?(P=(M,G)=>({source:M,query:G,options:M.clientFilter?dt(G.data??[],m):G.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,B=n.filter(qi),R=n.filter(Vi),D=yn({queries:B.map(M=>kn(a,M,x,T,d))});let O;e[5]!==D||e[6]!==N?(O=(M,G)=>N(M,D[G]),e[5]=D,e[6]=N,e[7]=O):O=e[7];const F=B.map(O),_=F.length===0||F.every(Hi),I=yn({queries:R.map(M=>kn(a,M,x,T,d&&_))});let U;e[8]!==I||e[9]!==N?(U=(M,G)=>N(M,I[G]),e[8]=I,e[9]=N,e[10]=U):U=e[10];const Z=R.map(U),z=_?Z:F,q=z.length===1&&z[0]?.source.homepageLinks?z[0]:null,ee=q&&!q.query.isLoading&&!q.query.isError?q?.query.data??[]:[],ce=dt(ee.filter(Ui),m),C=dt(ee.filter(Ii),m),H=ce.length>0&&C.length>0,A=M=>{p(M),E.current&&clearTimeout(E.current),f(M?u:""),v(M?u:"")};let J;e[11]===Symbol.for("react.memo_cache_sentinel")?(J=M=>{f(M),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{v(M)},300)},e[11]=J):J=e[11];const Y=J,Q=M=>{o(M),A(!1)},he=Xs(m),se=Fe(r,{[i]:he}),W=Ds,oe=Os,we="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",de=zi;let re;e[12]!==g||e[13]!==l?(re=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=re):re=e[14];let ue;e[15]!==re?(ue=s.jsx(Fs,{className:"sr-only",children:s.jsx(Ms,{children:re})}),e[15]=re,e[16]=ue):ue=e[16];let ke;e[17]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Hs,{size:16,className:"shrink-0 text-foreground"}),e[17]=ke):ke=e[17];let ae;e[18]!==l?(ae=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=ae):ae=e[19];let fe;e[20]!==g?(fe=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-[12px] text-special",children:g}),e[20]=g,e[21]=fe):fe=e[21];let ie;e[22]!==ae||e[23]!==fe?(ie=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ke,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ae," ",fe]})]}),e[22]=ae,e[23]=fe,e[24]=ie):ie=e[24];const Te=qs,Se=!1,Me="min-h-0 flex-1";let ge;e[25]!==w||e[26]!==m?(ge=s.jsx(Ws,{autoFocus:!0,placeholder:w,value:m,onValueChange:Y}),e[25]=w,e[26]=m,e[27]=ge):ge=e[27];const Ze=Vs,vt="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Be;e[28]!==l?(Be=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Be):Be=e[29];let Ae;e[30]!==Be?(Ae=s.jsx(Gs,{children:Be}),e[30]=Be,e[31]=Ae):Ae=e[31];const be=he&&s.jsx(mt,{className:"shrink-0",children:s.jsxs(pt,{value:`__raw__:${he}`,className:"gap-3 py-2",onSelect:()=>Q(he),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Po,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:he,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:se})]})]})}),$e=H?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:ce,template:r,paramName:i,keyPrefix:`${q?.source.id}:cat`,onSelect:Q})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${q?.source.id}:prod`,onSelect:Q})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:z.map(M=>{const{source:G,query:Ke,options:et}=M,{noun:Ue}=k[G.kind];if(Ke.isLoading)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.loading",{noun:Ue})},G.id);if(Ke.isError)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},G.id);if(G.homepageLinks){const bt=Ke.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:dt(bt.filter(Ki),m),template:r,paramName:i,keyPrefix:`${G.id}:cat`,onSelect:Q}),s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:dt(bt.filter($i),m),template:r,paramName:i,keyPrefix:`${G.id}:prod`,onSelect:Q})]},G.id)}return s.jsx(ut,{heading:z.length>1?k[G.kind].heading:void 0,iconKind:G.kind,options:et,template:r,paramName:i,keyPrefix:G.id,onSelect:Q},G.id)})});let Ce;e[32]!==Ze||e[33]!==Ae||e[34]!==be||e[35]!==$e?(Ce=s.jsxs(Ze,{className:vt,children:[Ae,be,$e]}),e[32]=Ze,e[33]=Ae,e[34]=be,e[35]=$e,e[36]=Ce):Ce=e[36];let Re;e[37]!==Te||e[38]!==ge||e[39]!==Ce?(Re=s.jsxs(Te,{shouldFilter:Se,className:Me,children:[ge,Ce]}),e[37]=Te,e[38]=ge,e[39]=Ce,e[40]=Re):Re=e[40];let Pe;e[41]!==oe||e[42]!==ue||e[43]!==ie||e[44]!==Re||e[45]!==de?(Pe=s.jsxs(oe,{className:we,onClick:de,children:[ue,ie,Re]}),e[41]=oe,e[42]=ue,e[43]=ie,e[44]=Re,e[45]=de,e[46]=Pe):Pe=e[46];let xe;return e[47]!==W||e[48]!==A||e[49]!==d||e[50]!==Pe?(xe=s.jsx(W,{open:d,onOpenChange:A,children:Pe}),e[47]=W,e[48]=A,e[49]=d,e[50]=Pe,e[51]=xe):xe=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-[12px] text-special hover:bg-special/25",onClick:M=>{M.stopPropagation(),A(!0)},children:u||g}),xe]})}function $i(t){return t.kind==="product"}function Ki(t){return t.kind!=="product"}function zi(t){return t.stopPropagation()}function Ii(t){return t.kind==="product"}function Ui(t){return t.kind!=="product"}function Hi(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Vi(t){return t.isFallback}function qi(t){return!t.isFallback}function Wi(t){const e=ne.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const x={template:r,paramName:i},v=n.filter(Gi);l=yn,o=v.map(E=>kn(u,E,"",x,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const x of p){if(x.isLoading)break;const v=x.data?.[0];if(v){f(!0),queueMicrotask(()=>a(v.value));break}}return null}function Gi(t){return!t.isFallback}function Ji(t){const e=ne.c(31),{name:n,value:r,onCommit:i}=t,u=_e(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,x=a||f;let v;e[3]!==x?(v=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-[12px]",children:x}),e[3]=x,e[4]=v):v=e[4];let E;e[5]!==f||e[6]!==u?(E=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=E):E=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let j;e[10]!==r?(j=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=j):j=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=Xs(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let b;e[16]!==a||e[17]!==f||e[18]!==E||e[19]!==j||e[20]!==y?(b=s.jsx("input",{type:"text",value:a,placeholder:f,title:E,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-[12px] text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Yi,onChange:g,onFocus:k,onKeyDown:j,onBlur:y}),e[16]=a,e[17]=f,e[18]=E,e[19]=j,e[20]=y,e[21]=b):b=e[21];let w;e[22]!==v||e[23]!==b?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,b]}),e[22]=v,e[23]=b,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.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-[10px] text-muted-foreground",children:[s.jsx(ka,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Yi(t){return t.stopPropagation()}function Qi(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Xi(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Zi(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function el(t){const e=ne.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=$s(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const d=Qr(a),p=l?{...l,name:a,path:o}:Xr(a,o);return await r.mutateAsync({blockKey:d,data:p}),{key:d,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],Ir(i)}function tl(t){const e=ne.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=_e();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let x;e[2]!==d?(x=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=x):x=e[3];const[v,E]=S.useState(x),[g,k]=S.useState(dn),[j,y]=S.useState(null),[b,w]=S.useState(n);n!==b&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),E(d("sectionsEditor.createPageModal.defaultPagePath")),k(dn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=ae=>{!ae&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let B;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==v||e[11]!==T||e[12]!==g?(B=async ae=>{ae.preventDefault();const fe=m.trim(),ie=v.trim();if(!fe||!ie||l)return;const Te=Zs(ie);if(Te){y(Te);return}y(null),await o({name:fe,path:ie,templateKey:T&&g!==dn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=v,e[11]=T,e[12]=g,e[13]=B):B=e[13];const R=B,D=j??u;let O;e[14]!==d?(O=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=O):O=e[15];let F;e[16]!==O?(F=s.jsx(Fs,{children:s.jsx(Ms,{children:O})}),e[16]=O,e[17]=F):F=e[17];let _;e[18]!==d?(_=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=_):_=e[19];let I;e[20]!==_?(I=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=I):I=e[21];let U;e[22]===Symbol.for("react.memo_cache_sentinel")?(U=ae=>f(ae.target.value),e[22]=U):U=e[22];let Z;e[23]!==d?(Z=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=Z):Z=e[24];let z;e[25]!==l||e[26]!==m||e[27]!==Z?(z=s.jsx(rs,{id:"new-page-name",value:m,onChange:U,placeholder:Z,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=Z,e[28]=z):z=e[28];let q;e[29]!==z||e[30]!==I?(q=s.jsxs("div",{className:"space-y-1.5",children:[I,z]}),e[29]=z,e[30]=I,e[31]=q):q=e[31];let te;e[32]!==d?(te=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=te):te=e[33];let ee;e[34]!==te?(ee=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:te}),e[34]=te,e[35]=ee):ee=e[35];let ce;e[36]===Symbol.for("react.memo_cache_sentinel")?(ce=ae=>E(ae.target.value),e[36]=ce):ce=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let H;e[39]!==l||e[40]!==v||e[41]!==C?(H=s.jsx(rs,{id:"new-page-path",value:v,onChange:ce,placeholder:C,disabled:l}),e[39]=l,e[40]=v,e[41]=C,e[42]=H):H=e[42];let A;e[43]!==ee||e[44]!==H?(A=s.jsxs("div",{className:"space-y-1.5",children:[ee,H]}),e[43]=ee,e[44]=H,e[45]=A):A=e[45];let J;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(J=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(Zr,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=J):J=e[51];let Y;e[52]!==D?(Y=D&&s.jsx("p",{className:"text-xs text-destructive",children:D}),e[52]=D,e[53]=Y):Y=e[53];let Q;e[54]!==q||e[55]!==A||e[56]!==J||e[57]!==Y?(Q=s.jsxs("div",{className:"space-y-4 py-4",children:[q,A,J,Y]}),e[54]=q,e[55]=A,e[56]=J,e[57]=Y,e[58]=Q):Q=e[58];let he;e[59]!==r?(he=()=>r(!1),e[59]=r,e[60]=he):he=e[60];let se;e[61]!==d?(se=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=se):se=e[62];let W;e[63]!==l||e[64]!==he||e[65]!==se?(W=s.jsx(Xe,{type:"button",variant:"outline",onClick:he,disabled:l,children:se}),e[63]=l,e[64]=he,e[65]=se,e[66]=W):W=e[66];let oe;e[67]!==l||e[68]!==m||e[69]!==v?(oe=!m.trim()||!v.trim()||l,e[67]=l,e[68]=m,e[69]=v,e[70]=oe):oe=e[70];let we;e[71]!==l||e[72]!==d?(we=l?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=we):we=e[73];let de;e[74]!==oe||e[75]!==we?(de=s.jsx(Xe,{type:"submit",disabled:oe,children:we}),e[74]=oe,e[75]=we,e[76]=de):de=e[76];let re;e[77]!==W||e[78]!==de?(re=s.jsxs(Ur,{children:[W,de]}),e[77]=W,e[78]=de,e[79]=re):re=e[79];let ue;e[80]!==R||e[81]!==Q||e[82]!==re||e[83]!==F?(ue=s.jsx(Os,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[F,Q,re]})}),e[80]=R,e[81]=Q,e[82]=re,e[83]=F,e[84]=ue):ue=e[84];let ke;return e[85]!==N||e[86]!==n||e[87]!==ue?(ke=s.jsx(Ds,{open:n,onOpenChange:N,children:ue}),e[85]=N,e[86]=n,e[87]=ue,e[88]=ke):ke=e[88],ke}function nl(t){const e=ne.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=_e();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=$s(p);let f;e[4]!==m?(f=na((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const x=f;let v;e[6]!==l||e[7]!==o?(v=ea(o,l),e[6]=l,e[7]=o,e[8]=v):v=e[8];const{resolveType:E,props:g,title:k}=v;if(!E){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const j=`loader:${l}`;let y;e[13]!==l||e[14]!==E||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:E,title:k},e[13]=l,e[14]=E,e[15]=k,e[16]=y):y=e[16];let b;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==x||e[25]!==j||e[26]!==y||e[27]!==r?(b=s.jsx(ta,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:sl,onSaveReferencedBlock:x,showRun:!1},j),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=x,e[25]=j,e[26]=y,e[27]=r,e[28]=b):b=e[28],b}async function sl(){}function rl(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Ts(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:rl(t.error)}}function al(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 ol(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=al(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(i=>i.status==="error"&&!i.hasData&&i.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 il=S.lazy(()=>Hr(()=>import("./sections-editor-A_RH8q6f.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])).then(t=>({default:t.SectionsEditor})));function Cs(t){const e=ne.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=Sn(),{currentBranch:o,taskId:l}=It(),d=tr(),p=Pn(),m=nr(),f=d.lifecycle.phase==="running",x=p.previewUrl;let v;e[0]!==o||e[1]!==a||e[2]!==x||e[3]!==l||e[4]!==n?(v=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:x}:null,e[0]=o,e[1]=a,e[2]=x,e[3]=l,e[4]=n,e[5]=v):v=e[5];const E=v,g=En(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const j=jn(E,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const b=Ks(E,y),w=ol({lifecyclePhase:d.lifecycle.phase,decofile:Ts(j),meta:Ts(b),hasEditableContent:mo(j.data,b.data),fastPreviewActive:Js(n).runtime==="cms"||xn(g)}),T=zs()===void 0,P=ll;if(sa(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(oa,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(ia,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Vr,{})),e[13]=C):C=e[13],C}if(j.data&&Va(b.data)){const C=m.state.target,H=C?.kind==="page"||C?.kind==="section"?C.key:null,A=H??"",J=o??"";let Y;return e[14]!==j.data||e[15]!==H||e[16]!==a.slug||e[17]!==A||e[18]!==J||e[19]!==n?(Y=P(s.jsx(ra,{orgSlug:a.slug,virtualMcpId:n,branch:J,decofile:j.data,initialKey:H,compact:!0},A)),e[14]=j.data,e[15]=H,e[16]=a.slug,e[17]=A,e[18]=J,e[19]=n,e[20]=Y):Y=e[20],Y}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(la,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==j||e[23]!==p||e[24]!==b||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([j.refetch(),b.refetch()])},e[22]=j,e[23]=p,e[24]=b,e[25]=w.source,e[26]=C):C=e[26];const H=C;let A;return e[27]!==H||e[28]!==w.source?(A=P(s.jsx(aa,{source:w.source,onRetry:H})),e[27]=H,e[28]=w.source,e[29]=A):A=e[29],A}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const B=N,R=m.state.target;if(R?.kind==="loader"&&j.data&&b.data){const C=o??"",H=x??null;let A;return e[31]!==j.data||e[32]!==b.data||e[33]!==a.slug||e[34]!==C||e[35]!==H||e[36]!==R.key||e[37]!==n?(A=B(s.jsx(nl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:H,meta:b.data,decofile:j.data,blockKey:R.key})),e[31]=j.data,e[32]=b.data,e[33]=a.slug,e[34]=C,e[35]=H,e[36]=R.key,e[37]=n,e[38]=A):A=e[38],A}let D;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(D=R||!o?null:Is(Us(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=D):D=e[43];const O=D;let F="/",_=null,I=null;R?.kind==="page"?(F=R.path,_=R.key):R?.kind==="section"?I=R.key:O&&(F=O.path,_=O.pageKey);const U=_?`page:${_}`:I?`section:${I}`:`path:${F}`;let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=Z):Z=e[44];const z=o??"",q=x??void 0,te=I?null:u,ee=!!_&&m.state.editSeoPageKey===_;let ce;return e[45]!==I||e[46]!==_||e[47]!==F||e[48]!==U||e[49]!==i||e[50]!==a.slug||e[51]!==te||e[52]!==ee||e[53]!==z||e[54]!==q||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ce=B(s.jsx(S.Suspense,{fallback:Z,children:s.jsx(il,{orgSlug:a.slug,virtualMcpId:n,branch:z,previewReady:!0,previewUrl:q,currentPath:F,activePageBlockKey:_,activeGlobalBlockKey:I,externalSelection:te,initialEditSeo:ee,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},U)})),e[45]=I,e[46]=_,e[47]=F,e[48]=U,e[49]=i,e[50]=a.slug,e[51]=te,e[52]=ee,e[53]=z,e[54]=q,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ce):ce=e[59],ce}function ll(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Rs(t){const e=ne.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=_e(),o=zs(),l=o===!0,d=qa(n);let p;e[0]!==d||e[1]!==r?(p=Wa(d,jo(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=Sn(),{currentBranch:x,taskId:v}=It(),g=Pn().previewUrl;let k;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==v||e[7]!==n?(k=x?{orgSlug:f.slug,virtualMcpId:n,branch:x,threadId:v??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=v,e[7]=n,e[8]=k):k=e[8];const y=jn(k),b=x??"";let w;e[9]!==f.slug||e[10]!==b||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:b},e[9]=f.slug,e[10]=b,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=ca(w),N=y.data?.[r],B=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,D=!x||R||B;let O;e[13]!==N?(O=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=O):O=e[14];const F=O;let _;e[15]!==r||e[16]!==D||e[17]!==T?(_=te=>{if(D)return;let ee;try{ee=JSON.parse(te)}catch{return}ee===null||typeof ee!="object"||Array.isArray(ee)||T(r,ee)},e[15]=r,e[16]=D,e[17]=T,e[18]=_):_=e[18];const I=_;let U;e[19]!==P?(U=()=>({flush:P}),e[19]=P,e[20]=U):U=e[20],S.useImperativeHandle(u,U);let Z;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(Z=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Xe,{variant:"ghost",size:"icon",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"size-7 shrink-0",children:s.jsx(qr,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=Z):Z=e[25];let z;e[26]!==y.data||e[27]!==P||e[28]!==F||e[29]!==B||e[30]!==R||e[31]!==r||e[32]!==D||e[33]!==I||e[34]!==a?(z=B?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Eo,{code:F,language:"json",readOnly:D,height:"100%",onChange:te=>I(te??""),onSave:te=>{I(te),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=F,e[29]=B,e[30]=R,e[31]=r,e[32]=D,e[33]=I,e[34]=a,e[35]=z):z=e[35];let q;return e[36]!==Z||e[37]!==z?(q=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,z]}),e[36]=Z,e[37]=z,e[38]=q):q=e[38],q}function dr(t){return t.contentEditingEnabled&&!t.isMobile}function cl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function dl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ul(t){return dr({contentEditingEnabled:er(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function fl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}const ml=15e3;function pl(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 Ls(t){return t.loading?{...t,loading:!1}:t}const hl=500,gl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},_s=1,Ft=["desktop","mobile","tablet"],vl=["preview","visual","blocks"],As={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function bl(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 ft(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 xl(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 yl(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wl(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function kl(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sl({virtualMcpId:t}){const e=_e(),n=ro(),{currentBranch:r,taskId:i,virtualMcpId:u}=It(),a=!!ga(),o=nr(),l=Oa(u===t?t:null),d=Js(t),p=To(l?.metadata?.ui?.layout??null),m=er(p),f=dr({contentEditingEnabled:m,isMobile:n}),[x]=S.useState(()=>ul({cmsMode:p,isMobile:n})),[v,E]=as(os.previewEditingMode(t),c=>c&&vl.includes(c)?c:null),g=v??x,[k,j]=as(os.previewDeviceSize(t),c=>c&&Ft.includes(c)?c:"desktop"),[y,b]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[B,R]=S.useState(!1),D=S.useRef(null),O=()=>{D.current?.flush(),R(!1)},F=()=>R(c=>(c&&D.current?.flush(),!c)),[_,I]=S.useState({width:0,height:0}),[U,Z]=S.useState(!1),[z,q]=S.useState(""),te=S.useRef(null),[ee,ce]=S.useState(!1),[C,H]=S.useState(),[A,J]=S.useState(null),[Y,Q]=S.useState(null),[he,se]=S.useState(null),[W,oe]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[we,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[re,ue]=S.useState({}),[ke,ae]=S.useState(!1),fe=S.useRef(null),ie=()=>{ae(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>ae(!1),15e3)},Te=()=>{fe.current&&(clearTimeout(fe.current),fe.current=null),ae(!1)},{org:Se}=Sn(),Me=tr(),ge=Pn(),Ze=ge.vmEntry,vt=Me.lifecycle.phase,{url:Be,undecided:Ae}=Ga(t),be=En(t,r),{connection:$e}=Qs(t),Ce=No(t),Re=Ja({hasServeConnection:!!$e,runtime:d.runtime}),Pe=Ae||Re==="github"&&(Ce==="loading"||Ce==="error"),xe=!xn(be)&&!Pe&&!(Re==="github"&&be.kind==="pending"),M=Qe(be)??Be,G=M??ge.previewUrl,Ke=!!M||vt==="running",et=l?.id===t?Fa(l.metadata):null,Ue=!M&&!Ae&&l?.id===t&&d.runtime==="cms",bt=d.projectDefault==="cms",tt=xe?xo({sandboxUrl:G,previewServerUrl:et,fastPreviewActive:Ue}):null,Cn=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:G}:null,Rn=jn(Cn,{fetchEnabled:Ke}),Ln=Ks(Cn,{fetchEnabled:Ke}),X=Rn.data,ve=Ln.data,He=X?po(X,ve).sort((c,h)=>c.name.localeCompare(h.name)):[],_n=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r}:null,An=el(_n),Ut=X&&ve?ho(X,ve):[],On=xe&&X&&ve?da(ve,X,"loaders"):[],Dn=z?(()=>{const c=z.toLowerCase();return He.map(h=>({page:h,score:wl(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,L)=>L.score-h.score||h.page.path.length-L.page.path.length).map(({page:h})=>h)})():He,Bn=Ut.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),Fn=f?On:[],Mn=Fn.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),xt=Y?On.find(c=>c.key===Y)??null:null,Le=Nn,Ht=A||Y?null:go(He,W,we),V=Ht?.key??null,Ve=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??V,yt=Ht?.path??null,qe=(V?re[V]:void 0)??{},ye=Fe(W,qe),Vt={};if(xe&&Ke&&G&&ve&&X){const c=ua(ve,"loaders"),h=V?X[V]:void 0,L=Si(h,X,le=>c.has(le)),$=bi(L);for(const le of ht(W)){if(le.type!=="param")continue;const De=hi(W,le.name,L),je=wi(De,c,$);je.length>0&&(Vt[le.name]=je)}}const wt=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,$n=X&&V?vo(X,V,0):[],Kn=X?fa($n,X):[],qt=Kn.map(c=>c.isSavedBlock?c.label:""),Wt=Kn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),Gt=$n.map(c=>wn(c,X??{})),kt=S.useRef(null),Ee=S.useRef(null),ur=Me.status.state==="paused",Jt=Me.phase,zn=ma({claimPhase:Jt,lifecycle:Me.lifecycle}),ze=ge.previewState,fr=ge.userStopped,mr=Ya(Se.slug,t??""),{url:Oe}=wo(Ue&&t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,previewServerUrl:et??null,path:ye}:null),pr=bt&&d.runtime==="sandbox",Yt=Qa(be,Re,Ce),K=Xo({previewState:ze,progressStatus:zn.status,previewServerUrl:et,fastPreviewActive:Ue,fastPreviewReady:!!Oe,codingSession:pr,localPreviewUrl:M,hostedDraft:Yt,deciding:Pe}),hr=K.showWakingPill||Yt&&K.mode==="production"&&!Oe,nt=K.mode!=="none",gr=K.mode==="production"&&K.iframeBase?ft(K.iframeBase):null,We=K.mode==="production"?gr:ft(G),vr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,st=xe?M?K.mode==="sandbox"&&f&&g==="blocks":K.mode==="production"&&Ue&&vr&&f&&g==="blocks":!1,In=S.useRef(null),{pin:br,effective:xr}=xl(In.current,{inPlaceRenderActive:st,draftPreviewUrl:Oe,resolvedPath:ye});In.current=br;const Un=o.state.variantOverride??[],St=xe?Un:[],Qt=xe?[]:Un,yr=$e&&Qe(be)?ao($e.endpoint,Qt)??ms:null,Ge=bl(K.mode==="sandbox"?At(bs(ps(he??bn(ye,K.iframeBase)??K.iframeBase,yr),k),St):K.mode==="production"?At(bs(ds(ps(he??xr??bn(ye,K.iframeBase)??K.iframeBase,hr?ms:null),Qt),k),St):null),Hn=Oe??(K.iframeBase?bn(ye,K.iframeBase):null),wr=K.mode==="production"?Hn?At(ds(Hn,Qt),St):null:Ge??K.iframeBase,kr=()=>{const c=wr;c&&window.open(c,"_blank","noopener")},rt=t&&r?Us(Se.slug,t,r):null,at=c=>{rt&&ba(rt,c)},me=o.state.target;S.useEffect(()=>{if(!(!me||!tt||!ve))if(me.kind==="page"){const c=re[me.key]??{};Ee.current=Fe(me.path,c),J(null),Q(null),se(null),de(me.key),oe(me.path),at({path:me.path,pageKey:me.key,params:c})}else if(me.kind==="loader")Ee.current=null,J(null),Q(me.key),se(null);else{const c=Ut.find(h=>h.key===me.key);if(c){Ee.current=null;const h=fs(ve);Q(null),J(c),se(hs(tt,h,c.key))}}},[me,tt,ve,re]),S.useEffect(()=>{!V||yt===null||me?.kind==="page"&&me.key===V&&me.path===yt||o.selectTarget({kind:"page",key:V,path:yt})},[V,yt,me]);const[Vn,Sr]=S.useState(null);if(ze.kind==="iframe"&&Vn!==ze.previewUrl){const c=Vn!==null;Sr(ze.previewUrl);const h=rt?Is(rt):null;if(h){if(Ee.current=Fe(h.path,h.params),oe(h.path),de(h.pageKey),se(null),J(null),Q(null),h.pageKey&&Object.keys(h.params).length>0){const L=h.pageKey;ue($=>({...$,[L]:h.params}))}}else c&&(Ee.current=null,oe("/"),se(null),de(null),J(null),Q(null))}kt.current=Ge;const Pr=K.mode==="production"&&!!Oe&&!M,[qn,Xt]=S.useState({src:Ge??void 0,loading:!1}),Pt=pl(qn,Ge??void 0,Pr);Pt!==qn&&Xt(Pt);const ot=Pt.src,Wn=Pt.loading,Gn=ni({iframeRef:P,src:K.mode==="sandbox"?Ge:null,active:K.mode==="sandbox"}),Jn=S.useRef(null);S.useEffect(()=>{const c=Wn?setTimeout(()=>Xt(Ls),ml):null,h=()=>{c&&clearTimeout(c)};if(!Oe||!ot||Jn.current===Oe)return h;Jn.current=Oe;const L=P.current;return L&&L.getAttribute("src")!==ot&&(ie(),L.src=ot),h},[Oe,ot,Wn]);const Yn=()=>{const c=P.current?.contentWindow,h=We;if(!c||!h||!X||!V)return;const L=X[V];if(!L||typeof L!="object")return;const $=yo({previewBaseUrl:h,pageBlock:L,decofile:X,path:ye,pathTemplate:W});if(!$)return;const le=At($.src,oo(St,V));c.postMessage({type:"cms-editor::render",src:le,body:$.body},h)},Zt=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){Zt.current=null;return}const c={nav:JSON.stringify({page:V,path:ye,pathTemplate:W}),content:JSON.stringify(X)},h=yl(Zt.current,c);Zt.current=c,h&&Yn()},[X,st,A,Y,V,ye,W]);const en=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){en.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=en.current;en.current={page:V,sig:c},!(!h||h.page!==V||h.sig===c)&&Yn()},[o.state.variantOverride,st,A,Y,V]);const Er=!!t&&!!r&&!Me.notFound&&!fr&&!ur&&(Jt?.kind==="ready"||vt!=="idle"),pe=fl({editingMode:g,sandboxDisplay:K.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=We;if(!c)return;const h=L=>{if(L.origin===c)if(L.data?.type==="visual-editor::element-clicked"){const $=oi.safeParse(L.data.payload);$.success&&b($.data)}else if(L.data?.type==="cms-editor::section-clicked"){const $=ci.safeParse(L.data.payload);$.success&&T({index:$.data.sectionIndex,seq:$.data.clickSeq})}else L.data?.type==="cms-editor::render-start"?ie():L.data?.type==="cms-editor::render-end"?(Te(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},c)):L.data?.type==="cms-editor::render-error"&&Te()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[We,qt,Wt,Gt]);const Qn=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::activate",script:ii},h)},jr=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},tn=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage(K.mode==="production"||M?{type:"editor::inject",args:{script:Ps}}:{type:"visual-editor::activate",script:Ps},h),c.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},h))},Nr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Tr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},Et=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),E(c),b(null),T(null),c!=="blocks"&&Q(null),h==="visual"&&jr(),c==="visual"&&Qn(),h==="blocks"&&c!=="blocks"&&Nr(),c==="blocks"&&tn()},Cr=()=>{Et(cl(g,f))},Rr=()=>{Et(dl(g,f))},nn=()=>{const c=P.current;if(!c)return;ie();const h=document.activeElement,L=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),kl(c,kt.current);let $;const le=()=>{clearTimeout($),c.tabIndex=L,c.style.pointerEvents="";const De=document.activeElement;(!De||De===document.body||De===c)&&h?.focus(),c.removeEventListener("load",le)};c.addEventListener("load",le),$=setTimeout(le,3e3)};So(nn);const jt=Xa(Se.slug,t??""),Nt=Yt&&nt&&!!t,Xn=S.useRef(null);S.useEffect(()=>{if(Nt)return Za(jt)},[Nt,jt]);const{reload:it}=eo(Se.slug,t??""),Zn=S.useRef(it.seq);S.useEffect(()=>{if(Zn.current!==it.seq&&(Zn.current=it.seq,!!Nt&&Xn.current===kt.current)){if(it.navigates){cs(jt);return}nn()}},[it.seq]);const Lr=to(_n),lt=no(Qe(be)?Lr:""),es=S.useRef(lt);S.useEffect(()=>{const c=es.current;if(es.current=lt,!c||!lt||c===lt)return;const h=P.current;if(h)return ai({iframe:h,reload:nn})},[lt]);const _r=()=>{const c=Ft.indexOf(k);j(Ft[(c+1)%Ft.length])},sn=(c,h)=>{if(!V)return;const L=V,$={...qe,[c]:h};Ee.current=Fe(W,$),ue(le=>({...le,[L]:$})),at({path:W,pageKey:L,params:$})},Ar=Qi({iframeBase:K.iframeBase,resolvedPath:ye,activeGlobalSectionName:A?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),rn=c=>{const h=re[c.key]??{},L=Fe(c.path,h);(A||Le(L)!==Le(ye))&&ie(),Ee.current=L,J(null),Q(null),se(null),T(null),de(c.key),oe(c.path),at({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};va(rt,c=>{(A||Le(c)!==Le(ye))&&ie(),Ee.current=c,J(null),Q(null),se(null),T(null),de(null),oe(c),at({path:c,pageKey:null,params:{}})});const Or=c=>{if(xn(be)){const $=X?bo(X,c.key,ve):null;$?rn($):cn.info(e("sandbox.preview.blockOnNoPage"));return}if(!tt||!ve){cn.error(e("sandbox.preview.previewMetadataNotReady"));return}ie(),Ee.current=null;const h=fs(ve),L=hs(tt,h,c.key);J(c),Q(null),se(L),T(null),o.selectTarget({kind:"section",key:c.key})},Dr=c=>{f&&(J(null),Q(c.key),se(null),Et("blocks"),o.selectTarget({kind:"loader",key:c.key}))},Br=async({name:c,path:h,templateKey:L})=>{if(!t||!r)return;const $=Zs(h);if($){H($);return}const le=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(He.some(je=>Le(je.path)===Le(le))){H(e("sandbox.preview.pageAlreadyExists",{path:le}));return}let De;if(L&&(De=X?.[L],!De)){H(e("sandbox.preview.templateNoLongerExists"));return}H(void 0);try{const je=await An.mutateAsync({name:c,path:le,template:De});ce(!1),cn.success(e("sandbox.preview.pageCreated",{name:c})),await Co(hl),rn({key:je.key,name:je.name,path:je.path}),Et("blocks")}catch(je){H(je instanceof Error?je.message:e("sandbox.preview.failedToCreatePage"))}},Tt=Xi({previewSurfaceActive:nt,daemonReady:Er,production:K.mode==="production",servePreviewUrl:Qe(be)}),Fr=Zi({showPreviewToolbar:Tt,contentEditingEnabled:m}),Ct=()=>{Z(!1),q("")},an=A?.name??xt?.title??Ht?.name,on=Rn.isPending||Ln.isPending,ln=on?ft(K.iframeBase):an,Rt=A?`section:${A.key}`:Y?`loader:${Y}`:V?`page:${V}`:void 0,Mr=Tt?Fr?s.jsxs(La,{open:U,onOpenChange:c=>{Z(c),c||q("")},children:[s.jsx(_a,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:on?ln??void 0:A||xt?an:[an,W].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-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:s.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:[A&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(Sa,{size:11}),e("sandbox.preview.globalBadge")]}),xt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:[s.jsx(Pa,{size:11}),e("sandbox.preview.loaderBadge")]}),ln&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ln}),!on&&!A&&!xt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:W}),s.jsx(xa,{size:12,className:Mt("shrink-0 transition-transform",U&&"rotate-180")})]})})}),s.jsxs(Aa,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(qs,{shouldFilter:!1,defaultValue:Rt,children:[s.jsx(Ws,{value:z,onValueChange:c=>{q(c),te.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(Vs,{ref:te,className:"max-h-80",children:[s.jsx(Gs,{children:He.length===0&&Ut.length===0&&Fn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Dn.length>0&&s.jsx(mt,{children:Dn.map(c=>s.jsxs(pt,{value:`page:${c.key}`,"aria-current":Rt===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Ct(),rn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Bn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalComponents"),children:Bn.map(c=>s.jsx(pt,{value:`section:${c.key}`,"aria-current":Rt===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Or(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Mn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalLoaders"),children:Mn.map(c=>s.jsx(pt,{value:`loader:${c.key}`,"aria-current":Rt===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Dr(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!A&&!Y&&ht(W).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:ht(W).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const L=Vt[c.name];return L&&wt?s.jsx(Mi,{sources:L,template:W,paramName:c.name,value:qe[c.name]??"",sandboxRef:wt,onCommit:$=>sn(c.name,$)},`${V}:${c.name}`):s.jsx(Ji,{name:c.name,value:qe[c.name]??"",onCommit:$=>sn(c.name,$)},`${V}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Xe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ct(),H(void 0),ce(!0)},children:[s.jsx(Ra,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Ar}):null,ts=Tt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:_r,"aria-label":e(As[k]),children:k==="mobile"?s.jsx(Ea,{size:16}):k==="tablet"?s.jsx(ja,{size:16}):s.jsx(Na,{size:16})})}),s.jsx(pn,{children:e(As[k])})]}),Mr,s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.jsx(ct,{onClick:kr,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(Wr,{size:16})})})]}):null,$r=(xe||a)&&K.mode==="sandbox",Lt=gl[k],_t=k==="desktop"&&(_.width===0||_.width>=Lt.width+2*_s),ns=_t?1:Math.min(_.width>0?_.width/(Lt.width+2*_s):1,1),Kr=_t?{width:"100%",height:"100%"}:{width:`${Lt.width}px`,height:_.height>0?`${_.height/ns}px`:`${Lt.height}px`,transform:`scale(${ns})`,transformOrigin:"top center"},ss=s.jsxs(s.Fragment,{children:[$r&&(Tt||m)&&s.jsx(ct,{onClick:Cr,"aria-pressed":pe==="visual","aria-label":e("sandbox.preview.visualEditor"),active:pe==="visual",children:s.jsx(ls,{size:16})}),f&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:Rr,"aria-pressed":pe==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:pe==="blocks",children:s.jsx(Ca,{size:16})})}),s.jsx(pn,{children:e("sandbox.preview.blocksEditor")})]}),Ve&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:F,"aria-pressed":B,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:B,children:s.jsx(Ta,{size:16})})}),s.jsx(pn,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),zr=!!Y&&pe==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(Vt).map(([c,h])=>(qe[c]??"")===""?s.jsx(Wi,{sources:h,template:W,paramName:c,sandboxRef:wt,onFill:L=>sn(c,L)},`${V}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(is.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:ts}),children:ts}),s.jsx(is.Toolbar.Right.Portal,{fallback:ss,children:ss})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:zr?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F}),B&&Ve&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]}):s.jsxs(gs,{orientation:"horizontal",disabled:pe!=="blocks",className:"relative isolate",children:[s.jsx(Ot,{ref:N,id:"preview-blocks-editor",defaultSize:pe==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:pe==="blocks"&&s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F})}),pe==="blocks"&&s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-canvas",defaultSize:pe==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(gs,{orientation:"horizontal",disabled:!(B&&Ve),children:[s.jsx(Ot,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>I($=>$.width===c.clientWidth&&$.height===c.clientHeight?$:{width:c.clientWidth,height:c.clientHeight});h();const L=new ResizeObserver(h);return L.observe(c),()=>L.disconnect()},className:Mt("h-full relative overflow-clip flex justify-center",nt&&!_t&&"bg-muted/30"),children:[(ke||mr)&&nt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),K.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),K.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"starting",progress:zn,claimPhase:Jt})}),!M&&!Pe&&ze.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"suspended",onResume:ge.resume})}),!M&&!Pe&&ze.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"errored",error:ze.error,onRetry:ge.retry,connectionsHref:`/${Se.slug}/settings/connections`})}),K.showWakingPill&&s.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 border border-border bg-muted px-4 py-3 shadow-lg pointer-events-none select-none",children:[s.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),pe==="visual"&&!y&&s.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-violet-400/40 bg-violet-500/90 px-3 py-1 text-xs font-medium text-white shadow-md backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(ls,{size:12}),e("sandbox.preview.clickElementToAsk")]}),pe==="visual"&&y&&s.jsx(fi,{element:y,onDismiss:()=>b(null)}),nt&&Ge&&s.jsx("div",{className:Mt("shrink-0",!_t&&"border-x border-border bg-background shadow-sm"),style:Kr,onMouseLeave:Tr,children:s.jsx("iframe",{ref:P,src:ot,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Gn.handleError,onLoad:()=>{if(Xt(Ls),Gn.handleLoad(),Te(),Xn.current=kt.current,Nt&&cs(jt),K.mode!=="sandbox"||M){(K.mode==="production"&&!K.showWakingPill||M)&&pe==="blocks"&&tn();return}if(Gr("vm_preview_loaded",{view_mode:pe,vm_id:Ze?.sandboxHandle??null}),!A)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ee.current;if(h!==null&&(Ee.current=null,Le(c)!==Le(h))||Le(c)===Le(ye))return;oe(c),at({path:c,pageKey:we,params:qe})}catch{}pe==="visual"&&Qn(),pe==="blocks"&&tn()}},K.iframeBase)})]})}),B&&Ve&&s.jsxs(s.Fragment,{children:[s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]})]})})]})}),s.jsx(tl,{open:ee,onOpenChange:ce,isPending:An.isPending,error:C,templates:He,onSubmit:Br})]})}const Pl=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},El=1e4,jl=1e4,Nl=5e3,Tl=2;function Cl(t,e){return t&&e===0?jl:Math.min(1e3*2**Math.max(0,e-1),Nl)}function Rl(t,e,n){return e?!0:t===!0&&n<Tl}function Ll(t,e){const n=ne.c(11),r=Pl,i=Jr();let u;n[0]!==t?(u=Bs.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,x=new AbortController,v=()=>x.abort();f.addEventListener("abort",v);const E=setTimeout(v,El),g=await r(t,x.signal).catch(Al);clearTimeout(E),f.removeEventListener("abort",v);const k=i.getQueryData(a),j=g?0:(k?.failures??0)+1;return{up:Rl(k?.up??null,g,j),failures:j}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:_l},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=Yr(d);return t?p?.up??null:null}function _l(t){return t.state.data?Cl(t.state.data.up,t.state.data.failures):!1}function Al(){return!1}function Ol(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 Ec(t){const e=ne.c(48),{virtualMcpId:n}=t,r=_e(),i=Da(n),{connection:u}=Qs(n),{activeTask:a,taskId:o,currentBranch:l}=It(),d=Bo(o),[p,m]=S.useState(!1),f=En(n,l);let x;e[0]!==f||e[1]!==u?(x=u?Qe(f):null,e[0]=f,e[1]=u,e[2]=x):x=e[2];const v=x,E=Ll(v),g=rr();if(_o({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:hn(i?.metadata),threadHasRepo:hn(d)||hn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(xs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let b;e[4]!==r?(b=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=b):b=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(xs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let B;e[12]!==N?(B=s.jsxs(Xe,{onClick:T,children:[P,N]}),e[12]=N,e[13]=B):B=e[13];let R;e[14]!==b||e[15]!==w||e[16]!==B?(R=s.jsx(Ro,{className:"h-full",image:y,title:b,description:w,actions:B}),e[14]=b,e[15]=w,e[16]=B,e[17]=R):R=e[17];let D;e[18]!==p?(D=s.jsx(Lo,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=D):D=e[19];let O;return e[20]!==D||e[21]!==R?(O=s.jsxs(s.Fragment,{children:[R,D]}),e[20]=D,e[21]=R,e[22]=O):O=e[22],O}if(u&&i&&!Qe(f)){let y;e[23]!==g||e[24]!==f?(y=Ol({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let b;e[26]!==u.endpoint?(b=so(u.endpoint),e[26]=u.endpoint,e[27]=b):b=e[27];let w;return e[28]!==y||e[29]!==b?(w=s.jsx(Bl,{status:y,host:b}),e[28]=y,e[29]=b,e[30]=w):w=e[30],w}if(v&&E!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let b;e[33]!==v||e[34]!==r?(b=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Dl(v)}),e[33]=v,e[34]=r,e[35]=b):b=e[35];let w;e[36]!==b?(w=s.jsx(Kt,{text:b}),e[36]=b,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(zt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let j;return e[46]!==n?(j=s.jsx(pa,{children:s.jsx(Sl,{virtualMcpId:n})}),e[46]=n,e[47]=j):j=e[47],j}function Dl(t){try{return new URL(t).host}catch{return t}}function Bl(t){const e=ne.c(20),{status:n,host:r}=t,i=_e();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Kt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${Ys} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(zt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=zo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(Ko,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{Ko as L,Ec as P,zt as S,Pc as u};
|
package/dist/client/assets/{product-picker-dialog-BDff_MLx.js → product-picker-dialog-B0S08IE6.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ye}from"./thread-intent-DzC9Ji46.js";import{c as w,K as ie,m as ae,b as se,j as f,h as xe,r as H,l as re,I as le,af as be,s as je,v as Pe,B as ke,q as ve,D as Se}from"./index-eirpwNKj.js";import{L as Ce,G as we}from"./agent-icon-C0Cpk_fI.js";import{aq as Ne}from"./site-editor-toast-C5e-1uEv.js";const De="https://placeholder.invalid";function Je(s,e){const t=(s??"").trim();if(!t)return"";const o=ye((e??"").trim());if(!o)return"";try{const i=new URL(t,De),a=new URL(o);return a.pathname=i.pathname,a.search=i.search,a.hash=i.hash,a.href}catch{return""}}const fe="vtex/loaders/intelligentSearch/productList.ts",Te="vtex/loaders/categories/tree.ts",Ee=24;function G(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Le(s){return s.split("/").filter(Boolean).map((t,o)=>`category-${o+1}/${t}`).join("/")}function $e(s,e){const t=e.trim(),o=fe,i=Ee;if(s==="cluster")return t?[{resolveType:o,props:{collection:t,count:i}}]:[];if(s==="category"){if(!t)return[];const d=Le(t);return d?[{resolveType:o,props:{facets:d,count:i}}]:[]}if(!t)return[{resolveType:o,props:{query:"",count:i}}];const a=[];/^\d+$/.test(t)&&a.push({resolveType:o,props:{ids:[t]}});const l=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return a.push({resolveType:o,props:{query:l,count:i}}),a}function Ie(){return{resolveType:Te,props:{}}}function _e(s){return{resolveType:fe,props:{ids:s}}}function de(s){return typeof s=="string"||typeof s=="number"?String(s):""}function pe(s){const e=G(s),t=Array.isArray(s)?s:Array.isArray(e?.products)?e.products:[],o=[],i=new Set;for(const a of t){const r=G(a);if(!r)continue;const l=de(r.productID)||de(r.sku);if(!l||i.has(l))continue;i.add(l);const d=G(r.isVariantOf),u=typeof d?.name=="string"&&d.name||typeof r.name=="string"&&r.name||l,n=qe(r.image),c=n[0],m=typeof r.url=="string"&&r.url||typeof d?.url=="string"&&d.url||void 0;o.push({id:l,label:u,image:c,images:n,url:m,category:Ae(r.category),description:Fe(r,d)})}return o}function qe(s){if(!Array.isArray(s))return[];const e=[];for(const t of s){const o=G(t),i=typeof o?.url=="string"?o.url:"";i&&!e.includes(i)&&e.push(i)}return e}function Ae(s){return typeof s!="string"||!s.trim()?void 0:s.split(/[>/]/).map(t=>t.trim()).filter(Boolean).pop()||void 0}function Fe(s,e){const o=(typeof s.description=="string"&&s.description||typeof e?.description=="string"&&e.description||"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();if(o)return o.length>400?`${o.slice(0,400).trimEnd()}…`:o}function Oe(s){if(typeof s!="string"||!s)return null;let e;try{e=new URL(s,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function Re(s){const e=[],t=new Set,o=(i,a)=>{const r=G(i);if(!r)return;const l=typeof r.name=="string"&&r.name?r.name:"",d=l?[...a,l]:a,u=Oe(r.url);if(u&&!t.has(u)&&(t.add(u),e.push({path:u,label:d.join(" › ")||u,url:typeof r.url=="string"?r.url:`/${u}`})),Array.isArray(r.children))for(const n of r.children)o(n,d)};if(Array.isArray(s))for(const i of s)o(i,[]);return e}function Ke(s,e,t=50){const o=e.trim().toLowerCase();return(o?s.filter(a=>a.label.toLowerCase().includes(o)||a.path.toLowerCase().includes(o)):s).slice(0,t)}const ze=1e4;async function ce(s,{resolveType:e,props:t}){const o=await fetch(Ne(s),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(ze)});if(!o.ok)throw new Error(`Failed to fetch (${o.status})`);return o.json()}function We(s,e){const t=w.c(20);let o;t[0]!==e?(o=new Set(e.filter(Boolean)),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==o?(i=[...o],t[2]=o,t[3]=i):i=t[3];const a=i;let r;t[4]!==a||t[5]!==s?(r=ie.sandboxInvoke(s?`${s.orgSlug}/${s.virtualMcpId}/${s.branch}`:"none",`blog-products-by-ids:${a.join(",")}`),t[4]=a,t[5]=s,t[6]=r):r=t[6];let l;t[7]!==a||t[8]!==s?(l=()=>ce(s,_e(a)).then(pe),t[7]=a,t[8]=s,t[9]=l):l=t[9];const d=!!s&&a.length>0;let u;t[10]!==r||t[11]!==l||t[12]!==d?(u={queryKey:r,queryFn:l,enabled:d,staleTime:6e4,retry:1},t[10]=r,t[11]=l,t[12]=d,t[13]=u):u=t[13];const n=ae(u);let c;if(t[14]!==n.data){c=new Map;for(const p of n.data??[])c.set(p.id,p);t[14]=n.data,t[15]=c}else c=t[15];let m;return t[16]!==c||t[17]!==n.isError||t[18]!==n.isLoading?(m={byId:c,isLoading:n.isLoading,isError:n.isError},t[16]=c,t[17]=n.isError,t[18]=n.isLoading,t[19]=m):m=t[19],m}function me(s){return`${s.orgSlug}/${s.virtualMcpId}/${s.branch}`}function ge(s){const e=w.c(9),{query:t,emptyLabel:o,loadingLabel:i}=s,a=se();if(t.isLoading){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=f.jsx(xe,{size:"xs"}),e[0]=l):l=e[0];let d;return e[1]!==i?(d=f.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[l,i]}),e[1]=i,e[2]=d):d=e[2],d}if(t.isError){let l;e[3]!==a?(l=a("sandbox.productPickerDialog.couldNotLoad"),e[3]=a,e[4]=l):l=e[4];let d;return e[5]!==l?(d=f.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:l}),e[5]=l,e[6]=d):d=e[6],d}let r;return e[7]!==o?(r=f.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:o}),e[7]=o,e[8]=r):r=e[8],r}function Be(s){const e=w.c(32),{sandboxRef:t,enabled:o,onSelect:i,className:a}=s,r=se(),[l,d]=H.useState("");let u;e[0]!==t?(u=ie.sandboxInvoke(me(t),"blog-category-tree"),e[0]=t,e[1]=u):u=e[1];let n;e[2]!==t?(n=()=>ce(t,Ie()).then(Re),e[2]=t,e[3]=n):n=e[3];let c;e[4]!==o||e[5]!==u||e[6]!==n?(c={queryKey:u,queryFn:n,enabled:o,staleTime:6e4,retry:1},e[4]=o,e[5]=u,e[6]=n,e[7]=c):c=e[7];const m=ae(c);let p,g,h,P;if(e[8]!==a||e[9]!==l||e[10]!==i||e[11]!==m||e[12]!==r){const C=Ke(m.data??[],l);h="space-y-2";let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=S=>d(S.target.value),e[17]=j):j=e[17];let b;e[18]!==r?(b=r("sandbox.productPickerDialog.filterCategoriesPlaceholder"),e[18]=r,e[19]=b):b=e[19],e[20]!==l||e[21]!==b?(P=f.jsx(le,{value:l,onChange:j,placeholder:b,className:"h-9"}),e[20]=l,e[21]=b,e[22]=P):P=e[22],e[23]!==a?(p=re("overflow-y-auto rounded-md border",a),e[23]=a,e[24]=p):p=e[24],g=C.length===0?f.jsx(ge,{query:m,loadingLabel:r("sandbox.productPickerDialog.loadingCategories"),emptyLabel:r("sandbox.productPickerDialog.noCategories")}):f.jsx("div",{className:"p-1",children:C.map(S=>f.jsx("button",{type:"button",onClick:()=>i(S),className:"block w-full truncate px-2 py-1.5 text-left text-sm hover:bg-muted/60 rounded-lg",children:S.label},S.path))}),e[8]=a,e[9]=l,e[10]=i,e[11]=m,e[12]=r,e[13]=p,e[14]=g,e[15]=h,e[16]=P}else p=e[13],g=e[14],h=e[15],P=e[16];let x;e[25]!==p||e[26]!==g?(x=f.jsx("div",{className:p,children:g}),e[25]=p,e[26]=g,e[27]=x):x=e[27];let v;return e[28]!==h||e[29]!==P||e[30]!==x?(v=f.jsxs("div",{className:h,children:[P,x]}),e[28]=h,e[29]=P,e[30]=x,e[31]=v):v=e[31],v}const Ue=[{id:"search",labelKey:"sandbox.productPickerDialog.modeSearch"},{id:"category",labelKey:"sandbox.productPickerDialog.modeCategory"},{id:"cluster",labelKey:"sandbox.productPickerDialog.modeClusterId"}];async function Me(s,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(r=>ce(s,r))),o=t.filter(r=>r.status==="fulfilled").map(r=>r.value);if(o.length===0){const r=t.find(l=>l.status==="rejected");throw r?r.reason:new Error("Failed to fetch products")}const i=[],a=new Set;for(const r of o)for(const l of pe(r))a.has(l.id)||(a.add(l.id),i.push(l));return i}function ue(s){const e=w.c(6),[t,o]=H.useState(""),[i,a]=H.useState(""),r=H.useRef(null);let l;e[0]!==s?(l=n=>{o(n),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>a(n),s)},e[0]=s,e[1]=l):l=e[1];const d=l;let u;return e[2]!==i||e[3]!==d||e[4]!==t?(u={value:t,debounced:i,onChange:d},e[2]=i,e[3]=d,e[4]=t,e[5]=u):u=e[5],u}function Ve(s){const e=w.c(23),{option:t,selected:o,onToggle:i}=s,a=o?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted/60";let r;e[0]!==a?(r=re("flex w-full items-center gap-3 rounded-lg border px-2 py-2 text-left transition-colors",a),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==t.image?(l=f.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:t.image?f.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):f.jsx(Ce,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=l):l=e[3];let d;e[4]!==t.label?(d=f.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let u;e[6]!==t.id?(u=f.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=u):u=e[7];let n;e[8]!==d||e[9]!==u?(n=f.jsxs("span",{className:"min-w-0 flex-1",children:[d,u]}),e[8]=d,e[9]=u,e[10]=n):n=e[10];const c=o?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let m;e[11]!==c?(m=re("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",c),e[11]=c,e[12]=m):m=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=f.jsx(be,{size:12}),e[13]=p):p=e[13];let g;e[14]!==m?(g=f.jsx("span",{className:m,children:p}),e[14]=m,e[15]=g):g=e[15];let h;return e[16]!==i||e[17]!==o||e[18]!==g||e[19]!==r||e[20]!==l||e[21]!==n?(h=f.jsxs("button",{type:"button",onClick:i,"aria-pressed":o,className:r,children:[l,n,g]}),e[16]=i,e[17]=o,e[18]=g,e[19]=r,e[20]=l,e[21]=n,e[22]=h):h=e[22],h}function Ye(s){const e=w.c(20),{sandboxRef:t,open:o,selected:i,onSelect:a}=s,r=se();if(i){let d;e[0]!==a?(d=()=>a(null),e[0]=a,e[1]=d):d=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=f.jsx(we,{size:14}),e[2]=u):u=e[2];let n;e[3]!==r?(n=r("sandbox.productPickerDialog.categoryLabel"),e[3]=r,e[4]=n):n=e[4];let c;e[5]!==i.label?(c=f.jsx("span",{className:"text-foreground",children:i.label}),e[5]=i.label,e[6]=c):c=e[6];let m;e[7]!==r?(m=r("sandbox.productPickerDialog.change"),e[7]=r,e[8]=m):m=e[8];let p;e[9]!==n||e[10]!==c||e[11]!==m?(p=f.jsxs("span",{className:"truncate",children:[n,c," —",m]}),e[9]=n,e[10]=c,e[11]=m,e[12]=p):p=e[12];let g;return e[13]!==d||e[14]!==p?(g=f.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[u,p]}),e[13]=d,e[14]=p,e[15]=g):g=e[15],g}let l;return e[16]!==a||e[17]!==o||e[18]!==t?(l=f.jsx(Be,{sandboxRef:t,enabled:o,onSelect:a,className:"h-48"}),e[16]=a,e[17]=o,e[18]=t,e[19]=l):l=e[19],l}function Ze(s){const e=w.c(90),{open:t,onOpenChange:o,sandboxRef:i,selectedIds:a,onChange:r,onPicked:l,multiple:d}=s,u=d===void 0?!0:d,n=se(),[c,m]=H.useState("search"),p=ue(300),g=ue(300),[h,P]=H.useState(null),x=c==="search"?p.debounced:c==="cluster"?g.debounced:h?.path??"";let v;e[0]!==c||e[1]!==x?(v=$e(c,x),e[0]=c,e[1]=x,e[2]=v):v=e[2];const C=v;let j;e[3]!==c||e[4]!==i||e[5]!==x?(j=ie.sandboxInvoke(me(i),`blog-product:${c}:${x}`),e[3]=c,e[4]=i,e[5]=x,e[6]=j):j=e[6];let b;e[7]!==C||e[8]!==i?(b=()=>Me(i,C),e[7]=C,e[8]=i,e[9]=b):b=e[9];const S=t&&C.length>0;let Q;e[10]!==j||e[11]!==b||e[12]!==S?(Q={queryKey:j,queryFn:b,enabled:S,staleTime:6e4,retry:1},e[10]=j,e[11]=b,e[12]=S,e[13]=Q):Q=e[13];const N=ae(Q);let X;e[14]!==a?(X=new Set(a.filter(Boolean)),e[14]=a,e[15]=X):X=e[15];const k=X;let J;e[16]!==u||e[17]!==r||e[18]!==l||e[19]!==k||e[20]!==a?(J=y=>{const te=y.id,ne=k.has(te);if(l){l(y,!ne);return}r(u?ne?a.filter(he=>he!==te):[...a.filter(Boolean),te]:ne?[]:[te])},e[16]=u,e[17]=r,e[18]=l,e[19]=k,e[20]=a,e[21]=J):J=e[21];const oe=J;let W;e[22]!==N.data?(W=N.data??[],e[22]=N.data,e[23]=W):W=e[23];const Z=W,D=C.length===0;let T;e[24]!==u||e[25]!==n?(T=n(u?"sandbox.productPickerDialog.addProducts":"sandbox.productPickerDialog.chooseProduct"),e[24]=u,e[25]=n,e[26]=T):T=e[26];let E;e[27]!==T?(E=f.jsx(je,{className:"border-b border-border px-4 py-3",children:f.jsx(Pe,{className:"text-sm font-medium",children:T})}),e[27]=T,e[28]=E):E=e[28];let L;e[29]!==c||e[30]!==n?(L=Ue.map(y=>f.jsx("button",{type:"button",onClick:()=>m(y.id),className:re("rounded-lg px-2.5 py-1 text-sm transition-colors",c===y.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:n(y.labelKey)},y.id)),e[29]=c,e[30]=n,e[31]=L):L=e[31];let $;e[32]!==L?($=f.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:L}),e[32]=L,e[33]=$):$=e[33];let I;e[34]!==c||e[35]!==p||e[36]!==n?(I=c==="search"&&f.jsx(le,{autoFocus:!0,value:p.value,onChange:y=>p.onChange(y.target.value),placeholder:n("sandbox.productPickerDialog.searchProductsPlaceholder"),className:"h-9"}),e[34]=c,e[35]=p,e[36]=n,e[37]=I):I=e[37];let _;e[38]!==g||e[39]!==c||e[40]!==n?(_=c==="cluster"&&f.jsx(le,{autoFocus:!0,value:g.value,onChange:y=>g.onChange(y.target.value),placeholder:n("sandbox.productPickerDialog.clusterIdPlaceholder"),className:"h-9"}),e[38]=g,e[39]=c,e[40]=n,e[41]=_):_=e[41];let q;e[42]!==h||e[43]!==c||e[44]!==t||e[45]!==i?(q=c==="category"&&f.jsx(Ye,{sandboxRef:i,open:t,selected:h,onSelect:P}),e[42]=h,e[43]=c,e[44]=t,e[45]=i,e[46]=q):q=e[46];let A;e[47]!==I||e[48]!==_||e[49]!==q?(A=f.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[I,_,q]}),e[47]=I,e[48]=_,e[49]=q,e[50]=A):A=e[50];let F;e[51]!==Z||e[52]!==N||e[53]!==k||e[54]!==D||e[55]!==n||e[56]!==oe?(F=Z.length>0?Z.map(y=>f.jsx(Ve,{option:y,selected:k.has(y.id),onToggle:()=>oe(y)},y.id)):!D&&f.jsx(ge,{query:N,loadingLabel:n("sandbox.productPickerDialog.loadingProducts"),emptyLabel:n("sandbox.productPickerDialog.noProductsFound")}),e[51]=Z,e[52]=N,e[53]=k,e[54]=D,e[55]=n,e[56]=oe,e[57]=F):F=e[57];let O;e[58]!==c||e[59]!==D||e[60]!==n?(O=D&&f.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:n(c==="category"?"sandbox.productPickerDialog.pickCategoryPrompt":"sandbox.productPickerDialog.enterClusterPrompt")}),e[58]=c,e[59]=D,e[60]=n,e[61]=O):O=e[61];let R;e[62]!==F||e[63]!==O?(R=f.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[F,O]}),e[62]=F,e[63]=O,e[64]=R):R=e[64];let K;e[65]!==k.size||e[66]!==n?(K=k.size===0?n("sandbox.productPickerDialog.noneSelected"):n("sandbox.productPickerDialog.selectedCount",{count:String(k.size)}),e[65]=k.size,e[66]=n,e[67]=K):K=e[67];let z;e[68]!==K?(z=f.jsx("span",{className:"text-xs text-muted-foreground",children:K}),e[68]=K,e[69]=z):z=e[69];let B;e[70]!==o?(B=()=>o(!1),e[70]=o,e[71]=B):B=e[71];let U;e[72]!==n?(U=n("sandbox.productPickerDialog.done"),e[72]=n,e[73]=U):U=e[73];let M;e[74]!==B||e[75]!==U?(M=f.jsx(ke,{size:"sm",onClick:B,children:U}),e[74]=B,e[75]=U,e[76]=M):M=e[76];let V;e[77]!==z||e[78]!==M?(V=f.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[z,M]}),e[77]=z,e[78]=M,e[79]=V):V=e[79];let Y;e[80]!==E||e[81]!==$||e[82]!==A||e[83]!==R||e[84]!==V?(Y=f.jsxs(ve,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[E,$,A,R,V]}),e[80]=E,e[81]=$,e[82]=A,e[83]=R,e[84]=V,e[85]=Y):Y=e[85];let ee;return e[86]!==o||e[87]!==t||e[88]!==Y?(ee=f.jsx(Se,{open:t,onOpenChange:o,children:Y}),e[86]=o,e[87]=t,e[88]=Y,e[89]=ee):ee=e[89],ee}export{Be as C,Ze as P,$e as b,ce as i,pe as p,Je as r,We as u};
|
|
1
|
+
import{s as ye}from"./thread-intent-CCu0BEYJ.js";import{c as w,K as ie,m as ae,b as se,j as f,h as xe,r as H,l as re,I as le,af as be,s as je,v as Pe,B as ke,q as ve,D as Se}from"./index-Cmhl3zNb.js";import{L as Ce,G as we}from"./agent-icon-DMH8Ftve.js";import{aq as Ne}from"./site-editor-toast-g-4xfmJ4.js";const De="https://placeholder.invalid";function Je(s,e){const t=(s??"").trim();if(!t)return"";const o=ye((e??"").trim());if(!o)return"";try{const i=new URL(t,De),a=new URL(o);return a.pathname=i.pathname,a.search=i.search,a.hash=i.hash,a.href}catch{return""}}const fe="vtex/loaders/intelligentSearch/productList.ts",Te="vtex/loaders/categories/tree.ts",Ee=24;function G(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Le(s){return s.split("/").filter(Boolean).map((t,o)=>`category-${o+1}/${t}`).join("/")}function $e(s,e){const t=e.trim(),o=fe,i=Ee;if(s==="cluster")return t?[{resolveType:o,props:{collection:t,count:i}}]:[];if(s==="category"){if(!t)return[];const d=Le(t);return d?[{resolveType:o,props:{facets:d,count:i}}]:[]}if(!t)return[{resolveType:o,props:{query:"",count:i}}];const a=[];/^\d+$/.test(t)&&a.push({resolveType:o,props:{ids:[t]}});const l=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return a.push({resolveType:o,props:{query:l,count:i}}),a}function Ie(){return{resolveType:Te,props:{}}}function _e(s){return{resolveType:fe,props:{ids:s}}}function de(s){return typeof s=="string"||typeof s=="number"?String(s):""}function pe(s){const e=G(s),t=Array.isArray(s)?s:Array.isArray(e?.products)?e.products:[],o=[],i=new Set;for(const a of t){const r=G(a);if(!r)continue;const l=de(r.productID)||de(r.sku);if(!l||i.has(l))continue;i.add(l);const d=G(r.isVariantOf),u=typeof d?.name=="string"&&d.name||typeof r.name=="string"&&r.name||l,n=qe(r.image),c=n[0],m=typeof r.url=="string"&&r.url||typeof d?.url=="string"&&d.url||void 0;o.push({id:l,label:u,image:c,images:n,url:m,category:Ae(r.category),description:Fe(r,d)})}return o}function qe(s){if(!Array.isArray(s))return[];const e=[];for(const t of s){const o=G(t),i=typeof o?.url=="string"?o.url:"";i&&!e.includes(i)&&e.push(i)}return e}function Ae(s){return typeof s!="string"||!s.trim()?void 0:s.split(/[>/]/).map(t=>t.trim()).filter(Boolean).pop()||void 0}function Fe(s,e){const o=(typeof s.description=="string"&&s.description||typeof e?.description=="string"&&e.description||"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();if(o)return o.length>400?`${o.slice(0,400).trimEnd()}…`:o}function Oe(s){if(typeof s!="string"||!s)return null;let e;try{e=new URL(s,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function Re(s){const e=[],t=new Set,o=(i,a)=>{const r=G(i);if(!r)return;const l=typeof r.name=="string"&&r.name?r.name:"",d=l?[...a,l]:a,u=Oe(r.url);if(u&&!t.has(u)&&(t.add(u),e.push({path:u,label:d.join(" › ")||u,url:typeof r.url=="string"?r.url:`/${u}`})),Array.isArray(r.children))for(const n of r.children)o(n,d)};if(Array.isArray(s))for(const i of s)o(i,[]);return e}function Ke(s,e,t=50){const o=e.trim().toLowerCase();return(o?s.filter(a=>a.label.toLowerCase().includes(o)||a.path.toLowerCase().includes(o)):s).slice(0,t)}const ze=1e4;async function ce(s,{resolveType:e,props:t}){const o=await fetch(Ne(s),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(ze)});if(!o.ok)throw new Error(`Failed to fetch (${o.status})`);return o.json()}function We(s,e){const t=w.c(20);let o;t[0]!==e?(o=new Set(e.filter(Boolean)),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==o?(i=[...o],t[2]=o,t[3]=i):i=t[3];const a=i;let r;t[4]!==a||t[5]!==s?(r=ie.sandboxInvoke(s?`${s.orgSlug}/${s.virtualMcpId}/${s.branch}`:"none",`blog-products-by-ids:${a.join(",")}`),t[4]=a,t[5]=s,t[6]=r):r=t[6];let l;t[7]!==a||t[8]!==s?(l=()=>ce(s,_e(a)).then(pe),t[7]=a,t[8]=s,t[9]=l):l=t[9];const d=!!s&&a.length>0;let u;t[10]!==r||t[11]!==l||t[12]!==d?(u={queryKey:r,queryFn:l,enabled:d,staleTime:6e4,retry:1},t[10]=r,t[11]=l,t[12]=d,t[13]=u):u=t[13];const n=ae(u);let c;if(t[14]!==n.data){c=new Map;for(const p of n.data??[])c.set(p.id,p);t[14]=n.data,t[15]=c}else c=t[15];let m;return t[16]!==c||t[17]!==n.isError||t[18]!==n.isLoading?(m={byId:c,isLoading:n.isLoading,isError:n.isError},t[16]=c,t[17]=n.isError,t[18]=n.isLoading,t[19]=m):m=t[19],m}function me(s){return`${s.orgSlug}/${s.virtualMcpId}/${s.branch}`}function ge(s){const e=w.c(9),{query:t,emptyLabel:o,loadingLabel:i}=s,a=se();if(t.isLoading){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=f.jsx(xe,{size:"xs"}),e[0]=l):l=e[0];let d;return e[1]!==i?(d=f.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[l,i]}),e[1]=i,e[2]=d):d=e[2],d}if(t.isError){let l;e[3]!==a?(l=a("sandbox.productPickerDialog.couldNotLoad"),e[3]=a,e[4]=l):l=e[4];let d;return e[5]!==l?(d=f.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:l}),e[5]=l,e[6]=d):d=e[6],d}let r;return e[7]!==o?(r=f.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:o}),e[7]=o,e[8]=r):r=e[8],r}function Be(s){const e=w.c(32),{sandboxRef:t,enabled:o,onSelect:i,className:a}=s,r=se(),[l,d]=H.useState("");let u;e[0]!==t?(u=ie.sandboxInvoke(me(t),"blog-category-tree"),e[0]=t,e[1]=u):u=e[1];let n;e[2]!==t?(n=()=>ce(t,Ie()).then(Re),e[2]=t,e[3]=n):n=e[3];let c;e[4]!==o||e[5]!==u||e[6]!==n?(c={queryKey:u,queryFn:n,enabled:o,staleTime:6e4,retry:1},e[4]=o,e[5]=u,e[6]=n,e[7]=c):c=e[7];const m=ae(c);let p,g,h,P;if(e[8]!==a||e[9]!==l||e[10]!==i||e[11]!==m||e[12]!==r){const C=Ke(m.data??[],l);h="space-y-2";let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=S=>d(S.target.value),e[17]=j):j=e[17];let b;e[18]!==r?(b=r("sandbox.productPickerDialog.filterCategoriesPlaceholder"),e[18]=r,e[19]=b):b=e[19],e[20]!==l||e[21]!==b?(P=f.jsx(le,{value:l,onChange:j,placeholder:b,className:"h-9"}),e[20]=l,e[21]=b,e[22]=P):P=e[22],e[23]!==a?(p=re("overflow-y-auto rounded-md border",a),e[23]=a,e[24]=p):p=e[24],g=C.length===0?f.jsx(ge,{query:m,loadingLabel:r("sandbox.productPickerDialog.loadingCategories"),emptyLabel:r("sandbox.productPickerDialog.noCategories")}):f.jsx("div",{className:"p-1",children:C.map(S=>f.jsx("button",{type:"button",onClick:()=>i(S),className:"block w-full truncate px-2 py-1.5 text-left text-sm hover:bg-muted/60 rounded-lg",children:S.label},S.path))}),e[8]=a,e[9]=l,e[10]=i,e[11]=m,e[12]=r,e[13]=p,e[14]=g,e[15]=h,e[16]=P}else p=e[13],g=e[14],h=e[15],P=e[16];let x;e[25]!==p||e[26]!==g?(x=f.jsx("div",{className:p,children:g}),e[25]=p,e[26]=g,e[27]=x):x=e[27];let v;return e[28]!==h||e[29]!==P||e[30]!==x?(v=f.jsxs("div",{className:h,children:[P,x]}),e[28]=h,e[29]=P,e[30]=x,e[31]=v):v=e[31],v}const Ue=[{id:"search",labelKey:"sandbox.productPickerDialog.modeSearch"},{id:"category",labelKey:"sandbox.productPickerDialog.modeCategory"},{id:"cluster",labelKey:"sandbox.productPickerDialog.modeClusterId"}];async function Me(s,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(r=>ce(s,r))),o=t.filter(r=>r.status==="fulfilled").map(r=>r.value);if(o.length===0){const r=t.find(l=>l.status==="rejected");throw r?r.reason:new Error("Failed to fetch products")}const i=[],a=new Set;for(const r of o)for(const l of pe(r))a.has(l.id)||(a.add(l.id),i.push(l));return i}function ue(s){const e=w.c(6),[t,o]=H.useState(""),[i,a]=H.useState(""),r=H.useRef(null);let l;e[0]!==s?(l=n=>{o(n),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>a(n),s)},e[0]=s,e[1]=l):l=e[1];const d=l;let u;return e[2]!==i||e[3]!==d||e[4]!==t?(u={value:t,debounced:i,onChange:d},e[2]=i,e[3]=d,e[4]=t,e[5]=u):u=e[5],u}function Ve(s){const e=w.c(23),{option:t,selected:o,onToggle:i}=s,a=o?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted/60";let r;e[0]!==a?(r=re("flex w-full items-center gap-3 rounded-lg border px-2 py-2 text-left transition-colors",a),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==t.image?(l=f.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:t.image?f.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):f.jsx(Ce,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=l):l=e[3];let d;e[4]!==t.label?(d=f.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let u;e[6]!==t.id?(u=f.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=u):u=e[7];let n;e[8]!==d||e[9]!==u?(n=f.jsxs("span",{className:"min-w-0 flex-1",children:[d,u]}),e[8]=d,e[9]=u,e[10]=n):n=e[10];const c=o?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let m;e[11]!==c?(m=re("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",c),e[11]=c,e[12]=m):m=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=f.jsx(be,{size:12}),e[13]=p):p=e[13];let g;e[14]!==m?(g=f.jsx("span",{className:m,children:p}),e[14]=m,e[15]=g):g=e[15];let h;return e[16]!==i||e[17]!==o||e[18]!==g||e[19]!==r||e[20]!==l||e[21]!==n?(h=f.jsxs("button",{type:"button",onClick:i,"aria-pressed":o,className:r,children:[l,n,g]}),e[16]=i,e[17]=o,e[18]=g,e[19]=r,e[20]=l,e[21]=n,e[22]=h):h=e[22],h}function Ye(s){const e=w.c(20),{sandboxRef:t,open:o,selected:i,onSelect:a}=s,r=se();if(i){let d;e[0]!==a?(d=()=>a(null),e[0]=a,e[1]=d):d=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=f.jsx(we,{size:14}),e[2]=u):u=e[2];let n;e[3]!==r?(n=r("sandbox.productPickerDialog.categoryLabel"),e[3]=r,e[4]=n):n=e[4];let c;e[5]!==i.label?(c=f.jsx("span",{className:"text-foreground",children:i.label}),e[5]=i.label,e[6]=c):c=e[6];let m;e[7]!==r?(m=r("sandbox.productPickerDialog.change"),e[7]=r,e[8]=m):m=e[8];let p;e[9]!==n||e[10]!==c||e[11]!==m?(p=f.jsxs("span",{className:"truncate",children:[n,c," —",m]}),e[9]=n,e[10]=c,e[11]=m,e[12]=p):p=e[12];let g;return e[13]!==d||e[14]!==p?(g=f.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[u,p]}),e[13]=d,e[14]=p,e[15]=g):g=e[15],g}let l;return e[16]!==a||e[17]!==o||e[18]!==t?(l=f.jsx(Be,{sandboxRef:t,enabled:o,onSelect:a,className:"h-48"}),e[16]=a,e[17]=o,e[18]=t,e[19]=l):l=e[19],l}function Ze(s){const e=w.c(90),{open:t,onOpenChange:o,sandboxRef:i,selectedIds:a,onChange:r,onPicked:l,multiple:d}=s,u=d===void 0?!0:d,n=se(),[c,m]=H.useState("search"),p=ue(300),g=ue(300),[h,P]=H.useState(null),x=c==="search"?p.debounced:c==="cluster"?g.debounced:h?.path??"";let v;e[0]!==c||e[1]!==x?(v=$e(c,x),e[0]=c,e[1]=x,e[2]=v):v=e[2];const C=v;let j;e[3]!==c||e[4]!==i||e[5]!==x?(j=ie.sandboxInvoke(me(i),`blog-product:${c}:${x}`),e[3]=c,e[4]=i,e[5]=x,e[6]=j):j=e[6];let b;e[7]!==C||e[8]!==i?(b=()=>Me(i,C),e[7]=C,e[8]=i,e[9]=b):b=e[9];const S=t&&C.length>0;let Q;e[10]!==j||e[11]!==b||e[12]!==S?(Q={queryKey:j,queryFn:b,enabled:S,staleTime:6e4,retry:1},e[10]=j,e[11]=b,e[12]=S,e[13]=Q):Q=e[13];const N=ae(Q);let X;e[14]!==a?(X=new Set(a.filter(Boolean)),e[14]=a,e[15]=X):X=e[15];const k=X;let J;e[16]!==u||e[17]!==r||e[18]!==l||e[19]!==k||e[20]!==a?(J=y=>{const te=y.id,ne=k.has(te);if(l){l(y,!ne);return}r(u?ne?a.filter(he=>he!==te):[...a.filter(Boolean),te]:ne?[]:[te])},e[16]=u,e[17]=r,e[18]=l,e[19]=k,e[20]=a,e[21]=J):J=e[21];const oe=J;let W;e[22]!==N.data?(W=N.data??[],e[22]=N.data,e[23]=W):W=e[23];const Z=W,D=C.length===0;let T;e[24]!==u||e[25]!==n?(T=n(u?"sandbox.productPickerDialog.addProducts":"sandbox.productPickerDialog.chooseProduct"),e[24]=u,e[25]=n,e[26]=T):T=e[26];let E;e[27]!==T?(E=f.jsx(je,{className:"border-b border-border px-4 py-3",children:f.jsx(Pe,{className:"text-sm font-medium",children:T})}),e[27]=T,e[28]=E):E=e[28];let L;e[29]!==c||e[30]!==n?(L=Ue.map(y=>f.jsx("button",{type:"button",onClick:()=>m(y.id),className:re("rounded-lg px-2.5 py-1 text-sm transition-colors",c===y.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:n(y.labelKey)},y.id)),e[29]=c,e[30]=n,e[31]=L):L=e[31];let $;e[32]!==L?($=f.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:L}),e[32]=L,e[33]=$):$=e[33];let I;e[34]!==c||e[35]!==p||e[36]!==n?(I=c==="search"&&f.jsx(le,{autoFocus:!0,value:p.value,onChange:y=>p.onChange(y.target.value),placeholder:n("sandbox.productPickerDialog.searchProductsPlaceholder"),className:"h-9"}),e[34]=c,e[35]=p,e[36]=n,e[37]=I):I=e[37];let _;e[38]!==g||e[39]!==c||e[40]!==n?(_=c==="cluster"&&f.jsx(le,{autoFocus:!0,value:g.value,onChange:y=>g.onChange(y.target.value),placeholder:n("sandbox.productPickerDialog.clusterIdPlaceholder"),className:"h-9"}),e[38]=g,e[39]=c,e[40]=n,e[41]=_):_=e[41];let q;e[42]!==h||e[43]!==c||e[44]!==t||e[45]!==i?(q=c==="category"&&f.jsx(Ye,{sandboxRef:i,open:t,selected:h,onSelect:P}),e[42]=h,e[43]=c,e[44]=t,e[45]=i,e[46]=q):q=e[46];let A;e[47]!==I||e[48]!==_||e[49]!==q?(A=f.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[I,_,q]}),e[47]=I,e[48]=_,e[49]=q,e[50]=A):A=e[50];let F;e[51]!==Z||e[52]!==N||e[53]!==k||e[54]!==D||e[55]!==n||e[56]!==oe?(F=Z.length>0?Z.map(y=>f.jsx(Ve,{option:y,selected:k.has(y.id),onToggle:()=>oe(y)},y.id)):!D&&f.jsx(ge,{query:N,loadingLabel:n("sandbox.productPickerDialog.loadingProducts"),emptyLabel:n("sandbox.productPickerDialog.noProductsFound")}),e[51]=Z,e[52]=N,e[53]=k,e[54]=D,e[55]=n,e[56]=oe,e[57]=F):F=e[57];let O;e[58]!==c||e[59]!==D||e[60]!==n?(O=D&&f.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:n(c==="category"?"sandbox.productPickerDialog.pickCategoryPrompt":"sandbox.productPickerDialog.enterClusterPrompt")}),e[58]=c,e[59]=D,e[60]=n,e[61]=O):O=e[61];let R;e[62]!==F||e[63]!==O?(R=f.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[F,O]}),e[62]=F,e[63]=O,e[64]=R):R=e[64];let K;e[65]!==k.size||e[66]!==n?(K=k.size===0?n("sandbox.productPickerDialog.noneSelected"):n("sandbox.productPickerDialog.selectedCount",{count:String(k.size)}),e[65]=k.size,e[66]=n,e[67]=K):K=e[67];let z;e[68]!==K?(z=f.jsx("span",{className:"text-xs text-muted-foreground",children:K}),e[68]=K,e[69]=z):z=e[69];let B;e[70]!==o?(B=()=>o(!1),e[70]=o,e[71]=B):B=e[71];let U;e[72]!==n?(U=n("sandbox.productPickerDialog.done"),e[72]=n,e[73]=U):U=e[73];let M;e[74]!==B||e[75]!==U?(M=f.jsx(ke,{size:"sm",onClick:B,children:U}),e[74]=B,e[75]=U,e[76]=M):M=e[76];let V;e[77]!==z||e[78]!==M?(V=f.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[z,M]}),e[77]=z,e[78]=M,e[79]=V):V=e[79];let Y;e[80]!==E||e[81]!==$||e[82]!==A||e[83]!==R||e[84]!==V?(Y=f.jsxs(ve,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[E,$,A,R,V]}),e[80]=E,e[81]=$,e[82]=A,e[83]=R,e[84]=V,e[85]=Y):Y=e[85];let ee;return e[86]!==o||e[87]!==t||e[88]!==Y?(ee=f.jsx(Se,{open:t,onOpenChange:o,children:Y}),e[86]=o,e[87]=t,e[88]=Y,e[89]=ee):ee=e[89],ee}export{Be as C,Ze as P,$e as b,ce as i,pe as p,Je as r,We as u};
|