decocms 4.82.19 → 4.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-fklrqSW5.js → AlertCircle-DPEsW7A8.js} +1 -1
- package/dist/client/assets/{AreaChart-BdmhsxSM.js → AreaChart-BDBkVxFA.js} +1 -1
- package/dist/client/assets/{ArrowUp-Bdy-0gyO.js → ArrowUp-B_VVATf8.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-D6zDsrnH.js → ArrowUpRight-DPt871Ex.js} +1 -1
- package/dist/client/assets/{CheckCircle-BYkf45lM.js → CheckCircle-Bhjgrg4k.js} +1 -1
- package/dist/client/assets/{ChevronDown-sgVULpdb.js → ChevronDown-ClEtq8UA.js} +1 -1
- package/dist/client/assets/{ChevronRight-BUKoQxxN.js → ChevronRight-B9DmLAKh.js} +1 -1
- package/dist/client/assets/{ChevronUp-mvRqss9i.js → ChevronUp-Y_qcNB-R.js} +1 -1
- package/dist/client/assets/{Copy01-DLSxZiKr.js → Copy01-tOHQDVdb.js} +1 -1
- package/dist/client/assets/{DotsVertical-DitrZ6w4.js → DotsVertical-CmHvBgAo.js} +1 -1
- package/dist/client/assets/{Eye-DR1QNYLF.js → Eye-DkqzK9v4.js} +1 -1
- package/dist/client/assets/{FilterLines-Y38x0Q7Z.js → FilterLines-Da90Z39y.js} +1 -1
- package/dist/client/assets/{Globe01-CnltMSDk.js → Globe01-BptLpR6D.js} +1 -1
- package/dist/client/assets/{Globe04-X5sxJeUb.js → Globe04-5erCJGew.js} +1 -1
- package/dist/client/assets/{HardDrive-Nu1jIe4l.js → HardDrive-BWMqpfxS.js} +1 -1
- package/dist/client/assets/{Image01-CSEqtjAN.js → Image01-XM4bpaLw.js} +1 -1
- package/dist/client/assets/{Key01-Dh4DUQLF.js → Key01-ByxRAii_.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Dt7rJY-r.js → LayoutLeft-B9Jd6ymK.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CKHslpvH.js → LinkExternal01-CKVW-eEM.js} +1 -1
- package/dist/client/assets/{Monitor01-r0C7odur.js → Monitor01-ClZ2KmM9.js} +1 -1
- package/dist/client/assets/{Package-3dsm96jG.js → Package-CDoMKJ25.js} +1 -1
- package/dist/client/assets/{Palette-DAx6eGU_.js → Palette-Dj74Mlc6.js} +1 -1
- package/dist/client/assets/{Play-CJE2nK0g.js → Play-D5sDqr8I.js} +1 -1
- package/dist/client/assets/{Plus-BwYAFd19.js → Plus-JOcsz2OW.js} +1 -1
- package/dist/client/assets/{SearchLg-Ci76gxPe.js → SearchLg-BHMKxNfO.js} +1 -1
- package/dist/client/assets/{SearchMd-C4E_z5AK.js → SearchMd-C-NJ_45S.js} +1 -1
- package/dist/client/assets/{Settings02-D2iJ0Y_1.js → Settings02-CVFCJqEn.js} +1 -1
- package/dist/client/assets/{Shield01-D52f0rB7.js → Shield01-Bj6HGuxh.js} +1 -1
- package/dist/client/assets/{Star01-nXpwaO4U.js → Star01-QG8pK1yw.js} +1 -1
- package/dist/client/assets/{Stars01-DZkGi0yh.js → Stars01-DqPZujie.js} +1 -1
- package/dist/client/assets/{Stars02-B6BvIKTN.js → Stars02-D1eOi134.js} +1 -1
- package/dist/client/assets/{Sun-DECbKLB_.js → Sun-DHI7Rs1S.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D4cMfdK_.js → SwitchHorizontal01-D8ShLQwH.js} +1 -1
- package/dist/client/assets/{Tool01-CcxbpsdM.js → Tool01-C6ssLf07.js} +1 -1
- package/dist/client/assets/{Tool02-O3edpLSO.js → Tool02-BHHNM_g4.js} +1 -1
- package/dist/client/assets/{Trash01-Cwer5u_n.js → Trash01-BtophoGC.js} +1 -1
- package/dist/client/assets/{TrendUp01-dtZF5xAg.js → TrendUp01-WOe5Y0pM.js} +1 -1
- package/dist/client/assets/{Upload01-C1yFspcl.js → Upload01-CXhKVCP8.js} +1 -1
- package/dist/client/assets/{User01-DFGTsbFQ.js → User01-uwH1s6Qn.js} +1 -1
- package/dist/client/assets/{Users01-oR_WIF7g.js → Users01-suVU8oKl.js} +1 -1
- package/dist/client/assets/{Users03-BK-DRA0O.js → Users03-Zrh5Q_ci.js} +1 -1
- package/dist/client/assets/{X-JhcLrxaK.js → X-BolYo4iB.js} +1 -1
- package/dist/client/assets/{XCircle-Do7Zx-eD.js → XCircle-CnJ70X3w.js} +1 -1
- package/dist/client/assets/{XClose-C9Ve9LT-.js → XClose-BdaQO-2_.js} +1 -1
- package/dist/client/assets/{Zap-BsJbp079.js → Zap-BzNhtsnx.js} +1 -1
- package/dist/client/assets/{ZapSquare-DVSX_PUJ.js → ZapSquare-DMvgJwuD.js} +1 -1
- package/dist/client/assets/{ZoomOut-DAawwf0t.js → ZoomOut-B5XPtpBa.js} +1 -1
- package/dist/client/assets/{access-gate-B2PcKpQi.js → access-gate-CjWAQSdR.js} +1 -1
- package/dist/client/assets/{add-section-modal-39yDT-Ju.js → add-section-modal-CyW16nLc.js} +1 -1
- package/dist/client/assets/{agent-icon-CGx0_9l5.js → agent-icon-BGgFt2fk.js} +1 -1
- package/dist/client/assets/agents-list-MwwVi6Ba.js +1 -0
- package/dist/client/assets/ai-providers-DAP6QknZ.js +1 -0
- package/dist/client/assets/{alert-DtoAKyyA.js → alert-Beqn0Fvg.js} +1 -1
- package/dist/client/assets/{alert-dialog-CFnkTG10.js → alert-dialog-CwKyb2j-.js} +1 -1
- package/dist/client/assets/app-editor-DseSILWA.js +1 -0
- package/dist/client/assets/{auth-CKKxsAQR.js → auth-D4bTHSVX.js} +1 -1
- package/dist/client/assets/{auth-catchall-xiyz_7s2.js → auth-catchall-BKLc7QKI.js} +1 -1
- package/dist/client/assets/{auth-entry-DXpniWYo.js → auth-entry-1PWVON9e.js} +1 -1
- package/dist/client/assets/{auth-split-layout-022_L0k-.js → auth-split-layout-B6cSVZVN.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BL10FIRd.js → authenticate-and-persist-oauth-Bt8Gm2rH.js} +1 -1
- package/dist/client/assets/{automation-list-row-DTtDcco-.js → automation-list-row-P3Wfaud1.js} +1 -1
- package/dist/client/assets/{automation-runs-BGZr5t8h.js → automation-runs-0Gp5Pl3p.js} +4 -4
- package/dist/client/assets/automations-B1Pch092.js +1 -0
- package/dist/client/assets/{autosend-Bm2lFqoD.js → autosend-kl7RNqnt.js} +1 -1
- package/dist/client/assets/{avatar-BlYuWW7J.js → avatar-BxCDP7Ot.js} +1 -1
- package/dist/client/assets/{badge-BsoTUFnu.js → badge-CJKB36w7.js} +1 -1
- package/dist/client/assets/block-document-BNPa3FEr.js +3 -0
- package/dist/client/assets/{brand-context-DPc68RhH.js → brand-context-D3Rlfh4r.js} +1 -1
- package/dist/client/assets/{buckets-C8gEZDbc.js → buckets-eqtPNxJ7.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Cy58NtQW.js → bulk-category-panel-CzrR4JyW.js} +1 -1
- package/dist/client/assets/{calendar-Do7G6Kxp.js → calendar-DeTvDsBF.js} +2 -2
- package/dist/client/assets/{capability-load-error-DT5FhHrY.js → capability-load-error-DB_oh7IY.js} +1 -1
- package/dist/client/assets/{card-dggHqb7D.js → card-9tKE7GXF.js} +1 -1
- package/dist/client/assets/category-editor-BQbsXApg.js +1 -0
- package/dist/client/assets/{chat-context-CEf5YFvv.js → chat-context-CwNi3A6G.js} +6 -6
- package/dist/client/assets/{checkbox-CvJb_88Z.js → checkbox-Diqx1FoE.js} +1 -1
- package/dist/client/assets/{cli-auth-success-bEJ734L7.js → cli-auth-success-DvYAFC0B.js} +1 -1
- package/dist/client/assets/collection-detail-Cv0k2_GT.js +1 -0
- package/dist/client/assets/{collection-display-button-Dha8xlYb.js → collection-display-button-hHnJ4_g2.js} +1 -1
- package/dist/client/assets/{collection-search-BisIJu80.js → collection-search-kUG_oKbb.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CmbjrcGr.js → collection-table-wrapper-B9yKUfMg.js} +1 -1
- package/dist/client/assets/{collection-tabs-DFm981Kf.js → collection-tabs-BTDZrBXn.js} +1 -1
- package/dist/client/assets/{command-DsH5vUBI.js → command-N0I3WfMj.js} +1 -1
- package/dist/client/assets/commerce-onboarding-BySa1y-W.js +1 -0
- package/dist/client/assets/{companions-core-DqYVV5IY.js → companions-core-CXFBjxtL.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BR3Yayc6.js → connect-desktop-dialog-ChBtls8K.js} +1 -1
- package/dist/client/assets/connection-card-D0_c6gO9.js +1 -0
- package/dist/client/assets/connection-detail-BE-m8wny.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DaqwWAk0.js → connection-form-helpers-BYaB09EC.js} +1 -1
- package/dist/client/assets/connections-BFAOtXPe.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-v3bamRu-.js → decopilot-sse-pool-BLGL0LsS.js} +1 -1
- package/dist/client/assets/{dialog-Dy1IRNfn.js → dialog-BxyVzjQ3.js} +1 -1
- package/dist/client/assets/{domain-settings-DzzFgUkc.js → domain-settings-BK0JpUz3.js} +1 -1
- package/dist/client/assets/{drawer-C_exNDXZ.js → drawer-CQKQzuhR.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DnbYxaX3.js → dropdown-menu-BScjo8--.js} +1 -1
- package/dist/client/assets/{empty-state-CiSz3At1.js → empty-state-es2nRb_j.js} +1 -1
- package/dist/client/assets/extract-connection-data-C2_0wEKz.js +1 -0
- package/dist/client/assets/file-explorer-ipUahnFG.js +2 -0
- package/dist/client/assets/{file-type-icon-C4zp7G8m.js → file-type-icon-L2ARwYHI.js} +1 -1
- package/dist/client/assets/{files-IDnCaOPZ.js → files-CEyq4COK.js} +1 -1
- package/dist/client/assets/{form-BuzHPVCM.js → form-BBrmDTao.js} +1 -1
- package/dist/client/assets/general-mpELEztz.js +1 -0
- package/dist/client/assets/github-repo-picker-ClgZW6LI.js +1 -0
- package/dist/client/assets/{hooks-y59N0gpi.js → hooks-faeU6CoI.js} +4 -4
- package/dist/client/assets/{index-B_7Q0rH0.js → index-8daa3oHu.js} +1 -1
- package/dist/client/assets/index-B7DxR0_h.js +1 -0
- package/dist/client/assets/{index-BoBOH_Zc.js → index-BXoUOnNS.js} +1 -1
- package/dist/client/assets/index-C-1vh7Fd.css +1 -0
- package/dist/client/assets/{index-Qi63FtON.js → index-CesmbZpg.js} +27 -27
- package/dist/client/assets/{index-DZ3hzzf1.js → index-CxWNtx9x.js} +3 -3
- package/dist/client/assets/index-D1EuIdjV.js +1 -0
- package/dist/client/assets/{index-B5G64KtU.js → index-D521UaSg.js} +1 -1
- package/dist/client/assets/{index-thBdMRIF.js → index-DI-ckLEU.js} +2 -2
- package/dist/client/assets/{index-DPfxLsOi.js → index-DIB09EG-.js} +1 -1
- package/dist/client/assets/{index-k49d95pH.js → index-DJmEqij6.js} +1 -1
- package/dist/client/assets/{index-3D1LNWvP.js → index-DNRNEGzF.js} +1 -1
- package/dist/client/assets/{index-BiYdGYPy.js → index-DU67rOKJ.js} +1 -1
- package/dist/client/assets/index-DxY7xoBM.js +2 -0
- package/dist/client/assets/{index-BQGOFLqt.js → index-HF6wstce.js} +2 -2
- package/dist/client/assets/{index-redirect-DooIQ2K8.js → index-redirect-B1CSBKQb.js} +1 -1
- package/dist/client/assets/{input-CK7GAn-2.js → input-C9EhK1Lu.js} +1 -1
- package/dist/client/assets/{integration-icon-BRokQ8N8.js → integration-icon-Bz3MOu79.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DpQoOb2-.js → invite-member-dialog-B4o_u0Yn.js} +1 -1
- package/dist/client/assets/{label-BlLucFOT.js → label-JPT2W8Pg.js} +1 -1
- package/dist/client/assets/{layout-AgvOy3-T.js → layout-DDwESlPa.js} +1 -1
- package/dist/client/assets/{login-DOG0kNP3.js → login-CyRsInne.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DZFKw2wh.js → mcp-oauth-DUn-Fuzj.js} +1 -1
- package/dist/client/assets/{members-B-s3djNS.js → members-C17VYqOT.js} +1 -1
- package/dist/client/assets/{monaco-editor-Dxhxh5om.js → monaco-editor-DYNno9ow.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D1k7iMId.js → monitoring-stats-row-B1B3SvpD.js} +1 -1
- package/dist/client/assets/{multi-select-D_VdhvGn.js → multi-select-CTnDksvV.js} +1 -1
- package/dist/client/assets/{oauth-callback-BQlC45vw.js → oauth-callback-C2RnV8Ra.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B9k6hxgd.js → oauth-callback-ai-provider-qznLDLZZ.js} +1 -1
- package/dist/client/assets/{onboarding-BlB6EXWa.js → onboarding-DUVBk0XQ.js} +1 -1
- package/dist/client/assets/{org-install-CB6tXQXx.js → org-install-DQ2uKUYH.js} +1 -1
- package/dist/client/assets/{org-layout-D5haJNfI.js → org-layout-Bln5VKHy.js} +1 -1
- package/dist/client/assets/{organization-choice-2KhHSbLO.js → organization-choice-BzUmyMzq.js} +1 -1
- package/dist/client/assets/{orgs-5ZmCOdHD.js → orgs-CQnP3RnF.js} +1 -1
- package/dist/client/assets/{page-seo-form-Y0TGppB0.js → page-seo-form-BtLUHPsW.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DG0rFMaK.js +1 -0
- package/dist/client/assets/{popover-BIkriKI7.js → popover-BPf7qyUL.js} +1 -1
- package/dist/client/assets/post-editor-BLwE05et.js +1 -0
- package/dist/client/assets/{primitives-DlQu8ea0.js → primitives-DdZDjvVV.js} +1 -1
- package/dist/client/assets/{profile-D21Io7Ux.js → profile-8a3_1Shi.js} +1 -1
- package/dist/client/assets/project-app-view-C5gaZj3T.js +1 -0
- package/dist/client/assets/record-editor-DvEIA6tV.js +1 -0
- package/dist/client/assets/redirect-editor-BplQQqRM.js +1 -0
- package/dist/client/assets/registry-Bq_80-6l.js +2 -0
- package/dist/client/assets/{registry-layout-DIv4ITtZ.js → registry-layout-DTk5e6HH.js} +2 -2
- package/dist/client/assets/{reports-CRhUJ2qK.js → reports-qdBRQ4pV.js} +1 -1
- package/dist/client/assets/{require-capability-DlBK7Ljx.js → require-capability-Bspi0oGk.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CjAMzDiv.js → required-auth-layout-0AnIaBaR.js} +1 -1
- package/dist/client/assets/{reset-password-5FQKQ0O7.js → reset-password-D0qvkNvH.js} +1 -1
- package/dist/client/assets/roles-BwrRDzH5.js +1 -0
- package/dist/client/assets/{search-input-D20m0IjW.js → search-input-Bdl49Lyd.js} +1 -1
- package/dist/client/assets/{secrets-WBkgPU-G.js → secrets-BGFKYnKe.js} +1 -1
- package/dist/client/assets/sections-editor-BKlLtB36.js +2 -0
- package/dist/client/assets/{select-BesvP7cx.js → select-BjS6pi0R.js} +1 -1
- package/dist/client/assets/{select-model-1OjsUmRd.js → select-model-Bj5d_bo2.js} +1 -1
- package/dist/client/assets/self-tool-result-CzsRIvtg.js +1 -0
- package/dist/client/assets/seo-editor-CMScpL2i.js +1 -0
- package/dist/client/assets/{settings-layout-BRYv6j8B.js → settings-layout-Cbmu_dvI.js} +1 -1
- package/dist/client/assets/{settings-section-CDAkS7s3.js → settings-section-C5ntTZ3s.js} +1 -1
- package/dist/client/assets/{shell-controls-DAVZTycr.js → shell-controls-CZu8nt18.js} +1 -1
- package/dist/client/assets/shell-layout-ElsOHGco.js +1 -0
- package/dist/client/assets/{sidebar-Cc4XVWKB.js → sidebar-Du3GhEXu.js} +1 -1
- package/dist/client/assets/{skeleton-YVFIgHQg.js → skeleton-DYrRZj58.js} +1 -1
- package/dist/client/assets/{sso-D9JBA9_h.js → sso-DwHclfbW.js} +1 -1
- package/dist/client/assets/store-D1pr97wp.js +1 -0
- package/dist/client/assets/store-registry-Q6zoLWY_.js +2 -0
- package/dist/client/assets/{studio-tools-B4JofgO_.js → studio-tools-HHcBk3Yy.js} +1 -1
- package/dist/client/assets/{switch-BZYENsAO.js → switch-Co9VnPF1.js} +1 -1
- package/dist/client/assets/{table-BpC3o1Ua.js → table-7Pa2oc8U.js} +1 -1
- package/dist/client/assets/{tabs-DAIg04aD.js → tabs-DIYXMj-h.js} +1 -1
- package/dist/client/assets/{textarea-DtLXmNNW.js → textarea-azsnX4mp.js} +1 -1
- package/dist/client/assets/{toggle-group-Djz-ljio.js → toggle-group-_FACvaFN.js} +1 -1
- package/dist/client/assets/{toolbar-DuuVbShQ.js → toolbar-WAIhuPvK.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DBJ1Czuj.js → toolbar-icon-button-CFa583yL.js} +1 -1
- package/dist/client/assets/{tooltip-BLkLB4r7.js → tooltip-CTQ3jqyw.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BRga8_lW.js → use-ai-providers-C3gvqXwZ.js} +1 -1
- package/dist/client/assets/use-automations-CV0g4TCD.js +1 -0
- package/dist/client/assets/{use-autosave-BWy5WyvE.js → use-autosave-BUYSmKJl.js} +1 -1
- package/dist/client/assets/{use-capability-BSDyr6zM.js → use-capability-DzMeZG_B.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DJOVC-Ea.js → use-clock-tick-4n-sf8En.js} +1 -1
- package/dist/client/assets/{use-collections-CfZhiJR7.js → use-collections-CR5m--3v.js} +1 -1
- package/dist/client/assets/use-connection-Bja1yNlO.js +1 -0
- package/dist/client/assets/{use-copy-DK3qaoqd.js → use-copy-BV3KPbyw.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DdEqi3Z6.js → use-create-virtual-mcp-Uhf3saYW.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DejInOR3.js → use-debounced-autosave-CrTBH0r8.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B2z6I7X3.js → use-debounced-value-DiZ6agyj.js} +1 -1
- package/dist/client/assets/use-deco-credits-CrWRWg5d.js +1 -0
- package/dist/client/assets/{use-decopilot-events-D8o2yOzI.js → use-decopilot-events-By89abVN.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DYh-HBji.js → use-delete-connection-rmpivgwt.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CT7A_R9u.js → use-deployment-admin-Dx9ZkF6I.js} +1 -1
- package/dist/client/assets/{use-file-configs-Cxw_imQw.js → use-file-configs-CKVr-c7q.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BQFpclfv.js → use-infinite-scroll-B1UJmYzB.js} +1 -1
- package/dist/client/assets/{use-join-requests-O1rb1Ly4.js → use-join-requests-C6fMCeHB.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Bm5xkgD0.js → use-mcp-auth-status-wzWeSyhc.js} +1 -1
- package/dist/client/assets/use-mcp-client-CodYj4lk.js +10 -0
- package/dist/client/assets/{use-mcp-tools-CNPoXDXJ.js → use-mcp-tools-DhezZmhh.js} +1 -1
- package/dist/client/assets/{use-members-CLdfd0HT.js → use-members-C5exRENp.js} +1 -1
- package/dist/client/assets/{use-mobile-C0TUGCBw.js → use-mobile-DmC5AwHK.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CPivegDO.js → use-navigate-to-agent-VNxYrStf.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-D0LQ152W.js → use-org-auth-client-C-_6T-I_.js} +1 -1
- package/dist/client/assets/{use-org-sso-CjKp2EUT.js → use-org-sso-D9Zrv9Ex.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CaN1N3mQ.js → use-organization-roles-kfhFanV-.js} +1 -1
- package/dist/client/assets/use-organization-settings-C02fN1Pg.js +1 -0
- package/dist/client/assets/use-registry-app-CntYFu2c.js +1 -0
- package/dist/client/assets/use-registry-connections-CSTpfPSI.js +1 -0
- package/dist/client/assets/{use-secrets-BNrIMIKw.js → use-secrets-59JvHtO0.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C9YypyXn.js → use-status-sounds-CrVwkBda.js} +1 -1
- package/dist/client/assets/{use-view-mode-BxC6fcT8.js → use-view-mode-Ba0ZEqUw.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-Bs6Z3XqB.js +1 -0
- package/dist/client/assets/useInfiniteQuery-GqUtQwTk.js +1 -0
- package/dist/client/assets/{useRouterState-TFX2py_c.js → useRouterState-BStHehOf.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-oEtZEsYD.js +1 -0
- package/dist/client/assets/{users-DEUTfPh7.js → users-DXYde7XY.js} +1 -1
- package/dist/client/assets/variant-calendar-BlhvVxku.js +1 -0
- package/dist/client/assets/{view-mode-toggle-D1oVoYUo.js → view-mode-toggle-Behabpts.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +420 -420
- package/dist/server/migrate.js +80 -80
- package/dist/server/server.js +321 -321
- package/package.json +1 -1
- package/dist/client/assets/agents-list-BD9p7x4W.js +0 -1
- package/dist/client/assets/ai-providers-C9hcbmzR.js +0 -1
- package/dist/client/assets/app-editor-NqGdO2ex.js +0 -1
- package/dist/client/assets/automations-BVcJCw_j.js +0 -1
- package/dist/client/assets/block-document--9kID5te.js +0 -3
- package/dist/client/assets/category-editor-oiOftp_V.js +0 -1
- package/dist/client/assets/collection-detail-BSIJs2wo.js +0 -1
- package/dist/client/assets/commerce-onboarding-CYTa6cE_.js +0 -1
- package/dist/client/assets/connection-card-C-QD5wMH.js +0 -1
- package/dist/client/assets/connection-detail-DE_GZwV4.js +0 -1
- package/dist/client/assets/connections-D8jVtSMf.js +0 -1
- package/dist/client/assets/constants-BHDe7bIw.js +0 -1
- package/dist/client/assets/extract-connection-data-DQK5y-ef.js +0 -1
- package/dist/client/assets/file-explorer-DOtLKUBk.js +0 -2
- package/dist/client/assets/general-DFcWTX46.js +0 -1
- package/dist/client/assets/github-repo-picker-xBH3tHfN.js +0 -1
- package/dist/client/assets/index-BLjhZzKI.js +0 -1
- package/dist/client/assets/index-BmGHTOVY.css +0 -1
- package/dist/client/assets/index-DD4eXCXL.js +0 -2
- package/dist/client/assets/index-DpRnZ26Z.js +0 -1
- package/dist/client/assets/page-seo-sheet-CYknmbBc.js +0 -1
- package/dist/client/assets/post-editor-E69m4ehV.js +0 -1
- package/dist/client/assets/project-app-view-Dk5loBX7.js +0 -1
- package/dist/client/assets/record-editor-LvNAa5Nv.js +0 -1
- package/dist/client/assets/redirect-editor-CxNel36Y.js +0 -1
- package/dist/client/assets/registry-DAAMT3Nm.js +0 -2
- package/dist/client/assets/roles-gGoHVKiQ.js +0 -1
- package/dist/client/assets/sections-editor-BcH1P-xX.js +0 -2
- package/dist/client/assets/self-tool-result-CByDOVQW.js +0 -1
- package/dist/client/assets/seo-editor-CdDjsZRI.js +0 -1
- package/dist/client/assets/shell-layout-G6cWtPZY.js +0 -1
- package/dist/client/assets/store-B_VpcGv4.js +0 -1
- package/dist/client/assets/store-registry-DHf-5XTX.js +0 -2
- package/dist/client/assets/use-automations-fFC4EQc3.js +0 -1
- package/dist/client/assets/use-connection-sIYGQRZw.js +0 -1
- package/dist/client/assets/use-deco-credits-8-3yjWlK.js +0 -1
- package/dist/client/assets/use-mcp-client-BIXuHEwh.js +0 -10
- package/dist/client/assets/use-organization-settings-C_QN8e5A.js +0 -1
- package/dist/client/assets/use-registry-app-J1vnPNS0.js +0 -1
- package/dist/client/assets/use-registry-connections-701IXXum.js +0 -1
- package/dist/client/assets/use-virtual-mcp-BLx5NqtM.js +0 -1
- package/dist/client/assets/useInfiniteQuery-D1UM76v9.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-8ID1agn2.js +0 -1
- package/dist/client/assets/variant-calendar-B4ArzUYB.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as He,r as w,l as Ee,j as n,B as We,i as Hn,n as Ss,t as G,K as xs}from"./index-DZ3hzzf1.js";import{X as ys,Y as bs,Z as _s,K as Un,L as zt,M as Gn,P as Wn,i as Yn,_ as js,F as qn,H as Qn,$ as ks,G as ws,a0 as Rs,N as Jn,O as Rt,T as Xn,U as Zn,Q as ea,R as ta,a1 as na,a2 as Ns,a3 as Nt,a4 as Ds,S as aa,a5 as tt,a6 as Cs,a7 as Vs,a8 as Ts,e as Ps,k as As,a9 as Ms,aa as Es,ab as Ks,ac as $s,r as Ot,ad as Bt,ae as Os,af as ut,ag as jt,ah as Bs,ai as Ls,aj as Qe,ak as Vn,al as Fs,am as Tn,an as kt,ao as Lt,ap as Is,aq as sn,ar as zs,as as xt,at as Hs,au as Us,av as Gs,aw as Ws,ax as Ys,ay as dt,az as qs,aA as Qs,aB as Js,aC as Pn,aD as wt,m as Xs,aE as Zs,aF as er,aG as tr,aH as nr,aI as rn,aJ as An,aK as Mn,aL as yt,aM as Ft,aN as En,aO as ar,aP as sr,aQ as on,aR as rr,aS as or,aT as Kn,aU as ir}from"./index-Qi63FtON.js";import{t as lr}from"./ChevronDown-sgVULpdb.js";import{X as cn,Q as sa,C as cr,w as ra,Y as ur,Z as dr}from"./agent-icon-CGx0_9l5.js";import{i as oa}from"./ChevronRight-BUKoQxxN.js";import{n as mr}from"./ChevronUp-mvRqss9i.js";import{i as fr}from"./Globe01-CnltMSDk.js";import{m as It}from"./automation-runs-BGZr5t8h.js";import{b as mt,T as ft,a as pt}from"./tooltip-BLkLB4r7.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-Dy1IRNfn.js";import{I as yr}from"./input-CK7GAn-2.js";import{a as ia}from"./Copy01-DLSxZiKr.js";import{b as br}from"./ZoomOut-DAawwf0t.js";import{i as _r}from"./Settings02-D2iJ0Y_1.js";import{s as jr}from"./Eye-DR1QNYLF.js";import{s as la}from"./TrendUp01-dtZF5xAg.js";import{s as un}from"./Plus-BwYAFd19.js";import{s as ca}from"./Trash01-Cwer5u_n.js";import{i as kr}from"./Zap-BsJbp079.js";import{d as it,a as ua,D as da,c as ma,j as wr}from"./dropdown-menu-DnbYxaX3.js";import{S as Rr,r as $n,a as Nr,d as Dr,b as Cr,i as Vr,f as Tr,P as Pr,c as Ar}from"./page-seo-form-Y0TGppB0.js";import{b as Mr}from"./Tool01-CcxbpsdM.js";import{A as Er}from"./add-section-modal-39yDT-Ju.js";import"./ArrowUp-Bdy-0gyO.js";import"./chat-context-CEf5YFvv.js";import"./autosend-Bm2lFqoD.js";import"./hooks-y59N0gpi.js";import"./use-mcp-client-BIXuHEwh.js";import"./constants-BHDe7bIw.js";import"./auth-CKKxsAQR.js";import"./decopilot-sse-pool-v3bamRu-.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-B4JofgO_.js";import"./use-virtual-mcp-BLx5NqtM.js";import"./use-collections-CfZhiJR7.js";import"./use-ai-providers-BRga8_lW.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-D8o2yOzI.js";import"./use-organization-settings-C_QN8e5A.js";import"./drawer-C_exNDXZ.js";import"./collection-search-BisIJu80.js";import"./SearchMd-C4E_z5AK.js";import"./use-mobile-C0TUGCBw.js";import"./AreaChart-BdmhsxSM.js";import"./index-BiYdGYPy.js";import"./calendar-Do7G6Kxp.js";import"./X-JhcLrxaK.js";import"./shell-layout-G6cWtPZY.js";import"./avatar-BlYuWW7J.js";import"./User01-DFGTsbFQ.js";import"./Users03-BK-DRA0O.js";import"./SearchLg-Ci76gxPe.js";import"./Stars02-B6BvIKTN.js";import"./XClose-C9Ve9LT-.js";import"./CheckCircle-BYkf45lM.js";import"./FilterLines-Y38x0Q7Z.js";import"./required-auth-layout-CjAMzDiv.js";import"./use-org-sso-CjKp2EUT.js";import"./index-DD4eXCXL.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-D4cMfdK_.js";import"./use-registry-app-J1vnPNS0.js";import"./use-mcp-tools-CNPoXDXJ.js";import"./use-connection-sIYGQRZw.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-BL10FIRd.js";import"./mcp-oauth-DZFKw2wh.js";import"./extract-connection-data-DQK5y-ef.js";import"./use-members-CLdfd0HT.js";import"./use-org-auth-client-D0LQ152W.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-fklrqSW5.js";import"./DotsVertical-DitrZ6w4.js";import"./popover-BIkriKI7.js";import"./command-DsH5vUBI.js";import"./index-B_7Q0rH0.js";import"./use-copy-DK3qaoqd.js";import"./LinkExternal01-CKHslpvH.js";import"./ZapSquare-DVSX_PUJ.js";import"./Star01-nXpwaO4U.js";import"./Image01-CSEqtjAN.js";import"./Upload01-C1yFspcl.js";import"./form-BuzHPVCM.js";import"./label-BlLucFOT.js";import"./select-BesvP7cx.js";import"./XCircle-Do7Zx-eD.js";import"./tabs-DAIg04aD.js";import"./Tool02-O3edpLSO.js";import"./toggle-group-Djz-ljio.js";import"./use-deco-credits-8-3yjWlK.js";import"./connection-card-C-QD5wMH.js";import"./use-registry-connections-701IXXum.js";import"./useInfiniteQuery-D1UM76v9.js";import"./use-infinite-scroll-BQFpclfv.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-dggHqb7D.js";import"./integration-icon-BRokQ8N8.js";import"./textarea-DtLXmNNW.js";import"./connection-form-helpers-DaqwWAk0.js";import"./collection-tabs-DFm981Kf.js";import"./badge-BsoTUFnu.js";import"./useSuspenseInfiniteQuery-8ID1agn2.js";import"./Monitor01-r0C7odur.js";import"./connect-desktop-dialog-BR3Yayc6.js";import"./select-model-1OjsUmRd.js";import"./checkbox-CvJb_88Z.js";import"./skeleton-YVFIgHQg.js";import"./Key01-Dh4DUQLF.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CDAkS7s3.js";import"./ArrowUpRight-D6zDsrnH.js";import"./Stars01-DZkGi0yh.js";import"./index-B5G64KtU.js";import"./Palette-DAx6eGU_.js";import"./alert-dialog-CFnkTG10.js";import"./file-type-icon-C4zp7G8m.js";import"./toolbar-DuuVbShQ.js";import"./Package-3dsm96jG.js";import"./use-debounced-value-B2z6I7X3.js";import"./index-DPfxLsOi.js";import"./LayoutLeft-Dt7rJY-r.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C9YypyXn.js";import"./empty-state-CiSz3At1.js";import"./use-capability-BSDyr6zM.js";import"./toolbar-icon-button-DBJ1Czuj.js";import"./Play-CJE2nK0g.js";import"./use-debounced-autosave-DejInOR3.js";import"./index-BoBOH_Zc.js";import"./sidebar-Cc4XVWKB.js";import"./search-input-D20m0IjW.js";import"./use-mcp-auth-status-Bm5xkgD0.js";import"./switch-BZYENsAO.js";import"./github-repo-picker-xBH3tHfN.js";import"./use-navigate-to-agent-CPivegDO.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./Users01-oR_WIF7g.js";import"./use-secrets-BNrIMIKw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DqYVV5IY.js";import"./monaco-editor-Dxhxh5om.js";import"./use-file-configs-Cxw_imQw.js";import"./use-automations-fFC4EQc3.js";import"./automation-list-row-DTtDcco-.js";import"./Globe04-X5sxJeUb.js";import"./HardDrive-Nu1jIe4l.js";import"./Sun-DECbKLB_.js";import"./Shield01-D52f0rB7.js";import"./table-BpC3o1Ua.js";import"./use-clock-tick-DJOVC-Ea.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=ys(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=bs(c,r.data);if(d)return _s(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function On(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function fa(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return fa(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function pa(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=b):b=e[5];let V;e[6]!==S||e[7]!==h?(V=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=V):V=e[8];let R;e[9]!==V?(R=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:V}),e[9]=V,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let N;return e[16]!==b||e[17]!==R||e[18]!==o?(N=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=N):N=e[19],N}function ha(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:V,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?Yn(c.__resolveType??""):!1;let N;e[0]!==r?(N=js(r),e[0]=r,e[1]=N):N=e[1];const l=N;let Q;e[2]!==h?(Q={id:h,animateLayoutChanges:Wr},e[2]=h,e[3]=Q):Q=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:T,isDragging:se}=qn(Q);let P;e[4]!==T?(P=Qn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=se?0:void 0;let D;e[6]!==P||e[7]!==pe?(D={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=D):D=e[8];const ce=D;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ve=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ha(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(pa,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Gr,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==V||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),V()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=V,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(sa,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let De;e[26]!==g?(De=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(ia,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==De?(re=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=re):re=e[30];let W;e[31]!==l||e[32]!==_?(W=l&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(la,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=W):W=e[33];let Y;e[34]!==te||e[35]!==b?(Y=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=Y):Y=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ca,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==W||e[48]!==Y||e[49]!==ne||e[50]!==Se?(de=n.jsxs(da,{children:[X,n.jsxs(ma,{align:"end",className:"w-44",children:[re,W,Y,ne,Se]})]}),e[46]=re,e[47]=W,e[48]=Y,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ve,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(m){return m.stopPropagation()}function Wr(){return!1}function Yr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:V,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:N,canAddSection:l}=m,Q=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>On(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[T,se]=w.useState(null),[P,pe]=w.useState(r),[D,ce]=w.useState(d.length),B=w.useRef(!1);P!==r?(pe(r),ce(d.length),u(On(d.length))):D!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Jn},e[3]=oe):oe=e[3];const Ve=Un(zt(Wn,te),zt(Gn,oe));let E;e[4]!==K?(E=K.map(qr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:J}=L;if(!J||ae.id===J.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(J.id));Ie===-1||he===-1||(u(Je=>fa(Rt([...Je],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const De=X;let ve,re,W,Y,ne,le,ke,Se,de,be,$,Z,we,Ke,$e;if(e[11]!==T||e[12]!==Q||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==N||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==V||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ve){Ke=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==T||e[46]!==Q||e[47]!==K||e[48]!==N||e[49]!==c||e[50]!==d){const ae=T?K.find(J=>J.id===T):null;if(Y=ae!=null?d[ae.index]:null,W=ae!=null?c[ae.index]:void 0,K.length===0){let J;e[54]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=J):J=e[54];const Ie=!Q;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Je;e[56]!==N||e[57]!==Ie?(Je=n.jsxs("div",{className:"space-y-2",children:[J,n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:N,children:[he,"Add section"]})]}),e[56]=N,e[57]=Ie,e[58]=Je):Je=e[58],Ke=Je;break e}we=Ee(ae&&"cursor-grabbing"),e[45]=T,e[46]=Q,e[47]=K,e[48]=N,e[49]=c,e[50]=d,e[51]=W,e[52]=Y,e[53]=we}else W=e[51],Y=e[52],we=e[53];re=Xn,Se=Ve,de=Zn,be=je,$=Ae,Z=De,ve=ea,le=ue,ke=ta,$e="space-y-1",ne=K.map(ae=>{const J=d[ae.index];return J?n.jsx(Ir,{sortableId:ae.id,section:J,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>V(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=T,e[12]=Q,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=N,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=V,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ve,e[30]=ve,e[31]=re,e[32]=W,e[33]=Y,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],re=e[31],W=e[32],Y=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Te;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Te=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Te):Te=e[66];let Oe;e[67]!==W||e[68]!==Y||e[69]!==h?(Oe=Y?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ha(Y,!1)),children:n.jsx(pa,{section:Y,raw:W,meta:h})}):null,e[67]=W,e[68]=Y,e[69]=h,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(na,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Te||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Te,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Te,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!Q;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==N||e[84]!==xe?(me=n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:N,children:[Re,"Add section"]}),e[83]=N,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function qr(m){return m.id}function Bn(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[V,R]=w.useState(r);r!==V&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const N=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const Q=d||"the rule";let H;e[8]!==Q?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:Q}),"."]})]}),e[8]=Q,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let T;e[12]!==d||e[13]!==v||e[14]!==g?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=T):T=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let P;e[18]!==v||e[19]!==se?(P=n.jsx(We,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Hn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let D;e[23]!==v||e[24]!==pe?(D=n.jsx(We,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=D):D=e[25];let ce;e[26]!==P||e[27]!==D?(ce=n.jsxs(vr,{children:[P,D]}),e[26]=P,e[27]=D,e[28]=ce):ce=e[28];let B;e[29]!==N||e[30]!==ce||e[31]!==H||e[32]!==T?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:N,children:[H,T,ce]})}),e[29]=N,e[30]=ce,e[31]=H,e[32]=T,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Qr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",ga="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function va(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Ns(d);h=cr(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Ln(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Jr(m){return m.map((e,r)=>({...e,index:r}))}function Sa(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let b;e[0]!==c||e[1]!==d?(b=n.jsx(va,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=b):b=e[2];let V;e[3]!==r?(V=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=V):V=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(da,{children:[n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(sa,{size:14})})}),n.jsxs(ma,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(ia,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(ca,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==b||e[13]!==V||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[b,V,R]}),e[12]=b,e[13]=V,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:b,onDuplicate:V,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:N,transform:l,isDragging:Q}=qn(_);let H;e[2]!==l?(H=Qn.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=Q?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const T=u,se=p??void 0;let P;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(P=Nt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=P):P=e[10];const pe=P;let D;e[11]!==g?(D=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=D):D=e[12];const ce=Q?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?ga:Qr;let te;e[13]!==ce||e[14]!==B?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==V||e[22]!==b?(oe=n.jsx(Sa,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:b,onDuplicate:V,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=V,e[22]=b,e[23]=oe):oe=e[23];let Ve;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==N||e[28]!==T||e[29]!==te||e[30]!==oe||e[31]!==D?(Ve=n.jsx("div",{ref:N,style:T,...k,...o,onClick:g,onKeyDown:D,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=N,e[28]=T,e[29]=te,e[30]=oe,e[31]=D,e[32]=Ve):Ve=e[32],Ve}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Nt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",ga),e[4]=g):g=e[4];let b;return e[5]!==v||e[6]!==h||e[7]!==r.label?(b=n.jsx("div",{className:g,children:n.jsx(Sa,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=b):b=e[8],b}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:b,onDuplicate:V,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>ln(c),e[0]=c,e[1]=k):k=e[1];const[o,N]=w.useState(k),[l,Q]=w.useState(null),[H,K]=w.useState(r),[u,T]=w.useState(c.length);let se;e[2]!==c?(se=()=>Ln(c),e[2]=c,e[3]=se):se=e[3];const[P,pe]=w.useState(se),D=w.useRef(!1),ce=Ln(c);H!==r?(K(r),T(c.length),pe(ce),N(ln(c))):u!==c.length?(T(c.length),pe(ce),N(ln(c))):P!==ce&&(pe(ce),N(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Jn},e[5]=te):te=e[5];const oe=Un(zt(Wn,B),zt(Gn,te));let Ve;e[6]!==o?(Ve=o.map(so),e[6]=o,e[7]=Ve):Ve=e[7];const E=Ve,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);Q(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{Q(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(N(L=>Jr(Rt([...L],me,ee))),D.current=!0,requestAnimationFrame(()=>{D.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{Q(null)},e[13]=X):X=e[13];const De=X;let ve,re,W,Y,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==V||e[26]!==b||e[27]!==v||e[28]!==oe){const Me=L=>{D.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Xn,le=oe,ke=Zn,Se=je,de=Ae,be=De,ve=ea,Y=E,ne=ta,we="space-y-0.5",W=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>b(L.index),onDuplicate:()=>V(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=V,e[26]=b,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=W,e[32]=Y,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],W=e[31],Y=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ke;e[49]!==W||e[50]!==we?(Ke=n.jsx("div",{className:we,children:W}),e[49]=W,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==Y||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:Y,strategy:ne,children:Ke}),e[52]=ve,e[53]=Y,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Te;e[62]!==Le?(Te=n.jsx(na,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Te):Te=e[63];let Oe;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==$e||e[71]!==Te?(Oe=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[$e,Te]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=$e,e[71]=Te,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:$,children:[Z,Oe]}),e[73]=$,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Fn(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[b,V]=w.useState(g);let R;e[1]!==b?(R=b.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>V([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(ra,{className:"size-3.5"})}),b.map((o,N)=>{const l=N===b.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[N>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(b.slice(0,N+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${N}`)})]}),e[1]=b,e[2]=R):R=e[2];let _;e[3]!==b||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(aa,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:b,onBreadcrumbChange:V,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=b,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function In(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:b,siteDefaultSeo:V,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let N;e[0]!==p?(N=p===void 0?[]:p,e[0]=p,e[1]=N):N=e[1];const l=N;let Q;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==b||e[13]!==V?(Q=r&&c?b?n.jsx(Rr,{schema:r,resolveType:b,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:V}):n.jsx(aa,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=b,e[13]=V,e[14]=Q):Q=e[14];const H=Q;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return Ds(m,e,tt)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[b,V]=w.useState(r);b!==r&&(V(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let N;return e[10]!==_||e[11]!==o?(N=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=N):N=e[12],N}function zn(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(la,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function nc({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:b=!1,onExitSeo:V,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:N}=Cs(k),{data:l,isLoading:Q}=Vs(k),H=Ts(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,T]=w.useState(null),[se,P]=w.useState(null),[pe,D]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ve,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[De,ve]=w.useState(null),[re,W]=w.useState(null),[Y,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[be,$]=w.useState(!1),[Z,we]=w.useState(b),[Ke,$e]=w.useState(b);b&&!Ke&&($e(!0),we(!0),T(null),P(null),D(null),M([])),!b&&Ke&&$e(!1);const[Le,Te]=w.useState(null),[Oe,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,J]=w.useState(null),[Ie,he]=w.useState(null),[Je,dn]=w.useState(null),xa=Ss(),ya=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[ba,_a]=w.useState(h),[ja,ka]=w.useState(S),[wa,Ra]=w.useState(p);(ba!==h||ja!==S||wa!==p)&&(queueMicrotask(()=>Ht.flush()),_a(h),ka(S),Ra(p),T(null),P(null),D(null),B(0),E(null),ie(null),L(0),J(null),he(null),M([]),X(t=>t+1),we(!1),Te(null),Fe(void 0),xe([]),me(t=>t+1));const ye=As({orgSlug:m,virtualMcpId:e,branch:r}),Dt=Xs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Ut=Ms({orgSlug:m,virtualMcpId:e,branch:r}),[bt,Ct]=w.useState(!1),Gt=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Wt=w.useRef({}),Ye=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||N||Q)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Hn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Na=Es(o),_e=!!p,ze=_e?null:Ks(Na,h,S),j=_e?p:ze?.key??null,Yt=_e&&p?o[p]:void 0,mn=_e&&p&&Yt?$s(p,Yt):_e&&p?p:"",Vt=!_e&&j&&o[j]?o[j]:null,qt=Z&&o&&l&&j&&ze?$n(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Da=Z?Vt?.seo:void 0,Qt=Oe!==void 0?Oe:Da,Ca=Z?Nr(Qt):void 0,Va=qt?.seoTypeOptions??[],Ta=Z&&l?Dr(l):"",fn=Le??Ca??{},Jt=Z&&qt?Cr(fn,qt):null,Pa=Z&&Jt&&Vr(Qt)?Ot(Jt,l):null,Aa=Z?Tr(o,l)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Vt?.sections,o??{}),Tt=Be.length>1,Ce=Math.min(ce,Be.length-1),nt=Be[Ce],I=nt?.sections??[],Pe=Bt(I,o),pn=!_e&&Os(Vt?.sections);if(_e&&p&&Je!==p){dn(p);const t=I[0],a=Pe[0];if(t&&a){T(0),L(0),M([]);const s=ut(t,a,o);s&&(P(s.data),D(s.resolveType),he(null),J(null))}}!_e&&Je!==null&&dn(null),Ye.current={rawSections:I,parsedSections:Pe,decofile:o??{},activePageKey:j,pageVariants:Be,variantIndex:Ce,sectionVariantIndex:ee,selectedSectionIndex:u};const Ma=()=>({multivariate:pn,index:Ce,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!j||!pn||t.length<=1){_(null);return}const s=En(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ma(),f=En(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const y=ar({pageKey:j,page:i,sectionIndex:a,sectionLazy:Pe[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...y];_(x.length>0?x:null)},at=(t,a,s,i=u??-1,f=!1)=>{const y=Qe(t,a);if(!y){P(null),D(null),he(null),J(null),f&&vt(null,i,s);return}const C=Vn(y,tt)[s];if(!C){P(null),D(null),he(null),J(null),f&&vt(null,i,s);return}const q=Hs(C.value,o);P(q?.data??null),D(q?.resolveType??null);const{resolveType:A,formValue:O}=jt(C.rule,o,l??void 0);he(A),J(O),f&&vt(y,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Pe[v];if(t&&a)if(T(v),L(0),M([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(P(s.data),D(s.resolveType)):(P(null),D(null)),he(null),J(null)}}const Pt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Xt=pe&&l?Ot(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ce,Be);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>G.error(`Save failed: ${i.message}`)})},St=()=>{T(null),P(null),D(null),L(0),J(null),he(null),M([]),X(t=>t+1)},Ea=(t,a)=>{Gt.current&&clearTimeout(Gt.current);const s=Ye.current.sectionVariantIndex;Gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:q}=Ye.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...y[x]},ge=[...i];if(O.isMultivariate){const z=Qe(A,O);if(!z||!x)return;const U=rr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=Yn(A.__resolveType),U=z?{...A.section}:{...A},Ne=Array.isArray(U.variants)?[...U.variants]:[];Ne[0]&&(Ne[0]={...Ne[0],value:t}),U.variants=Ne,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const z=F.sections,U=[...z?.variants??[]];U[q]&&(U[q]={...U[q],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;ye.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>G.error(`Save failed: ${z.message}`)})},on)},Ka=t=>{T(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Pe[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const i=ut(a,s,o);if(!i){P(null),D(null),he(null),J(null),vt(null,t,0);return}P(i.data),D(i.resolveType),he(null),J(null),vt(null,t,0)},gn=t=>{const a=t;P(a),u!==null&&Ea(a,u)},Zt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=$n(o,a,l);s&&Ht.save(j,()=>{const i=xa.getQueryData(xs.decofile(ya))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Ar(a,s,f,t.inner):f})},$a=(t,a)=>{j&&(Wt.current[t]=a,Zt())},Oa=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);u!==null&&(u===t?T(a):t<u&&a>=u?T(u-1):t>u&&a<=u&&T(u+1)),Ue(s)},Ba=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&T(u-1),Ue(a)},La=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),u!==null&&u>t&&T(u+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Ia=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},za=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...y}=i.data,x=[...I];s.isLazy?x[t]={...a,section:y}:x[t]=y,u===t&&St(),Ue(x)},Ha=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),T(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Bt(a,o)[s];if(!i||!f)return;if(f.isMultivariate){at(i,f,0);return}const y=ut(i,f,o);if(!y){P(null),D(null),he(null),J(null);return}P(y.data),D(y.resolveType),he(null),J(null)}})},Ua=t=>{if(u===null)return;const a=I[u],s=Pe[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),at(a,s,t,u,!0))},Ga=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Qe(a,s);if(!i)return;const f=Qs(i,t);if(!f){G.error("Cannot delete the only variant.");return}const y=[...I];y[u]=dt(a,s,f);const x=f.variants;let C=ee;t===ee?C=Math.min(t,x.length-1):t<ee&&(C=ee-1),L(C),M([]),X(q=>q+1),at(y[u],s,C),Ue(y)},Wa=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Qe(a,s);if(!i)return;const f=Js(i,t),y=[...I];y[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(C=>C+1),at(y[u],s,x),Ue(y)},Ya=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Pe[u];if(!s||!i?.isMultivariate)return;const f=Qe(s,i);if(!f)return;const y=Ys(f,t,a),x=[...I];x[u]=dt(s,i,y);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),L(C),at(x[u],i,C),Ue(x)},en=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Pe[a];if(!s||!i)return;const f=Us(s,i);if(!f){G.error("This section cannot have variants.");return}const y=[...I];y[a]=f.section;const x=Bt(y,o)[a];if(!x?.isMultivariate){G.error("Could not add variant.");return}T(a),L(f.newVariantIndex),M([]),X(C=>C+1),at(f.section,x,f.newVariantIndex,a),Ue(y)},qa=()=>{if(u===null||!j)return;const t=I[u],a=Pe[u];if(!t||!a?.isMultivariate)return;const s=Qe(t,a);if(!s)return;const i=qs(t,a,s);if(!i){G.error("Could not remove variants.");return}const f=[...I];f[u]=i;const y=Bt(f,o)[u];if(!y)return;L(0),he(null),J(null),M([]),X(C=>C+1);const x=ut(i,y,o);x?(P(x.data),D(x.resolveType)):(P(null),D(null)),vt(null,u,0),Ue(f)},Qa=async t=>{if(De===null||!j)return;const a=rn(t,o);if(a){G.error(a);return}const s=I[De],i=Pe[De];if(!s||!i)return;const f=ut(s,i,o);if(!f){G.error("This section cannot be saved as global.");return}const y={...f.data,name:t};try{await ye.mutateAsync({blockKey:t,data:y});const x=[...I];x[De]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ce,Be)}),u===De&&St(),ve(null),G.success(`Saved global block "${t}"`),g?.()}catch(x){G.error(x instanceof Error?x.message:"Failed to save global block")}},vn=nt?.rule;if(Tt&&u===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},l??void 0);ie(t),E(a)}const At=l?Bs(l):[],Sn=l&&o?Ls(l,o):[],Ja=!_e&&!!(d&&l&&o),xn=ue&&l?Ot(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,l)>0))try{await Ut.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},yn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=Ye.current;if(!a)return;const f={...s[a]},y={...f.sections},x=[...y.variants??[]],C=x[i],q=C?.rule;if(xt(q,s,l)){const A=q?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(x[i]={...C,rule:t}),f.sections={...y,variants:x},ye.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},on)},Xa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Kn};E({}),yn(a)},Za=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};yn(s)},es=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=Ye.current;if(!a)return;const f=s[a],y=f?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const C=[...x.variants],q=C[i];if(!q)return;const A=kt(q.rule,s,l),O=Ft(t);C[i]={...q,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:C}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},bn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=Ye.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:q}=Ye.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Qe(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,y,l)){const fe=z?.__resolveType??"",Ge=y[fe],Ze=typeof Ge?.name=="string"?Ge.name:fe,{__resolveType:rt,...et}=t;ye.mutate({blockKey:fe,data:yt(rt??"",et,Ze)},{onSuccess:()=>g?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Pn(F,s,t),Ne=[...i];Ne[a]=dt(A,O,U);const qe=wt(y,x,Ne,q,C);ye.mutate({blockKey:x,data:qe},{onSuccess:()=>g?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},on))},ts=t=>{he(t),J({}),bn(t?{__resolveType:t}:{__resolveType:Kn})},ns=t=>{const a=t;J(a);const s=Ie?{__resolveType:Ie,...a}:{...a};bn(s)},as=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:q}=Ye.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Qe(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,y,l),U=Ft(t),Ne=Pn(F,s,U),qe=[...i];qe[a]=dt(A,O,Ne);const fe=wt(y,x,qe,q,C),Ge={...y,[x]:fe},{resolveType:Ze,formValue:rt}=jt(U,Ge,l??void 0);he(Ze),J(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,Ge),g?.()}catch(et){G.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!Yt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const st=u!==null?Pe[u]??null:null,_n=u!==null?I[u]:null,jn=_n&&st?.isMultivariate?Qe(_n,st):null,lt=jn?Vn(jn,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,kn=u!==null&&st!==null,Kt=kn&&(ct||!!(Xt&&se)),ss=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ss,rs=_e?mn:st?.label??"",wn=Ie&&l?Ot(Ie,l):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[ze.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],os=Z&&ze?[ze.name,"SEO",...Me]:[],$t=Z?os:Xe?nn.length>0?nn:[rs]:nn,Rn=()=>{if(!j)return;const t=o[j],a=Gs(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),T(null),P(null),D(null),M([]),E(null),ie(null)},onError:i=>G.error(`Save failed: ${i.message}`)})},an=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const y=f;if(!Array.isArray(y.variants))return;const x=t([...y.variants]);if(!x)return;const C=or(y,x),q={...o,[j]:{...i,sections:C}};ye.mutate({blockKey:j,data:q[j]},{onSuccess:()=>{a?.(),s&&_t(s,q)},onError:A=>G.error(`Save failed: ${A.message}`)})},is=t=>{W(null),B(t),T(null),P(null),D(null),M([]);const a=Be[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),hn(Be.map(f=>({rule:f.rule})),t)},ls=(t,a)=>{if(t===a)return;let s=Ce;Ce===t?s=a:t<Ce&&a>=Ce?s=Ce-1:t>Ce&&a<=Ce&&(s=Ce+1),B(s);const i=Rt(Be.map(f=>({rule:f.rule})),t,a);hn(i,s),an(f=>Rt(f,t,a))},cs=t=>{const a=Be[t]?.rule,s=kt(a,o??{},l??void 0);an(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Be.length-1===1?B(0):t<Ce?B(Ce-1):t===Ce&&B(Math.max(0,t-1)),T(null),P(null),D(null),M([]),E(null),ie(null)},s)},us=t=>{an(a=>ir(a,t),()=>{B(t+1),T(null),P(null),D(null),M([]),E(null),ie(null)})},ds=async(t,a)=>{Mt();const s=Ye.current.activePageKey,i=Ye.current.decofile;if(!s)return;const f=i[s],y=f.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const C=[...x.variants],q=C[t];if(!q?.rule||typeof q.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=q.rule,O=a.trim();Ct(!0);try{if(!O){if(!xt(A,i,l)){W(null);return}const qe=A.__resolveType??"";C[t]={...q,rule:An(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:C}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await _t(qe,fe),W(null),g?.();return}const F=Mn(A,i,l);if(!F){G.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await ye.mutateAsync({blockKey:F.blockKey,data:yt(F.resolveType,F.data,O)}),W(null),g?.();return}const ge=sn(O),z=rn(ge,i);if(z){G.error(z);return}const U=yt(F.resolveType,F.data,O);let Ne=null;try{await ye.mutateAsync({blockKey:ge,data:U}),Ne=ge,C[t]={...q,rule:Ft(ge)},await ye.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:C}}}),Ne=null}catch(qe){throw Ne&&await Ut.mutateAsync({blockKey:Ne}).catch(()=>{}),qe}W(null),G.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){G.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Ct(!1)}},ms=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:q}=Ye.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Qe(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=z.rule,Ne=a.trim();Ct(!0);const qe=async fe=>{const Ge={...F,variants:fe},Ze=[...i];Ze[s]=dt(A,O,Ge);const rt=wt(y,x,Ze,q,C);return await ye.mutateAsync({blockKey:x,data:rt}),{...y,[x]:rt}};try{if(!Ne){if(!xt(U,y,l)){ne(null);return}const ot=U.__resolveType??"",Cn=[...ge];Cn[t]={...z,rule:An(U,y,l)};const vs=await qe(Cn);await _t(ot,vs),ne(null),g?.();return}const fe=Mn(U,y,l);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,Ne)}),ne(null),g?.();return}const Ge=sn(Ne),Ze=rn(Ge,y);if(Ze){G.error(Ze);return}const rt=yt(fe.resolveType,fe.data,Ne);let et=null;try{await ye.mutateAsync({blockKey:Ge,data:rt}),et=Ge;const ot=[...ge];ot[t]={...z,rule:Ft(Ge)},await qe(ot),et=null}catch(ot){throw et&&await Ut.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${Ne}"`),g?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Ct(!1)}},Nn=()=>{St()},fs=t=>{Te(t),Zt({inner:t})},ps=t=>{Fe(t),Zt({raw:t})},hs=()=>{Te(null),xe([])},gs=()=>me(t=>t+1),Dn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Te(null),Fe(void 0),xe([]),me(s=>s+1),V?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Nn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Dn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ra,{className:"size-4"})}),!_e&&Tt&&nt&&n.jsxs("button",{type:"button",onClick:Nn,title:`Editing in variant: ${nt.label}`,className:Ee("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(va,{rule:Nt(nt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Dn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),kn&&!ct&&!st?.isHidden&&j&&n.jsx(zn,{onClick:()=>en()})]}),Xe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:$a})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(ur,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(zn,{onClick:Rn})]})}),Z?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Vt&&j?n.jsx(Pr,{rawSeo:Qt,innerSeo:fn,defaultResolveType:Ta,seoSchema:Pa,activeResolveType:Jt,seoTypeOptions:Va,formResetKey:Re,siteDefaultSeo:Aa,onBreadcrumbChange:xe,onPersistRaw:ps,onInnerChange:fs,onClearForm:hs,onBumpFormKey:gs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ua,onRename:ne,onDuplicate:Wa,onDelete:Ga,onRemoveAll:qa,onReorder:Ya,onAdd:()=>en()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Tn,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:ts,onSelectGlobal:as}),wn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:wn,value:ae,onChange:ns,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${u??"none"}:${tn}:${Ie??""}`)})]})]}),n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Tt&&j&&n.jsx(ao,{listKey:j,variants:Be,activeIndex:Ce,decofile:o??{},meta:l,matchers:At,onSelect:is,onReorder:ls,onRename:W,onDuplicate:us,onDelete:cs,onAdd:Rn}),Tt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(mr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Ee("space-y-3",bt&&"pointer-events-none opacity-50"),children:[n.jsx(Tn,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(nt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:Xa,onSelectGlobal:es}),xn&&Ve&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:xn,value:Ve,onChange:Za,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${Ce}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Yr,{listKey:`${j??""}-${Ce}`,rawSections:I,sections:Pe,meta:l,selectedIndex:u,onSelect:Ka,onReorder:Oa,onDelete:Ba,onDuplicate:La,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:Ia,onAddVariant:en,onDetach:za,onAddSection:()=>de(!0),canAddSection:Ja})})]}),n.jsx(Is,{open:De!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:De!==null?sn(Pe[De]?.label??""):"",isPending:ye.isPending,onSubmit:Qa}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ha}),be&&j&&o&&n.jsx(zs,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(Bn,{open:!0,initialName:xt(Be[re]?.rule,o??{},l??void 0)?Lt(Be[re]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(Be[re]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ds(re,t)},onOpenChange:t=>{!t&&!bt&&W(null)}}),Y!==null&&n.jsx(Bn,{open:!0,initialName:xt(lt[Y]?.rule,o??{},l??void 0)?Lt(lt[Y]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(lt[Y]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ms(Y,t)},onOpenChange:t=>{!t&&!bt&&ne(null)}})]})}export{nc as SectionsEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as Nt,_ as $e,$ as wt,a0 as Et,a1 as lt,n as he,a2 as It,a3 as Tt,r as Q,a4 as Ot,a5 as Rt,a6 as kt,a7 as At,a8 as it,a9 as Lt,aa as Dt,ab as Pt,c as H,l as ie,j as s,B,d as Oe,K as Y,H as be,I as ae,J as Ce,M as ve,i as Ie,m as me,ac as $t,t as Re,v as Pe,p as oe,Q as zt,E as qt,a as Ft}from"./index-DZ3hzzf1.js";import{u as ze}from"./use-mcp-client-BIXuHEwh.js";import{W as ct,g as Kt,S as Ut}from"./constants-BHDe7bIw.js";import{I as qe}from"./integration-icon-BRokQ8N8.js";import{c as fe,a as dt,h as ut,D as mt,d as ft,e as pt}from"./dialog-Dy1IRNfn.js";import{b as Fe,T as Ke,a as Ue}from"./tooltip-BLkLB4r7.js";import{i as Me}from"./CheckCircle-BYkf45lM.js";import{e as ht,g as Mt,h as gt}from"./agent-icon-CGx0_9l5.js";import{u as J,t as Qt,m as Gt,s as Ht,g as Vt,p as Bt,F as Wt,b as Yt,a as Zt,c as Xt}from"./companions-core-DqYVV5IY.js";import{F as re,a as je,b as le,c as Ee,d as ce,f as de,e as Jt}from"./form-BuzHPVCM.js";import{I as _e}from"./input-CK7GAn-2.js";import{i as es}from"./ChevronUp-mvRqss9i.js";import{a as xt}from"./Copy01-DLSxZiKr.js";import{i as ts}from"./Settings02-D2iJ0Y_1.js";import{s as ss}from"./Eye-DR1QNYLF.js";import{u as ns}from"./use-debounced-value-B2z6I7X3.js";import{f as yt,a as os,p as is}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{c as as,e as rs}from"./extract-connection-data-DQK5y-ef.js";import{a as ls}from"./authenticate-and-persist-oauth-BL10FIRd.js";import{i as bt}from"./ArrowUpRight-D6zDsrnH.js";function at(o,e){const t=new Set(e);return o.filter(n=>!t.has(n))}function cs(o,e,t){const n=o.slice(0);return n[e]=t,n}var ds=class extends Nt{#o;#e;#i;#n;#t;#s;#a;#r;#l;#c=[];constructor(o,e,t){super(),this.#o=o,this.#n=t,this.#i=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(o=>{o.subscribe(e=>{this.#f(o,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(o=>{o.destroy()})}setQueries(o,e){this.#i=o,this.#n=e,$e.batch(()=>{const t=this.#t,n=this.#m(this.#i);n.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const i=n.map(r=>r.observer),a=i.map(r=>r.getCurrentResult()),l=t.length!==i.length,c=i.some((r,f)=>r!==t[f]),u=l||c,p=u?!0:a.some((r,f)=>{const m=this.#e[f];return!m||!wt(r,m)});!u&&!p||(u&&(this.#c=n,this.#t=i),this.#e=a,this.hasListeners()&&(u&&(at(t,i).forEach(r=>{r.destroy()}),at(i,t).forEach(r=>{r.subscribe(f=>{this.#f(r,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(o=>o.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(o,e){const t=this.#m(o),n=t.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=t.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#u(a??n,e,i),()=>this.#d(n,t)]}#d(o,e){return e.map((t,n)=>{const i=o[n];return t.defaultedQueryOptions.notifyOnChangeProps?i:t.observer.trackResult(i,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#u(o,e,t){if(e){const n=this.#l,i=t!==void 0&&n!==void 0&&(n.length!==t.length||t.some((a,l)=>a!==n[l]));return(!this.#s||this.#e!==this.#r||i||e!==this.#a)&&(this.#a=e,this.#r=this.#e,t!==void 0&&(this.#l=t),this.#s=Et(this.#s,e(o))),this.#s}return o}#h(){return this.#n?.combine!==void 0&&this.#t.some((o,e)=>o.options.suspense&&this.#e[e]?.data===void 0)}#m(o){const e=new Map;this.#t.forEach(n=>{const i=n.options.queryHash;if(!i)return;const a=e.get(i);a?a.push(n):e.set(i,[n])});const t=[];return o.forEach(n=>{const i=this.#o.defaultQueryOptions(n),l=e.get(i.queryHash)?.shift()??new lt(this.#o,i);t.push({defaultedQueryOptions:i,observer:l})}),t}#f(o,e){const t=this.#t.indexOf(o);t!==-1&&(this.#e=cs(this.#e,t,e),this.#p())}#p(){if(this.hasListeners()){const o=this.#d(this.#e,this.#c),e=this.#h(),t=this.#s,n=e?t:this.#u(o,this.#n?.combine);(e||t!==n)&&$e.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function us({queries:o,...e},t){const n=he(t),i=It(),a=Tt(),l=Q.useMemo(()=>o.map(C=>{const g=n.defaultQueryOptions(C);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[o,n,i]);l.forEach(C=>{Ot(C);const g=n.getQueryCache().get(C.queryHash);Rt(C,a,g)}),kt(a);const[c]=Q.useState(()=>new ds(n,l,e)),[u,p,r]=c.getOptimisticResult(l,e.combine),f=!i&&e.subscribed!==!1;Q.useSyncExternalStore(Q.useCallback(C=>f?c.subscribe($e.batchCalls(C)):At,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Q.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const h=u.some((C,g)=>it(l[g],C))?u.flatMap((C,g)=>{const d=l[g];if(d&&it(d,C)){const y=new lt(n,d);return Lt(d,y,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const _=u.find((C,g)=>{const d=l[g];return d&&Dt({result:C,errorResetBoundary:a,throwOnError:d.throwOnError,query:n.getQueryCache().get(d.queryHash),suspense:d.suspense})});if(_?.error)throw _.error;return p(r())}function ms(o,e){return us({...o,queries:o.queries.map(t=>({...t,suspense:!0,throwOnError:Pt,enabled:!0,placeholderData:void 0}))},e)}const fs=/^[a-zA-Z][a-zA-Z\d+.-]*:/,ps=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,hs=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,gs=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Te(o){const e=o.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=fs.test(e),n=ps.test(e),i=hs.test(e);if(t&&!n&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=n?e:`https://${e}`;let l;try{l=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=l.hostname.split(".");return c.length<2||c.some(u=>!u||!gs.test(u))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function Gn(o,e){if(!o.trim())return!0;const t=Te(o);if(!t.ok||!e)return!1;const n=Te(e);return n.ok&&n.value===t.value}function Hn(o){if(!o)return null;const e=Te(o);return e.ok?new URL(e.value).hostname:null}function xs(o){const e=H.c(14),{children:t,className:n,wrapperClassName:i}=o,[a,l]=Q.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=C=>{if(!C)return;const g=()=>{const y=C.scrollHeight-C.scrollTop-C.clientHeight<8;l(y)};g(),C.addEventListener("scroll",g,{passive:!0});const d=new ResizeObserver(g);d.observe(C);for(const y of Array.from(C.children))d.observe(y);return()=>{C.removeEventListener("scroll",g),d.disconnect()}},e[0]=c):c=e[0];const u=c;let p;e[1]!==i?(p=ie("relative",i),e[1]=i,e[2]=p):p=e[2];let r;e[3]!==t||e[4]!==n?(r=s.jsx("div",{ref:u,className:n,children:t}),e[3]=t,e[4]=n,e[5]=r):r=e[5];const f=a?"opacity-0":"opacity-100";let m;e[6]!==f?(m=ie("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=m):m=e[7];let h;e[8]!==m?(h=s.jsx("div",{"aria-hidden":!0,className:m}),e[8]=m,e[9]=h):h=e[9];let _;return e[10]!==p||e[11]!==r||e[12]!==h?(_=s.jsxs("div",{className:p,children:[r,h]}),e[10]=p,e[11]=r,e[12]=h,e[13]=_):_=e[13],_}function rt(o){const e=H.c(38);let t,n,i,a,l;e[0]!==o?({value:l,onChange:n,placeholder:i,className:t,...a}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=i,e[4]=a,e[5]=l):(t=e[1],n=e[2],i=e[3],a=e[4],l=e[5]);const[c,u]=Q.useState(!1),[p,r]=Q.useState(!1);let f;e[6]!==l?(f=async()=>{if(l)try{await navigator.clipboard.writeText(l),r(!0),setTimeout(()=>r(!1),2e3)}catch(R){console.error("Failed to copy text: ",R)}},e[6]=l,e[7]=f):f=e[7];const m=f;let h;e[8]!==c?(h=()=>{u(!c)},e[8]=c,e[9]=h):h=e[9];const _=h,C=c?"text":"password";let g;e[10]!==t?(g=ie("pr-20",t),e[10]=t,e[11]=g):g=e[11];let d;e[12]!==n||e[13]!==i||e[14]!==a||e[15]!==C||e[16]!==g||e[17]!==l?(d=s.jsx(_e,{type:C,value:l,onChange:n,placeholder:i,className:g,...a}),e[12]=n,e[13]=i,e[14]=a,e[15]=C,e[16]=g,e[17]=l,e[18]=d):d=e[18];const y=c?"Hide password":"Show password";let v;e[19]!==c?(v=c?s.jsx(ts,{size:16}):s.jsx(ss,{size:16}),e[19]=c,e[20]=v):v=e[20];let x;e[21]!==y||e[22]!==v||e[23]!==_?(x=s.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_,title:y,children:v}),e[21]=y,e[22]=v,e[23]=_,e[24]=x):x=e[24];const E=!l,S=p?"Copied!":"Copy token";let j;e[25]!==p?(j=p?s.jsx(es,{size:16}):s.jsx(xt,{size:16}),e[25]=p,e[26]=j):j=e[26];let b;e[27]!==m||e[28]!==S||e[29]!==j||e[30]!==E?(b=s.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:m,disabled:E,title:S,children:j}),e[27]=m,e[28]=S,e[29]=j,e[30]=E,e[31]=b):b=e[31];let N;e[32]!==b||e[33]!==x?(N=s.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[x,b]}),e[32]=b,e[33]=x,e[34]=N):N=e[34];let O;return e[35]!==N||e[36]!==d?(O=s.jsxs("div",{className:"relative",children:[d,N]}),e[35]=N,e[36]=d,e[37]=O):O=e[37],O}function Qe(o){const e=H.c(19),{card:t,selfClient:n,org:i,onDone:a,onError:l}=o,c=he();let u;e[0]!==t||e[1]!==n?(u=async g=>{const d={...t.configurationState??{},...g};await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:d}}})},e[0]=t,e[1]=n,e[2]=u):u=e[2];let p;e[3]!==a||e[4]!==i||e[5]!==c?(p=async()=>{await c.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),a()},e[3]=a,e[4]=i,e[5]=c,e[6]=p):p=e[6];let r;e[7]!==l?(r=g=>{l?.(g)},e[7]=l,e[8]=r):r=e[8];let f;e[9]!==u||e[10]!==p||e[11]!==r?(f={mutationFn:u,onSuccess:p,onError:r},e[9]=u,e[10]=p,e[11]=r,e[12]=f):f=e[12];const m=Oe(f);let h;e[13]!==m?(h=g=>m.mutate(g),e[13]=m,e[14]=h):h=e[14];const _=h;let C;return e[15]!==m.error||e[16]!==m.isPending||e[17]!==_?(C={save:_,isPending:m.isPending,error:m.error},e[15]=m.error,e[16]=m.isPending,e[17]=_,e[18]=C):C=e[18],C}const ys=be({accountName:ae().min(1,"Informe o nome da conta"),appKey:ae().optional(),appToken:ae().optional()});function bs(o){const e=H.c(63),{card:t,selfClient:n,org:i,onDone:a,onIsPendingChange:l}=o;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Ce(ys),e[0]=c):c=e[0];const u=t.configurationState?.accountName||"",p=t.configurationState?.appKey||"",r=t.configurationState?.appToken||"";let f;e[1]!==u||e[2]!==p||e[3]!==r?(f={resolver:c,defaultValues:{accountName:u,appKey:p,appToken:r}},e[1]=u,e[2]=p,e[3]=r,e[4]=f):f=e[4];const m=ve(f);let h;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==m?(h=()=>{m.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=m,e[9]=h):h=e[9];let _;e[10]!==t.configurationState||e[11]!==m?(_=[t.configurationState,m],e[10]=t.configurationState,e[11]=m,e[12]=_):_=e[12],Q.useEffect(h,_);let C;e[13]!==t||e[14]!==a||e[15]!==i||e[16]!==n?(C={card:t,selfClient:n,org:i,onDone:a},e[13]=t,e[14]=a,e[15]=i,e[16]=n,e[17]=C):C=e[17];const{save:g,isPending:d,error:y}=Qe(C);let v,x;e[18]!==d||e[19]!==l?(x=()=>{l?.(d)},v=[d,l],e[18]=d,e[19]=l,e[20]=v,e[21]=x):(v=e[20],x=e[21]),Q.useEffect(x,v);let E;if(e[22]!==m||e[23]!==g){let D;e[25]!==g?(D=async F=>{g(F)},e[25]=g,e[26]=D):D=e[26],E=m.handleSubmit(D),e[22]=m,e[23]=g,e[24]=E}else E=e[24];const S=E;let j;e[27]!==d?(j=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"Nome da conta"}),s.jsx(ce,{children:s.jsx(_e,{placeholder:"Nome da sua conta VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[27]=d,e[28]=j):j=e[28];let b;e[29]!==m.control||e[30]!==j?(b=s.jsx(re,{control:m.control,name:"accountName",render:j}),e[29]=m.control,e[30]=j,e[31]=b):b=e[31];let N;e[32]!==d?(N=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"App Key (opcional)"}),s.jsx(ce,{children:s.jsx(rt,{placeholder:"App Key da VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[32]=d,e[33]=N):N=e[33];let O;e[34]!==m.control||e[35]!==N?(O=s.jsx(re,{control:m.control,name:"appKey",render:N}),e[34]=m.control,e[35]=N,e[36]=O):O=e[36];let R;e[37]!==d?(R=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"App Token (opcional)"}),s.jsx(ce,{children:s.jsx(rt,{placeholder:"App Token da VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[37]=d,e[38]=R):R=e[38];let w;e[39]!==m.control||e[40]!==R?(w=s.jsx(re,{control:m.control,name:"appToken",render:R}),e[39]=m.control,e[40]=R,e[41]=w):w=e[41];let T;e[42]!==m||e[43]!==b||e[44]!==O||e[45]!==w?(T=s.jsxs(je,{...m,children:[b,O,w]}),e[42]=m,e[43]=b,e[44]=O,e[45]=w,e[46]=T):T=e[46];let L;e[47]!==y?(L=y&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[47]=y,e[48]=L):L=e[48];let P;e[49]!==d||e[50]!==a?(P=s.jsx(B,{type:"button",variant:"outline",onClick:a,disabled:d,children:"Cancelar"}),e[49]=d,e[50]=a,e[51]=P):P=e[51];const K=d?"Salvando...":"Salvar";let $;e[52]!==d||e[53]!==K?($=s.jsx(B,{type:"submit",disabled:d,children:K}),e[52]=d,e[53]=K,e[54]=$):$=e[54];let q;e[55]!==P||e[56]!==$?(q=s.jsxs(fe,{className:"pt-4",children:[P,$]}),e[55]=P,e[56]=$,e[57]=q):q=e[57];let M;return e[58]!==S||e[59]!==T||e[60]!==L||e[61]!==q?(M=s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[T,L,q]}),e[58]=S,e[59]=T,e[60]=L,e[61]=q,e[62]=M):M=e[62],M}function Ge(o){const e=H.c(29),{options:t,value:n,onChange:i,disabled:a,ariaLabel:l,searchPlaceholder:c,hideSearch:u}=o,p=c===void 0?"Buscar...":c,r=u===void 0?!1:u,[f,m]=Q.useState("");let h,_,C;if(e[0]!==t||e[1]!==f||e[2]!==n){const j=f.trim().toLowerCase();h=j?t.filter(b=>b.label.toLowerCase().includes(j)):t,_=h.map(Cs),C=_.includes(n)?n:_[0]??"",e[0]=t,e[1]=f,e[2]=n,e[3]=h,e[4]=_,e[5]=C}else h=e[3],_=e[4],C=e[5];const g=C;let d;e[6]!==a||e[7]!==_||e[8]!==i?(d=function(b){if(a||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(b.key))return;b.preventDefault();const O=b.currentTarget.dataset.value,R=_.indexOf(O),w=_.length;if(w===0)return;let T;b.key==="ArrowDown"||b.key==="ArrowRight"?T=(R+1)%w:b.key==="ArrowUp"||b.key==="ArrowLeft"?T=(R-1+w)%w:b.key==="Home"?T=0:T=w-1;const L=_[T];i(L),b.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(L)}"]`)?.focus()},e[6]=a,e[7]=_,e[8]=i,e[9]=d):d=e[9];const y=d;let v;e[10]!==l||e[11]!==a||e[12]!==r||e[13]!==f||e[14]!==p?(v=r?null:s.jsxs("div",{className:"relative",children:[s.jsx(ht,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(_e,{type:"text",value:f,onChange:j=>m(j.target.value),disabled:a,placeholder:p,"aria-label":`Buscar ${l}`,className:"h-8 pl-8"})]}),e[10]=l,e[11]=a,e[12]=r,e[13]=f,e[14]=p,e[15]=v):v=e[15];let x;e[16]!==a||e[17]!==h||e[18]!==y||e[19]!==i||e[20]!==g||e[21]!==n?(x=h.length===0?s.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):h.map(j=>{const b=j.value===n;return s.jsxs("button",{type:"button",role:"radio","aria-checked":b,disabled:a,"data-value":j.value,tabIndex:j.value===g?0:-1,onClick:()=>i(j.value),onKeyDown:y,className:ie("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",b?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[s.jsx("span",{className:"truncate",children:j.label}),b?s.jsx(Me,{size:16,className:"shrink-0 text-primary"}):null]},j.value)}),e[16]=a,e[17]=h,e[18]=y,e[19]=i,e[20]=g,e[21]=n,e[22]=x):x=e[22];let E;e[23]!==l||e[24]!==x?(E=s.jsx("div",{role:"radiogroup","aria-label":l,className:"max-h-[280px] overflow-y-auto",children:x}),e[23]=l,e[24]=x,e[25]=E):E=e[25];let S;return e[26]!==v||e[27]!==E?(S=s.jsxs("div",{className:"space-y-2",children:[v,E]}),e[26]=v,e[27]=E,e[28]=S):S=e[28],S}function Cs(o){return o.value}function He(o){const e=H.c(16),{label:t,iconSize:n,className:i,iconClassName:a,labelClassName:l}=o,c=n===void 0?14:n;let u;e[0]!==i?(u=ie("inline-flex items-center gap-2",i),e[0]=i,e[1]=u):u=e[1];let p;e[2]!==a?(p=ie("shrink-0 animate-spin",a),e[2]=a,e[3]=p):p=e[3];let r;e[4]!==c||e[5]!==p?(r=s.jsx(Ie,{size:c,className:p}),e[4]=c,e[5]=p,e[6]=r):r=e[6];let f;e[7]!==l?(f=ie("text-sm",l),e[7]=l,e[8]=f):f=e[8];let m;e[9]!==t||e[10]!==f?(m=s.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=m):m=e[11];let h;return e[12]!==u||e[13]!==r||e[14]!==m?(h=s.jsxs("span",{className:u,children:[r,m]}),e[12]=u,e[13]=r,e[14]=m,e[15]=h):h=e[15],h}const vs=be({propertyId:ae().min(1,"Selecione uma propriedade")});function js(o){const e=H.c(68),{card:t,connectionId:n,companionClient:i,selfClient:a,org:l,onDone:c,onDisconnect:u,onIsPendingChange:p}=o;let r;e[0]!==n||e[1]!==l.id?(r=Y.commerceDiscoveryCompanionGaProperties(l.id,n),e[0]=n,e[1]=l.id,e[2]=r):r=e[2];let f;e[3]!==i?(f=async()=>{const k=await i.callTool({name:"get-account-summaries",arguments:{}}),I=J(k);return Qt(I)},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==r||e[6]!==f?(m={queryKey:r,queryFn:f},e[5]=r,e[6]=f,e[7]=m):m=e[7];const h=me(m);let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=Ce(vs),e[8]=_):_=e[8];const C=t.configurationState?.propertyId||"";let g;e[9]!==C?(g={resolver:_,defaultValues:{propertyId:C}},e[9]=C,e[10]=g):g=e[10];const d=ve(g);let y;e[11]!==t||e[12]!==c||e[13]!==l||e[14]!==a?(y={card:t,selfClient:a,org:l,onDone:c},e[11]=t,e[12]=c,e[13]=l,e[14]=a,e[15]=y):y=e[15];const{save:v,isPending:x,error:E}=Qe(y);let S,j;e[16]!==x||e[17]!==p?(S=()=>{p?.(x)},j=[x,p],e[16]=x,e[17]=p,e[18]=S,e[19]=j):(S=e[18],j=e[19]),Q.useEffect(S,j);let b;if(e[20]!==d||e[21]!==v){let k;e[23]!==v?(k=async I=>{v(I)},e[23]=v,e[24]=k):k=e[24],b=d.handleSubmit(k),e[20]=d,e[21]=v,e[22]=b}else b=e[22];const N=b;if(h.isLoading){let k;return e[25]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(He,{label:"Carregando propriedades..."})}),e[25]=k):k=e[25],k}if(h.isError){let k;return e[26]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=k):k=e[26],k}let O;e[27]!==h.data?(O=h.data||[],e[27]=h.data,e[28]=O):O=e[28];const R=O;if(R.flatMap(Ss).length===0){let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."}),e[29]=k):k=e[29];let I;e[30]!==u?(I=u?s.jsx("button",{type:"button",onClick:u,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):s.jsx("span",{}),e[30]=u,e[31]=I):I=e[31];let G;e[32]!==c?(G=s.jsx(B,{type:"button",variant:"outline",onClick:c,children:"Fechar"}),e[32]=c,e[33]=G):G=e[33];let Z;return e[34]!==I||e[35]!==G?(Z=s.jsxs("div",{className:"space-y-4",children:[k,s.jsxs(fe,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[I,G]})]}),e[34]=I,e[35]=G,e[36]=Z):Z=e[36],Z}let T;e[37]!==x||e[38]!==R?(T=k=>{const{field:I}=k;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:R.flatMap(_s),value:I.value,onChange:I.onChange,disabled:x,ariaLabel:"Propriedade do Google Analytics"})}),s.jsx(de,{})]})},e[37]=x,e[38]=R,e[39]=T):T=e[39];let L;e[40]!==d.control||e[41]!==T?(L=s.jsx(re,{control:d.control,name:"propertyId",render:T}),e[40]=d.control,e[41]=T,e[42]=L):L=e[42];let P;e[43]!==d||e[44]!==L?(P=s.jsx(je,{...d,children:L}),e[43]=d,e[44]=L,e[45]=P):P=e[45];let K;e[46]!==E?(K=E&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E instanceof Error?E.message:"Não foi possível salvar a configuração"}),e[46]=E,e[47]=K):K=e[47];let $;e[48]!==x||e[49]!==u?($=u?s.jsx("button",{type:"button",onClick:u,disabled:x,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):s.jsx("span",{}),e[48]=x,e[49]=u,e[50]=$):$=e[50];let q;e[51]!==x||e[52]!==c?(q=s.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:x,children:"Cancelar"}),e[51]=x,e[52]=c,e[53]=q):q=e[53];const M=x?"Salvando...":"Salvar";let D;e[54]!==x||e[55]!==M?(D=s.jsx(B,{type:"submit",disabled:x,children:M}),e[54]=x,e[55]=M,e[56]=D):D=e[56];let F;e[57]!==q||e[58]!==D?(F=s.jsxs("div",{className:"flex gap-2",children:[q,D]}),e[57]=q,e[58]=D,e[59]=F):F=e[59];let z;e[60]!==$||e[61]!==F?(z=s.jsxs(fe,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[$,F]}),e[60]=$,e[61]=F,e[62]=z):z=e[62];let U;return e[63]!==N||e[64]!==P||e[65]!==K||e[66]!==z?(U=s.jsxs("form",{onSubmit:N,className:"space-y-4",children:[P,K,z]}),e[63]=N,e[64]=P,e[65]=K,e[66]=z,e[67]=U):U=e[67],U}function _s(o){return o.options}function Ss(o){return o.options}const Ns=be({siteUrl:ae().min(1,"Selecione um site")});function ws(o){const e=H.c(62),{card:t,connectionId:n,companionClient:i,selfClient:a,org:l,contextSiteUrl:c,onDone:u,onIsPendingChange:p}=o;let r;e[0]!==n||e[1]!==l.id?(r=Y.commerceDiscoveryCompanionGscSites(l.id,n),e[0]=n,e[1]=l.id,e[2]=r):r=e[2];let f;e[3]!==i?(f=async()=>{const I=await i.callTool({name:"list_sites",arguments:{}});return J(I).sites||[]},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==r||e[6]!==f?(m={queryKey:r,queryFn:f},e[5]=r,e[6]=f,e[7]=m):m=e[7];const h=me(m);let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=Ce(Ns),e[8]=_):_=e[8];const C=t.configurationState?.siteUrl||"";let g;e[9]!==C?(g={resolver:_,defaultValues:{siteUrl:C}},e[9]=C,e[10]=g):g=e[10];const d=ve(g);let y;e[11]!==t||e[12]!==u||e[13]!==l||e[14]!==a?(y={card:t,selfClient:a,org:l,onDone:u},e[11]=t,e[12]=u,e[13]=l,e[14]=a,e[15]=y):y=e[15];const{save:v,isPending:x,error:E}=Qe(y),S=Q.useRef(!1),j=t.configurationState?.siteUrl;let b,N;e[16]!==x||e[17]!==p?(b=()=>{p?.(x)},N=[x,p],e[16]=x,e[17]=p,e[18]=b,e[19]=N):(b=e[18],N=e[19]),Q.useEffect(b,N);let O,R;e[20]!==c||e[21]!==d||e[22]!==j||e[23]!==h.data||e[24]!==h.isSuccess?(O=()=>{if(!(S.current||!h.isSuccess)){if(S.current=!0,j){d.getValues("siteUrl")!==j&&d.setValue("siteUrl",j);return}if(!d.getValues("siteUrl")){const I=Gt(c,h.data??[]);I&&d.setValue("siteUrl",I)}}},R=[h.isSuccess,h.data,j,c,d],e[20]=c,e[21]=d,e[22]=j,e[23]=h.data,e[24]=h.isSuccess,e[25]=O,e[26]=R):(O=e[25],R=e[26]),Q.useEffect(O,R);let w;if(e[27]!==d||e[28]!==v){let I;e[30]!==v?(I=async G=>{v(G)},e[30]=v,e[31]=I):I=e[31],w=d.handleSubmit(I),e[27]=d,e[28]=v,e[29]=w}else w=e[29];const T=w;if(h.isLoading){let I;return e[32]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(He,{label:"Carregando sites..."})}),e[32]=I):I=e[32],I}if(h.isError){let I;return e[33]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[33]=I):I=e[33],I}let L;e[34]!==h.data?(L=h.data||[],e[34]=h.data,e[35]=L):L=e[35];const P=L;if(P.length===0){let I;return e[36]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[36]=I):I=e[36],I}let K;e[37]!==x||e[38]!==P?(K=I=>{const{field:G}=I;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:P.map(Es),value:G.value,onChange:G.onChange,disabled:x,ariaLabel:"Site verificado"})}),s.jsx(de,{})]})},e[37]=x,e[38]=P,e[39]=K):K=e[39];let $;e[40]!==d.control||e[41]!==K?($=s.jsx(re,{control:d.control,name:"siteUrl",render:K}),e[40]=d.control,e[41]=K,e[42]=$):$=e[42];let q;e[43]!==d||e[44]!==$?(q=s.jsx(je,{...d,children:$}),e[43]=d,e[44]=$,e[45]=q):q=e[45];let M;e[46]!==E?(M=E&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E instanceof Error?E.message:"Não foi possível salvar a configuração"}),e[46]=E,e[47]=M):M=e[47];let D;e[48]!==x||e[49]!==u?(D=s.jsx(B,{type:"button",variant:"outline",onClick:u,disabled:x,children:"Cancelar"}),e[48]=x,e[49]=u,e[50]=D):D=e[50];const F=x?"Salvando...":"Salvar";let z;e[51]!==x||e[52]!==F?(z=s.jsx(B,{type:"submit",disabled:x,children:F}),e[51]=x,e[52]=F,e[53]=z):z=e[53];let U;e[54]!==D||e[55]!==z?(U=s.jsxs(fe,{className:"pt-4",children:[D,z]}),e[54]=D,e[55]=z,e[56]=U):U=e[56];let k;return e[57]!==T||e[58]!==q||e[59]!==M||e[60]!==U?(k=s.jsxs("form",{onSubmit:T,className:"space-y-4",children:[q,M,U]}),e[57]=T,e[58]=q,e[59]=M,e[60]=U,e[61]=k):k=e[61],k}function Es(o){return{value:o.siteUrl,label:o.siteUrl}}function Is(o){const[e,t]=o.split("/");return!e||!t?null:{owner:e,name:t}}function Ts(o){const{existingRepo:e,owner:t,name:n}=o;return e?.connectionId&&e.owner.toLowerCase()===t.toLowerCase()&&e.name.toLowerCase()===n.toLowerCase()?{connectionId:e.connectionId,installationId:e.installationId}:null}function Os(o){const{existingRepo:e,existingConnections:t,repoConnectionId:n}=o,i=e?.connectionId&&e.connectionId!==n?e.connectionId:void 0,a=[...t.filter(l=>l.connection_id!==n&&l.connection_id!==i),{connection_id:n,selected_tools:[]}];return{staleConnectionId:i,mergedConnections:a}}const Rs=be({githubRepo:ae().min(1,"Selecione um repositório")}),ks=15e3,As=/^[\w.-]+\/[\w.-]+$/;async function Ls(o,e,t,n){const{installations:i}=await yt(o,t),a=n.trim(),l=await Promise.allSettled(i.map(async r=>{const f=r.type==="User"?"user":"org",m=a?`${f}:${r.login} ${a} in:name`:`${f}:${r.login}`,_=await e.callTool({name:"search_repositories",arguments:{query:m,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(ks)}),C=_.content?.[0]?.text;if(_.isError)throw new Error(C??"search_repositories failed");if(!C)throw new Error("empty search_repositories response");return JSON.parse(C).items??[]})),c=new Map;let u=0;for(const r of l){if(r.status==="rejected"){u+=1;continue}for(const f of r.value)f.full_name&&!c.has(f.full_name)&&c.set(f.full_name,f)}return{repos:Array.from(c.values()).sort((r,f)=>(f.updated_at??"").localeCompare(r.updated_at??"")).map(r=>r.full_name),failed:u,total:i.length}}function Ds(o){const e=H.c(89),{connectionId:t,companionClient:n,selfClient:i,org:a,onDone:l,onIsPendingChange:c}=o,u=he();let p;e[0]!==a.id?(p=ct.COMMERCE_DISCOVERY(a.id),e[0]=a.id,e[1]=p):p=e[1];const r=p,[f,m]=Q.useState(""),h=ns(f,300),_=Q.useRef(!1);let C;e[2]!==t||e[3]!==a.id?(C=Y.commerceDiscoveryCompanionGithubSelected(a.id,t),e[2]=t,e[3]=a.id,e[4]=C):C=e[4];let g;e[5]!==r||e[6]!==i?(g=async()=>{const W=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}}),se=J(W).item?.configuration_state??null;return typeof se?.github_repo=="string"?se.github_repo:""},e[5]=r,e[6]=i,e[7]=g):g=e[7];let d;e[8]!==C||e[9]!==g?(d={queryKey:C,queryFn:g},e[8]=C,e[9]=g,e[10]=d):d=e[10];const y=me(d);let v;e[11]!==t||e[12]!==h||e[13]!==a.id?(v=Y.commerceDiscoveryCompanionGithubRepos(a.id,t,h.trim()),e[11]=t,e[12]=h,e[13]=a.id,e[14]=v):v=e[14];let x;e[15]!==n||e[16]!==t||e[17]!==h||e[18]!==i?(x=()=>Ls(W=>i.callTool(W),n,t,h),e[15]=n,e[16]=t,e[17]=h,e[18]=i,e[19]=x):x=e[19];let E;e[20]!==v||e[21]!==x?(E={queryKey:v,queryFn:x},e[20]=v,e[21]=x,e[22]=E):E=e[22];const S=me(E);let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:Ce(Rs),defaultValues:{githubRepo:""}},e[23]=j):j=e[23];const b=ve(j);let N;e[24]!==r||e[25]!==n||e[26]!==t||e[27]!==a.id||e[28]!==a.slug||e[29]!==i?(N=async W=>{const se=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}}),jt={...J(se).item?.configuration_state??null??{},github_repo:W};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:r,data:{configuration_state:jt}}});const Ze=Is(W);if(!Ze)throw new Error(`Repositório inválido: "${W}". Use o formato owner/nome.`);const{owner:ge,name:ke}=Ze,Xe=Kt(a.id),Je=J(await i.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:Xe}})).item,et=Je?.metadata?.githubRepo,_t=Je?.connections??[],tt=Ts({existingRepo:et,owner:ge,name:ke});let Ne=tt?.connectionId,Ae=tt?.installationId,Le;if(!Ne){const{installations:De}=await yt(xe=>i.callTool(xe),t),we=os(De,ge);if(!we)throw new Error(`Nenhuma instalação do GitHub encontrada para "${ge}".`);Ae=we.installationId;const nt=J(await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}})).item;if(!nt)throw new Error("Conexão do GitHub não encontrada.");const{childConnectionId:ot}=await is({orgSlug:a.slug,sourceConnection:nt,installationId:Ae,owner:ge,repo:ke,githubCallTool:xe=>n.callTool(xe),selfCallTool:xe=>i.callTool(xe)});Ne=ot,Le=ot}const{staleConnectionId:st,mergedConnections:St}=Os({existingRepo:et,existingConnections:_t,repoConnectionId:Ne});try{await i.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:Xe,data:{connections:St,metadata:{githubRepo:{owner:ge,name:ke,url:`https://github.com/${W}`,installationId:Ae,connectionId:Ne}}}}}),st&&await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:st,force:!0}}).catch(zs)}catch(De){const we=De;throw Le&&await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:Le,force:!0}}).catch($s),we}},e[24]=r,e[25]=n,e[26]=t,e[27]=a.id,e[28]=a.slug,e[29]=i,e[30]=N):N=e[30];let O;e[31]!==r||e[32]!==l||e[33]!==a.id||e[34]!==u?(O=async()=>{await u.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(a.id,r)}),await u.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(a.id)}),$t(u,a.id),l()},e[31]=r,e[32]=l,e[33]=a.id,e[34]=u,e[35]=O):O=e[35];let R;e[36]!==O||e[37]!==N?(R={mutationFn:N,onSuccess:O},e[36]=O,e[37]=N,e[38]=R):R=e[38];const w=Oe(R),T=w.isPending;let L,P;e[39]!==T||e[40]!==c?(L=()=>{c?.(T)},P=[T,c],e[39]=T,e[40]=c,e[41]=L,e[42]=P):(L=e[41],P=e[42]),Q.useEffect(L,P);const K=y.data??"";let $,q;e[43]!==b||e[44]!==y.data||e[45]!==y.isSuccess?($=()=>{!y.isSuccess||_.current||(_.current=!0,y.data&&b.setValue("githubRepo",y.data))},q=[y.isSuccess,y.data,b],e[43]=b,e[44]=y.data,e[45]=y.isSuccess,e[46]=$,e[47]=q):($=e[46],q=e[47]),Q.useEffect($,q);let M;if(e[48]!==b||e[49]!==w){let W;e[51]!==w?(W=async se=>{w.mutate(se.githubRepo)},e[51]=w,e[52]=W):W=e[52],M=b.handleSubmit(W),e[48]=b,e[49]=w,e[50]=M}else M=e[50];const D=M;let F,z,U;if(e[53]!==h||e[54]!==S.data?.failed||e[55]!==S.data?.repos||e[56]!==S.data?.total||e[57]!==K){const W=S.data?.repos??[];F=S.data?.failed??0,U=S.data?.total??0;const se=h.trim();z=[...W],se&&As.test(se)&&!z.includes(se)&&z.unshift(se),K&&!z.includes(K)&&z.push(K),e[53]=h,e[54]=S.data?.failed,e[55]=S.data?.repos,e[56]=S.data?.total,e[57]=K,e[58]=F,e[59]=z,e[60]=U}else F=e[58],z=e[59],U=e[60];const k=U>0&&F===U,I=S.isError||k?"Não foi possível buscar os repositórios (erro ou tempo esgotado). Tente novamente ou digite o repositório no formato owner/nome.":F>0?"Parte da busca falhou — alguns repositórios podem não ter aparecido. Tente novamente ou digite owner/nome.":null;let G;e[61]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(ht,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[61]=G):G=e[61];let Z;e[62]===Symbol.for("react.memo_cache_sentinel")?(Z=W=>m(W.target.value),e[62]=Z):Z=e[62];let X;e[63]!==T||e[64]!==f?(X=s.jsxs("div",{className:"relative",children:[G,s.jsx(_e,{type:"text",value:f,onChange:Z,disabled:T,placeholder:"Buscar repositório","aria-label":"Buscar repositório",className:"h-8 pl-8"})]}),e[63]=T,e[64]=f,e[65]=X):X=e[65];let ee;e[66]!==b||e[67]!==T||e[68]!==z||e[69]!==S.isLoading||e[70]!==I?(ee=S.isLoading?s.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:s.jsx(He,{label:"Carregando repositórios..."})}):s.jsxs(s.Fragment,{children:[I&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:I}),z.length===0?!I&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum repositório encontrado. Digite o nome do repositório (owner/nome) para buscar."}):s.jsx(je,{...b,children:s.jsx(re,{control:b.control,name:"githubRepo",render:W=>{const{field:se}=W;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:z.map(Ps),value:se.value,onChange:se.onChange,disabled:T,ariaLabel:"Repositório",hideSearch:!0})}),s.jsx(de,{})]})}})})]}),e[66]=b,e[67]=T,e[68]=z,e[69]=S.isLoading,e[70]=I,e[71]=ee):ee=e[71];let V;e[72]!==w.error?(V=w.error&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:w.error instanceof Error?w.error.message:"Não foi possível salvar a configuração"}),e[72]=w.error,e[73]=V):V=e[73];let A;e[74]!==T||e[75]!==l?(A=s.jsx(B,{type:"button",variant:"outline",onClick:l,disabled:T,children:"Cancelar"}),e[74]=T,e[75]=l,e[76]=A):A=e[76];const te=T?"Salvando...":"Salvar";let ne;e[77]!==T||e[78]!==te?(ne=s.jsx(B,{type:"submit",disabled:T,children:te}),e[77]=T,e[78]=te,e[79]=ne):ne=e[79];let ue;e[80]!==A||e[81]!==ne?(ue=s.jsxs(fe,{className:"pt-4",children:[A,ne]}),e[80]=A,e[81]=ne,e[82]=ue):ue=e[82];let Se;return e[83]!==D||e[84]!==X||e[85]!==ee||e[86]!==V||e[87]!==ue?(Se=s.jsxs("form",{onSubmit:D,className:"space-y-4",children:[X,ee,V,ue]}),e[83]=D,e[84]=X,e[85]=ee,e[86]=V,e[87]=ue,e[88]=Se):Se=e[88],Se}function Ps(o){return{value:o,label:o}}function $s(){}function zs(){}const qs={vtex:bs,"google-analytics":js,"google-search-console":ws,github:Ds},pe="deco-reader@decocms.iam.gserviceaccount.com",Ct={"google-analytics":"ga4","google-search-console":"gsc"},vt={ga4:{label:"Google Analytics",resourceLabel:"ID da propriedade",resourcePlaceholder:"ex: 123456789",resourceHint:"No GA4: Admin → Detalhes da propriedade → ID da propriedade (só números).",connectSteps:["Abra o Google Analytics (GA4) da sua loja.","Vá em Admin → Acesso à propriedade (Gerenciamento de acesso).",`Clique em + → Adicionar usuários, cole ${pe} e conceda o papel Leitor.`,"Copie o ID da propriedade (Admin → Detalhes da propriedade) e cole abaixo."]},gsc:{label:"Google Search Console",resourceLabel:"Site / propriedade",resourcePlaceholder:"ex: sc-domain:sualoja.com.br",resourceHint:"Use o mesmo formato que aparece no Search Console: sc-domain:sualoja.com.br ou https://www.sualoja.com.br/.",connectSteps:["Abra o Google Search Console da sua loja.","Vá em Configurações → Usuários e permissões.",`Clique em Adicionar usuário, cole ${pe} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function Fs(o,e){const t=vt[o].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${t}.`,steps:o==="ga4"?[`Confirme que ${pe} foi adicionado em Admin → Acesso à propriedade com o papel Leitor.`,"Confira se o ID da propriedade está correto (só números, sem o prefixo 'properties/').","A concessão de acesso pode levar alguns segundos — tente novamente."]:[`Confirme que ${pe} foi adicionado em Configurações → Usuários e permissões.`,"A permissão precisa ser Completa ou Restrita — 'Não verificado' não funciona.","Confira se o endereço do site está exatamente como aparece no Search Console."]};case"no-web-stream":return{title:"Esta propriedade do GA4 não tem um fluxo de dados da Web (site) configurado.",steps:["No GA4, vá em Admin → Fluxos de dados.","Clique em Adicionar fluxo → Web.","Informe a URL do site da sua loja e salve o fluxo.","Volte aqui e tente vincular de novo. (Propriedades só de app precisam de vínculo manual — fale com o suporte.)"]};case"no-match":return{title:"O recurso informado não corresponde ao domínio desta loja.",steps:o==="ga4"?["Verifique se digitou o ID da propriedade certa — provavelmente é de outro site.","No GA4, o site medido aparece em Admin → Fluxos de dados → (seu fluxo Web) → URL do stream."]:["Verifique se selecionou a propriedade do Search Console referente a esta loja.","O endereço precisa cobrir o mesmo domínio do diagnóstico."]};case"resource_already_bound":return{title:"Este recurso já está vinculado a outra loja.",steps:["Se este recurso é realmente desta loja, fale com o suporte para uma revisão manual.","Caso tenha digitado o id errado, confira e tente novamente."]};default:return{title:"Não foi possível verificar o acesso a este recurso.",steps:["Revise os passos de acesso acima e tente novamente.","Se persistir, fale com o suporte."]}}}function Ks(o){const e=H.c(76),{provider:t,siteUrl:n,selfClient:i,org:a,initialResourceId:l,onDone:c,onIsPendingChange:u,onOAuthInstead:p}=o,r=vt[t],f=he(),[m,h]=Q.useState(null);let _,C;if(e[0]!==r.resourceLabel){const V=be({resourceId:ae().trim().min(1,`Informe o ${r.resourceLabel.toLowerCase()}`)});C=ve,_=Ce(V),e[0]=r.resourceLabel,e[1]=_,e[2]=C}else _=e[1],C=e[2];const g=l??"";let d;e[3]!==g?(d={resourceId:g},e[3]=g,e[4]=d):d=e[4];let y;e[5]!==_||e[6]!==d?(y={resolver:_,defaultValues:d},e[5]=_,e[6]=d,e[7]=y):y=e[7];const v=C(y);let x;e[8]!==t||e[9]!==i||e[10]!==n?(x=async V=>{if(!n)throw new Error("URL da loja indisponível — recarregue a página.");const A=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:n,provider:t,resourceId:V.resourceId}});return J(A)},e[8]=t,e[9]=i,e[10]=n,e[11]=x):x=e[11];let E,S;e[12]!==u?(E=()=>u?.(!0),S=()=>u?.(!1),e[12]=u,e[13]=E,e[14]=S):(E=e[13],S=e[14]);let j;e[15]!==r.label||e[16]!==c||e[17]!==a||e[18]!==t||e[19]!==f||e[20]!==n?(j=async V=>{if(V.ok){h(null),Re.success(`${r.label} conectado`),n&&await f.invalidateQueries({queryKey:Y.commerceDiscoveryConnectionStatus(a.id,n)}),c();return}h({...Fs(t,V.reason??"unknown"),detail:V.detail})},e[15]=r.label,e[16]=c,e[17]=a,e[18]=t,e[19]=f,e[20]=n,e[21]=j):j=e[21];let b;e[22]!==x||e[23]!==E||e[24]!==S||e[25]!==j?(b={mutationFn:x,onMutate:E,onSettled:S,onSuccess:j},e[22]=x,e[23]=E,e[24]=S,e[25]=j,e[26]=b):b=e[26];const N=Oe(b);let O;if(e[27]!==v||e[28]!==N){let V;e[30]!==N?(V=A=>N.mutate(A),e[30]=N,e[31]=V):V=e[31],O=v.handleSubmit(V),e[27]=v,e[28]=N,e[29]=O}else O=e[29];const R=O,w=N.isPending,T=Qs;let L;e[32]!==r.connectSteps?(L=r.connectSteps.map(Ms),e[32]=r.connectSteps,e[33]=L):L=e[33];let P;e[34]!==L?(P=s.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:L}),e[34]=L,e[35]=P):P=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:pe}),e[36]=K):K=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[K,s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:T,"aria-label":"Copiar e-mail do service account",children:s.jsx(xt,{size:16})})]}),e[37]=$):$=e[37];let q;e[38]!==r.resourceHint||e[39]!==r.resourceLabel||e[40]!==r.resourcePlaceholder||e[41]!==w?(q=V=>{const{field:A}=V;return s.jsxs(le,{children:[s.jsx(Ee,{children:r.resourceLabel}),s.jsx(ce,{children:s.jsx(_e,{...A,placeholder:r.resourcePlaceholder,disabled:w,autoComplete:"off"})}),s.jsx(Jt,{children:r.resourceHint}),s.jsx(de,{})]})},e[38]=r.resourceHint,e[39]=r.resourceLabel,e[40]=r.resourcePlaceholder,e[41]=w,e[42]=q):q=e[42];let M;e[43]!==v.control||e[44]!==q?(M=s.jsx(re,{control:v.control,name:"resourceId",render:q}),e[43]=v.control,e[44]=q,e[45]=M):M=e[45];let D;e[46]!==v||e[47]!==M?(D=s.jsx(je,{...v,children:M}),e[46]=v,e[47]=M,e[48]=D):D=e[48];let F;e[49]!==m?(F=m&&s.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:m.title}),s.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:m.steps.map(Us)})]}),e[49]=m,e[50]=F):F=e[50];let z;e[51]!==N.error||e[52]!==N.isError?(z=N.isError&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N.error instanceof Error?N.error.message:"Não foi possível vincular."}),e[51]=N.error,e[52]=N.isError,e[53]=z):z=e[53];let U;e[54]!==w||e[55]!==p?(U=p?s.jsx("button",{type:"button",onClick:p,disabled:w,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):s.jsx("span",{}),e[54]=w,e[55]=p,e[56]=U):U=e[56];let k;e[57]!==w||e[58]!==c?(k=s.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:w,children:"Cancelar"}),e[57]=w,e[58]=c,e[59]=k):k=e[59];const I=w?"Verificando...":"Vincular";let G;e[60]!==w||e[61]!==I?(G=s.jsx(B,{type:"submit",disabled:w,children:I}),e[60]=w,e[61]=I,e[62]=G):G=e[62];let Z;e[63]!==k||e[64]!==G?(Z=s.jsxs("div",{className:"flex gap-2",children:[k,G]}),e[63]=k,e[64]=G,e[65]=Z):Z=e[65];let X;e[66]!==U||e[67]!==Z?(X=s.jsxs(fe,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[U,Z]}),e[66]=U,e[67]=Z,e[68]=X):X=e[68];let ee;return e[69]!==R||e[70]!==P||e[71]!==D||e[72]!==F||e[73]!==z||e[74]!==X?(ee=s.jsxs("form",{onSubmit:R,className:"space-y-4",children:[P,$,D,F,z,X]}),e[69]=R,e[70]=P,e[71]=D,e[72]=F,e[73]=z,e[74]=X,e[75]=ee):ee=e[75],ee}function Us(o){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{"aria-hidden":!0,children:"•"}),s.jsx("span",{children:o})]},o)}function Ms(o,e){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-foreground",children:e+1}),s.jsx("span",{children:o})]},o)}function Qs(){navigator.clipboard?.writeText(pe),Re.success("E-mail copiado")}function Gs(){const o=H.c(2);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0];let t;return o[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[e,s.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"hidden h-3 w-full animate-pulse rounded bg-muted/60 sm:block"})]}),s.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),o[1]=t):t=o[1],t}const Hs="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function Vs(o){const e=H.c(36),{card:t,connecting:n,disconnecting:i,disabled:a,onConnect:l,onDisconnect:c,org:u,selfClient:p,siteUrl:r,autoOpenConfigFieldKey:f,onAutoOpenConfigHandled:m}=o,h=t.linkedConnectionId,_=Ct[t.bindingType],C=!!_&&t.boundVia!=="oauth";let g;e[0]!==f||e[1]!==t||e[2]!==n||e[3]!==a||e[4]!==i||e[5]!==h||e[6]!==m||e[7]!==l||e[8]!==c||e[9]!==u||e[10]!==_||e[11]!==p||e[12]!==r||e[13]!==C?(g=C&&_?s.jsx(Bs,{card:t,provider:_,org:u,selfClient:p,siteUrl:r,onOAuthInstead:l,disabled:a,connecting:n}):t.satisfied&&h?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Me,{size:16,className:"text-success"})," Conectado"]}),s.jsx(Q.Suspense,{fallback:s.jsx(Ws,{}),children:s.jsx(Ys,{card:t,org:u,selfClient:p,connectionId:h,contextSiteUrl:r,autoOpen:Ht({autoOpenFieldKey:f,card:t}),onAutoOpenHandled:m})}),s.jsxs(Fe,{children:[s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:a||i,onClick:c,"aria-label":`Desconectar ${t.title}`,children:i?s.jsx(Ie,{size:16,className:"animate-spin"}):s.jsx(Mt,{size:16})})}),s.jsx(Ue,{children:"Desconectar"})]})]}):s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:a||n,onClick:l,"aria-label":`Conectar ${t.title}`,children:n?s.jsx(Ie,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=f,e[1]=t,e[2]=n,e[3]=a,e[4]=i,e[5]=h,e[6]=m,e[7]=l,e[8]=c,e[9]=u,e[10]=_,e[11]=p,e[12]=r,e[13]=C,e[14]=g):g=e[14];const d=g;let y;e[15]!==t.icon||e[16]!==t.title?(y=s.jsx(qe,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[15]=t.icon,e[16]=t.title,e[17]=y):y=e[17];let v;e[18]!==t.area?(v=t.area&&s.jsx("span",{className:ie("hidden sm:inline-block",Hs),children:t.area}),e[18]=t.area,e[19]=v):v=e[19];let x;e[20]!==y||e[21]!==v?(x=s.jsxs("div",{className:"shrink-0 sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[y,v]}),e[20]=y,e[21]=v,e[22]=x):x=e[22];let E;e[23]!==t.title?(E=s.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e[23]=t.title,e[24]=E):E=e[24];let S;e[25]!==t.headline?(S=t.headline&&s.jsx("p",{className:"hidden text-sm leading-5 text-muted-foreground sm:mt-0.5 sm:line-clamp-2 sm:block",children:t.headline}),e[25]=t.headline,e[26]=S):S=e[26];let j;e[27]!==E||e[28]!==S?(j=s.jsxs("div",{className:"min-w-0 flex-1",children:[E,S]}),e[27]=E,e[28]=S,e[29]=j):j=e[29];let b;e[30]!==d?(b=s.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:d}),e[30]=d,e[31]=b):b=e[31];let N;return e[32]!==x||e[33]!==j||e[34]!==b?(N=s.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[x,j,b]}),e[32]=x,e[33]=j,e[34]=b,e[35]=N):N=e[35],N}function Bs(o){const e=H.c(39),{card:t,provider:n,org:i,selfClient:a,siteUrl:l,onOAuthInstead:c,disabled:u,connecting:p}=o,[r,f]=Q.useState(!1),[m,h]=Q.useState(!1);let _;e[0]!==m?(_=T=>{!T&&m||f(T)},e[0]=m,e[1]=_):_=e[1];const C=_;let g;e[2]!==t.satisfied||e[3]!==t.title||e[4]!==p||e[5]!==u?(g=t.satisfied?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Me,{size:16,className:"text-success"})," Conectado"]}),s.jsxs(Fe,{children:[s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>f(!0),"aria-label":`Configurar ${t.title}`,children:s.jsx(gt,{size:16})})}),s.jsx(Ue,{children:"Editar configuração"})]})]}):s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:u||p,onClick:()=>f(!0),"aria-label":`Conectar ${t.title}`,children:p?s.jsx(Ie,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=t.satisfied,e[3]=t.title,e[4]=p,e[5]=u,e[6]=g):g=e[6];let d;e[7]!==t.icon||e[8]!==t.title?(d=s.jsx(qe,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=t.icon,e[8]=t.title,e[9]=d):d=e[9];let y;e[10]!==t.title?(y=s.jsx(dt,{children:t.title}),e[10]=t.title,e[11]=y):y=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=v):v=e[12];let x;e[13]!==y?(x=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[y,v]}),e[13]=y,e[14]=x):x=e[14];let E;e[15]!==d||e[16]!==x?(E=s.jsxs(mt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[d,x]}),e[15]=d,e[16]=x,e[17]=E):E=e[17];const S=t.boundResource??void 0;let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f(!1),e[18]=j):j=e[18];let b;e[19]!==t.satisfied||e[20]!==c?(b=t.satisfied?void 0:()=>{f(!1),c()},e[19]=t.satisfied,e[20]=c,e[21]=b):b=e[21];let N;e[22]!==i||e[23]!==n||e[24]!==a||e[25]!==l||e[26]!==b||e[27]!==S?(N=s.jsx(Ks,{provider:n,siteUrl:l,selfClient:a,org:i,initialResourceId:S,onDone:j,onIsPendingChange:h,onOAuthInstead:b}),e[22]=i,e[23]=n,e[24]=a,e[25]=l,e[26]=b,e[27]=S,e[28]=N):N=e[28];let O;e[29]!==N||e[30]!==E?(O=s.jsxs(ft,{className:"sm:max-w-lg",children:[E,N]}),e[29]=N,e[30]=E,e[31]=O):O=e[31];let R;e[32]!==C||e[33]!==r||e[34]!==O?(R=s.jsx(pt,{open:r,onOpenChange:C,children:O}),e[32]=C,e[33]=r,e[34]=O,e[35]=R):R=e[35];let w;return e[36]!==R||e[37]!==g?(w=s.jsxs(s.Fragment,{children:[g,R]}),e[36]=R,e[37]=g,e[38]=w):w=e[38],w}function Ws(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0],e}function Ys(o){const e=H.c(60),{card:t,org:n,selfClient:i,connectionId:a,contextSiteUrl:l,autoOpen:c,onAutoOpenHandled:u}=o;let p;e[0]!==a||e[1]!==n.id||e[2]!==n.slug?(p={connectionId:a,orgId:n.id,orgSlug:n.slug},e[0]=a,e[1]=n.id,e[2]=n.slug,e[3]=p):p=e[3];const r=ze(p),[f,m]=Q.useState(c),[h,_]=Q.useState(!1),C=he(),g=qs[t.bindingType],d=Vt(t.configurationState);let y;e[4]!==c||e[5]!==u?(y=()=>{m(!1),c&&u()},e[4]=c,e[5]=u,e[6]=y):y=e[6];const v=y;let x;e[7]!==v||e[8]!==h?(x=I=>{if(!(!I&&h)){if(!I){v();return}m(!0)}},e[7]=v,e[8]=h,e[9]=x):x=e[9];const E=x;let S;e[10]!==a||e[11]!==i?(S=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})},e[10]=a,e[11]=i,e[12]=S):S=e[12];let j;e[13]!==t.title||e[14]!==v||e[15]!==n.id||e[16]!==C?(j=async()=>{await C.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(n.id)}),Re.success(`${t.title} desconectado`),v()},e[13]=t.title,e[14]=v,e[15]=n.id,e[16]=C,e[17]=j):j=e[17];let b;e[18]!==S||e[19]!==j?(b={mutationFn:S,onSuccess:j,onError:Zs},e[18]=S,e[19]=j,e[20]=b):b=e[20];const N=Oe(b);if(!g)return null;let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=()=>m(!0),e[21]=O):O=e[21];const R=`Configurar ${t.title}`;let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(gt,{size:16}),e[22]=w):w=e[22];let T;e[23]!==R?(T=s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:O,"aria-label":R,children:w})}),e[23]=R,e[24]=T):T=e[24];const L=d.length>0?"Editar configuração":"Configurar";let P;e[25]!==L?(P=s.jsx(Ue,{children:L}),e[25]=L,e[26]=P):P=e[26];let K;e[27]!==T||e[28]!==P?(K=s.jsxs(Fe,{children:[T,P]}),e[27]=T,e[28]=P,e[29]=K):K=e[29];let $;e[30]!==t.icon||e[31]!==t.title?($=s.jsx(qe,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[30]=t.icon,e[31]=t.title,e[32]=$):$=e[32];let q;e[33]!==t.title?(q=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx(dt,{children:t.title}),s.jsxs(ut,{children:["Configure o ",t.title," para enriquecer os dados"]})]}),e[33]=t.title,e[34]=q):q=e[34];let M;e[35]!==$||e[36]!==q?(M=s.jsxs(mt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[$,q]}),e[35]=$,e[36]=q,e[37]=M):M=e[37];let D;e[38]!==N?(D=()=>N.mutate(),e[38]=N,e[39]=D):D=e[39];let F;e[40]!==g||e[41]!==t||e[42]!==v||e[43]!==r||e[44]!==a||e[45]!==l||e[46]!==n||e[47]!==i||e[48]!==D?(F=s.jsx(g,{card:t,connectionId:a,companionClient:r,selfClient:i,org:n,contextSiteUrl:l,onDone:v,onDisconnect:D,onIsPendingChange:_}),e[40]=g,e[41]=t,e[42]=v,e[43]=r,e[44]=a,e[45]=l,e[46]=n,e[47]=i,e[48]=D,e[49]=F):F=e[49];let z;e[50]!==M||e[51]!==F?(z=s.jsxs(ft,{className:"sm:max-w-lg",children:[M,F]}),e[50]=M,e[51]=F,e[52]=z):z=e[52];let U;e[53]!==f||e[54]!==E||e[55]!==z?(U=s.jsx(pt,{open:f,onOpenChange:E,children:z}),e[53]=f,e[54]=E,e[55]=z,e[56]=U):U=e[56];let k;return e[57]!==K||e[58]!==U?(k=s.jsxs(s.Fragment,{children:[K,U]}),e[57]=K,e[58]=U,e[59]=k):k=e[59],k}function Zs(){Re.error("Não foi possível desconectar. Tente novamente.")}const Ve={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."},github:{registryAppId:"deco/mcp-github",area:"Engenharia",headline:"A saúde da entrega de código por trás da sua loja."}};function Xs(o){const e=H.c(40),{selfClient:t,org:n,cdConnectionId:i,siteUrl:a}=o;let l;e[0]!==i||e[1]!==n.id||e[2]!==n.slug?(l={connectionId:i,orgId:n.id,orgSlug:n.slug},e[0]=i,e[1]=n.id,e[2]=n.slug,e[3]=l):l=e[3];const c=ze(l);let u;e[4]!==i||e[5]!==n.id?(u=Y.commerceDiscoveryCompanionSchema(n.id,i),e[4]=i,e[5]=n.id,e[6]=u):u=e[6];let p;e[7]!==c?(p=async()=>{const A=await c.callTool({name:"MCP_CONFIGURATION",arguments:{}});return J(A)},e[7]=c,e[8]=p):p=e[8];let r;e[9]!==u||e[10]!==p?(r={queryKey:u,queryFn:p,retry:!1},e[9]=u,e[10]=p,e[11]=r):r=e[11];const f=me(r),m=f.data?.stateSchema?Bt(f.data.stateSchema):null,h=m&&m.length>0?m:Wt,_=h.map(cn),C=h.map(ln).filter(rn),g=h.filter(an).map(on),d=[...C,...g].sort().join(",");let y;e[12]!==i||e[13]!==n.id?(y=Y.commerceDiscoveryConnection(n.id,i),e[12]=i,e[13]=n.id,e[14]=y):y=e[14];let v;e[15]!==i||e[16]!==t?(v=async()=>{const A=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return J(A)},e[15]=i,e[16]=t,e[17]=v):v=e[17];let x;e[18]!==y||e[19]!==v?(x={queryKey:y,queryFn:v},e[18]=y,e[19]=v,e[20]=x):x=e[20];const S=Pe(x).data?.item?.configuration_state??null;let j;e[21]!==S?(j=A=>S?.[A.fieldKey]?.value,e[21]=S,e[22]=j):j=e[22];const b=h.map(j).filter(nn),N=[..._.map(sn),...C.map(tn),...b.map(en)].sort().join(","),R=Pe({queryKey:Y.commerceDiscoveryCompanionConnections(n.id,N),queryFn:async()=>{if(h.length===0)return{items:[]};const A=[{field:["app_name"],operator:"in",value:_},{field:["app_id"],operator:"in",value:C}];b.length>0&&A.push({field:["id"],operator:"in",value:b});const te=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:A},limit:1e3}});return J(te)}}).data?.items??[],w=new Set(b),T=R.filter(A=>w.has(A.id)),L=T.filter(Js);let P;e[23]!==n.id||e[24]!==n.slug?(P=A=>({queryKey:Y.commerceDiscoveryCompanionOAuthStatus(n.id,A.id),queryFn:async()=>{try{const te=await fetch(`/api/${encodeURIComponent(n.slug)}/connections/${encodeURIComponent(A.id)}/oauth-token/status`,{credentials:"include"});return te.ok?{hasToken:(await te.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=n.id,e[24]=n.slug,e[25]=P):P=e[25];const K=ms({queries:L.map(P)});let $;e[26]!==K?($=(A,te)=>[A.id,K[te]?.data?.hasToken===!0],e[26]=K,e[27]=$):$=e[27];const q=new Map(L.map($)),M={};for(const A of T)M[A.id]=!A.oauth_config||!!A.connection_token||q.get(A.id)===!0;const D=Pe({queryKey:Y.commerceDiscoveryCompanionRegistry(n.id,d),queryFn:async()=>{if(h.length===0)return{items:[]};const A=Yt(C,g),te=await as(ct.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...A?{where:A}:{},limit:1e3});return J(te)}}),F={},z={};for(const A of D.data?.items??[])F[A.id]=A,A.server?.name&&(z[A.server.name]=A);let U;e[28]!==n.id||e[29]!==a?(U=Y.commerceDiscoveryConnectionStatus(n.id,a??""),e[28]=n.id,e[29]=a,e[30]=U):U=e[30];const k=!!a;let I;e[31]!==t||e[32]!==a?(I=async()=>{const A=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:a}});return J(A)},e[31]=t,e[32]=a,e[33]=I):I=e[33];let G;e[34]!==U||e[35]!==k||e[36]!==I?(G={queryKey:U,enabled:k,queryFn:I},e[34]=U,e[35]=k,e[36]=I,e[37]=G):G=e[37];const Z=me(G),X={};for(const[A,te]of Object.entries(Ct)){const ne=Z.data?.providers?.[te];ne?.connected&&ne.via==="sa"&&(X[A]={resource:ne.resource??null})}const ee=Zt({requirements:h,itemsById:F,itemsByName:z,connections:R,connectionReadiness:M,configurationState:S,curated:Ve,saBindings:X});let V;return e[38]!==ee?(V={cards:ee},e[38]=ee,e[39]=V):V=e[39],V}function Js(o){return o.oauth_config&&!o.connection_token}function en(o){return`linked:${o}`}function tn(o){return`app:${o}`}function sn(o){return`binding:${o}`}function nn(o){return typeof o=="string"&&o.length>0}function on(o){return o.bindingType}function an(o){return!Ve[o.bindingType]}function rn(o){return!!o}function ln(o){return Ve[o.bindingType]?.registryAppId}function cn(o){return o.bindingType}function dn({selfClient:o,org:e,userId:t,cdConnectionId:n,domain:i,siteUrl:a}){const l=he(),[c,u]=Q.useState(null),[p,r]=Q.useState(null),[f,m]=Q.useState(null),h=async(g,d)=>{const y=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:g,data:d}});return J(y)};async function _(g){u(g.fieldKey),m(null);const d={app_name:g.title,field_key:g.fieldKey,organization_id:e.id,domain:i,site_url:a};oe("commerce_onboarding_companion_connect_clicked",d);try{let y=g.candidateConnectionId;if(!y){const b=rs(g.registryItem,e.id,t,{remoteIndex:0}),N=b.connection_type==="STDIO",O=!!b.connection_url,R=N&&b.connection_headers&&typeof b.connection_headers=="object"&&"command"in b.connection_headers;if(!O&&!R)return oe("commerce_onboarding_companion_connect_failed",{...d,error:"no_connection_method"}),m(`${g.title} cannot be connected: no connection method available`),!1;const w=await o.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:b}});y=J(w).item.id}const v=y,x=await ls({connectionId:v,orgId:e.id,orgSlug:e.slug,persistFallback:b=>h(v,{connection_token:b}).then(()=>{})});if(!x.ok)return oe("commerce_onboarding_companion_connect_failed",{...d,error:x.error}),m(`Couldn't sign in to ${g.title}: ${x.error}`),!1;const E=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),S=J(E).item?.configuration_state??null,j=Xt(S,g.fieldKey,g.bindingType,v);return g.bindingType==="github"&&delete j.github_repo,await h(n,{configuration_state:j}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(e.id,n)}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),oe("commerce_onboarding_companion_connected",d),!0}catch(y){return oe("commerce_onboarding_companion_connect_failed",{...d,error:y instanceof Error?y.message:String(y)}),m(y instanceof Error?y.message:String(y)),!1}finally{u(null)}}async function C(g){r(g.fieldKey),m(null);const d={app_name:g.title,field_key:g.fieldKey,organization_id:e.id,domain:i,site_url:a};oe("commerce_onboarding_companion_disconnect_clicked",d);try{const y=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),x={...J(y).item?.configuration_state??null??{}};return delete x[g.fieldKey],g.bindingType==="github"&&delete x.github_repo,await h(n,{configuration_state:x}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(e.id,n)}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),oe("commerce_onboarding_companion_disconnected",d),!0}catch(y){return oe("commerce_onboarding_companion_disconnect_failed",{...d,error:y instanceof Error?y.message:String(y)}),m(y instanceof Error?y.message:String(y)),!1}finally{r(null)}}return{connect:_,connectingFieldKey:c,disconnect:C,disconnectingFieldKey:p,error:f}}const Be="flex min-h-0 flex-1 flex-col gap-4 md:grid md:flex-none md:gap-4";function We(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h1",{className:"text-lg font-medium leading-6 text-foreground lg:text-2xl lg:leading-8",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),o[0]=e):e=o[0],e}function un(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(mn)}),o[0]=e):e=o[0],e}function mn(o){return s.jsx(Gs,{},o)}function fn(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:Be,children:[s.jsx(We,{}),s.jsx(un,{})]}),o[0]=e):e=o[0],e}function pn(o){const e=H.c(5),{onRetry:t}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(We,{}),e[0]=n):n=e[0];let i,a;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),a=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=a):(i=e[1],a=e[2]);let l;return e[3]!==t?(l=s.jsxs("div",{className:Be,children:[n,s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,a,s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=l):l=e[4],l}function Vn(o){const e=H.c(2);let t;return e[0]!==o?(t=s.jsx(zt,{children:n=>{const{reset:i}=n;return s.jsx(qt,{fallback:a=>{const{resetError:l}=a;return s.jsx(pn,{onRetry:()=>{i(),l()}})},children:s.jsx(Q.Suspense,{fallback:s.jsx(fn,{}),children:s.jsx(hn,{...o})})})}}),e[0]=o,e[1]=t):t=e[1],t}function hn(o){const e=H.c(46),{org:t,cdConnectionId:n,siteUrl:i,onReadinessChange:a}=o,{data:l}=Ft.useSession(),c=l?.user?.id??"";let u;if(e[0]!==i){const R=i?Te(i):null;if(R?.ok)try{u=new URL(R.value).hostname}catch{u=void 0}e[0]=i,e[1]=u}else u=e[1];let p;e[2]!==t.id||e[3]!==t.slug?(p={connectionId:Ut,orgId:t.id,orgSlug:t.slug},e[2]=t.id,e[3]=t.slug,e[4]=p):p=e[4];const r=ze(p);let f;e[5]!==n||e[6]!==t||e[7]!==r||e[8]!==i?(f={selfClient:r,org:t,cdConnectionId:n,siteUrl:i},e[5]=n,e[6]=t,e[7]=r,e[8]=i,e[9]=f):f=e[9];const{cards:m}=Xs(f);let h;e[10]!==n||e[11]!==t||e[12]!==r||e[13]!==u||e[14]!==i||e[15]!==c?(h={selfClient:r,org:t,userId:c,cdConnectionId:n,domain:u,siteUrl:i},e[10]=n,e[11]=t,e[12]=r,e[13]=u,e[14]=i,e[15]=c,e[16]=h):h=e[16];const{connect:_,connectingFieldKey:C,disconnect:g,disconnectingFieldKey:d,error:y}=dn(h),[v,x]=Q.useState(null);if(a?.(m.length===0||m.some(gn)),m.length===0)return null;const E=C!==null||d!==null;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(We,{}),e[17]=S):S=e[17];let j;e[18]!==y?(j=y&&s.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:y}),e[18]=y,e[19]=j):j=e[19];let b;if(e[20]!==v||e[21]!==E||e[22]!==m||e[23]!==_||e[24]!==C||e[25]!==g||e[26]!==d||e[27]!==t||e[28]!==r||e[29]!==i){let R;e[31]!==v||e[32]!==E||e[33]!==_||e[34]!==C||e[35]!==g||e[36]!==d||e[37]!==t||e[38]!==r||e[39]!==i?(R=w=>{const T=async()=>{await _(w)&&x(w.fieldKey)};return s.jsx(Vs,{card:w,connecting:C===w.fieldKey,disconnecting:d===w.fieldKey,disabled:E&&C!==w.fieldKey&&d!==w.fieldKey,org:t,selfClient:r,siteUrl:i,autoOpenConfigFieldKey:v,onAutoOpenConfigHandled:()=>x(L=>L===w.fieldKey?null:L),onConnect:()=>{T()},onDisconnect:()=>{g(w)}},w.fieldKey)},e[31]=v,e[32]=E,e[33]=_,e[34]=C,e[35]=g,e[36]=d,e[37]=t,e[38]=r,e[39]=i,e[40]=R):R=e[40],b=m.map(R),e[20]=v,e[21]=E,e[22]=m,e[23]=_,e[24]=C,e[25]=g,e[26]=d,e[27]=t,e[28]=r,e[29]=i,e[30]=b}else b=e[30];let N;e[41]!==b?(N=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:b}),e[41]=b,e[42]=N):N=e[42];let O;return e[43]!==j||e[44]!==N?(O=s.jsxs("div",{className:Be,children:[S,s.jsxs(xs,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[min(60vh,calc(100dvh-330px))] md:flex-none",children:[j,N]})]}),e[43]=j,e[44]=N,e[45]=O):O=e[45],O}function gn(o){return o.satisfied}const Ye="https://decocms.com/agendar",xn="Precisa de ajuda? Fale conosco",yn="Agende uma chamada e ajudamos você a conectar suas ferramentas.",ye=[{photo:"https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png",alt:"Especialista da deco"}],bn="var(--brand-green-dark)";function Bn({siteUrl:o,email:e}){const t=new URL(Ye);return o&&t.searchParams.set("siteUrl",o),e&&t.searchParams.set("email",e),t.toString()}function Cn(o){const e=H.c(12),{href:t,size:n,className:i,orgId:a}=o,l=t===void 0?Ye:t,c=n===void 0?"lg":n;let u;e[0]!==i?(u=ie("w-full",i),e[0]=i,e[1]=u):u=e[1];let p;e[2]!==a?(p=()=>oe("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:a}),e[2]=a,e[3]=p):p=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(bt,{size:16}),e[4]=r):r=e[4];let f;e[5]!==l||e[6]!==p?(f=s.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",onClick:p,children:["Agendar uma reunião",r]}),e[5]=l,e[6]=p,e[7]=f):f=e[7];let m;return e[8]!==c||e[9]!==u||e[10]!==f?(m=s.jsx(B,{asChild:!0,variant:"outline",size:c,className:u,children:f}),e[8]=c,e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function vn(o){const e=H.c(10),{size:t}=o,n=t===void 0?72:t;let i;e[0]!==n?(i=Math.round(n*.3),e[0]=n,e[1]=i):i=e[1];const a=i;let l;e[2]!==n?(l={height:n},e[2]=n,e[3]=l):l=e[3];let c;e[4]!==a||e[5]!==n?(c=ye.map((p,r)=>s.jsxs("div",{className:"relative shrink-0",style:{width:n,height:n,marginLeft:r===0?0:-a,zIndex:ye.length-r},children:[s.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:s.jsx("img",{src:p.photo,alt:p.alt,className:"h-full w-full object-cover",loading:"lazy"})}),r===0&&s.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),s.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},p.photo)),e[4]=a,e[5]=n,e[6]=c):c=e[6];let u;return e[7]!==l||e[8]!==c?(u=s.jsx("div",{className:"flex items-end",style:l,children:c}),e[7]=l,e[8]=c,e[9]=u):u=e[9],u}function Wn(o){const e=H.c(6),{href:t,orgId:n}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-20",style:{backgroundColor:bn}}),e[0]=i):i=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"-mt-9 mb-4",children:s.jsx(vn,{})}),e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:xn}),s.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:yn})]}),e[2]=l):l=e[2];let c;return e[3]!==t||e[4]!==n?(c=s.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:s.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,s.jsxs("div",{className:"px-8 pb-8",children:[a,l,s.jsx(Cn,{href:t,size:"lg",className:"mt-6",orgId:n})]})]})}),e[3]=t,e[4]=n,e[5]=c):c=e[5],c}function Yn(o){const e=H.c(13),{className:t,href:n,orgId:i}=o,a=n===void 0?Ye:n;let l;e[0]!==i?(l=()=>oe("commerce_onboarding_meeting_cta_clicked",{placement:"mobile_banner",organization_id:i}),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==t?(c=ie("flex items-center gap-3 rounded-xl border border-border bg-card p-3 card-shadow transition-colors hover:bg-accent",t),e[2]=t,e[3]=c):c=e[3];let u,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={height:32,width:32+2*Math.round(22.4)},p=ye.map(jn),e[4]=u,e[5]=p):(u=e[4],p=e[5]);let r,f,m;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"relative flex shrink-0 items-center",style:u,children:[p,s.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full border-2 border-card bg-success","aria-hidden":!0,style:{zIndex:ye.length+1}})]}),f=s.jsx("span",{className:"flex-1 text-sm font-medium leading-tight text-foreground",children:"Precisa de ajuda? Fale conosco"}),m=s.jsx(bt,{size:16,className:"shrink-0 text-muted-foreground"}),e[6]=r,e[7]=f,e[8]=m):(r=e[6],f=e[7],m=e[8]);let h;return e[9]!==a||e[10]!==l||e[11]!==c?(h=s.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",onClick:l,className:c,children:[r,f,m]}),e[9]=a,e[10]=l,e[11]=c,e[12]=h):h=e[12],h}function jn(o,e){return s.jsx("span",{className:"absolute block h-8 w-8 overflow-hidden rounded-full border-2 border-card",style:{left:e*Math.round(22.4),zIndex:ye.length-e},children:s.jsx("img",{src:o.photo,alt:o.alt,className:"h-full w-full object-cover",loading:"lazy"})},o.photo)}function Zn(o){const e=H.c(10),{host:t}=o,n=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let i,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=a,e[2]=l):(i=e[0],a=e[1],l=e[2]);let c;e[3]!==n?(c=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=c):c=e[4];let u;e[5]!==t?(u=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=u):u=e[6];let p;return e[7]!==c||e[8]!==u?(p=s.jsxs("div",{className:"flex items-center gap-3",children:[i,a,l,c,u]}),e[7]=c,e[8]=u,e[9]=p):p=e[9],p}function _n(o){return o.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function Xn(o){const e=o;if(e.isError)throw new Error(_n(e));return e.structuredContent??o}export{fn as C,He as L,Zn as S,xs as a,Bn as b,Wn as c,Vn as d,Yn as e,Gn as i,Te as n,Xn as p,Hn as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as T,j as t,r as J,B as je,i as be}from"./index-DZ3hzzf1.js";import{i as Se}from"./ChevronRight-BUKoQxxN.js";import{Y as fe}from"./agent-icon-CGx0_9l5.js";import{m as ue}from"./automation-runs-BGZr5t8h.js";import{r as Ne,u as ke,a as _e,b as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-Y0TGppB0.js";import{Z as xe,r as ze}from"./index-Qi63FtON.js";import{a as ge}from"./Image01-CSEqtjAN.js";import"./AlertCircle-fklrqSW5.js";import"./Tool01-CcxbpsdM.js";import"./ArrowUp-Bdy-0gyO.js";import"./Settings02-D2iJ0Y_1.js";import"./Tool02-O3edpLSO.js";import"./XCircle-Do7Zx-eD.js";import"./ArrowUpRight-D6zDsrnH.js";import"./TrendUp01-dtZF5xAg.js";import"./ZapSquare-DVSX_PUJ.js";import"./ZoomOut-DAawwf0t.js";import"./Users03-BK-DRA0O.js";import"./CheckCircle-BYkf45lM.js";import"./ChevronUp-mvRqss9i.js";import"./ChevronDown-sgVULpdb.js";import"./DotsVertical-DitrZ6w4.js";import"./Stars02-B6BvIKTN.js";import"./Copy01-DLSxZiKr.js";import"./Globe01-CnltMSDk.js";import"./Eye-DR1QNYLF.js";import"./FilterLines-Y38x0Q7Z.js";import"./Star01-nXpwaO4U.js";import"./Globe04-X5sxJeUb.js";import"./SwitchHorizontal01-D4cMfdK_.js";import"./HardDrive-Nu1jIe4l.js";import"./Key01-Dh4DUQLF.js";import"./LayoutLeft-Dt7rJY-r.js";import"./LinkExternal01-CKHslpvH.js";import"./Monitor01-r0C7odur.js";import"./Sun-DECbKLB_.js";import"./Package-3dsm96jG.js";import"./Palette-DAx6eGU_.js";import"./Play-CJE2nK0g.js";import"./Plus-BwYAFd19.js";import"./SearchLg-Ci76gxPe.js";import"./SearchMd-C4E_z5AK.js";import"./Shield01-D52f0rB7.js";import"./Stars01-DZkGi0yh.js";import"./Trash01-Cwer5u_n.js";import"./Upload01-C1yFspcl.js";import"./User01-DFGTsbFQ.js";import"./Users01-oR_WIF7g.js";import"./XClose-C9Ve9LT-.js";import"./X-JhcLrxaK.js";import"./Zap-BsJbp079.js";import"./select-BesvP7cx.js";import"./tooltip-BLkLB4r7.js";import"./useInfiniteQuery-D1UM76v9.js";import"./use-infinite-scroll-BQFpclfv.js";import"./use-connection-sIYGQRZw.js";import"./use-collections-CfZhiJR7.js";import"./use-mcp-client-BIXuHEwh.js";import"./constants-BHDe7bIw.js";import"./auth-CKKxsAQR.js";import"./use-virtual-mcp-BLx5NqtM.js";import"./card-dggHqb7D.js";import"./sidebar-Cc4XVWKB.js";import"./use-mobile-C0TUGCBw.js";import"./table-BpC3o1Ua.js";import"./empty-state-CiSz3At1.js";import"./use-members-CLdfd0HT.js";import"./use-org-auth-client-D0LQ152W.js";import"./use-clock-tick-DJOVC-Ea.js";import"./use-automations-fFC4EQc3.js";import"./studio-tools-B4JofgO_.js";import"./useSuspenseInfiniteQuery-8ID1agn2.js";import"./avatar-BlYuWW7J.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DK3qaoqd.js";import"./file-type-icon-C4zp7G8m.js";import"./dialog-Dy1IRNfn.js";import"./tab-id-BijBBRwE.js";import"./hooks-y59N0gpi.js";import"./decopilot-sse-pool-v3bamRu-.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-CEf5YFvv.js";import"./autosend-Bm2lFqoD.js";import"./use-ai-providers-BRga8_lW.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-D8o2yOzI.js";import"./use-organization-settings-C_QN8e5A.js";import"./monaco-editor-Dxhxh5om.js";import"./index-DPfxLsOi.js";import"./index-BiYdGYPy.js";import"./calendar-Do7G6Kxp.js";import"./shell-layout-G6cWtPZY.js";import"./required-auth-layout-CjAMzDiv.js";import"./use-org-sso-CjKp2EUT.js";import"./integration-icon-BRokQ8N8.js";import"./use-navigate-to-agent-CPivegDO.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BdmhsxSM.js";import"./form-BuzHPVCM.js";import"./label-BlLucFOT.js";import"./input-CK7GAn-2.js";import"./switch-BZYENsAO.js";import"./drawer-C_exNDXZ.js";import"./collection-search-BisIJu80.js";import"./index-DD4eXCXL.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-J1vnPNS0.js";import"./use-mcp-tools-CNPoXDXJ.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-BL10FIRd.js";import"./mcp-oauth-DZFKw2wh.js";import"./extract-connection-data-DQK5y-ef.js";import"./dropdown-menu-DnbYxaX3.js";import"./popover-BIkriKI7.js";import"./command-DsH5vUBI.js";import"./index-B_7Q0rH0.js";import"./tabs-DAIg04aD.js";import"./toggle-group-Djz-ljio.js";import"./use-deco-credits-8-3yjWlK.js";import"./connection-card-C-QD5wMH.js";import"./use-registry-connections-701IXXum.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DtLXmNNW.js";import"./connection-form-helpers-DaqwWAk0.js";import"./collection-tabs-DFm981Kf.js";import"./badge-BsoTUFnu.js";import"./connect-desktop-dialog-BR3Yayc6.js";import"./select-model-1OjsUmRd.js";import"./checkbox-CvJb_88Z.js";import"./skeleton-YVFIgHQg.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CDAkS7s3.js";import"./index-B5G64KtU.js";import"./alert-dialog-CFnkTG10.js";import"./toolbar-DuuVbShQ.js";import"./use-debounced-value-B2z6I7X3.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C9YypyXn.js";import"./use-capability-BSDyr6zM.js";import"./toolbar-icon-button-DBJ1Czuj.js";import"./use-debounced-autosave-DejInOR3.js";import"./index-BoBOH_Zc.js";import"./search-input-D20m0IjW.js";import"./use-mcp-auth-status-Bm5xkgD0.js";import"./github-repo-picker-xBH3tHfN.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-BNrIMIKw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DqYVV5IY.js";import"./use-file-configs-Cxw_imQw.js";import"./automation-list-row-DTtDcco-.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Q="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Q;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let b;return e[23]!==u||e[24]!==y||e[25]!==g?(b=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=b):b=e[26],b}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Q;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Q;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Q;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const b=i.description??ee;let _;e[17]!==y||e[18]!==b?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:b}),e[17]=y,e[18]=b,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let S;e[24]!==i.image?(S=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=S):S=e[25];let k;e[26]!==N||e[27]!==S||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,S]}),e[26]=N,e[27]=S,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Ai(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=J.useState(f),[j,v]=J.useState(null),[y,b]=J.useState(0),[_,N]=J.useState(void 0);x!==f&&(u(f),v(null),N(void 0),b(Me));const{persistSeo:S,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,Y;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},Y=o.kind==="page"?Ge(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=Y):(R=e[6],Y=e[7]);const ie=Y;let G;e[8]!==S||e[9]!==c||e[10]!==v?(G=E=>{if(!c)return;const de=E;v(de),S(de)},e[8]=S,e[9]=c,e[10]=v,e[11]=G):G=e[11];const se=G;let V;e[12]!==v?(V=()=>v(null),e[12]=v,e[13]=V):V=e[13];const le=V;let H;e[14]!==b?(H=()=>b(Ke),e[14]=b,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ye(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",Z=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(Se,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(be,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==S||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==Z||e[57]!==me||e[58]!==R?(A=!c||!Z&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:Z?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),S(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=S,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=Z,e[57]=me,e[58]=R,e[59]=A):A=e[59];let q;return e[60]!==I||e[61]!==A?(q=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=q):q=e[62],q}function Ke(n){return n+1}function Me(n){return n+1}function Ye(n,e){try{return new URL(n,e).href}catch{return e}}function Ge(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Ai as SeoEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,d as ee,j as s,B as O,bU as H,t as B,w as be,a as J,s as Ce,v as we,K as se,bV as Te,bW as Ee,D as Y,r as P,m as te,bX as $e,bY as Le,b as Ie,C as ze,e as xe,u as Me,R as Pe,aZ as Fe,bZ as Re,b_ as me,b$ as De,c0 as qe,S as Ue,O as Ge,c1 as Ke}from"./index-DZ3hzzf1.js";import{A as oe}from"./avatar-BlYuWW7J.js";import{t as Se,a as He}from"./Users03-BK-DRA0O.js";import{i as Be}from"./SearchLg-Ci76gxPe.js";import{i as Ye,s as Je,a as I,n as We}from"./Stars02-B6BvIKTN.js";import{s as Ve}from"./XClose-C9Ve9LT-.js";import{i as M}from"./CheckCircle-BYkf45lM.js";import{i as fe}from"./FilterLines-Y38x0Q7Z.js";import{i as K}from"./Zap-BsJbp079.js";import{d as Qe,D as Xe,a as Ze,e as et}from"./dialog-Dy1IRNfn.js";import{R as tt}from"./required-auth-layout-CjAMzDiv.js";import{A as nt}from"./autosend-Bm2lFqoD.js";import{m as st}from"./use-mcp-client-BIXuHEwh.js";import{a as he,S as ot}from"./constants-BHDe7bIw.js";import{d as it,c as at}from"./hooks-y59N0gpi.js";import{q as rt}from"./tab-id-BijBBRwE.js";import{e as lt}from"./use-organization-settings-C_QN8e5A.js";import{u as ct}from"./use-org-sso-CjKp2EUT.js";function dt(t){const e=k.c(27),{orgName:n,orgSlug:o,orgLogo:i,domain:r}=t;let a;e[0]!==o?(a={mutationFn:async()=>{const S=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),j=await S.json();if(!S.ok||!j.success)throw new Error(j.error??"Failed to join organization");return j},onSuccess:S=>{window.location.href=`/${S.slug??o}`},onError:mt},e[0]=o,e[1]=a):a=e[1];const l=ee(a),c=ut;let d;e[2]!==i||e[3]!==n?(d=i?s.jsx(oe,{url:i,fallback:n.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(Se,{className:"h-6 w-6 text-primary"})}),e[2]=i,e[3]=n,e[4]=d):d=e[4];let u;e[5]!==n?(u=s.jsxs("h3",{className:"text-lg font-medium",children:["Join ",n,"?"]}),e[5]=n,e[6]=u):u=e[6];let f;e[7]!==r?(f=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Anyone with an ",s.jsxs("strong",{children:["@",r]})," email can join this organization."]}),e[7]=r,e[8]=f):f=e[8];let h;e[9]!==u||e[10]!==f?(h=s.jsxs("div",{className:"space-y-2",children:[u,f]}),e[9]=u,e[10]=f,e[11]=h):h=e[11];let p;e[12]!==l?(p=()=>l.mutate(),e[12]=l,e[13]=p):p=e[13];const m=l.isPending?"Joining…":`Enter ${n}`;let g;e[14]!==l.isPending||e[15]!==p||e[16]!==m?(g=s.jsx(O,{onClick:p,disabled:l.isPending,children:m}),e[14]=l.isPending,e[15]=p,e[16]=m,e[17]=g):g=e[17];let y;e[18]!==l.isPending?(y=s.jsx(O,{variant:"ghost",onClick:c,disabled:l.isPending,children:"Go to home"}),e[18]=l.isPending,e[19]=y):y=e[19];let x;e[20]!==g||e[21]!==y?(x=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[g,y]}),e[20]=g,e[21]=y,e[22]=x):x=e[22];let w;return e[23]!==x||e[24]!==d||e[25]!==h?(w=s.jsxs(H,{children:[d,h,x]}),e[23]=x,e[24]=d,e[25]=h,e[26]=w):w=e[26],w}function ut(){window.location.href="/"}function mt(t){B.error(t instanceof Error?t.message:"Failed to join organization")}function ge(t){const e=k.c(17),{orgSlug:n,orgName:o,reason:i}=t,r=ft,a=i==="not-found",l=a?Be:be,c=a?"Organization not found":"No access";let d;e[0]!==a||e[1]!==o||e[2]!==n?(d=a?s.jsxs(s.Fragment,{children:["We couldn't find an organization called ",s.jsx("strong",{children:n}),"."]}):s.jsxs(s.Fragment,{children:["You don't have access to ",s.jsx("strong",{children:o??n}),".",s.jsx("br",{}),"Ask an admin to invite you."]}),e[0]=a,e[1]=o,e[2]=n,e[3]=d):d=e[3];const u=d;let f;e[4]!==l?(f=s.jsx("div",{className:"bg-muted p-3 rounded-full",children:s.jsx(l,{className:"h-6 w-6 text-muted-foreground"})}),e[4]=l,e[5]=f):f=e[5];let h;e[6]!==c?(h=s.jsx("h3",{className:"text-lg font-medium",children:c}),e[6]=c,e[7]=h):h=e[7];let p;e[8]!==u?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:u}),e[8]=u,e[9]=p):p=e[9];let m;e[10]!==h||e[11]!==p?(m=s.jsxs("div",{className:"space-y-2",children:[h,p]}),e[10]=h,e[11]=p,e[12]=m):m=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(O,{onClick:r,children:"Go to home"}),e[13]=g):g=e[13];let y;return e[14]!==f||e[15]!==m?(y=s.jsxs(H,{children:[f,m,g]}),e[14]=f,e[15]=m,e[16]=y):y=e[16],y}function ft(){window.location.href="/"}function ht(t){const e=k.c(39),{invitationId:n,orgName:o,orgSlug:i,orgLogo:r}=t;let a;e[0]!==n?(a=async()=>{const _=await J.organization.acceptInvitation({invitationId:n});if(_.error)throw new Error(_.error.message);return _.data},e[0]=n,e[1]=a):a=e[1];let l;e[2]!==i?(l=()=>{Ce(),window.location.href=`/${i}`},e[2]=i,e[3]=l):l=e[3];let c;e[4]!==a||e[5]!==l?(c={mutationFn:a,onSuccess:l,onError:yt},e[4]=a,e[5]=l,e[6]=c):c=e[6];const d=ee(c);let u;e[7]!==n?(u=async()=>{const _=await J.organization.rejectInvitation({invitationId:n});if(_.error)throw new Error(_.error.message);return _.data},e[7]=n,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=pt,e[9]=f):f=e[9];let h;e[10]!==u?(h={mutationFn:u,onSuccess:f,onError:gt},e[10]=u,e[11]=h):h=e[11];const p=ee(h),m=d.isPending||p.isPending;let g;e[12]!==r||e[13]!==o?(g=r?s.jsx(oe,{url:r,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(Ye,{className:"h-6 w-6 text-primary"})}),e[12]=r,e[13]=o,e[14]=g):g=e[14];let y;e[15]!==o?(y=s.jsxs("h3",{className:"text-lg font-medium",children:["You've been invited to ",s.jsx("strong",{children:o})]}),e[15]=o,e[16]=y):y=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("p",{className:"text-sm text-muted-foreground",children:"Accept the invitation to join this organization."}),e[17]=x):x=e[17];let w;e[18]!==y?(w=s.jsxs("div",{className:"space-y-2",children:[y,x]}),e[18]=y,e[19]=w):w=e[19];let S;e[20]!==d?(S=()=>d.mutate(),e[20]=d,e[21]=S):S=e[21];const j=d.isPending?"Accepting…":"Accept invitation";let N;e[22]!==m||e[23]!==S||e[24]!==j?(N=s.jsx(O,{onClick:S,disabled:m,children:j}),e[22]=m,e[23]=S,e[24]=j,e[25]=N):N=e[25];let T;e[26]!==p?(T=()=>p.mutate(),e[26]=p,e[27]=T):T=e[27];const $=p.isPending?"Declining…":"Decline";let b;e[28]!==m||e[29]!==T||e[30]!==$?(b=s.jsx(O,{variant:"ghost",onClick:T,disabled:m,children:$}),e[28]=m,e[29]=T,e[30]=$,e[31]=b):b=e[31];let E;e[32]!==N||e[33]!==b?(E=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[N,b]}),e[32]=N,e[33]=b,e[34]=E):E=e[34];let L;return e[35]!==w||e[36]!==E||e[37]!==g?(L=s.jsxs(H,{children:[g,w,E]}),e[35]=w,e[36]=E,e[37]=g,e[38]=L):L=e[38],L}function gt(t){B.error(t instanceof Error?t.message:"Failed to decline invitation")}function pt(){B.success("Invitation declined"),window.location.href="/"}function yt(t){B.error(t instanceof Error?t.message:"Failed to accept invitation")}function bt(t){const e=k.c(10),{orgName:n,orgLogo:o}=t;let i;e[0]!==o||e[1]!==n?(i=o?s.jsx(oe,{url:o,fallback:n.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(Je,{className:"h-6 w-6 text-primary"})}),e[0]=o,e[1]=n,e[2]=i):i=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("h3",{className:"text-lg font-medium",children:"Request pending"}),e[3]=r):r=e[3];let a;e[4]!==n?(a=s.jsxs("div",{className:"space-y-2",children:[r,s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your request to join ",s.jsx("strong",{children:n})," is waiting for an admin to approve it. You'll get access once it's approved."]})]}),e[4]=n,e[5]=a):a=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(O,{variant:"ghost",onClick:wt,children:"Go to home"}),e[6]=l):l=e[6];let c;return e[7]!==i||e[8]!==a?(c=s.jsxs(H,{children:[i,a,l]}),e[7]=i,e[8]=a,e[9]=c):c=e[9],c}function wt(){window.location.href="/"}function xt(t){const e=k.c(30),{orgName:n,orgSlug:o,orgLogo:i,domain:r}=t;let a;e[0]!==o?(a=async()=>{const j=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),N=await j.json();if(!j.ok||!N.success)throw new Error(N.error??"Failed to request access");return N},e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=jt,e[2]=l):l=e[2];let c;e[3]!==a?(c={mutationFn:a,onSuccess:l,onError:vt},e[3]=a,e[4]=c):c=e[4];const d=ee(c);let u;e[5]!==i||e[6]!==n?(u=i?s.jsx(oe,{url:i,fallback:n.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(Se,{className:"h-6 w-6 text-primary"})}),e[5]=i,e[6]=n,e[7]=u):u=e[7];let f;e[8]!==n?(f=s.jsxs("h3",{className:"text-lg font-medium",children:["Request to join ",n,"?"]}),e[8]=n,e[9]=f):f=e[9];let h;e[10]!==r?(h=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["An admin must approve requests from ",s.jsxs("strong",{children:["@",r]})," emails before you can join."]}),e[10]=r,e[11]=h):h=e[11];let p;e[12]!==f||e[13]!==h?(p=s.jsxs("div",{className:"space-y-2",children:[f,h]}),e[12]=f,e[13]=h,e[14]=p):p=e[14];let m;e[15]!==d?(m=()=>d.mutate(),e[15]=d,e[16]=m):m=e[16];const g=d.isPending?"Requesting…":"Request to join";let y;e[17]!==d.isPending||e[18]!==m||e[19]!==g?(y=s.jsx(O,{onClick:m,disabled:d.isPending,children:g}),e[17]=d.isPending,e[18]=m,e[19]=g,e[20]=y):y=e[20];let x;e[21]!==d.isPending?(x=s.jsx(O,{variant:"ghost",onClick:St,disabled:d.isPending,children:"Go to home"}),e[21]=d.isPending,e[22]=x):x=e[22];let w;e[23]!==y||e[24]!==x?(w=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[y,x]}),e[23]=y,e[24]=x,e[25]=w):w=e[25];let S;return e[26]!==w||e[27]!==u||e[28]!==p?(S=s.jsxs(H,{children:[u,p,w]}),e[26]=w,e[27]=u,e[28]=p,e[29]=S):S=e[29],S}function St(){window.location.href="/"}function vt(t){B.error(t instanceof Error?t.message:"Failed to request access")}function jt(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function kt(t){const e=k.c(7);let n;e[0]!==t?(n=se.orgAccessStatus(t),e[0]=t,e[1]=n):n=e[1];let o;e[2]!==t?(o=async()=>{const r=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!r.ok)throw new Error(`org-access-status failed (${r.status})`);return await r.json()},e[2]=t,e[3]=o):o=e[3];let i;return e[4]!==n||e[5]!==o?(i={queryKey:n,queryFn:o,refetchOnWindowFocus:!1},e[4]=n,e[5]=o,e[6]=i):i=e[6],we(i)}function Nt({orgSlug:t}){const{data:e}=kt(t);if(e.status!=="member"){Te()?.org===t&&Ee();const n=localStorage.getItem(Y.lastOrgSlug())===t;if(n&&localStorage.removeItem(Y.lastOrgSlug()),n&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?s.jsx(ge,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?s.jsx(ht,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?s.jsx(dt,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?s.jsx(xt,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?s.jsx(bt,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):s.jsx(ge,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function _t(t){const e=k.c(20),{release:n,onCtaClick:o,onLearnMoreClick:i}=t;let r;e[0]!==n.eyebrow?(r=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[0]=n.eyebrow,e[1]=r):r=e[1];let a;e[2]!==n.title?(a=s.jsx("h3",{className:"text-base font-semibold text-foreground",children:n.title}),e[2]=n.title,e[3]=a):a=e[3];let l;e[4]!==r||e[5]!==a?(l=s.jsxs("div",{children:[r,a]}),e[4]=r,e[5]=a,e[6]=l):l=e[6];let c;e[7]!==n.bullets?(c=n.bullets.map(At),e[7]=n.bullets,e[8]=c):c=e[8];let d;e[9]!==c?(d=s.jsx("ul",{className:"flex flex-col gap-3",children:c}),e[9]=c,e[10]=d):d=e[10];let u;e[11]!==o||e[12]!==i||e[13]!==n.cta||e[14]!==n.learnMoreHref?(u=(n.cta||n.learnMoreHref)&&s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[n.learnMoreHref?s.jsx("a",{href:n.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline",children:"Learn More"}):s.jsx("span",{}),n.cta&&s.jsx(O,{asChild:!0,size:"sm",onClick:o,children:s.jsx("a",{href:n.cta.href,children:n.cta.label})})]}),e[11]=o,e[12]=i,e[13]=n.cta,e[14]=n.learnMoreHref,e[15]=u):u=e[15];let f;return e[16]!==l||e[17]!==d||e[18]!==u?(f=s.jsxs("div",{className:"flex flex-col gap-3",children:[l,d,u]}),e[16]=l,e[17]=d,e[18]=u,e[19]=f):f=e[19],f}function At(t,e){return s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx(t.icon,{size:20,className:"text-muted-foreground mt-0.5 shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),s.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const ve=[{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:I,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:M,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:K,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:I,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:M,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:K,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:M,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:I,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:K,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:I,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:M,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:K,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:I,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:M,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:K,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:I,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:fe,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:M,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:He,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:K,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:M,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:I,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:fe,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:I,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:We,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],ne="studio.release-feed.v1",ce=new Set;let F="",R={},de=!1;function Ot(){if(de)return F||"{}";try{return localStorage.getItem(ne)??"{}"}catch{return F||"{}"}}function je(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function pe(){const t=Ot();return t!==F&&(F=t,R=je(t)),R}function Ct(t){ce.add(t);const e=n=>{if(!(n.key!==ne&&n.key!==null)){try{const o=localStorage.getItem(ne)??"{}",r={...je(o),...R};R=r,F=JSON.stringify(r)}catch{}t()}};return window.addEventListener("storage",e),()=>{ce.delete(t),window.removeEventListener("storage",e)}}function Tt(t){R=t,F=JSON.stringify(t);try{localStorage.setItem(ne,F),de=!1}catch{de=!0}ce.forEach(e=>e())}function Et(){const t=k.c(7),e=P.useSyncExternalStore(Ct,pe,pe);let n;t[0]!==e?(n=c=>!!e[c],t[0]=e,t[1]=n):n=t[1];const o=n,i=$t;let r;t[2]!==e?(r=ve.reduce((c,d)=>e[d.id]?c:c+1,0),t[2]=e,t[3]=r):r=t[3];const a=r;let l;return t[4]!==o||t[5]!==a?(l={isSeen:o,markSeen:i,unseenCount:a},t[4]=o,t[5]=a,t[6]=l):l=t[6],l}function $t(t){R[t]||Tt({...R,[t]:{seenAt:new Date().toISOString()}})}const Lt=720*60*60*1e3,It=10080*60*1e3;function zt(t){const[e,n,o]=t.split("-").map(Number);return!e||!n||!o?new Date(t).getTime():new Date(e,n-1,o).getTime()}function Mt(t){const e=ve[0];if(!e)return null;const n=zt(e.date),o=t-n;return o<0||o>Lt?null:e}function Pt(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function Ft(t,e){const n=Pt(t);return n===null?!1:e-n>=It}function Rt(){const t=k.c(22),{data:e}=J.useSession(),{isSeen:n,markSeen:o}=Et();let i,r,a;if(t[0]!==n||t[1]!==e?.user?.createdAt){a=Symbol.for("react.early_return_sentinel");e:{const m=Date.now();if(i=Mt(m),!i){a=null;break e}if(!Ft(e?.user?.createdAt,m)){a=null;break e}r=n(i.id)}t[0]=n,t[1]=e?.user?.createdAt,t[2]=i,t[3]=r,t[4]=a}else i=t[2],r=t[3],a=t[4];if(a!==Symbol.for("react.early_return_sentinel"))return a;if(r)return null;let l;t[5]!==i.id||t[6]!==o?(l=()=>o(i.id),t[5]=i.id,t[6]=o,t[7]=l):l=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ve,{size:14}),t[8]=c):c=t[8];let d;t[9]!==l?(d=s.jsx(O,{size:"icon",variant:"ghost","aria-label":"Dismiss release announcement",className:"absolute right-2 top-2 size-7 text-muted-foreground",onClick:l,children:c}),t[9]=l,t[10]=d):d=t[10];let u,f;t[11]!==i.id||t[12]!==o?(u=()=>o(i.id),f=()=>o(i.id),t[11]=i.id,t[12]=o,t[13]=u,t[14]=f):(u=t[13],f=t[14]);let h;t[15]!==i||t[16]!==u||t[17]!==f?(h=s.jsx(_t,{release:i,onCtaClick:u,onLearnMoreClick:f}),t[15]=i,t[16]=u,t[17]=f,t[18]=h):h=t[18];let p;return t[19]!==d||t[20]!==h?(p=s.jsxs("div",{role:"dialog","aria-label":"Release announcement",className:"fixed bottom-6 right-6 z-50 w-[min(360px,calc(100vw-3rem))] rounded-lg border border-border bg-background p-4 shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[d,h]}),t[19]=d,t[20]=h,t[21]=p):p=t[21],p}const ke=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),z=ke?"⌘":"Ctrl",C={keyboardShortcuts:{keys:[z,"K"],description:"Keyboard shortcuts"},back:{keys:[z,"["],description:"Back to previous"},focusChatInput:{keys:[z,"L"],description:"Focus chat input"},saveAndFormat:{keys:[z,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[z,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[z,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",z,"S"],description:"New task"},toggleDaemon:{keys:[z,"D"],description:"Toggle daemon logs"}},Dt=[{label:"General",shortcuts:[C.keyboardShortcuts,C.back,C.newTask,C.toggleDaemon]},{label:"Editor",shortcuts:[C.saveAndFormat]},{label:"Chat",shortcuts:[C.focusChatInput,C.togglePlanMode,C.sendMessage,C.newLine]},{label:"Questions",shortcuts:[C.selectOption]},{label:"Monitoring",shortcuts:[C.applyFilter]}];function ye(t){return ke?t.metaKey:t.ctrlKey}function qt(t){const e=k.c(5),{open:n,onOpenChange:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Xe,{children:s.jsx(Ze,{children:"Keyboard Shortcuts"})}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Qe,{className:"sm:max-w-md",children:[i,s.jsx("div",{className:"flex flex-col gap-4",children:Dt.map(Ut)})]}),e[1]=r):r=e[1];let a;return e[2]!==o||e[3]!==n?(a=s.jsx(et,{open:n,onOpenChange:o,children:r}),e[2]=o,e[3]=n,e[4]=a):a=e[4],a}function Ut(t){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Gt)})]},t.label)}function Gt(t){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:t.description}),s.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Kt)})]},t.description)}function Kt(t){return s.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const Ht=300*1e3,Bt="version-check",Yt=2;function Jt(t,e,n){return!e||e===n?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function Wt(){const t=k.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={queryKey:se.appVersionCheck(),queryFn:Qt,refetchInterval:Ht,refetchIntervalInBackground:!0,staleTime:0},t[0]=e):e=t[0];const{data:n,dataUpdatedAt:o}=te(e),[i,r]=P.useState(0);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={version:null,count:0},t[1]=a):a=t[1];const[l,c]=P.useState(a);o!==i&&(r(o),c(h=>Jt(h,n,"4.82.19")));const d=l.count>=Yt,[u,f]=P.useState(!1);return d&&!u&&(f(!0),B("A new version is available",{id:Bt,description:"You're viewing an outdated version of this page. Refresh to get the latest updates.",duration:1/0,action:{label:"Refresh",onClick:Vt}})),null}function Vt(){return window.location.reload()}async function Qt(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function Xt({activeOrg:t}){return t&&($e(t.id,{name:t.name??void 0,slug:t.slug??void 0}),Le()),null}function Zt(t,e,n){if(!n)return null;const o=it(t,e);return o?o.threads.get().find(r=>r.id===n)?.branch??null:null}function en(t){const{prev:e,virtualMcpId:n,decopilotId:o,savedLayout:i,opts:r,autosendValue:a}=t,l={};n?l.virtualmcpid=n:e.virtualmcpid&&(l.virtualmcpid=e.virtualmcpid);const c=typeof e.virtualmcpid=="string"?e.virtualmcpid:o,u=(n??c)!==c;let f="chat";if(r?.main)l.main=r.main;else if(i)i.main!==void 0&&(l.main=i.main),i.sidepanel!==void 0&&(f=i.sidepanel);else if(!u){const h=e.main;h&&typeof h=="string"&&!rt(h)&&(l.main=h)}return l.sidepanel=f,r?.autosend&&(l.autosend=a),l}const Ne="studio:thread-layout:v1",tn=50;function _e(t){const e={};return(t.main===0||typeof t.main=="string")&&(e.main=t.main),(t.sidepanel===0||t.sidepanel==="chat")&&(e.sidepanel=t.sidepanel),e}function nn(t,e,n,o=tn){const i=t.filter(([r])=>r!==e);for(i.push([e,_e(n)]);i.length>o;)i.shift();return i}function ue(){try{const t=sessionStorage.getItem(Ne);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(n=>Array.isArray(n)&&n.length===2&&typeof n[0]=="string"):[]}catch{return[]}}function Ae(t){try{sessionStorage.setItem(Ne,JSON.stringify(t))}catch{}}function sn(t,e){t&&Ae(nn(ue(),t,e))}function on(t){if(!t)return null;const e=ue().find(([n])=>n===t);return e?_e(e[1]):null}function $n(t){if(!t)return;const e=ue(),n=e.filter(([o])=>o!==t);n.length!==e.length&&Ae(n)}function Oe(t){return{queryKey:se.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function Ln(t){const e=k.c(10);let n;e[0]!==t?(n=Oe(t),e[0]=t,e[1]=n):n=e[1];const o=te(n);let i;e[2]!==o.data?.prompts?(i=o.data?.prompts??[],e[2]=o.data?.prompts,e[3]=i):i=e[3];let r;e[4]!==o.data?.tiles?(r=o.data?.tiles??[],e[4]=o.data?.tiles,e[5]=r):r=e[5];let a;return e[6]!==o.isLoading||e[7]!==i||e[8]!==r?(a={isLoading:o.isLoading,prompts:i,tiles:r},e[6]=o.isLoading,e[7]=i,e[8]=r,e[9]=a):a=e[9],a}function an(t){const e=k.c(17),{orgSlug:n,orgName:o,domain:i}=t;let r;e[0]!==n?(r=()=>{window.location.href=`/api/${encodeURIComponent(n)}/sso/authorize`},e[0]=n,e[1]=r):r=e[1];const a=r,l=rn;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(be,{className:"h-6 w-6 text-primary"})}),e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),e[3]=d):d=e[3];let u;e[4]!==i||e[5]!==o?(u=o?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:o})," requires SSO authentication",i?` via ${i}`:"","."]}):"This organization requires SSO authentication to access.",e[4]=i,e[5]=o,e[6]=u):u=e[6];let f;e[7]!==u?(f=s.jsxs("div",{className:"space-y-2",children:[d,s.jsx("p",{className:"text-sm text-muted-foreground",children:u})]}),e[7]=u,e[8]=f):f=e[8];let h;e[9]!==a?(h=s.jsx(O,{onClick:a,children:"Sign in with SSO"}),e[9]=a,e[10]=h):h=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(O,{variant:"ghost",onClick:l,children:"Go back"}),e[11]=p):p=e[11];let m;e[12]!==h?(m=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,p]}),e[12]=h,e[13]=m):m=e[13];let g;return e[14]!==f||e[15]!==m?(g=s.jsxs(H,{children:[c,f,m]}),e[14]=f,e[15]=m,e[16]=g):g=e[16],g}function rn(){window.location.href="/"}function ln(t){const e=k.c(8),{org:n,children:o}=t,r=lt(n.id,n.slug)?.enabled_plugins??null;let a;e[0]!==n.id||e[1]!==n.name||e[2]!==r?(a={id:n.id,organizationId:n.id,slug:"_org",name:n.name,enabledPlugins:r,ui:null},e[0]=n.id,e[1]=n.name,e[2]=r,e[3]=a):a=e[3];const l=a;let c;return e[4]!==o||e[5]!==n||e[6]!==l?(c=s.jsx(Ke,{org:n,project:l,children:o}),e[4]=o,e[5]=n,e[6]=l,e[7]=c):c=e[7],c}function cn(){const t=Ie(),e=at(),{org:n,locator:o}=ze(),i=xe({strict:!1}),r=Me({strict:!1}),a=i.org??"",l=i.taskId??"",c=(m,g,y=!0)=>t({to:"/$org/$taskId",params:{org:a,taskId:m},search:g,replace:y}),d=(m,g=!0)=>c(l,m,g),u=m=>d(g=>({...g,sidepanel:m})),f=(m,g,y)=>{const x=!!l&&l===m;l&&!x&&sn(l,{main:r.main,sidepanel:r.sidepanel});const w=x?null:on(m),S=he(n.id).id;return c(m,j=>en({prev:j,virtualMcpId:g,decopilotId:S,savedLayout:w,opts:y,autosendValue:nt}),!1)};return{openSidePanel:u,setTaskId:f,createNewTask:async m=>{const g=crypto.randomUUID(),y=m??r.virtualmcpid??he(n.id).id,w=y===r.virtualmcpid?Zt(n.slug,o,l):null;try{await e?.create({id:g,virtual_mcp_id:y,...w?{branch:w}:{}})}catch{}f(g,y)},openTab:m=>c(l||crypto.randomUUID(),g=>({...g,main:m}))}}function dn(){const t=k.c(53);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const o=Pe(e)?.params.org;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{taskId:r}=xe(i),[a,l]=P.useState(!1),c=Fe(),d=o??"";let u;t[2]!==d?(u=Oe(d),t[2]=d,t[3]=u):u=t[3];const f=!!o&&!r;let h;t[4]!==u||t[5]!==f?(h={...u,enabled:f},t[4]=u,t[5]=f,t[6]=h):h=t[6],te(h);const{data:p}=J.useSession(),m=p?.user?.id;let g;t[7]!==o||t[8]!==m?(g=o&&m?Re(m,o):null,t[7]=o,t[8]=m,t[9]=g):g=t[9];const y=g;let x,w;t[10]!==c?(x=()=>{const v=A=>{if(ye(A)&&A.code==="KeyK"){A.preventDefault(),l(!0);return}ye(A)&&A.code==="BracketLeft"&&c.history.canGoBack()&&(A.preventDefault(),c.history.back())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},w=[c],t[10]=c,t[11]=x,t[12]=w):(x=t[11],w=t[12]),P.useEffect(x,w);let S;t[13]!==o?(S=se.activeOrganization(o),t[13]=o,t[14]=S):S=t[14];let j;t[15]!==o||t[16]!==m?(j=async()=>{if(!o)return null;performance.mark("mesh:active-org-fetch:start");const{data:v}=await J.organization.getFullOrganization({query:{organizationSlug:o}}).finally(un),A=me(v);return v&&!A&&localStorage.setItem(Y.lastOrgSlug(),o),m&&v&&qe(m,o,v),v},t[15]=o,t[16]=m,t[17]=j):j=t[17];const N=y?y.data:void 0,T=y?.updatedAt;let $;t[18]!==j||t[19]!==N||t[20]!==T||t[21]!==S?($={queryKey:S,queryFn:j,initialData:N,initialDataUpdatedAt:T,gcTime:1/0,refetchOnWindowFocus:!1},t[18]=j,t[19]=N,t[20]=T,t[21]=S,t[22]=$):$=t[22];const{data:b}=we($),E=b?.id,L=b?.slug,{data:_}=ct(E,L),ie=E??"",ae=L??"";let D;t[23]!==ie||t[24]!==ae?(D=st({connectionId:ot,orgId:ie,orgSlug:ae}),t[23]=ie,t[24]=ae,t[25]=D):D=t[25];const re=!!E&&!!L;let W;if(t[26]!==D||t[27]!==re?(W={...D,enabled:re},t[26]=D,t[27]=re,t[28]=W):W=t[28],te(W),!b){let v;t[29]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ue,{}),t[29]=v):v=t[29];let A;return t[30]!==o?(A=s.jsx(P.Suspense,{fallback:v,children:s.jsx(Nt,{orgSlug:o})}),t[30]=o,t[31]=A):A=t[31],A}if(me(b)){localStorage.getItem(Y.lastOrgSlug())===o&&localStorage.removeItem(Y.lastOrgSlug());let v;return t[32]!==b.name?(v=s.jsx(De,{orgName:b.name}),t[32]=b.name,t[33]=v):v=t[33],v}if(_?.ssoRequired&&!_.authenticated){let v;return t[34]!==b.id||t[35]!==b.name||t[36]!==b.slug||t[37]!==_.domain?(v=s.jsx(an,{orgId:b.id,orgSlug:b.slug,orgName:b.name,domain:_.domain}),t[34]=b.id,t[35]=b.name,t[36]=b.slug,t[37]=_.domain,t[38]=v):v=t[38],v}const le=b.logo??null;let q;t[39]!==b||t[40]!==le?(q={...b,logo:le},t[39]=b,t[40]=le,t[41]=q):q=t[41];let U;t[42]!==b?(U=s.jsx(Xt,{activeOrg:b}),t[42]=b,t[43]=U):U=t[43];let V,Q;t[44]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Ge,{}),Q=s.jsx(Rt,{}),t[44]=V,t[45]=Q):(V=t[44],Q=t[45]);let G;t[46]!==a?(G=s.jsx(qt,{open:a,onOpenChange:l}),t[46]=a,t[47]=G):G=t[47];let X;t[48]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Wt,{}),t[48]=X):X=t[48];let Z;return t[49]!==q||t[50]!==U||t[51]!==G?(Z=s.jsxs(ln,{org:q,children:[U,V,Q,G,X]}),t[49]=q,t[50]=U,t[51]=G,t[52]=Z):Z=t[52],Z}function un(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function mn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(tt,{children:s.jsx(dn,{})}),t[0]=e):e=t[0],e}const In=Object.freeze(Object.defineProperty({__proto__:null,default:mn,usePanelActions:cn},Symbol.toStringTag,{value:"Module"}));export{C as K,Ln as a,$n as f,ye as i,Zt as r,In as s,cn as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as D,j as s,E as le,r as K,C as ae,n as ce,b as de,e as me,B as Y,p as te,K as fe,d as ge,t as ie}from"./index-DZ3hzzf1.js";import{i as ue}from"./AlertCircle-fklrqSW5.js";import{i as pe}from"./ChevronRight-BUKoQxxN.js";import{s as xe}from"./Plus-BwYAFd19.js";import{s as he}from"./Trash01-Cwer5u_n.js";import{I as X}from"./input-CK7GAn-2.js";import{S as oe}from"./switch-BZYENsAO.js";import{S as ye}from"./skeleton-YVFIgHQg.js";import{A as ne}from"./avatar-BlYuWW7J.js";import{b as je,P as Ce,a as Se}from"./popover-BIkriKI7.js";import{b as re}from"./use-connection-sIYGQRZw.js";import{W as Z}from"./constants-BHDe7bIw.js";import{P as G}from"./index-BoBOH_Zc.js";import{u as ve}from"./use-registry-connections-701IXXum.js";import{i as _e,j as be}from"./use-organization-settings-C_QN8e5A.js";import{c as Pe,b as I,S as ee,a as Q}from"./settings-section-CDAkS7s3.js";import{R as Re}from"./require-capability-DlBK7Ljx.js";import"./User01-DFGTsbFQ.js";import"./use-collections-CfZhiJR7.js";import"./use-mcp-client-BIXuHEwh.js";import"./auth-CKKxsAQR.js";import"./sidebar-Cc4XVWKB.js";import"./LayoutLeft-Dt7rJY-r.js";import"./use-mobile-C0TUGCBw.js";import"./X-JhcLrxaK.js";import"./tooltip-BLkLB4r7.js";import"./studio-tools-B4JofgO_.js";import"./card-dggHqb7D.js";import"./ArrowUpRight-D6zDsrnH.js";import"./use-capability-BSDyr6zM.js";import"./access-gate-B2PcKpQi.js";import"./capability-load-error-DT5FhHrY.js";function ke(t){const e=D.c(3),{error:o}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let n;return e[1]!==o.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",o.message]})]}),e[1]=o.message,e[2]=n):n=e[2],n}function we(t){const e=D.c(36),{onCancel:o,onSuccess:m}=t,n=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==n||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await n.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=n,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:Ne},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==o?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:o,disabled:d,children:"Cancel"}),e[19]=d,e[20]=o,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function Ne(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:o,description:m,icon:n,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==n||e[8]!==o?(c=n?s.jsx("img",{src:n,alt:o,className:"size-8 rounded-md object-contain"}):s.jsx(ne,{fallback:o.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=n,e[8]=o,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Me,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(oe,{checked:r,onClick:Ae,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==o||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:o,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=o,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ae(t){return t.stopPropagation()}function Me(t){return t.stopPropagation()}function Te(){const t=D.c(59),{org:e}=ae(),o=ve(),m=re(),n=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!n)return i===p;const w=n.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=o.find(i=>i.id===p),k=o.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=o.filter(i=>!B.has(i.id));let R;t[13]!==n||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=n??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=n,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const W=C;let U;t[20]!==n||t[21]!==r?(U=async i=>{S(!1);const w=n??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=n,t[21]=r,t[22]=U):U=t[22];const H=U,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==H||t[28]!==a?(T=a&&s.jsx(we,{onCancel:()=>S(!1),onSuccess:H}),t[27]=H,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let $;t[34]!==z||t[35]!==E?($=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=$):$=t[36];let q;t[37]!==W||t[38]!==P||t[39]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>W(i.id)},i.id),t[37]=W,t[38]=P,t[39]=l,t[40]=q):q=t[40];const V=A.map(q);let F;t[41]!==$||t[42]!==V?(F=s.jsxs(Q,{children:[$,V]}),t[41]=$,t[42]=V,t[43]=F):F=t[43],t[44]!==F||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,F]}),t[44]=F,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(ne,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(oe,{checked:!1,disabled:!0,onCheckedChange:ze})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function ze(){}function Ee(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(le,{fallback:$e,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Te,{})]})})})})})}),t[1]=o):o=t[1],o}function $e(t){const{error:e}=t;return s.jsx(ke,{error:e??new Error("Failed to load store settings")})}function ut(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Re,{capability:"registry:manage",area:"the store",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}export{ut as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-DIv4ITtZ.js","assets/index-DZ3hzzf1.js","assets/index-BmGHTOVY.css","assets/Tool02-O3edpLSO.js","assets/CheckCircle-BYkf45lM.js","assets/Settings02-D2iJ0Y_1.js","assets/use-mcp-client-BIXuHEwh.js","assets/constants-BHDe7bIw.js","assets/auth-CKKxsAQR.js","assets/useInfiniteQuery-D1UM76v9.js","assets/use-infinite-scroll-BQFpclfv.js","assets/studio-tools-B4JofgO_.js","assets/badge-BsoTUFnu.js","assets/input-CK7GAn-2.js","assets/dropdown-menu-DnbYxaX3.js","assets/ChevronUp-mvRqss9i.js","assets/ChevronRight-BUKoQxxN.js","assets/DotsVertical-DitrZ6w4.js","assets/table-BpC3o1Ua.js","assets/toggle-group-Djz-ljio.js","assets/use-view-mode-BxC6fcT8.js","assets/use-mobile-C0TUGCBw.js","assets/FilterLines-Y38x0Q7Z.js","assets/Globe01-CnltMSDk.js","assets/SearchMd-C4E_z5AK.js","assets/dialog-Dy1IRNfn.js","assets/X-JhcLrxaK.js","assets/AlertCircle-fklrqSW5.js","assets/Upload01-C1yFspcl.js","assets/alert-dialog-CFnkTG10.js","assets/card-dggHqb7D.js","assets/Trash01-Cwer5u_n.js","assets/label-BlLucFOT.js","assets/select-BesvP7cx.js","assets/tooltip-BLkLB4r7.js","assets/ChevronDown-sgVULpdb.js","assets/switch-BZYENsAO.js","assets/textarea-DtLXmNNW.js","assets/XCircle-Do7Zx-eD.js","assets/checkbox-CvJb_88Z.js","assets/Eye-DR1QNYLF.js","assets/LinkExternal01-CKHslpvH.js","assets/use-copy-DK3qaoqd.js","assets/Copy01-DLSxZiKr.js","assets/Key01-Dh4DUQLF.js","assets/Plus-BwYAFd19.js","assets/mcp-oauth-DZFKw2wh.js","assets/Play-CJE2nK0g.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as m,b as n,e as c,j as t,i as p,r as l,aX as f}from"./index-DZ3hzzf1.js";import{R as u}from"./require-capability-DlBK7Ljx.js";import"./use-capability-BSDyr6zM.js";import"./access-gate-B2PcKpQi.js";import"./capability-load-error-DT5FhHrY.js";const g=l.lazy(()=>f(()=>import("./registry-layout-DIv4ITtZ.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])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(p,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as U,C as q,K as T,m as I,n as x,d as y,t as m}from"./index-DZ3hzzf1.js";import{u as z}from"./use-mcp-client-BIXuHEwh.js";import{S as J}from"./constants-BHDe7bIw.js";import{u as Q}from"./studio-tools-B4JofgO_.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function it(t){const e=U.c(12),{org:s}=q(),l=t??J;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=z(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const r=!!t;let c;return e[8]!==n||e[9]!==o||e[10]!==r?(c={queryKey:n,queryFn:o,enabled:r,staleTime:3e4},e[8]=n,e[9]=o,e[10]=r,e[11]=c):c=e[11],I(c)}function ot(t){const e=U.c(9),{org:s}=q(),l=Q();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function at(t){const e=U.c(10),{org:s}=q(),l=Q();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function nt(t,e){const s=U.c(12),{org:l}=q(),a=Q();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let r;return s[8]!==i||s[9]!==n||s[10]!==o?(r={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=r):r=s[11],I(r)}function lt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function ut(){const t=U.c(64),{org:e}=q(),s=Q(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let r;t[6]!==s?(r=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=r):r=t[7];let c;t[8]!==i?(c=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=c):c=t[9];let d;t[10]!==r||t[11]!==c?(d={mutationFn:r,onSuccess:c,onError:X},t[10]=r,t[11]=c,t[12]=d):d=t[12];const D=y(d);let p;t[13]!==s?(p=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=p):p=t[14];let A;t[15]!==i||t[16]!==o?(A=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=A):A=t[17];let G;t[18]!==p||t[19]!==A?(G={mutationFn:p,onSuccess:A,onError:W},t[18]=p,t[19]=A,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let C;t[35]!==S||t[36]!==E?(C={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=C):C=t[37];const P=y(C);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let K;t[43]!==O||t[44]!==R?(K={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=K):K=t[45];const h=y(K);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{it as a,at as b,ot as c,lt as d,nt as e,ut as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f,C}from"./index-DZ3hzzf1.js";import{b as N,a as O,u as S}from"./use-collections-CfZhiJR7.js";import{u as I}from"./use-mcp-client-BIXuHEwh.js";import{S as m}from"./constants-BHDe7bIw.js";function _(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const p=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:m,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=I(a);return N(u.id,"CONNECTIONS",A,p)}function x(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:m,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=I(n);return S(i.id,"CONNECTIONS",t,l)}function L(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:m,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=I(i);return O(o.id,"CONNECTIONS",n)}export{x as a,L as b,_ as u};
|