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
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ie,j as s,B as J,C as ce,n as fe,a as he,r as K,m as ge,K as ee,d as xe,p as $,t as te,l as je}from"./index-DZ3hzzf1.js";import{d as Y,c as de,a as se,D as oe}from"./dropdown-menu-DnbYxaX3.js";import{a as be}from"./Users03-BK-DRA0O.js";import{G as me}from"./use-registry-app-J1vnPNS0.js";import{u as Ce,b as ye,c as we}from"./use-virtual-mcp-BLx5NqtM.js";import{P as X}from"./index-BoBOH_Zc.js";import{i as _e}from"./DotsVertical-DitrZ6w4.js";import{a as Ne,b as Se}from"./Settings02-D2iJ0Y_1.js";import{s as ve}from"./Trash01-Cwer5u_n.js";import{A as Ie,aI as De}from"./agent-icon-CGx0_9l5.js";import{c as ue}from"./use-navigate-to-agent-CPivegDO.js";import{C as Ae}from"./card-dggHqb7D.js";import{f as ne}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as Ee}from"./use-capability-BSDyr6zM.js";import{E as Te}from"./empty-state-CiSz3At1.js";import{u as ke}from"./use-create-virtual-mcp-DdEqi3Z6.js";import{u as Ge}from"./use-connection-sIYGQRZw.js";import{u as re}from"./use-mcp-client-BIXuHEwh.js";import{S as Le}from"./constants-BHDe7bIw.js";import{u as Oe,G as Pe}from"./github-repo-picker-xBH3tHfN.js";import{g as ze}from"./github-repo-scope-DjMZbiKa.js";import{f as Me,a as $e,p as He}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{e as Fe,d as Re,D as Ue,a as Be,c as Ve}from"./dialog-Dy1IRNfn.js";import{C as Ke}from"./collection-search-BisIJu80.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-CFnkTG10.js";import{S as tt}from"./search-input-D20m0IjW.js";import{s as le}from"./Plus-BwYAFd19.js";import"./ChevronUp-mvRqss9i.js";import"./ChevronRight-BUKoQxxN.js";import"./use-mcp-tools-CNPoXDXJ.js";import"./use-collections-CfZhiJR7.js";import"./sidebar-Cc4XVWKB.js";import"./LayoutLeft-Dt7rJY-r.js";import"./use-mobile-C0TUGCBw.js";import"./X-JhcLrxaK.js";import"./tooltip-BLkLB4r7.js";import"./AlertCircle-fklrqSW5.js";import"./Tool01-CcxbpsdM.js";import"./ArrowUp-Bdy-0gyO.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"./CheckCircle-BYkf45lM.js";import"./ChevronDown-sgVULpdb.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"./Image01-CSEqtjAN.js";import"./Key01-Dh4DUQLF.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"./SearchLg-Ci76gxPe.js";import"./SearchMd-C4E_z5AK.js";import"./Shield01-D52f0rB7.js";import"./Stars01-DZkGi0yh.js";import"./Upload01-C1yFspcl.js";import"./User01-DFGTsbFQ.js";import"./Users01-oR_WIF7g.js";import"./XClose-C9Ve9LT-.js";import"./Zap-BsJbp079.js";import"./hooks-y59N0gpi.js";import"./decopilot-sse-pool-v3bamRu-.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./auth-CKKxsAQR.js";import"./use-debounced-value-B2z6I7X3.js";import"./authenticate-and-persist-oauth-BL10FIRd.js";import"./mcp-oauth-DZFKw2wh.js";import"./extract-connection-data-DQK5y-ef.js";function ae(t){const e=ie.c(19),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:l,isCreating:b,align:C,side:d,showBetaBadge:g}=t,y=C===void 0?"end":C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==b||e[2]!==i?(m=s.jsxs(Y,{disabled:b,onClick:i,children:[x,"Create from scratch"]}),e[1]=b,e[2]=i,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(me,{className:"size-3.5"}),e[4]=f):f=e[4];let a;e[5]!==g?(a=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=a):a=e[6];let h;e[7]!==n||e[8]!==a?(h=s.jsxs(Y,{onClick:n,children:[f,"Import from GitHub",a]}),e[7]=n,e[8]=a,e[9]=h):h=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=c):c=e[10];let r;e[11]!==l?(r=s.jsxs(Y,{onClick:l,children:[c,"Import from deco.cx"]}),e[11]=l,e[12]=r):r=e[12];let u;return e[13]!==y||e[14]!==d||e[15]!==m||e[16]!==h||e[17]!==r?(u=s.jsxs(de,{side:d,align:y,className:"w-48",children:[m,h,r]}),e[13]=y,e[14]=d,e[15]=m,e[16]=h,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ie.c(45),{project:i,lastUsedAt:n,onDeleteClick:l}=t,b=ue();let C;e[0]!==b||e[1]!==i.id?(C=()=>b(i.id),e[0]=b,e[1]=i.id,e[2]=C):C=e[2];let d;e[3]!==i.title||e[4]!==C?(d=s.jsx("button",{type:"button",onClick:C,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=C,e[5]=d):d=e[5];let g;e[6]!==i.icon||e[7]!==i.title?(g=s.jsx(Ie,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=g):g=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{asChild:!0,children:s.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(_e,{size:20})})}),e[9]=y):y=e[9];let x;e[10]!==b||e[11]!==i.id?(x=()=>b(i.id,{search:{main:"settings"}}),e[10]=b,e[11]=i.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ne,{size:16}),e[13]=m):m=e[13];let f;e[14]!==x?(f=s.jsxs(Y,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=f):f=e[15];let a;e[16]!==l?(a=l&&s.jsxs(Y,{variant:"destructive",onClick:G=>{G.stopPropagation(),l(G)},children:[s.jsx(ve,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let h;e[18]!==f||e[19]!==a?(h=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(oe,{children:[y,s.jsxs(de,{align:"end",children:[f,a]})]})}),e[18]=f,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==g||e[22]!==h?(c=s.jsxs("div",{className:"flex items-start justify-between",children:[g,h]}),e[21]=g,e[22]=h,e[23]=c):c=e[23];let r;e[24]!==i.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=r):r=e[25];const u=i.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let w;e[31]!==c||e[32]!==D?(w=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,D]}),e[31]=c,e[32]=D,e[33]=w):w=e[33];let E;e[34]!==n||e[35]!==i.updated_at?(E=n?`Last used ${ne(new Date(n),{addSuffix:!0})}`:`Updated ${ne(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=n,e[35]=i.updated_at,e[36]=E):E=e[36];let N;e[37]!==E?(N=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})})}),e[37]=E,e[38]=N):N=e[38];let T;e[39]!==w||e[40]!==N?(T=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[w,N]}),e[39]=w,e[40]=N,e[41]=T):T=e[41];let S;return e[42]!==T||e[43]!==d?(S=s.jsxs(Ae,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,T]}),e[42]=T,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function it(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function nt(t,e){const i=e?it(e):null,n=i?.owner??ot,l=i?.repo??t;return{owner:n,name:l,url:`https://github.com/${n}/${l}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function pe(t,e,i){const n=await fetch(t,e),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error??`${i} (${n.status})`);return l}function lt(t){return pe(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function at({open:t,onOpenChange:e,onBack:i}){const{org:n}=ce(),l=ue(),b=fe(),{data:C}=he.useSession(),[d,g]=K.useState(null),[y,x]=K.useState(null),[m,f]=K.useState(""),a=re({connectionId:Le,orgId:n.id,orgSlug:n.slug}),h=Ge({slug:"mcp-github"}),c=ze(h),r=Oe({enabled:t&&c.length===0}),u=c.length===1?c[0]??null:y,I=c.length>1&&!u,D=re({connectionId:u?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:E,isLoading:N,error:T}=ge({queryKey:ee.decoSites(C?.user?.email),queryFn:()=>lt(n.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=E?.sites??[],G=o=>{o||(g(null),x(null),f("")),e(o)},P=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||P.some(o=>o.name===d),L=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:k,appSlug:v}=await Me(_=>a.callTool(_),u.id),A=S.find(_=>_.name===o);if(!A)throw new Error("Selected site is no longer available");const j=nt(o,A.metadata),z=$e(k,j.owner);if(!z){const _=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${_}`)}let V=null,U=null,B=null;const W=async()=>{B&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:B}}).catch(()=>{}),U&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:U,force:!0}}).catch(()=>{}),V&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const _=await pe(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})},"Failed to create connection"),O=_.connId;if(!O)throw new Error("Server did not return a connection ID");V=O;const{childConnectionId:M}=await He({orgSlug:n.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:Z=>D.callTool(Z),selfCallTool:Z=>a.callTool(Z)});U=M;const H=_.icon??null,F=rt(o),q=o.toLowerCase(),p=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:q,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:z.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:F,pinnedViews:[{connectionId:O,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:O,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:O},{connection_id:M}]}}}),Q=p.structuredContent??p;if(!Q.item?.id)throw new Error("Failed to create the imported agent");return B=Q.item.id,{slug:F,virtualMcpId:Q.item.id,connId:O,item:Q.item}}catch(_){throw await W(),_}},onSuccess:({slug:o,virtualMcpId:k,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:k,slug:o}),b.setQueryData(ee.collectionItem(a,n.id,"","VIRTUAL_MCP",k),{item:v}),b.invalidateQueries({predicate:A=>{const j=A.queryKey;return j[1]===n.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),b.invalidateQueries({queryKey:ee.projects(n.id)}),te.success(`Imported ${o} from deco.cx`),G(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(k)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),te.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Fe,{open:t,onOpenChange:G,children:s.jsxs(Re,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(Se,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:f,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&f("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(J,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!w&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),c.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(me,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!w&&!I&&r.status!=="error"&&!T&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!w&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[P.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),P.map(o=>{const k=o.domains?.find(A=>A.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),k&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:k})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(J,{variant:"outline",onClick:()=>G(!1),disabled:L.isPending,children:"Cancel"}),s.jsx(J,{disabled:!d||!R||L.isPending||N||w||I||!u||r.status==="error",onClick:()=>d&&L.mutate(d),children:L.isPending?"Importing...":"Import"})]})]})})}function Hs(){const t=ie.c(46),{org:e}=ce(),i=Ce(),n=ye(),[l,b]=K.useState("");let C;t[0]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},t[0]=C):C=t[0];const{createVirtualMCP:d,isCreating:g}=ke(C),[y,x]=K.useState(null),[m,f]=K.useState(!1),[a,h]=K.useState(!1),{granted:c}=Ee("agents:manage"),r=l.toLowerCase(),u=i.filter(p=>p.id!==e.id&&(p.title.toLowerCase().includes(r)||p.description?.toLowerCase().includes(r))),{data:I}=we(u.map(ct));let D;t[1]!==n||t[2]!==y?(D=async()=>{if(!y)return;const{id:p,title:Q}=y;x(null);try{await n.delete.mutateAsync(p),$("agent_deleted",{agent_id:p,source:"agents_list"}),te.success(`Deleted "${Q}"`)}catch{}},t[1]=n,t[2]=y,t[3]=D):D=t[3];const w=D,E=X,N=X,T=X;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(X.Title,{children:"Agents"}),t[4]=S):S=t[4];let G;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=p=>{p.key==="Escape"&&(b(""),p.target.blur())},t[5]=G):G=t[5];let P;t[6]!==l?(P=s.jsx(tt,{value:l,onChange:b,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:G}),t[6]=l,t[7]=P):P=t[7];let R;t[8]!==c||t[9]!==d||t[10]!==g?(R=c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),f(!0)},isCreating:g,align:"end"})]}),t[8]=c,t[9]=d,t[10]=g,t[11]=R):R=t[11];let L;t[12]!==P||t[13]!==R?(L=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[P,R]})]}),t[12]=P,t[13]=R,t[14]=L):L=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(De,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),f(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),k=u.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:u.map(p=>s.jsx(st,{project:p,lastUsedAt:I?.get(p.id)?.last_used_at,onDeleteClick:c?()=>x({id:p.id,title:p.title}):void 0},p.id))})]});let v;t[15]!==k||t[16]!==T.Body||t[17]!==L||t[18]!==o?(v=s.jsxs(T.Body,{children:[L,o,k]}),t[15]=k,t[16]=T.Body,t[17]=L,t[18]=o,t[19]=v):v=t[19];let A;t[20]!==v||t[21]!==N.Content?(A=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=A):A=t[22];let j;t[23]!==a?(j=s.jsx(Pe,{open:a,onOpenChange:h}),t[23]=a,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:f}),t[25]=m,t[26]=z):z=t[26];const V=!!y;let U;t[27]===Symbol.for("react.memo_cache_sentinel")?(U=p=>!p&&x(null),t[27]=U):U=t[27];let B;t[28]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(qe,{children:"Delete Agent?"}),t[28]=B):B=t[28];const W=y?.title;let _;t[29]!==W?(_=s.jsxs(Qe,{children:[B,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),t[29]=W,t[30]=_):_=t[30];let O;t[31]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(We,{children:"Cancel"}),t[31]=O):O=t[31];let M;t[32]!==w?(M=s.jsxs(Ye,{children:[O,s.jsx(Xe,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=w,t[33]=M):M=t[33];let H;t[34]!==_||t[35]!==M?(H=s.jsxs(Ze,{children:[_,M]}),t[34]=_,t[35]=M,t[36]=H):H=t[36];let F;t[37]!==V||t[38]!==H?(F=s.jsx(et,{open:V,onOpenChange:U,children:H}),t[37]=V,t[38]=H,t[39]=F):F=t[39];let q;return t[40]!==E||t[41]!==A||t[42]!==j||t[43]!==z||t[44]!==F?(q=s.jsxs(E,{children:[A,j,z,F]}),t[40]=E,t[41]=A,t[42]=j,t[43]=z,t[44]=F,t[45]=q):q=t[45],q}function ct(t){return t.id}export{Hs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as V,I as N,ad as ae,af as le,ag as he,ae as xe,b3 as me,c as U,J as ge,M as be,r as M,j as s,ah as Ee,t as G,aL as ye,C as re,n as oe,d as J,K as Q,m as ve,l as ue,B as L,p as je,E as $e}from"./index-DZ3hzzf1.js";import{i as Fe}from"./AlertCircle-fklrqSW5.js";import{P as te}from"./index-BoBOH_Zc.js";import{S as ne}from"./skeleton-YVFIgHQg.js";import{b as _e,a as ce,S as de,c as Re}from"./settings-section-CDAkS7s3.js";import{u as X,a as se,b as Se}from"./use-ai-providers-BRga8_lW.js";import{i as Me}from"./CheckCircle-BYkf45lM.js";import{n as Oe,o as Te,q as Ue,S as ze}from"./chat-context-CEf5YFvv.js";import{g as qe,h as Le}from"./use-organization-settings-C_QN8e5A.js";import{M as Ve,b as ke,P as Qe,C as pe}from"./select-model-1OjsUmRd.js";import{u as Be}from"./use-debounced-autosave-DejInOR3.js";import{I as ie}from"./input-CK7GAn-2.js";import{T as fe,a as Ge}from"./toggle-group-Djz-ljio.js";import{b as Ie,c as Ce,d as Ne,A as we,a as Pe,e as De,g as Ae,f as Ke}from"./alert-dialog-CFnkTG10.js";import{u as H}from"./studio-tools-B4JofgO_.js";import{s as Ye}from"./Plus-BwYAFd19.js";import{b as We}from"./Tool01-CcxbpsdM.js";import{s as He}from"./Trash01-Cwer5u_n.js";import{A as Je}from"./avatar-BlYuWW7J.js";import{i as Xe}from"./Settings02-D2iJ0Y_1.js";import{s as Ze}from"./Eye-DR1QNYLF.js";import{c as et,D as tt,a as st,d as it,e as rt}from"./dialog-Dy1IRNfn.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-DlBK7Ljx.js";import"./sidebar-Cc4XVWKB.js";import"./LayoutLeft-Dt7rJY-r.js";import"./use-mobile-C0TUGCBw.js";import"./X-JhcLrxaK.js";import"./tooltip-BLkLB4r7.js";import"./card-dggHqb7D.js";import"./ArrowUpRight-D6zDsrnH.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"./use-virtual-mcp-BLx5NqtM.js";import"./use-collections-CfZhiJR7.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-D8o2yOzI.js";import"./drawer-C_exNDXZ.js";import"./checkbox-CvJb_88Z.js";import"./ChevronUp-mvRqss9i.js";import"./select-BesvP7cx.js";import"./ChevronDown-sgVULpdb.js";import"./Key01-Dh4DUQLF.js";import"./SearchMd-C4E_z5AK.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-r0C7odur.js";import"./ChevronRight-BUKoQxxN.js";import"./connect-desktop-dialog-BR3Yayc6.js";import"./Copy01-DLSxZiKr.js";import"./Image01-CSEqtjAN.js";import"./Stars01-DZkGi0yh.js";import"./User01-DFGTsbFQ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-BSDyr6zM.js";import"./access-gate-B2PcKpQi.js";import"./capability-load-error-DT5FhHrY.js";V({title:N(),url:N(),icon:N()});V({registries:le(N(),V({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=V({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=V({tiers:V({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});V({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});V({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:V({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:V({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Oe(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=M.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],M.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let p;t[7]!==i||t[8]!==u?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=p):p=t[9];const k=p;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const F=y.keyId??m??"";S(F),a({keyId:F,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let f;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=f):f=t[19],f}function pt(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Me,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function ft(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:P=>{o.reset(i),G.error(`Failed to save: ${P.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Be(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:p}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),M.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==p?(h=()=>{const v=o.getValues(),P=new Set(t.map(ht)),$={};c?.id&&($[c.id]=j),u?.id&&($[u.id]=_),g?.id&&($[g.id]=p);const w=Y=>Y!=null&&!P.has(Y.keyId),C={fast:w(v.tiers.fast)?null:v.tiers.fast,smart:w(v.tiers.smart)?null:v.tiers.smart,thinking:w(v.tiers.thinking)?null:v.tiers.thinking,image:w(v.tiers.image)?null:v.tiers.image,web_search:w(v.tiers.web_search)?null:v.tiers.web_search,deep_research:w(v.tiers.deep_research)?null:v.tiers.deep_research},B=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!B&&z)return;const q=Ue(t,$);o.reset({tiers:{fast:C.fast??q.chat.fast,smart:C.smart??q.chat.smart,thinking:C.thinking??q.chat.thinking,image:C.image??q.image,web_search:C.web_search??q.webSearch,deep_research:C.deep_research??q.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=p,e[19]=h):h=e[19];const f=c?.id,y=u?.id,F=g?.id;let O;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==p||e[25]!==f||e[26]!==y||e[27]!==F?(O=[o,t,j,_,p,f,y,F],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=p,e[25]=f,e[26]=y,e[27]=F,e[28]=O):O=e[28],M.useEffect(h,O);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const R=b&&!d;let D;e[30]!==S||e[31]!==R?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(pt,{isPending:S,showSaved:R})]}),e[30]=S,e[31]=R,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:P=>{const{field:$}=P;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:w=>{$.onChange(w),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=M.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:f}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return f},onSuccess:yt,onError:bt}),[o,x]=M.useState(""),[S,b]=M.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let p;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(p=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(L,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(L,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=p):p=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(L,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(L,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==p||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,p,k]})}),e[22]=_,e[23]=p,e[24]=k,e[25]=I):I=e[25],I}function bt(e){G.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=M.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=Q.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:p,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const f=p?.balanceCents!=null?p.balanceCents/100:null;let y;e[19]!==f?(y=f!=null?`$${f.toFixed(2)}`:"—",e[19]=f,e[20]=y):y=e[20];const F=y;let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=O):O=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let R;e[23]!==c?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[O,s.jsx(L,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=R):R=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ie,{children:[s.jsx(Ce,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ne,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(we,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[D,s.jsxs(De,{children:[A,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ke,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==f||e[33]!==F||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",f!=null&&vt(f)),children:F}),e[32]=f,e[33]=F,e[34]=h,e[35]=k,e[36]=v):v=e[36];let P;e[37]!==I?(P=()=>I(),e[37]=I,e[38]=P):P=e[38];const $=h&&"animate-spin";let w;e[39]!==$?(w=ue($),e[39]=$,e[40]=w):w=e[40];let C;e[41]!==w?(C=s.jsx(ye,{size:14,className:w}),e[41]=w,e[42]=C):C=e[42];let B;e[43]!==h||e[44]!==P||e[45]!==C?(B=s.jsx("button",{type:"button",onClick:P,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=P,e[45]=C,e[46]=B):B=e[46];let z;e[47]!==v||e[48]!==B?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,B]}),e[47]=v,e[48]=B,e[49]=z):z=e[49];let q;e[50]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=q):q=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,q]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==R||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,E,Y,Z]})})}),e[54]=R,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){G.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),G.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(L,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=V({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function wt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=M.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:p}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async f=>{let y;f.apiKey?c?y=JSON.stringify({baseUrl:f.baseUrl||l||"",apiKey:f.apiKey}):y=f.apiKey:c&&f.baseUrl&&f.baseUrl!==l&&(y=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:f.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:Q.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:Q.aiProviders(S.id)}),G.success("Provider updated"),x()},onError:f=>G.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:j(f=>I(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),p.label&&s.jsx("p",{className:"text-xs text-destructive",children:p.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(L,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function Pt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?ke(i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=Q.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(wt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let p;return t[24]!==l||t[25]!==r||t[26]!==_?(p=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=p):p=t[27],p}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=M.useState(!1),[b,d]=M.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?ke(i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const B=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${B} · added ${z} ago`}const _=j;let p;t[5]!==i.id||t[6]!==l?(p=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=p):p=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:Q.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:Q.aiProviders(r.id)}),o.invalidateQueries({queryKey:Q.aiProviderModels(r.id,i.id)}),G.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==p||t[13]!==k?(I={mutationFn:p,onSuccess:k,onError:At},t[12]=p,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:f}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Je,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let F;t[18]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(L,{variant:"ghost",size:"icon","aria-label":"Edit provider key",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(We,{size:14})}),t[18]=F):F=t[18];let O,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(O=()=>S(!0),T=s.jsx(He,{size:14}),t[19]=O,t[20]=T):(O=t[19],T=t[20]);let R;t[21]!==f?(R=s.jsxs("div",{className:"flex items-center gap-0.5",children:[F,s.jsx(L,{variant:"ghost",size:"icon","aria-label":"Delete provider key",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:f,onClick:O,children:T})]}),t[21]=f,t[22]=R):R=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==R||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:R}),t[23]=_,t[24]=u,t[25]=R,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(Pt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ce,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(Ie,{children:[K,s.jsxs(Ne,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(we,{children:"Cancel"}),t[35]=v):v=t[35];let P;t[36]!==h?(P=s.jsxs(De,{children:[v,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=P):P=t[37];let $;t[38]!==E||t[39]!==P?($=s.jsxs(Pe,{children:[E,P]}),t[38]=E,t[39]=P,t[40]=$):$=t[40];let w;t[41]!==x||t[42]!==$?(w=s.jsx(Ke,{open:x,onOpenChange:S,children:$}),t[41]=x,t[42]=$,t[43]=w):w=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==w?(C=s.jsxs(s.Fragment,{children:[D,A,w]}),t[44]=D,t[45]=A,t[46]=w,t[47]=C):C=t[47],C}function At(e){return G.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter(Ft).map(S).filter($t);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ye,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(L,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function $t(e){return e.provider!==void 0}function Ft(e){return e.providerId!=="deco"}function Rt(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Fe,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Mt(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=M.useState(!1),[x,S]=M.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let p;e[5]!==n?(p=s.jsx(Qe,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=p):p=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=F=>{F||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let f;e[8]!==k||e[9]!==h?(f=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=f):f=e[10];let y;return e[11]!==p||e[12]!==f?(y=s.jsxs(s.Fragment,{children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(M.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Ot(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Re,{children:[t,s.jsx($e,{fallback:Ut,children:s.jsx(M.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Mt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Rt,{error:t??new Error("Failed to load AI providers")})}function Hs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Hs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-DZ3hzzf1.js";import{i as jt}from"./ChevronRight-BUKoQxxN.js";import{m as kt}from"./automation-runs-BGZr5t8h.js";import{A as _t}from"./add-section-modal-39yDT-Ju.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index-Qi63FtON.js";import"./select-BesvP7cx.js";import"./tooltip-BLkLB4r7.js";import"./ChevronUp-mvRqss9i.js";import"./ChevronDown-sgVULpdb.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"./LayoutLeft-Dt7rJY-r.js";import"./use-mobile-C0TUGCBw.js";import"./X-JhcLrxaK.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"./AlertCircle-fklrqSW5.js";import"./CheckCircle-BYkf45lM.js";import"./DotsVertical-DitrZ6w4.js";import"./agent-icon-CGx0_9l5.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"./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"./Image01-CSEqtjAN.js";import"./Key01-Dh4DUQLF.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"./Zap-BsJbp079.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"./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"./switch-BZYENsAO.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 $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Cr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Cr as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-DZ3hzzf1.js";import{s as q}from"./Plus-BwYAFd19.js";import{i as S}from"./Zap-BsJbp079.js";import{S as D}from"./search-input-D20m0IjW.js";import{P as l}from"./index-BoBOH_Zc.js";import{E as b}from"./empty-state-CiSz3At1.js";import{c as O}from"./use-automations-fFC4EQc3.js";import{c as V}from"./use-navigate-to-agent-CPivegDO.js";import{A as F}from"./automation-list-row-DTtDcco-.js";import{f as G}from"./constants-BHDe7bIw.js";import{u as H}from"./use-virtual-mcp-BLx5NqtM.js";import{R as J}from"./require-capability-DlBK7Ljx.js";import"./SearchMd-C4E_z5AK.js";import"./sidebar-Cc4XVWKB.js";import"./LayoutLeft-Dt7rJY-r.js";import"./use-mobile-C0TUGCBw.js";import"./X-JhcLrxaK.js";import"./tooltip-BLkLB4r7.js";import"./use-mcp-client-BIXuHEwh.js";import"./auth-CKKxsAQR.js";import"./studio-tools-B4JofgO_.js";import"./hooks-y59N0gpi.js";import"./decopilot-sse-pool-v3bamRu-.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-CFnkTG10.js";import"./dropdown-menu-DnbYxaX3.js";import"./ChevronUp-mvRqss9i.js";import"./ChevronRight-BUKoQxxN.js";import"./DotsVertical-DitrZ6w4.js";import"./Stars02-B6BvIKTN.js";import"./Trash01-Cwer5u_n.js";import"./agent-icon-CGx0_9l5.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"./ChevronDown-sgVULpdb.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"./Image01-CSEqtjAN.js";import"./Key01-Dh4DUQLF.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"./SearchLg-Ci76gxPe.js";import"./Shield01-D52f0rB7.js";import"./Stars01-DZkGi0yh.js";import"./Upload01-C1yFspcl.js";import"./User01-DFGTsbFQ.js";import"./Users01-oR_WIF7g.js";import"./XClose-C9Ve9LT-.js";import"./use-collections-CfZhiJR7.js";import"./use-capability-BSDyr6zM.js";import"./access-gate-B2PcKpQi.js";import"./capability-load-error-DT5FhHrY.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function go(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{go as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as _,r as q,l as K,j as o}from"./index-DZ3hzzf1.js";import{C as Ne,I as ke,D as Se,E as we,r as Ae,S as Be,F as _e,H as Ie,J as Te,K as $e,L as ue,M as Re,P as Le,N as Pe,O as De,Q as Ee,R as Oe,T as ze,U as Ue}from"./index-Qi63FtON.js";import{V as Fe,C as He,a6 as Je,a7 as Me,a8 as Ve}from"./agent-icon-CGx0_9l5.js";import{s as ve}from"./Plus-BwYAFd19.js";import{e as fe,a as Ge,b as qe,C as Ke,d as Qe,c as Ye}from"./command-DsH5vUBI.js";import{P as We,a as Xe,b as Ze}from"./popover-BIkriKI7.js";import{a as et}from"./Copy01-DLSxZiKr.js";import{b as tt}from"./ZoomOut-DAawwf0t.js";import{s as ae}from"./Trash01-Cwer5u_n.js";import{b as lt}from"./XCircle-Do7Zx-eD.js";import{u as st,d as ot}from"./calendar-Do7G6Kxp.js";import{c as rt}from"./automation-runs-BGZr5t8h.js";import{I as O,F as de,T as se,s as w,p as W,R as X,A as Q}from"./primitives-DlQu8ea0.js";import{i as nt}from"./ChevronUp-mvRqss9i.js";import{L as le}from"./label-BlLucFOT.js";const oe=g=>typeof g=="string"?g:"",it=/\/blog\.tsx?$/;function ye(g,e){for(const[t,i]of Object.entries(g)){if(t.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const l=i;if(typeof l.__resolveType!="string"||!it.test(l.__resolveType))continue;const c=oe(l[e]);if(c)return c}return null}function at(g){return ye(g,"pageSlug")}function ct(g){return ye(g,"categorySlug")}function dt(g){const e=g.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return oe(t?.slug)}function ut(g,e){let t=g;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}const ft=/:(?:categorySlug|category|slug)\??/,mt=/:(?:categorySlug|category|slug)\??/g;function pt(g,e){return ft.test(g)?e?g.replace(mt,encodeURIComponent(e)):null:g}function gl({decofile:g,category:e,previewBaseUrl:t}){if(!t)return null;const i=ct(g);if(!i)return null;const l=pt(i,oe(e.slug));if(!l)return null;try{return new URL(l,t).href}catch{return null}}function xl({decofile:g,post:e,previewBaseUrl:t}){if(!t)return null;const i=at(g);if(!i)return null;const l=ut(i,{category:dt(e),slug:oe(e.slug)});if(!l)return null;try{return new URL(l,t).href}catch{return null}}const me={app:"Blocks",site:"Custom blocks"};function gt(g){const e=_.c(6),{iconName:t,iconUrl:i,alt:l}=g;let c;e[0]!==t?(c=He(t)??Fe,e[0]=t,e[1]=c):c=e[1];const p=c;let f;return e[2]!==p||e[3]!==l||e[4]!==i?(f=o.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:i?o.jsx("img",{src:i,alt:l,className:"size-5 object-contain"}):o.jsx(p,{size:16,className:"text-muted-foreground"})}),e[2]=p,e[3]=l,e[4]=i,e[5]=f):f=e[5],f}function pe(g){const e=_.c(19),{type:t,onInsert:i}=g,l=`${t.title} ${t.resolveType} ${t.description??""}`;let c;e[0]!==i||e[1]!==t.resolveType?(c=()=>i(t.resolveType),e[0]=i,e[1]=t.resolveType,e[2]=c):c=e[2];let p;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(p=o.jsx(gt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=p):p=e[6];let f;e[7]!==t.title?(f=o.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let a;e[9]!==t.description?(a=t.description&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=a):a=e[10];let m;e[11]!==f||e[12]!==a?(m=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f,a]}),e[11]=f,e[12]=a,e[13]=m):m=e[13];let d;return e[14]!==l||e[15]!==c||e[16]!==p||e[17]!==m?(d=o.jsxs(Ge,{value:l,onSelect:c,className:"flex items-center gap-2.5",children:[p,m]}),e[14]=l,e[15]=c,e[16]=p,e[17]=m,e[18]=d):d=e[18],d}function ge(g){const e=_.c(28),{blockTypes:t,onInsert:i,alwaysShow:l}=g,c=l===void 0?!1:l,[p,f]=q.useState(!1);let a,m;if(e[0]!==t){a=[],m=[];for(const S of t)(S.source==="site"?m:a).push(S);e[0]=t,e[1]=a,e[2]=m}else a=e[1],m=e[2];let d;e[3]!==i?(d=S=>{i(S),f(!1)},e[3]=i,e[4]=d):d=e[4];const h=d,s=a.length>0&&m.length>0,r=c?"h-10":"";let n;e[5]!==r?(n=K("group/insert relative flex h-6 items-center justify-center",r),e[5]=r,e[6]=n):n=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border"}),e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(We,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":"Insert block",className:"relative z-10 flex h-6 w-6 items-center justify-center rounded-full border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",children:o.jsx(ve,{size:14})})}),e[8]=x):x=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(qe,{placeholder:"Search blocks…"}),e[9]=b):b=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(Ke,{children:"No blocks found."}),e[10]=y):y=e[10];let v;e[11]!==h||e[12]!==s||e[13]!==m?(v=m.length>0&&o.jsx(fe,{heading:s?me.site:void 0,children:m.map(S=>o.jsx(pe,{type:S,onInsert:h},S.resolveType))}),e[11]=h,e[12]=s,e[13]=m,e[14]=v):v=e[14];let j;e[15]!==a||e[16]!==h||e[17]!==s?(j=a.length>0&&o.jsx(fe,{heading:s?me.app:void 0,children:a.map(S=>o.jsx(pe,{type:S,onInsert:h},S.resolveType))}),e[15]=a,e[16]=h,e[17]=s,e[18]=j):j=e[18];let k;e[19]!==j||e[20]!==v?(k=o.jsx(Xe,{className:"w-80 p-0",align:"center",children:o.jsxs(Qe,{children:[b,o.jsxs(Ye,{className:"max-h-80",children:[y,v,j]})]})}),e[19]=j,e[20]=v,e[21]=k):k=e[21];let C;e[22]!==p||e[23]!==k?(C=o.jsxs(Ze,{open:p,onOpenChange:f,children:[x,k]}),e[22]=p,e[23]=k,e[24]=C):C=e[24];let N;return e[25]!==C||e[26]!==n?(N=o.jsxs("div",{className:n,children:[u,C]}),e[25]=C,e[26]=n,e[27]=N):N=e[27],N}function xt({html:g,placeholder:e,onChange:t}){const i=q.useRef(t);i.current=t;const l=st({extensions:[rt.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),Ne.configure({placeholder:e??"Write something…"})],content:g||"",editorProps:{attributes:{class:K("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:c})=>{const p=c.getHTML();i.current(p==="<p></p>"?"":p)}});return l?o.jsxs("div",{className:"relative",children:[l.isFocused&&o.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[o.jsx(te,{active:l.isActive("bold"),label:"Bold",onClick:()=>l.chain().focus().toggleBold().run(),children:o.jsx(Je,{size:14})}),o.jsx(te,{active:l.isActive("italic"),label:"Italic",onClick:()=>l.chain().focus().toggleItalic().run(),children:o.jsx(Me,{size:14})}),o.jsx(te,{active:l.isActive("underline"),label:"Underline",onClick:()=>l.chain().focus().toggleUnderline().run(),children:o.jsx(Ve,{size:14})}),o.jsx(te,{active:l.isActive("link"),label:"Link",onClick:()=>{const c=l.getAttributes("link").href,p=window.prompt("Link URL",c??"https://");p!==null&&(p===""?l.chain().focus().unsetLink().run():l.chain().focus().setLink({href:p}).run())},children:o.jsx(lt,{size:14})})]}),o.jsx(ot,{editor:l,className:"text-[15px] text-foreground"})]}):null}function te(g){const e=_.c(8),{active:t,label:i,onClick:l,children:c}=g,p=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let f;e[0]!==p?(f=K("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",p),e[0]=p,e[1]=f):f=e[1];let a;return e[2]!==t||e[3]!==c||e[4]!==i||e[5]!==l||e[6]!==f?(a=o.jsx("button",{type:"button","aria-label":i,"aria-pressed":t,onMouseDown:ht,onClick:l,className:f,children:c}),e[2]=t,e[3]=c,e[4]=i,e[5]=l,e[6]=f,e[7]=a):a=e[7],a}function ht(g){return g.preventDefault()}const bt=["1","2","3"],xe={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function vt(g){const e=_.c(19),{text:t,level:i,onChange:l}=g,[c,p]=q.useState(!1),f=i||"2";let a;e[0]!==c||e[1]!==f||e[2]!==l||e[3]!==t?(a=c&&o.jsx(de,{children:bt.map(x=>o.jsxs(se,{active:f===x,label:`Heading ${x}`,onClick:()=>l({text:t,level:x}),children:["H",x]},x))}),e[0]=c,e[1]=f,e[2]=l,e[3]=t,e[4]=a):a=e[4];let m;e[5]!==f||e[6]!==l?(m=x=>l({text:x,level:f}),e[5]=f,e[6]=l,e[7]=m):m=e[7];let d,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=()=>p(!0),h=()=>p(!1),e[8]=d,e[9]=h):(d=e[8],h=e[9]);const s=xe[f]??xe[2];let r;e[10]!==s?(r=K("text-foreground",s),e[10]=s,e[11]=r):r=e[11];let n;e[12]!==m||e[13]!==r||e[14]!==t?(n=o.jsx(O,{value:t,onChange:m,onFocus:d,onBlur:h,placeholder:"Heading",className:r}),e[12]=m,e[13]=r,e[14]=t,e[15]=n):n=e[15];let u;return e[16]!==a||e[17]!==n?(u=o.jsxs("div",{className:"relative",children:[a,n]}),e[16]=a,e[17]=n,e[18]=u):u=e[18],u}function yt(g){const e=_.c(3),{quote:t,onChange:i}=g;let l;return e[0]!==i||e[1]!==t?(l=o.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:o.jsx(O,{value:t,onChange:i,placeholder:"Quote",className:"text-lg italic text-foreground/90"})}),e[0]=i,e[1]=t,e[2]=l):l=e[2],l}function jt(g){const e=_.c(15),{code:t,language:i,onChange:l}=g;let c;e[0]!==t||e[1]!==l?(c=d=>l({code:t,language:d.target.value}),e[0]=t,e[1]=l,e[2]=c):c=e[2];let p;e[3]!==i||e[4]!==c?(p=o.jsx("input",{value:i,onChange:c,placeholder:"language",className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[3]=i,e[4]=c,e[5]=p):p=e[5];let f;e[6]!==i||e[7]!==l?(f=d=>l({code:d,language:i}),e[6]=i,e[7]=l,e[8]=f):f=e[8];let a;e[9]!==t||e[10]!==f?(a=o.jsx(O,{value:t,onChange:f,placeholder:"Code",spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[9]=t,e[10]=f,e[11]=a):a=e[11];let m;return e[12]!==p||e[13]!==a?(m=o.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[p,a]}),e[12]=p,e[13]=a,e[14]=m):m=e[14],m}function Ct(g){const e=_.c(17),{items:t,style:i,onChange:l}=g,c=i==="ordered",p=t.length?t.split(`
|
|
2
|
-
`):[""],[f,a]=q.useState(!1),m=q.useRef([]);let d;e[0]!==l||e[1]!==i?(d=k=>l({items:k.join(`
|
|
3
|
-
`),style:i}),e[0]=l,e[1]=i,e[2]=d):d=e[2];const h=d,s=(k,C)=>requestAnimationFrame(()=>{const N=m.current[k];if(!N)return;N.focus();const S=C==="end"?N.value.length:0;N.setSelectionRange(S,S)}),r="relative";let n,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=()=>a(!0),u=k=>{k.currentTarget.contains(k.relatedTarget)||a(!1)},e[3]=n,e[4]=u):(n=e[3],u=e[4]);let x;e[5]!==f||e[6]!==t||e[7]!==l||e[8]!==c?(x=f&&o.jsxs(de,{children:[o.jsx(se,{active:!c,label:"Bulleted",onClick:()=>l({items:t,style:"unordered"}),children:"•"}),o.jsx(se,{active:c,label:"Numbered",onClick:()=>l({items:t,style:"ordered"}),children:"1."})]}),e[5]=f,e[6]=t,e[7]=l,e[8]=c,e[9]=x):x=e[9];const b="space-y-1",y=p.map((k,C)=>o.jsxs("li",{className:"flex items-start gap-2.5",children:[o.jsx("span",{className:"min-w-5 shrink-0 select-none pt-px text-right text-[15px] leading-relaxed text-muted-foreground tabular-nums",children:c?`${C+1}.`:"•"}),o.jsx(O,{inputRef:N=>{m.current[C]=N},value:k,onChange:N=>{const S=[...p];S[C]=N,h(S)},onKeyDown:N=>{const S=N.currentTarget;if(N.key==="Enter"){N.preventDefault();const T=[...p];T.splice(C+1,0,""),h(T),s(C+1,"start")}else N.key==="Backspace"&&k===""&&p.length>1?(N.preventDefault(),h(p.filter((T,A)=>A!==C)),s(Math.max(0,C-1),"end")):N.key==="ArrowUp"&&S.selectionStart===0&&C>0?(N.preventDefault(),s(C-1,"end")):N.key==="ArrowDown"&&S.selectionEnd===k.length&&C<p.length-1&&(N.preventDefault(),s(C+1,"end"))},placeholder:"List item",className:"text-[15px] leading-relaxed text-foreground"})]},C));let v;e[10]!==y?(v=o.jsx("ul",{className:b,children:y}),e[10]=y,e[11]=v):v=e[11];let j;return e[12]!==n||e[13]!==u||e[14]!==x||e[15]!==v?(j=o.jsxs("div",{className:r,onFocus:n,onBlur:u,children:[x,v]}),e[12]=n,e[13]=u,e[14]=x,e[15]=v,e[16]=j):j=e[16],j}function Nt(g){const e=_.c(37),{block:t,onChange:i}=g;let l;e[0]!==t.size?(l=w(t.size)||"normal",e[0]=t.size,e[1]=l):l=e[1];const c=l;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p={type:"string",format:"image-uri",title:"Image"},e[2]=p):p=e[2];let f;e[3]!==t||e[4]!==i?(f=v=>i({...t,url:v}),e[3]=t,e[4]=i,e[5]=f):f=e[5];let a;e[6]!==t.url||e[7]!==f?(a=o.jsx(ke,{schema:p,value:t.url,onChange:f,path:"block-image-url",label:"Image"}),e[6]=t.url,e[7]=f,e[8]=a):a=e[8];let m;e[9]!==t.caption?(m=w(t.caption),e[9]=t.caption,e[10]=m):m=e[10];let d;e[11]!==t||e[12]!==i?(d=v=>i({...t,caption:v}),e[11]=t,e[12]=i,e[13]=d):d=e[13];let h;e[14]!==m||e[15]!==d?(h=o.jsx(O,{value:m,onChange:d,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=m,e[15]=d,e[16]=h):h=e[16];let s;e[17]===Symbol.for("react.memo_cache_sentinel")?(s=["normal","full"],e[17]=s):s=e[17];let r;e[18]!==t||e[19]!==i||e[20]!==c?(r=o.jsx("div",{className:"flex items-center gap-1",children:s.map(v=>o.jsx("button",{type:"button",onClick:()=>i({...t,size:v}),className:K("rounded px-2 py-0.5 transition-colors cursor-pointer",c===v?"bg-accent text-accent-foreground":"hover:bg-muted"),children:v==="full"?"Full width":"Normal"},v))}),e[18]=t,e[19]=i,e[20]=c,e[21]=r):r=e[21];let n;e[22]!==t.alt?(n=w(t.alt),e[22]=t.alt,e[23]=n):n=e[23];let u;e[24]!==t||e[25]!==i?(u=v=>i({...t,alt:v.target.value}),e[24]=t,e[25]=i,e[26]=u):u=e[26];let x;e[27]!==n||e[28]!==u?(x=o.jsx("input",{value:n,onChange:u,placeholder:"Alt text (accessibility)",className:"flex-1 border-0 bg-transparent p-0 text-xs outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[27]=n,e[28]=u,e[29]=x):x=e[29];let b;e[30]!==x||e[31]!==r?(b=o.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[r,x]}),e[30]=x,e[31]=r,e[32]=b):b=e[32];let y;return e[33]!==b||e[34]!==a||e[35]!==h?(y=o.jsxs("div",{className:"space-y-2",children:[a,h,b]}),e[33]=b,e[34]=a,e[35]=h,e[36]=y):y=e[36],y}function kt(g){const e=g.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=g.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function St(g){const e=_.c(21),{url:t,caption:i,onChange:l}=g;let c;e[0]!==t?(c=kt(t),e[0]=t,e[1]=c):c=e[1];const p=c;let f;e[2]!==i||e[3]!==p?(f=p?o.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:o.jsx("iframe",{src:p,title:i||"Video",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):o.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:"Paste a YouTube or Vimeo URL to preview"}),e[2]=i,e[3]=p,e[4]=f):f=e[4];let a;e[5]!==i||e[6]!==l?(a=r=>l({url:r.target.value,caption:i}),e[5]=i,e[6]=l,e[7]=a):a=e[7];let m;e[8]!==a||e[9]!==t?(m=o.jsx("input",{value:t,onChange:a,placeholder:"https://youtube.com/watch?v=…",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[8]=a,e[9]=t,e[10]=m):m=e[10];let d;e[11]!==l||e[12]!==t?(d=r=>l({url:t,caption:r}),e[11]=l,e[12]=t,e[13]=d):d=e[13];let h;e[14]!==i||e[15]!==d?(h=o.jsx(O,{value:i,onChange:d,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=i,e[15]=d,e[16]=h):h=e[16];let s;return e[17]!==f||e[18]!==m||e[19]!==h?(s=o.jsxs("div",{className:"space-y-2",children:[f,m,h]}),e[17]=f,e[18]=m,e[19]=h,e[20]=s):s=e[20],s}function wt(){const g=_.c(1);let e;return g[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center py-3","aria-label":"Divider",children:o.jsx("span",{className:"h-px flex-1 bg-border"})}),g[0]=e):e=g[0],e}function At(g){const e=_.c(16),{text:t,href:i,onChange:l}=g;let c;e[0]!==i||e[1]!==l?(c=h=>l({text:h.target.value,href:i}),e[0]=i,e[1]=l,e[2]=c):c=e[2];const p=Math.max(t.length||11,8);let f;e[3]!==c||e[4]!==p||e[5]!==t?(f=o.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:o.jsx("input",{value:t,onChange:c,placeholder:"Button label",size:p,className:"border-0 bg-transparent p-0 text-center text-sm font-semibold text-primary-foreground outline-none placeholder:text-primary-foreground/60 focus:ring-0"})}),e[3]=c,e[4]=p,e[5]=t,e[6]=f):f=e[6];let a;e[7]!==l||e[8]!==t?(a=h=>l({text:t,href:h.target.value}),e[7]=l,e[8]=t,e[9]=a):a=e[9];let m;e[10]!==i||e[11]!==a?(m=o.jsx("input",{value:i,onChange:a,placeholder:"https://destination-url.com",className:"w-full max-w-sm border-0 bg-transparent p-0 text-center text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[10]=i,e[11]=a,e[12]=m):m=e[12];let d;return e[13]!==f||e[14]!==m?(d=o.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[f,m]}),e[13]=f,e[14]=m,e[15]=d):d=e[15],d}const re=[{value:"info",icon:"ℹ",color:"oklch(0.62 0.19 250)"},{value:"tip",icon:"✓",color:"oklch(0.65 0.17 150)"},{value:"warning",icon:"⚠",color:"oklch(0.75 0.15 75)"},{value:"product",icon:"★",color:"oklch(0.62 0.21 300)"}];function Bt(g){const e=_.c(45),{title:t,body:i,variant:l,onChange:c}=g,[p,f]=q.useState(!1);let a;e[0]!==l?(a=re.find(A=>A.value===l)??re[0],e[0]=l,e[1]=a):a=e[1];const m=a;let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>f(!0),h=A=>{A.currentTarget.contains(A.relatedTarget)||f(!1)},e[2]=d,e[3]=h):(d=e[2],h=e[3]);let s;e[4]!==i||e[5]!==p||e[6]!==c||e[7]!==t||e[8]!==m.value?(s=p&&o.jsx(de,{children:re.map(A=>o.jsx(se,{active:m.value===A.value,label:A.value,onClick:()=>c({title:t,body:i,variant:A.value}),children:o.jsx("span",{style:{color:A.color},children:A.icon})},A.value))}),e[4]=i,e[5]=p,e[6]=c,e[7]=t,e[8]=m.value,e[9]=s):s=e[9];const r=`3px solid ${m.color}`,n=`color-mix(in oklch, ${m.color} 8%, transparent)`;let u;e[10]!==r||e[11]!==n?(u={borderLeft:r,backgroundColor:n},e[10]=r,e[11]=n,e[12]=u):u=e[12];let x;e[13]!==m.color?(x={color:m.color},e[13]=m.color,e[14]=x):x=e[14];let b;e[15]!==m.icon?(b=o.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:m.icon}),e[15]=m.icon,e[16]=b):b=e[16];let y;e[17]!==i||e[18]!==c||e[19]!==l?(y=A=>c({title:A.target.value,body:i,variant:l}),e[17]=i,e[18]=c,e[19]=l,e[20]=y):y=e[20];let v;e[21]!==m.color?(v={color:m.color},e[21]=m.color,e[22]=v):v=e[22];let j;e[23]!==y||e[24]!==v||e[25]!==t?(j=o.jsx("input",{value:t,onChange:y,placeholder:"Callout title",className:"flex-1 border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none focus:ring-0",style:v}),e[23]=y,e[24]=v,e[25]=t,e[26]=j):j=e[26];let k;e[27]!==j||e[28]!==x||e[29]!==b?(k=o.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:x,children:[b,j]}),e[27]=j,e[28]=x,e[29]=b,e[30]=k):k=e[30];let C;e[31]!==c||e[32]!==t||e[33]!==l?(C=A=>c({title:t,body:A,variant:l}),e[31]=c,e[32]=t,e[33]=l,e[34]=C):C=e[34];let N;e[35]!==i||e[36]!==C?(N=o.jsx(O,{value:i,onChange:C,placeholder:"Callout text…",className:"text-[15px] leading-relaxed text-foreground"}),e[35]=i,e[36]=C,e[37]=N):N=e[37];let S;e[38]!==k||e[39]!==N||e[40]!==u?(S=o.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:u,children:[k,N]}),e[38]=k,e[39]=N,e[40]=u,e[41]=S):S=e[41];let T;return e[42]!==S||e[43]!==s?(T=o.jsxs("div",{className:"relative",onFocus:d,onBlur:h,children:[s,S]}),e[42]=S,e[43]=s,e[44]=T):T=e[44],T}function _t(g){const e=_.c(25),{value:t,label:i,description:l,onChange:c}=g;let p;e[0]!==l||e[1]!==i||e[2]!==c?(p=r=>c({value:r.target.value,label:i,description:l}),e[0]=l,e[1]=i,e[2]=c,e[3]=p):p=e[3];let f;e[4]!==p||e[5]!==t?(f=o.jsx("input",{value:t,onChange:p,placeholder:"42%",className:"w-full border-0 bg-transparent p-0 text-center text-4xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[4]=p,e[5]=t,e[6]=f):f=e[6];let a;e[7]!==l||e[8]!==c||e[9]!==t?(a=r=>c({value:t,label:r.target.value,description:l}),e[7]=l,e[8]=c,e[9]=t,e[10]=a):a=e[10];let m;e[11]!==i||e[12]!==a?(m=o.jsx("input",{value:i,onChange:a,placeholder:"Label",className:"w-full border-0 bg-transparent p-0 text-center text-xs font-semibold uppercase tracking-wide text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[11]=i,e[12]=a,e[13]=m):m=e[13];let d;e[14]!==i||e[15]!==c||e[16]!==t?(d=r=>c({value:t,label:i,description:r}),e[14]=i,e[15]=c,e[16]=t,e[17]=d):d=e[17];let h;e[18]!==l||e[19]!==d?(h=o.jsx(O,{value:l,onChange:d,placeholder:"Optional description",className:"max-w-md text-center text-sm text-muted-foreground"}),e[18]=l,e[19]=d,e[20]=h):h=e[20];let s;return e[21]!==f||e[22]!==m||e[23]!==h?(s=o.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[f,m,h]}),e[21]=f,e[22]=m,e[23]=h,e[24]=s):s=e[24],s}function It(g){const e=_.c(19),{cards:t,onChange:i}=g;let l,c,p,f,a;if(e[0]!==t||e[1]!==i){c=W(t);let s;e[7]!==i?(s=n=>i(JSON.stringify(n)),e[7]=i,e[8]=s):s=e[8],l=s;const r=(n,u)=>l(c.map((x,b)=>b===n?{...x,...u}:x));a="space-y-2",p="grid grid-cols-1 gap-3 sm:grid-cols-3",f=c.slice(0,3).map((n,u)=>o.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"absolute right-1 top-1",children:o.jsx(X,{label:"Remove card",onClick:()=>l(c.filter((x,b)=>b!==u))})}),o.jsx("input",{value:w(n.icon),onChange:x=>r(u,{icon:x.target.value}),placeholder:"🎴",className:"flex h-9 w-9 items-center justify-center rounded-md border bg-background text-center text-lg outline-none focus:ring-0"}),o.jsx("input",{value:w(n.title),onChange:x=>r(u,{title:x.target.value}),placeholder:"Card title",className:"border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),o.jsx(O,{value:w(n.body),onChange:x=>r(u,{body:x}),placeholder:"Card body",className:"text-sm text-muted-foreground"})]},u)),e[0]=t,e[1]=i,e[2]=l,e[3]=c,e[4]=p,e[5]=f,e[6]=a}else l=e[2],c=e[3],p=e[4],f=e[5],a=e[6];let m;e[9]!==p||e[10]!==f?(m=o.jsx("div",{className:p,children:f}),e[9]=p,e[10]=f,e[11]=m):m=e[11];let d;e[12]!==l||e[13]!==c?(d=c.length<3&&o.jsx(Q,{label:"Add card",onClick:()=>l([...c,{title:"",body:""}])}),e[12]=l,e[13]=c,e[14]=d):d=e[14];let h;return e[15]!==a||e[16]!==m||e[17]!==d?(h=o.jsxs("div",{className:a,children:[m,d]}),e[15]=a,e[16]=m,e[17]=d,e[18]=h):h=e[18],h}function Tt(g){const e=_.c(27),{title:t,items:i,onChange:l}=g;let c,p,f,a,m;if(e[0]!==i||e[1]!==l||e[2]!==t){p=W(i);let r;e[8]!==l||e[9]!==t?(r=u=>l({title:t,items:JSON.stringify(u)}),e[8]=l,e[9]=t,e[10]=r):r=e[10],c=r,a="space-y-2";let n;e[11]!==i||e[12]!==l?(n=u=>l({title:u.target.value,items:i}),e[11]=i,e[12]=l,e[13]=n):n=e[13],e[14]!==n||e[15]!==t?(m=o.jsx("input",{value:t,onChange:n,placeholder:"Checklist title (optional)",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[14]=n,e[15]=t,e[16]=m):m=e[16],f=p.map((u,x)=>o.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[o.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:o.jsx(nt,{size:15})}),o.jsx(O,{value:u,onChange:b=>c(p.map((y,v)=>v===x?b:y)),placeholder:"Checklist item",className:"text-[15px] text-foreground"}),o.jsx(X,{label:"Remove item",onClick:()=>c(p.filter((b,y)=>y!==x))})]},x)),e[0]=i,e[1]=l,e[2]=t,e[3]=c,e[4]=p,e[5]=f,e[6]=a,e[7]=m}else c=e[3],p=e[4],f=e[5],a=e[6],m=e[7];let d;e[17]!==f?(d=o.jsx("ul",{children:f}),e[17]=f,e[18]=d):d=e[18];let h;e[19]!==c||e[20]!==p?(h=o.jsx(Q,{label:"Add item",onClick:()=>c([...p,""])}),e[19]=c,e[20]=p,e[21]=h):h=e[21];let s;return e[22]!==a||e[23]!==m||e[24]!==d||e[25]!==h?(s=o.jsxs("div",{className:a,children:[m,d,h]}),e[22]=a,e[23]=m,e[24]=d,e[25]=h,e[26]=s):s=e[26],s}function $t(g){const e=_.c(19),{stats:t,onChange:i}=g;let l,c,p,f,a;if(e[0]!==i||e[1]!==t){c=W(t);let s;e[7]!==i?(s=n=>i(JSON.stringify(n)),e[7]=i,e[8]=s):s=e[8],l=s;const r=(n,u)=>l(c.map((x,b)=>b===n?{...x,...u}:x));a="space-y-2",p="grid grid-cols-1 gap-3 sm:grid-cols-3",f=c.slice(0,3).map((n,u)=>o.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[o.jsx("div",{className:"absolute right-1 top-1",children:o.jsx(X,{label:"Remove stat",onClick:()=>l(c.filter((x,b)=>b!==u))})}),o.jsx("input",{value:w(n.value),onChange:x=>r(u,{value:x.target.value}),placeholder:"99%",className:"w-full border-0 bg-transparent p-0 text-center text-3xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),o.jsx("input",{value:w(n.label),onChange:x=>r(u,{label:x.target.value}),placeholder:"Label",className:"mt-1 w-full border-0 bg-transparent p-0 text-center text-sm text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"})]},u)),e[0]=i,e[1]=t,e[2]=l,e[3]=c,e[4]=p,e[5]=f,e[6]=a}else l=e[2],c=e[3],p=e[4],f=e[5],a=e[6];let m;e[9]!==p||e[10]!==f?(m=o.jsx("div",{className:p,children:f}),e[9]=p,e[10]=f,e[11]=m):m=e[11];let d;e[12]!==l||e[13]!==c?(d=c.length<3&&o.jsx(Q,{label:"Add stat",onClick:()=>l([...c,{value:"",label:""}])}),e[12]=l,e[13]=c,e[14]=d):d=e[14];let h;return e[15]!==a||e[16]!==m||e[17]!==d?(h=o.jsxs("div",{className:a,children:[m,d]}),e[15]=a,e[16]=m,e[17]=d,e[18]=h):h=e[18],h}function Rt(g){const e=_.c(29),{title:t,steps:i,onChange:l}=g;let c,p,f,a,m,d;if(e[0]!==l||e[1]!==i||e[2]!==t){p=W(i);let n;e[9]!==l||e[10]!==t?(n=b=>l({title:t,steps:JSON.stringify(b)}),e[9]=l,e[10]=t,e[11]=n):n=e[11],c=n;const u=(b,y)=>c(p.map((v,j)=>j===b?{...v,...y}:v));m="space-y-2";let x;e[12]!==l||e[13]!==i?(x=b=>l({title:b.target.value,steps:i}),e[12]=l,e[13]=i,e[14]=x):x=e[14],e[15]!==x||e[16]!==t?(d=o.jsx("input",{value:t,onChange:x,placeholder:"Steps title (optional)",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[15]=x,e[16]=t,e[17]=d):d=e[17],f="space-y-3",a=p.map((b,y)=>o.jsxs("li",{className:"group/item flex gap-4",children:[o.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border text-sm font-semibold text-muted-foreground",children:y+1}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[o.jsx("input",{value:w(b.title),onChange:v=>u(y,{title:v.target.value}),placeholder:"Step title",className:"w-full border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),o.jsx(O,{value:w(b.description),onChange:v=>u(y,{description:v}),placeholder:"Step description",className:"text-sm text-muted-foreground"})]}),o.jsx(X,{label:"Remove step",onClick:()=>c(p.filter((v,j)=>j!==y))})]},y)),e[0]=l,e[1]=i,e[2]=t,e[3]=c,e[4]=p,e[5]=f,e[6]=a,e[7]=m,e[8]=d}else c=e[3],p=e[4],f=e[5],a=e[6],m=e[7],d=e[8];let h;e[18]!==f||e[19]!==a?(h=o.jsx("ol",{className:f,children:a}),e[18]=f,e[19]=a,e[20]=h):h=e[20];let s;e[21]!==c||e[22]!==p?(s=o.jsx(Q,{label:"Add step",onClick:()=>c([...p,{title:"",description:""}])}),e[21]=c,e[22]=p,e[23]=s):s=e[23];let r;return e[24]!==m||e[25]!==d||e[26]!==h||e[27]!==s?(r=o.jsxs("div",{className:m,children:[d,h,s]}),e[24]=m,e[25]=d,e[26]=h,e[27]=s,e[28]=r):r=e[28],r}function he(g,e){try{const t=JSON.parse(g||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items:[]}}catch{return{title:e,items:[]}}}function Lt(g){const e=_.c(7),{left:t,right:i,onChange:l}=g;let c;if(e[0]!==t||e[1]!==l||e[2]!==i){const p={left:he(t,"Option A"),right:he(i,"Option B")},f=(h,s)=>l({left:h==="left"?JSON.stringify(s):t,right:h==="right"?JSON.stringify(s):i});let a;e[4]!==f?(a=(h,s,r)=>{const n=s.items??[];return o.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[o.jsx("input",{value:w(s.title),onChange:u=>f(h,{...s,title:u.target.value}),placeholder:"Column title",className:"w-full border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),o.jsx("ul",{className:"space-y-1.5",children:n.map((u,x)=>o.jsxs("li",{className:"group/item flex items-start gap-2",children:[o.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:r},children:"✓"}),o.jsx(O,{value:u,onChange:b=>f(h,{...s,items:n.map((y,v)=>v===x?b:y)}),placeholder:"Item",className:"text-sm text-foreground"}),o.jsx(X,{label:"Remove item",onClick:()=>f(h,{...s,items:n.filter((b,y)=>y!==x)})})]},x))}),o.jsx(Q,{label:"Add item",onClick:()=>f(h,{...s,items:[...n,""]})})]})},e[4]=f,e[5]=a):a=e[5];const m=a;let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=K("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[6]=d):d=e[6],c=o.jsxs("div",{className:d,children:[m("left",p.left,"oklch(0.65 0.17 150)"),m("right",p.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=l,e[2]=i,e[3]=c}else c=e[3];return c}const Pt="vtex/loaders/intelligentSearch/productList.ts";function F(g){return g&&typeof g=="object"&&!Array.isArray(g)?g:null}function ne(g){return typeof g=="string"||typeof g=="number"?String(g):""}function ie(g){const e=F(g);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function je(g){if(Array.isArray(g))return g.map(i=>ne(F(i)?.productId));const e=F(g),t=F(e?.props);return t&&Array.isArray(t.ids)?t.ids.map(ne):e&&"productId"in e?[ne(e.productId)]:[]}function Dt(g){const e=F(g)??{};return typeof e.__resolveType=="string"?e.__resolveType:Pt}function Ce(g,e){if(Array.isArray(g)){const c=g.find(ie);if(c)return e.map((p,f)=>{const a=F(g[f]);return{...ie(a)?a:{__resolveType:c.__resolveType},productId:p}})}const t=F(g);if(ie(t)&&!F(t.props)?.ids)return{...t,productId:e[0]??""};const i=F(t?.props)??{},l=Dt(g);return{...t??{},__resolveType:l,props:{...i,ids:e,simulationBehavior:i.simulationBehavior??"default"}}}function Et(g){const e=_.c(21),{ids:t,onChange:i,label:l}=g;let c;e[0]!==t||e[1]!==i?(c=(r,n)=>i(t.map((u,x)=>x===r?n:u)),e[0]=t,e[1]=i,e[2]=c):c=e[2];const p=c;let f;e[3]!==l?(f=o.jsx(le,{className:"text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=f):f=e[4];let a;e[5]!==t.length?(a=t.length===0&&o.jsx("p",{className:"text-xs text-muted-foreground",children:"No product IDs yet — add one below."}),e[5]=t.length,e[6]=a):a=e[6];let m;e[7]!==t||e[8]!==i||e[9]!==p?(m=t.map((r,n)=>o.jsxs("li",{className:"group/item flex items-center gap-3",children:[o.jsx("input",{value:r,onChange:u=>p(n,u.target.value),placeholder:"151331",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),o.jsx(X,{label:"Remove product ID",onClick:()=>i(t.filter((u,x)=>x!==n))})]},n)),e[7]=t,e[8]=i,e[9]=p,e[10]=m):m=e[10];let d;e[11]!==m?(d=o.jsx("ul",{className:"space-y-2",children:m}),e[11]=m,e[12]=d):d=e[12];let h;e[13]!==t||e[14]!==i?(h=o.jsx(Q,{label:"Add product ID",onClick:()=>i([...t,""])}),e[13]=t,e[14]=i,e[15]=h):h=e[15];let s;return e[16]!==f||e[17]!==a||e[18]!==d||e[19]!==h?(s=o.jsxs("div",{className:"space-y-2",children:[f,a,d,h]}),e[16]=f,e[17]=a,e[18]=d,e[19]=h,e[20]=s):s=e[20],s}function Ot(g){const e=_.c(32),{block:t,onChange:i}=g;let l;e[0]!==t.product?(l=je(t.product),e[0]=t.product,e[1]=l):l=e[1];const p=l[0]??"";let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Product card"}),e[2]=f):f=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(le,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:"CTA label"}),e[3]=a):a=e[3];let m;e[4]!==t.textCta?(m=w(t.textCta),e[4]=t.textCta,e[5]=m):m=e[5];let d;e[6]!==t||e[7]!==i?(d=j=>i({...t,textCta:j.target.value}),e[6]=t,e[7]=i,e[8]=d):d=e[8];let h;e[9]!==m||e[10]!==d?(h=o.jsxs("div",{className:"space-y-2",children:[a,o.jsx("input",{id:"product-card-cta",value:m,onChange:d,placeholder:"Ver produto",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[9]=m,e[10]=d,e[11]=h):h=e[11];let s;e[12]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(le,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:"Product slug"}),e[12]=s):s=e[12];let r;e[13]!==t.productSlug?(r=w(t.productSlug),e[13]=t.productSlug,e[14]=r):r=e[14];let n;e[15]!==t||e[16]!==i?(n=j=>i({...t,productSlug:j.target.value}),e[15]=t,e[16]=i,e[17]=n):n=e[17];let u;e[18]!==r||e[19]!==n?(u=o.jsxs("div",{className:"space-y-2",children:[s,o.jsx("input",{id:"product-card-slug",value:r,onChange:n,placeholder:"product-slug",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[18]=r,e[19]=n,e[20]=u):u=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(le,{htmlFor:"product-card-id",className:"text-xs text-muted-foreground",children:"VTEX product ID"}),e[21]=x):x=e[21];let b;e[22]!==t||e[23]!==i?(b=j=>i({...t,product:Ce(t.product,j.target.value?[j.target.value]:[])}),e[22]=t,e[23]=i,e[24]=b):b=e[24];let y;e[25]!==p||e[26]!==b?(y=o.jsxs("div",{className:"space-y-2",children:[x,o.jsx("input",{id:"product-card-id",value:p,onChange:b,placeholder:"151331",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[25]=p,e[26]=b,e[27]=y):y=e[27];let v;return e[28]!==u||e[29]!==y||e[30]!==h?(v=o.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[f,h,u,y]}),e[28]=u,e[29]=y,e[30]=h,e[31]=v):v=e[31],v}function zt(g){const e=_.c(19),{block:t,onChange:i}=g;let l;e[0]!==t.products?(l=je(t.products),e[0]=t.products,e[1]=l):l=e[1];const c=l;let p;e[2]!==t.title?(p=w(t.title),e[2]=t.title,e[3]=p):p=e[3];let f;e[4]!==t||e[5]!==i?(f=s=>i({...t,title:s.target.value}),e[4]=t,e[5]=i,e[6]=f):f=e[6];let a;e[7]!==p||e[8]!==f?(a=o.jsx("input",{value:p,onChange:f,placeholder:"Shelf title",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[7]=p,e[8]=f,e[9]=a):a=e[9];let m;e[10]!==t||e[11]!==i?(m=s=>i({...t,products:Ce(t.products,s)}),e[10]=t,e[11]=i,e[12]=m):m=e[12];let d;e[13]!==c||e[14]!==m?(d=o.jsx(Et,{label:"VTEX product IDs",ids:c,onChange:m}),e[13]=c,e[14]=m,e[15]=d):d=e[15];let h;return e[16]!==a||e[17]!==d?(h=o.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[a,d]}),e[16]=a,e[17]=d,e[18]=h):h=e[18],h}const Ut=2,Ft=2;function Ht(g){return W(g).map(w)}function Jt(g){return W(g).map(e=>Array.isArray(e)?e.map(w):[])}function be(g){return Array.from({length:g},()=>"")}function Mt(g){const e=_.c(42),{headers:t,rows:i,onChange:l}=g;let c,p,f,a,m,d,h,s,r;if(e[0]!==t||e[1]!==l||e[2]!==i){const N=Ht(t),S=Jt(i),T=N.length===0&&S.length===0;f=T?Ut:Math.max(N.length,...S.map(qt),1);const A=Array.from({length:f},(I,B)=>N[B]??"");a=T?Array.from({length:Ft},()=>be(f)):S.map(I=>Array.from({length:f},(B,R)=>I[R]??""));let P;e[12]!==l?(P=(I,B)=>l({headers:JSON.stringify(I.some(Gt)?I:[]),rows:JSON.stringify(B)}),e[12]=l,e[13]=P):P=e[13];const z=P,Y=(I,B)=>z(A.map((R,D)=>D===I?B:R),a),Z=(I,B,R)=>z(A,a.map((D,$)=>$===I?D.map((E,L)=>L===B?R:E):D));p=()=>z(A,[...a,be(f)]);const H=I=>z(A,a.filter((B,R)=>R!==I));c=()=>z([...A,""],a.map(Vt));const J=I=>z(A.filter((B,R)=>R!==I),a.map(B=>B.filter((R,D)=>D!==I)));r="space-y-2",s="overflow-x-auto rounded-lg border",d="w-full border-collapse";let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("th",{className:"w-8 border-b"}),e[14]=M):M=e[14];const U=o.jsxs("tr",{className:"bg-muted/40",children:[A.map((I,B)=>o.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0",children:[o.jsx("input",{value:I,onChange:R=>Y(B,R.target.value),placeholder:`Header ${B+1}`,className:"w-full border-0 bg-transparent py-2 pl-7 pr-3 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/40 focus:bg-background focus:ring-0"}),f>1&&o.jsx("button",{type:"button","aria-label":`Remove column ${B+1}`,onClick:()=>J(B),className:"absolute left-0.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground/50 opacity-0 transition-opacity hover:text-destructive group-hover/col:opacity-100 cursor-pointer",children:o.jsx(ae,{size:12})})]},B)),M]});e[15]!==U?(h=o.jsx("thead",{children:U}),e[15]=U,e[16]=h):h=e[16],m=a.map((I,B)=>o.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[I.map((R,D)=>o.jsx("td",{className:"border-r p-0 last:border-r-0",children:o.jsx("input",{value:R,onChange:$=>Z(B,D,$.target.value),placeholder:"—",className:"w-full border-0 bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/30 focus:bg-muted/30 focus:ring-0"})},D)),o.jsx("td",{className:"w-8 text-center align-middle",children:a.length>1&&o.jsx("button",{type:"button","aria-label":`Remove row ${B+1}`,onClick:()=>H(B),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer",children:o.jsx(ae,{size:13})})})]},B)),e[0]=t,e[1]=l,e[2]=i,e[3]=c,e[4]=p,e[5]=f,e[6]=a,e[7]=m,e[8]=d,e[9]=h,e[10]=s,e[11]=r}else c=e[3],p=e[4],f=e[5],a=e[6],m=e[7],d=e[8],h=e[9],s=e[10],r=e[11];let n;e[17]!==f||e[18]!==a.length?(n=a.length===0&&o.jsx("tr",{children:o.jsx("td",{colSpan:f+1,className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No rows yet — add one below."})}),e[17]=f,e[18]=a.length,e[19]=n):n=e[19];let u;e[20]!==m||e[21]!==n?(u=o.jsxs("tbody",{children:[m,n]}),e[20]=m,e[21]=n,e[22]=u):u=e[22];let x;e[23]!==d||e[24]!==h||e[25]!==u?(x=o.jsxs("table",{className:d,children:[h,u]}),e[23]=d,e[24]=h,e[25]=u,e[26]=x):x=e[26];let b;e[27]!==s||e[28]!==x?(b=o.jsx("div",{className:s,children:x}),e[27]=s,e[28]=x,e[29]=b):b=e[29];let y;e[30]!==p?(y=o.jsx(Q,{label:"Add row",onClick:p}),e[30]=p,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(ve,{size:13}),e[32]=v):v=e[32];let j;e[33]!==c?(j=o.jsxs("button",{type:"button",onClick:c,className:"flex items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[v,"Add column"]}),e[33]=c,e[34]=j):j=e[34];let k;e[35]!==y||e[36]!==j?(k=o.jsxs("div",{className:"flex gap-2",children:[y,j]}),e[35]=y,e[36]=j,e[37]=k):k=e[37];let C;return e[38]!==k||e[39]!==r||e[40]!==b?(C=o.jsxs("div",{className:r,children:[b,k]}),e[38]=k,e[39]=r,e[40]=b,e[41]=C):C=e[41],C}function Vt(g){return[...g,""]}function Gt(g){return g.trim()!==""}function qt(g){return g.length}function Kt(g){const e=_.c(180),{block:t,meta:i,onChange:l}=g,c=t.__resolveType??"",p=Se(c);if(we(c))switch(p){case"Paragraph":{let s;e[0]!==t.html?(s=w(t.html),e[0]=t.html,e[1]=s):s=e[1];let r;e[2]!==t||e[3]!==l?(r=u=>l({...t,html:u}),e[2]=t,e[3]=l,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=o.jsx(xt,{html:s,placeholder:"Write something…",onChange:r}),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}case"Heading":{let s;e[8]!==t.text?(s=w(t.text),e[8]=t.text,e[9]=s):s=e[9];let r;e[10]!==t.level?(r=w(t.level),e[10]=t.level,e[11]=r):r=e[11];let n;e[12]!==t||e[13]!==l?(n=x=>l({...t,...x}),e[12]=t,e[13]=l,e[14]=n):n=e[14];let u;return e[15]!==s||e[16]!==r||e[17]!==n?(u=o.jsx(vt,{text:s,level:r,onChange:n}),e[15]=s,e[16]=r,e[17]=n,e[18]=u):u=e[18],u}case"Quote":{let s;e[19]!==t.quote?(s=w(t.quote),e[19]=t.quote,e[20]=s):s=e[20];let r;e[21]!==t||e[22]!==l?(r=u=>l({...t,quote:u}),e[21]=t,e[22]=l,e[23]=r):r=e[23];let n;return e[24]!==s||e[25]!==r?(n=o.jsx(yt,{quote:s,onChange:r}),e[24]=s,e[25]=r,e[26]=n):n=e[26],n}case"Code":{let s;e[27]!==t.code?(s=w(t.code),e[27]=t.code,e[28]=s):s=e[28];let r;e[29]!==t.language?(r=w(t.language),e[29]=t.language,e[30]=r):r=e[30];let n;e[31]!==t||e[32]!==l?(n=x=>l({...t,...x}),e[31]=t,e[32]=l,e[33]=n):n=e[33];let u;return e[34]!==s||e[35]!==r||e[36]!==n?(u=o.jsx(jt,{code:s,language:r,onChange:n}),e[34]=s,e[35]=r,e[36]=n,e[37]=u):u=e[37],u}case"List":{let s;e[38]!==t.items?(s=w(t.items),e[38]=t.items,e[39]=s):s=e[39];let r;e[40]!==t.style?(r=w(t.style),e[40]=t.style,e[41]=r):r=e[41];let n;e[42]!==t||e[43]!==l?(n=x=>l({...t,...x}),e[42]=t,e[43]=l,e[44]=n):n=e[44];let u;return e[45]!==s||e[46]!==r||e[47]!==n?(u=o.jsx(Ct,{items:s,style:r,onChange:n}),e[45]=s,e[46]=r,e[47]=n,e[48]=u):u=e[48],u}case"BlockImage":{let s;return e[49]!==t||e[50]!==l?(s=o.jsx(Nt,{block:t,onChange:l}),e[49]=t,e[50]=l,e[51]=s):s=e[51],s}case"Video":{let s;e[52]!==t.url?(s=w(t.url),e[52]=t.url,e[53]=s):s=e[53];let r;e[54]!==t.caption?(r=w(t.caption),e[54]=t.caption,e[55]=r):r=e[55];let n;e[56]!==t||e[57]!==l?(n=x=>l({...t,...x}),e[56]=t,e[57]=l,e[58]=n):n=e[58];let u;return e[59]!==s||e[60]!==r||e[61]!==n?(u=o.jsx(St,{url:s,caption:r,onChange:n}),e[59]=s,e[60]=r,e[61]=n,e[62]=u):u=e[62],u}case"Divider":{let s;return e[63]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(wt,{}),e[63]=s):s=e[63],s}case"Cta":{let s;e[64]!==t.text?(s=w(t.text),e[64]=t.text,e[65]=s):s=e[65];let r;e[66]!==t.href?(r=w(t.href),e[66]=t.href,e[67]=r):r=e[67];let n;e[68]!==t||e[69]!==l?(n=x=>l({...t,...x}),e[68]=t,e[69]=l,e[70]=n):n=e[70];let u;return e[71]!==s||e[72]!==r||e[73]!==n?(u=o.jsx(At,{text:s,href:r,onChange:n}),e[71]=s,e[72]=r,e[73]=n,e[74]=u):u=e[74],u}case"Callout":{let s;e[75]!==t.title?(s=w(t.title),e[75]=t.title,e[76]=s):s=e[76];let r;e[77]!==t.body?(r=w(t.body),e[77]=t.body,e[78]=r):r=e[78];let n;e[79]!==t.variant?(n=w(t.variant),e[79]=t.variant,e[80]=n):n=e[80];let u;e[81]!==t||e[82]!==l?(u=b=>l({...t,...b}),e[81]=t,e[82]=l,e[83]=u):u=e[83];let x;return e[84]!==s||e[85]!==r||e[86]!==n||e[87]!==u?(x=o.jsx(Bt,{title:s,body:r,variant:n,onChange:u}),e[84]=s,e[85]=r,e[86]=n,e[87]=u,e[88]=x):x=e[88],x}case"Stat":{let s;e[89]!==t.value?(s=w(t.value),e[89]=t.value,e[90]=s):s=e[90];let r;e[91]!==t.label?(r=w(t.label),e[91]=t.label,e[92]=r):r=e[92];let n;e[93]!==t.description?(n=w(t.description),e[93]=t.description,e[94]=n):n=e[94];let u;e[95]!==t||e[96]!==l?(u=b=>l({...t,...b}),e[95]=t,e[96]=l,e[97]=u):u=e[97];let x;return e[98]!==s||e[99]!==r||e[100]!==n||e[101]!==u?(x=o.jsx(_t,{value:s,label:r,description:n,onChange:u}),e[98]=s,e[99]=r,e[100]=n,e[101]=u,e[102]=x):x=e[102],x}case"StatGroup":{let s;e[103]!==t.stats?(s=w(t.stats),e[103]=t.stats,e[104]=s):s=e[104];let r;e[105]!==t||e[106]!==l?(r=u=>l({...t,stats:u}),e[105]=t,e[106]=l,e[107]=r):r=e[107];let n;return e[108]!==s||e[109]!==r?(n=o.jsx($t,{stats:s,onChange:r}),e[108]=s,e[109]=r,e[110]=n):n=e[110],n}case"CardGroup":{let s;e[111]!==t.cards?(s=typeof t.cards=="string"?t.cards:JSON.stringify(t.cards??[]),e[111]=t.cards,e[112]=s):s=e[112];let r;e[113]!==t||e[114]!==l?(r=u=>l({...t,cards:u}),e[113]=t,e[114]=l,e[115]=r):r=e[115];let n;return e[116]!==s||e[117]!==r?(n=o.jsx(It,{cards:s,onChange:r}),e[116]=s,e[117]=r,e[118]=n):n=e[118],n}case"Checklist":{let s;e[119]!==t.title?(s=w(t.title),e[119]=t.title,e[120]=s):s=e[120];let r;e[121]!==t.items?(r=w(t.items),e[121]=t.items,e[122]=r):r=e[122];let n;e[123]!==t||e[124]!==l?(n=x=>l({...t,...x}),e[123]=t,e[124]=l,e[125]=n):n=e[125];let u;return e[126]!==s||e[127]!==r||e[128]!==n?(u=o.jsx(Tt,{title:s,items:r,onChange:n}),e[126]=s,e[127]=r,e[128]=n,e[129]=u):u=e[129],u}case"Steps":{let s;e[130]!==t.title?(s=w(t.title),e[130]=t.title,e[131]=s):s=e[131];let r;e[132]!==t.steps?(r=w(t.steps),e[132]=t.steps,e[133]=r):r=e[133];let n;e[134]!==t||e[135]!==l?(n=x=>l({...t,...x}),e[134]=t,e[135]=l,e[136]=n):n=e[136];let u;return e[137]!==s||e[138]!==r||e[139]!==n?(u=o.jsx(Rt,{title:s,steps:r,onChange:n}),e[137]=s,e[138]=r,e[139]=n,e[140]=u):u=e[140],u}case"Comparison":{let s;e[141]!==t.left?(s=w(t.left),e[141]=t.left,e[142]=s):s=e[142];let r;e[143]!==t.right?(r=w(t.right),e[143]=t.right,e[144]=r):r=e[144];let n;e[145]!==t||e[146]!==l?(n=x=>l({...t,...x}),e[145]=t,e[146]=l,e[147]=n):n=e[147];let u;return e[148]!==s||e[149]!==r||e[150]!==n?(u=o.jsx(Lt,{left:s,right:r,onChange:n}),e[148]=s,e[149]=r,e[150]=n,e[151]=u):u=e[151],u}case"Table":{let s;e[152]!==t.headers?(s=typeof t.headers=="string"?t.headers:JSON.stringify(t.headers??[]),e[152]=t.headers,e[153]=s):s=e[153];let r;e[154]!==t.rows?(r=typeof t.rows=="string"?t.rows:JSON.stringify(t.rows??[]),e[154]=t.rows,e[155]=r):r=e[155];let n;e[156]!==t||e[157]!==l?(n=x=>l({...t,...x}),e[156]=t,e[157]=l,e[158]=n):n=e[158];let u;return e[159]!==s||e[160]!==r||e[161]!==n?(u=o.jsx(Mt,{headers:s,rows:r,onChange:n}),e[159]=s,e[160]=r,e[161]=n,e[162]=u):u=e[162],u}case"ProductCard":{let s;return e[163]!==t||e[164]!==l?(s=o.jsx(Ot,{block:t,onChange:l}),e[163]=t,e[164]=l,e[165]=s):s=e[165],s}case"ProductShelf":{let s;return e[166]!==t||e[167]!==l?(s=o.jsx(zt,{block:t,onChange:l}),e[166]=t,e[167]=l,e[168]=s):s=e[168],s}}let a;e[169]!==i||e[170]!==c?(a=c?Ae(c,i):null,e[169]=i,e[170]=c,e[171]=a):a=e[171];const m=a;if(!m){const s=c?` (${c})`:"";let r;return e[172]!==s?(r=o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Unknown block type",s,"."]}),e[172]=s,e[173]=r):r=e[173],r}let d;e[174]!==l?(d=s=>l(s),e[174]=l,e[175]=d):d=e[175];let h;return e[176]!==t||e[177]!==m||e[178]!==d?(h=o.jsx(Be,{schema:m,value:t,onChange:d,basePath:""}),e[176]=t,e[177]=m,e[178]=d,e[179]=h):h=e[179],h}function Qt(g){const e=_.c(33),{id:t,block:i,meta:l,onChange:c,onDelete:p,onDuplicate:f}=g;let a;e[0]!==t?(a={id:t},e[0]=t,e[1]=a):a=e[1];const{attributes:m,listeners:d,setNodeRef:h,transform:s,transition:r,isDragging:n}=_e(a);let u;e[2]!==s?(u=Ie.Transform.toString(s),e[2]=s,e[3]=u):u=e[3];let x;e[4]!==u||e[5]!==r?(x={transform:u,transition:r},e[4]=u,e[5]=r,e[6]=x):x=e[6];const b=n&&"opacity-50";let y;e[7]!==b?(y=K("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",b),e[7]=b,e[8]=y):y=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(tt,{size:14}),e[9]=v):v=e[9];let j;e[10]!==m||e[11]!==d?(j=o.jsx("button",{type:"button","aria-label":"Drag to reorder",className:"absolute left-1 top-1.5 flex h-6 w-6 cursor-grab items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100",...m,...d,children:v}),e[10]=m,e[11]=d,e[12]=j):j=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(et,{size:14}),e[13]=k):k=e[13];let C;e[14]!==f?(C=o.jsx("button",{type:"button","aria-label":"Duplicate block",onClick:f,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer",children:k}),e[14]=f,e[15]=C):C=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(ae,{size:14}),e[16]=N):N=e[16];let S;e[17]!==p?(S=o.jsx("button",{type:"button","aria-label":"Delete block",onClick:p,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer",children:N}),e[17]=p,e[18]=S):S=e[18];let T;e[19]!==S||e[20]!==C?(T=o.jsxs("div",{className:"absolute right-1 top-1 z-10 flex flex-row gap-0.5 rounded-md bg-background/80 opacity-0 backdrop-blur-sm transition-opacity group-hover/row:opacity-100",children:[C,S]}),e[19]=S,e[20]=C,e[21]=T):T=e[21];let A;e[22]!==i||e[23]!==l||e[24]!==c?(A=o.jsx(Kt,{block:i,meta:l,onChange:c}),e[22]=i,e[23]=l,e[24]=c,e[25]=A):A=e[25];let P;return e[26]!==h||e[27]!==T||e[28]!==A||e[29]!==x||e[30]!==y||e[31]!==j?(P=o.jsxs("div",{ref:h,style:x,className:y,children:[j,T,A]}),e[26]=h,e[27]=T,e[28]=A,e[29]=x,e[30]=y,e[31]=j,e[32]=P):P=e[32],P}function hl(g){return Array.isArray(g)?g:[]}function bl(g){const e=_.c(62),{value:t,onChange:i,meta:l,emptyMessage:c}=g,p=c===void 0?"No content yet. Use ⊕ to add your first block.":c;let f;e[0]!==l?(f=Te(l),e[0]=l,e[1]=f):f=e[1];const a=f;let m;e[2]!==t?(m=()=>t.map(Zt),e[2]=t,e[3]=m):m=e[3];const[d,h]=q.useState(m);let s;e[4]!==d?(s=d.map(Xt),e[4]=d,e[5]=s):s=e[5];const r=s;let n;e[6]!==d?(n=d.map(Wt),e[6]=d,e[7]=n):n=e[7];const u=n;let x;e[8]!==i?(x=$=>{h($),i($.map(Yt))},e[8]=i,e[9]=x):x=e[9];const b=x;let y;e[10]!==d||e[11]!==b?(y=($,E)=>{const L=[...d];L.splice($,0,{id:ce(),block:{__resolveType:E}}),b(L)},e[10]=d,e[11]=b,e[12]=y):y=e[12];const v=y;let j;e[13]!==d||e[14]!==b?(j=($,E)=>{b(d.map((L,V)=>V===$?{...L,block:E}:L))},e[13]=d,e[14]=b,e[15]=j):j=e[15];const k=j;let C;e[16]!==d||e[17]!==b?(C=$=>{b(d.filter((E,L)=>L!==$))},e[16]=d,e[17]=b,e[18]=C):C=e[18];const N=C;let S;e[19]!==d||e[20]!==b?(S=$=>{const E=d[$];if(!E)return;const L=[...d];L.splice($+1,0,{id:ce(),block:structuredClone(E.block)}),b(L)},e[19]=d,e[20]=b,e[21]=S):S=e[21];const T=S;let A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A={activationConstraint:{distance:6}},e[22]=A):A=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P={coordinateGetter:Pe},e[23]=P):P=e[23];const z=$e(ue(Le,A),ue(Re,P));let Y;e[24]!==d||e[25]!==b?(Y=$=>{const{active:E,over:L}=$;if(!L||E.id===L.id)return;const V=d.findIndex(G=>G.id===String(E.id)),ee=d.findIndex(G=>G.id===String(L.id));V===-1||ee===-1||b(De(d,V,ee))},e[24]=d,e[25]=b,e[26]=Y):Y=e[26];const Z=Y;let H;e[27]!==u.length||e[28]!==p?(H=u.length===0&&o.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:p}),e[27]=u.length,e[28]=p,e[29]=H):H=e[29];let J;e[30]!==v?(J=$=>v(0,$),e[30]=v,e[31]=J):J=e[31];const M=u.length===0;let U;e[32]!==a||e[33]!==J||e[34]!==M?(U=o.jsx(ge,{blockTypes:a,onInsert:J,alwaysShow:M}),e[32]=a,e[33]=J,e[34]=M,e[35]=U):U=e[35];let I;if(e[36]!==d||e[37]!==a||e[38]!==T||e[39]!==v||e[40]!==l||e[41]!==N||e[42]!==k){let $;e[44]!==a||e[45]!==T||e[46]!==v||e[47]!==l||e[48]!==N||e[49]!==k?($=(E,L)=>{const{id:V,block:ee}=E;return o.jsxs("div",{children:[o.jsx(Qt,{id:V,block:ee,meta:l,onChange:G=>k(L,G),onDelete:()=>N(L),onDuplicate:()=>T(L)}),o.jsx(ge,{blockTypes:a,onInsert:G=>v(L+1,G)})]},V)},e[44]=a,e[45]=T,e[46]=v,e[47]=l,e[48]=N,e[49]=k,e[50]=$):$=e[50],I=d.map($),e[36]=d,e[37]=a,e[38]=T,e[39]=v,e[40]=l,e[41]=N,e[42]=k,e[43]=I}else I=e[43];let B;e[51]!==r||e[52]!==U||e[53]!==I?(B=o.jsxs(Ee,{items:r,strategy:Oe,children:[U,I]}),e[51]=r,e[52]=U,e[53]=I,e[54]=B):B=e[54];let R;e[55]!==Z||e[56]!==z||e[57]!==B?(R=o.jsx(ze,{sensors:z,collisionDetection:Ue,onDragEnd:Z,children:B}),e[55]=Z,e[56]=z,e[57]=B,e[58]=R):R=e[58];let D;return e[59]!==H||e[60]!==R?(D=o.jsxs("div",{className:"mt-2",children:[H,R]}),e[59]=H,e[60]=R,e[61]=D):D=e[61],D}function Yt(g){return g.block}function Wt(g){return g.block}function Xt(g){return g.id}function Zt(g){return{id:ce(),block:g}}function ce(){return crypto.randomUUID()}export{bl as B,hl as a,xl as b,gl as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as G,r as S,l as J,j as t,B as U,i as Q,t as I}from"./index-DZ3hzzf1.js";import{i as X}from"./XCircle-Do7Zx-eD.js";import{c as T}from"./ZoomOut-DAawwf0t.js";import{n as Y}from"./LinkExternal01-CKHslpvH.js";import{aL as Z}from"./agent-icon-CGx0_9l5.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-CFnkTG10.js";import{I as L}from"./input-CK7GAn-2.js";import{L as M}from"./label-BlLucFOT.js";import{v as at,w as mt,V as nt,o as lt,x as R,A as pt,W as ct,y as dt}from"./index-Qi63FtON.js";import{c as ut,B as gt,a as xt}from"./block-document--9kID5te.js";import{u as ft}from"./use-autosave-BWy5WyvE.js";import{t as ht}from"./ChevronDown-sgVULpdb.js";import{p as yt,q as jt,o as vt}from"./automation-runs-BGZr5t8h.js";import{s as v,E as bt}from"./primitives-DlQu8ea0.js";import"./AlertCircle-fklrqSW5.js";import"./Tool01-CcxbpsdM.js";import"./ArrowUp-Bdy-0gyO.js";import"./Settings02-D2iJ0Y_1.js";import"./Tool02-O3edpLSO.js";import"./ArrowUpRight-D6zDsrnH.js";import"./TrendUp01-dtZF5xAg.js";import"./ZapSquare-DVSX_PUJ.js";import"./Users03-BK-DRA0O.js";import"./CheckCircle-BYkf45lM.js";import"./ChevronUp-mvRqss9i.js";import"./ChevronRight-BUKoQxxN.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"./Image01-CSEqtjAN.js";import"./Key01-Dh4DUQLF.js";import"./LayoutLeft-Dt7rJY-r.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"./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"./tooltip-BLkLB4r7.js";import"./dialog-Dy1IRNfn.js";import"./drawer-C_exNDXZ.js";import"./collection-search-BisIJu80.js";import"./use-mobile-C0TUGCBw.js";import"./AreaChart-BdmhsxSM.js";import"./index-BiYdGYPy.js";import"./calendar-Do7G6Kxp.js";import"./shell-layout-G6cWtPZY.js";import"./avatar-BlYuWW7J.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"./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"./dropdown-menu-DnbYxaX3.js";import"./popover-BIkriKI7.js";import"./command-DsH5vUBI.js";import"./index-B_7Q0rH0.js";import"./use-copy-DK3qaoqd.js";import"./form-BuzHPVCM.js";import"./select-BesvP7cx.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"./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"./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"./file-type-icon-C4zp7G8m.js";import"./toolbar-DuuVbShQ.js";import"./use-debounced-value-B2z6I7X3.js";import"./index-DPfxLsOi.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"./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"./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"./table-BpC3o1Ua.js";import"./use-clock-tick-DJOVC-Ea.js";function Ct(k){const e=G.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,A=b===void 0?!1:b,[x,D]=S.useState(A);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=J("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:D,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function yr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:A,onManagePosts:x,onOpenPost:D,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=ft(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=ut({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[m,C]=S.useState(null),[N,P]=S.useState(!1),$=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=$.length,W=o=>s("slug",o),q=async(o,w)=>{const V=v(r.name);P(!0);try{let g=0;for(const{key:E,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:V,slug:w});F!==O&&(await i.mutateAsync({blockKey:E,data:R(E,"posts",dt(F))}),g+=1)}const z={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",z)}),c(z),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{P(!1)}},H=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){W(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Y,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(bt,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:H,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Ct,{icon:Z,title:"Content",defaultOpen:!0,children:t.jsx(gt,{value:xt(r.sections),onChange:o=>s("sections",o),meta:A,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!m,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&q(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{yr as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as y,j as t,B as F,i as Y,H as Ge,I as se,E as Pe,r as T,C as re,M as Qe,l as V,bd as Ze,u as Ye,L as G,t as Xe,e as ae,aZ as ke}from"./index-DZ3hzzf1.js";import{E as Ee}from"./empty-state-CiSz3At1.js";import{u as et,a as Ae}from"./use-collections-CfZhiJR7.js";import{u as ce}from"./use-mcp-client-BIXuHEwh.js";import{F as ne,a as tt,b as de,d as me}from"./form-BuzHPVCM.js";import{I as ue}from"./input-CK7GAn-2.js";import{T as le}from"./textarea-DtLXmNNW.js";import{a as st,b as nt,V as xe,O as ot,M as it}from"./index-thBdMRIF.js";import{ax as lt,O as rt,an as at,V as ct,a4 as dt,ay as mt,Z as be}from"./agent-icon-CGx0_9l5.js";import{g as ut,M as xt,a as Ne}from"./index-BiYdGYPy.js";import{A as pt,a as ft,b as ht}from"./alert-DtoAKyyA.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-BesvP7cx.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-BLkLB4r7.js";import{i as jt}from"./AlertCircle-fklrqSW5.js";import{s as bt}from"./Stars02-B6BvIKTN.js";import{a as Nt}from"./Copy01-DLSxZiKr.js";import{i as vt}from"./Play-CJE2nK0g.js";import{i as St}from"./ChevronRight-BUKoQxxN.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./use-mcp-auth-status-Bm5xkgD0.js";import{a as Oe,u as Re}from"./use-connection-sIYGQRZw.js";import{a as It}from"./use-mcp-tools-CNPoXDXJ.js";import{M as $t,c as Tt}from"./monaco-editor-Dxhxh5om.js";import{I as Te}from"./integration-icon-BRokQ8N8.js";import{h as Pt,m as kt}from"./chat-context-CEf5YFvv.js";import{u as Et}from"./shell-layout-G6cWtPZY.js";import{n as At}from"./Tool02-O3edpLSO.js";import"./constants-BHDe7bIw.js";import"./auth-CKKxsAQR.js";import"./label-BlLucFOT.js";import"./index-BoBOH_Zc.js";import"./sidebar-Cc4XVWKB.js";import"./LayoutLeft-Dt7rJY-r.js";import"./use-mobile-C0TUGCBw.js";import"./X-JhcLrxaK.js";import"./ZoomOut-DAawwf0t.js";import"./Key01-Dh4DUQLF.js";import"./extract-connection-data-DQK5y-ef.js";import"./use-registry-connections-701IXXum.js";import"./use-organization-settings-C_QN8e5A.js";import"./studio-tools-B4JofgO_.js";import"./Plus-BwYAFd19.js";import"./index-3D1LNWvP.js";import"./index-B_7Q0rH0.js";import"./popover-BIkriKI7.js";import"./use-virtual-mcp-BLx5NqtM.js";import"./ChevronUp-mvRqss9i.js";import"./SearchMd-C4E_z5AK.js";import"./Users03-BK-DRA0O.js";import"./use-create-virtual-mcp-DdEqi3Z6.js";import"./use-navigate-to-agent-CPivegDO.js";import"./hooks-y59N0gpi.js";import"./decopilot-sse-pool-v3bamRu-.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-CcxbpsdM.js";import"./ArrowUp-Bdy-0gyO.js";import"./Settings02-D2iJ0Y_1.js";import"./XCircle-Do7Zx-eD.js";import"./ArrowUpRight-D6zDsrnH.js";import"./TrendUp01-dtZF5xAg.js";import"./ZapSquare-DVSX_PUJ.js";import"./CheckCircle-BYkf45lM.js";import"./ChevronDown-sgVULpdb.js";import"./DotsVertical-DitrZ6w4.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"./Image01-CSEqtjAN.js";import"./LinkExternal01-CKHslpvH.js";import"./Monitor01-r0C7odur.js";import"./Sun-DECbKLB_.js";import"./Package-3dsm96jG.js";import"./Palette-DAx6eGU_.js";import"./SearchLg-Ci76gxPe.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"./Zap-BsJbp079.js";import"./badge-BsoTUFnu.js";import"./mcp-oauth-DZFKw2wh.js";import"./index-DPfxLsOi.js";import"./autosend-Bm2lFqoD.js";import"./use-ai-providers-BRga8_lW.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-D8o2yOzI.js";import"./avatar-BlYuWW7J.js";import"./dialog-Dy1IRNfn.js";import"./required-auth-layout-CjAMzDiv.js";import"./use-org-sso-CjKp2EUT.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:i,isSaving:l,saveLabel:a,undoLabel:c}=s,r=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!i)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(lt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==l||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:l,"aria-label":u,children:[x,u]}),e[1]=l,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==l?(p=l?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==l||e[8]!==o||e[9]!==r||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:l,"aria-label":r,children:[p,r]}),e[7]=l,e[8]=o,e[9]=r,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function ie(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let i;e[1]!==o.control?(i=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=i):i=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let r;e[7]!==i||e[8]!==c?(r=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=r):r=e[9];let u;return e[10]!==o||e[11]!==r?(u=t.jsx(tt,{...o,children:r}),e[10]=o,e[11]=r,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(le,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:i}=re(),l=o||null;let a;e[0]!==i.id||e[1]!==i.slug||e[2]!==l?(a={connectionId:l,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=l,e[3]=a):a=e[3];const c=ce(a),r=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==r?(m=r?{title:r.title,description:r.description??null,body:ie(r)}:void 0,e[4]=r,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==r?(g=()=>{r&&f.reset({title:r.title,description:r.description??null,body:ie(r)})},e[8]=f,e[9]=r,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:ie(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!r){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==r.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:r.title}),e[16]=r.title,e[17]=$):$=e[17];let E;e[18]!==r.description?(E=r.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:r.description})]}):null,e[18]=r.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const i=n;if(!i){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==o?(l=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:i,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==n||e[6]!==i?(l=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:i,...n}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==n||e[6]!==i?(l=t.jsx("ol",{"data-slot":"breadcrumb-list",className:i,...n}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==n||e[6]!==i?(l=t.jsx("li",{"data-slot":"breadcrumb-item",className:i,...n}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function Q(s){const e=y.c(10);let o,n,i;e[0]!==s?({asChild:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);const l=o?Ze:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==i||e[8]!==a?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:a,...i}),e[6]=l,e[7]=i,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==n||e[6]!==i?(l=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:i,...n}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function Z(s){const e=y.c(12);let o,n,i;e[0]!==s?({children:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);let l;e[4]!==n?(l=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==i||e[9]!==l||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...i,children:a}),e[8]=i,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:i,onSelectInstance:l,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const r=wt(c);if(!r.isAuthenticated){let m;return e[2]!==r.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:r.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(it,{hasReadme:!1})}),e[2]=r.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==l||e[7]!==i||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:i,onSelectInstance:l},u),e[5]=n,e[6]=l,e[7]=i,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:i}=Ye({strict:!1}),l=(()=>{if(!i)return null;const d=`replay-${i}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[h,v]of Object.entries(l))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,r]=T.useState(a??{}),[u,x]=T.useState(l?JSON.stringify(l,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=re(),k=Oe(e),N=Pt(),A=kt(),{openSidePanel:U}=Et(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=Tt(d.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,X]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(X("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{r(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Z,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Z,{})]}),t.jsx(q,{children:t.jsx(De,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(le,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(le,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx($t,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:i}=s,[l,a]=T.useState(n[0]?.id??"");let c;e[0]!==l||e[1]!==n?(c=n.find(p=>p.id===l)?.id??n[0]?.id??"",e[0]=l,e[1]=n,e[2]=c):c=e[2];const r=c;if(!Oe(r||void 0)||!r){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:r,siblings:n,onSelectInstance:a,onBack:i})}),e[5]=r,e[6]=i,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:i,description:l,buttonProps:a,buttonComponent:c,className:r,children:u}=s;let x;e[0]!==r?(x=V("flex flex-col items-center justify-center py-16 text-center",r),e[0]=r,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==i?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:i}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==l?(f=l&&t.jsx("div",{className:"text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.itemId);let l;s[1]!==n.appSlug?(l={slug:n.appSlug},s[1]=n.appSlug,s[2]=l):l=s[2];const a=Re(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const r=c,u=Wt;let x;return s[5]!==r||s[6]!==i||s[7]!==a?(x=t.jsx(Jt,{itemId:i,siblings:a,onBack:r,onUpdate:u}),s[5]=r,s[6]=i,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.collectionName),l=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:r}=re();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==r.id||s[6]!==r.slug||s[7]!==g?(S={connectionId:g,orgId:r.id,orgSlug:r.slug},s[5]=r.id,s[6]=r.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,i,I);let $;s[9]!==R||s[10]!==l?($=async M=>{l&&await R.update.mutateAsync({id:l,data:M})},s[9]=R,s[10]=l,s[11]=$):$=s[11];const E=$;let P;s[12]!==i?(P=i?.toLowerCase(),s[12]=i,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==i?(C=Gt(i),s[14]=i,s[15]=C):C=s[15];const k=C;let N;s[16]!==r.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:r.slug},children:"Connections"})})}),s[16]=r.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Z,{}),s[18]=A):A=s[18];let U;s[19]!==i||s[20]!==m||s[21]!==r.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:n.appSlug},search:{tab:i},children:m.title})})}),t.jsx(Z,{})]}),s[19]=i,s[20]=m,s[21]=r.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==l?(M=t.jsx(w,{itemId:l,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=l,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Zt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Qt,{}),s[2]=l):l=s[2],l}function qn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Zt,{})})}),s[0]=e):e=s[0],e}export{qn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as E,j as n,u as Ie,o as De,p as se,r as M,a as Se,b as Fe,q as qe,d as Te,s as Le,Q as He,E as Ve,K as _e,v as Ue,B as je,N as Be}from"./index-DZ3hzzf1.js";import{L as Ke,s as ve,S as Pe,a as Ne,b as Ce,c as be,i as Qe,n as pe,C as we,p as xe}from"./self-tool-result-CByDOVQW.js";import{A as We}from"./auth-entry-DXpniWYo.js";import{A as Ge}from"./auth-split-layout-022_L0k-.js";import{O as Re}from"./organization-choice-2KhHSbLO.js";import{I as Ye}from"./input-CK7GAn-2.js";import{u as Je}from"./use-mcp-client-BIXuHEwh.js";import{S as Xe,W as Ze,g as et,a as tt}from"./constants-BHDe7bIw.js";import{i as it}from"./XCircle-Do7Zx-eD.js";import"./integration-icon-BRokQ8N8.js";import"./Tool02-O3edpLSO.js";import"./agent-icon-CGx0_9l5.js";import"./AlertCircle-fklrqSW5.js";import"./Tool01-CcxbpsdM.js";import"./ArrowUp-Bdy-0gyO.js";import"./Settings02-D2iJ0Y_1.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"./ChevronRight-BUKoQxxN.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"./Image01-CSEqtjAN.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"./dialog-Dy1IRNfn.js";import"./tooltip-BLkLB4r7.js";import"./companions-core-DqYVV5IY.js";import"./extract-connection-data-DQK5y-ef.js";import"./github-repo-scope-DjMZbiKa.js";import"./form-BuzHPVCM.js";import"./label-BlLucFOT.js";import"./use-debounced-value-B2z6I7X3.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./authenticate-and-persist-oauth-BL10FIRd.js";import"./mcp-oauth-DZFKw2wh.js";import"./auth-CKKxsAQR.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-BlYuWW7J.js";const nt={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ot(l){return nt[l]}function ye(l){const e=E.c(4),{variant:i}=l;let t;e[0]!==i?(t=ot(i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(Ke,{label:t,className:"text-muted-foreground"})}),e[2]=t,e[3]=s):s=e[3],s}function Li(){const l=E.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(st,{}),l[0]=e):e=l[0],e}const Me=M.createContext(null),$e=()=>M.useContext(Me);function R(l){const e=E.c(13);let i,t;e[0]!==l?({visual:t,...i}=l,e[0]=l,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/commerce-onboarding"},e[3]=s):s=e[3];const c=Ie(s),{data:a}=Se.useSession(),o=a?.user?.email;let m;e[4]!==c.siteUrl||e[5]!==o?(m=Ce({siteUrl:c.siteUrl,email:o}),e[4]=c.siteUrl,e[5]=o,e[6]=m):m=e[6];const d=m;let u;e[7]!==d||e[8]!==t?(u=t??n.jsx(be,{href:d}),e[7]=d,e[8]=t,e[9]=u):u=e[9];let v;return e[10]!==i||e[11]!==u?(v=n.jsx(Ge,{...i,visual:u}),e[10]=i,e[11]=u,e[12]=v):v=e[12],v}const rt={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:l=>`Código enviado para ${l}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:l=>`Continuar com ${l}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function Oe(l){switch(l){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return l}}let ze=!1;function st(){const l=Ie({from:"/commerce-onboarding"}),{org:e,siteUrl:i}=l,t=ve(i);return!ze&&De()&&(ze=!0,se("commerce_onboarding_viewed",{site_url:i,domain:t??void 0,...t?{$set:{last_scanned_domain:t}}:{}})),n.jsx(Me.Provider,{value:t,children:n.jsx(at,{requestedOrgSlug:e,siteUrl:i})})}function at(l){const e=E.c(8),{requestedOrgSlug:i,siteUrl:t}=l,{data:s,isPending:c}=Se.useSession(),a=$e();if(c){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(R,{children:n.jsx(ye,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!s){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==a?(d=a?n.jsx(Pe,{host:a}):void 0,e[1]=a,e[2]=d):d=e[2];let u;return e[3]!==d?(u=n.jsx(R,{children:n.jsx(We,{callbackUrl:m,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:d,copy:rt})}),e[3]=d,e[4]=u):u=e[4],u}let o;return e[5]!==i||e[6]!==t?(o=n.jsx(lt,{requestedOrgSlug:i,siteUrl:t}),e[5]=i,e[6]=t,e[7]=o):o=e[7],o}function lt(l){const e=E.c(43),{requestedOrgSlug:i,siteUrl:t}=l,s=Fe(),c=qe(),[a,o]=M.useState(null),[m,d]=M.useState(null),u=c.data?.map(mt)??[];let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:ct,retry:!1,onSuccess:r=>{d(r)}},e[0]=v):v=e[0];const p=Te(v);if(c.isPending){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(R,{children:n.jsx(ye,{variant:"workspace"})}),e[1]=r):r=e[1],r}if(c.error){let r;return e[2]!==c?(r=n.jsx(ae,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[2]=c,e[3]=r):r=e[3],r}const j=i?u.find(r=>r.slug===i):null;if(j){let r;return e[4]!==j||e[5]!==t?(r=n.jsx(re,{org:j,initialSiteUrl:t}),e[4]=j,e[5]=t,e[6]=r):r=e[6],r}if(i){let r;return e[7]!==c?(r=n.jsx(ae,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[7]=c,e[8]=r):r=e[8],r}if(a){let r;return e[9]!==a||e[10]!==t?(r=n.jsx(re,{org:a,initialSiteUrl:t}),e[9]=a,e[10]=t,e[11]=r):r=e[11],r}if(u.length===1&&u[0]){let r;return e[12]!==u[0]||e[13]!==t?(r=n.jsx(re,{org:u[0],initialSiteUrl:t}),e[12]=u[0],e[13]=t,e[14]=r):r=e[14],r}if(u.length>1){let r;e[15]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(k,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=r):r=e[15];let h;e[16]!==s||e[17]!==t?(h=O=>s({to:"/commerce-onboarding",search:{org:O.slug,siteUrl:t}}),e[16]=s,e[17]=t,e[18]=h):h=e[18];let C;return e[19]!==u||e[20]!==h?(C=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(Re,{organizations:u,selectLabel:"Continuar",onSelected:h})})]})}),e[19]=u,e[20]=h,e[21]=C):C=e[21],C}if(!m){let r;e[22]!==p?(r=()=>{p.reset(),p.mutate()},e[22]=p,e[23]=r):r=e[23];let h;return e[24]!==p||e[25]!==r?(h=n.jsx(dt,{mutation:p,onRetry:r}),e[24]=p,e[25]=r,e[26]=h):h=e[26],h}const g=m;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let r;return e[27]!==g.organization||e[28]!==t?(r=n.jsx(re,{org:g.organization,initialSiteUrl:t}),e[27]=g.organization,e[28]=t,e[29]=r):r=e[29],r}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let r;e[30]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(k,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[30]=r):r=e[30];const h=g.domain??void 0;let C;e[31]!==s||e[32]!==t?(C=($,P)=>{Le(),o({...$,slug:P}),s({to:"/commerce-onboarding",search:{org:P,siteUrl:t}})},e[31]=s,e[32]=t,e[33]=C):C=e[33];let O;return e[34]!==g.organizations||e[35]!==h||e[36]!==C?(O=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(Re,{organizations:g.organizations,domain:h,onJoined:C})})]})}),e[34]=g.organizations,e[35]=h,e[36]=C,e[37]=O):O=e[37],O}const S=g?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let _;e[38]!==p?(_=()=>{d(null),p.reset()},e[38]=p,e[39]=_):_=e[39];let I;return e[40]!==S||e[41]!==_?(I=n.jsx(ae,{title:"O onboarding de commerce precisa de suporte",description:S,actionLabel:"Tentar novamente",onRetry:_}),e[40]=S,e[41]=_,e[42]=I):I=e[42],I}async function ct(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Le(),e}function mt(l){return{id:l.id,name:l.name,slug:l.slug,logo:l.logo??null}}function dt(l){const e=E.c(7),{mutation:i,onRetry:t}=l,s=M.useRef(!1);let c;e[0]!==i?(c=d=>{!d||s.current||(s.current=!0,i.mutate())},e[0]=i,e[1]=c):c=e[1];const a=c;if(i.error){let d;return e[2]!==t?(d=n.jsx(ae,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:t}),e[2]=t,e[3]=d):d=e[3],d}let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ye,{variant:"generic"}),e[4]=o):o=e[4];let m;return e[5]!==a?(m=n.jsx(R,{children:n.jsx("div",{ref:a,children:o})}),e[5]=a,e[6]=m):m=e[6],m}function k(l){const e=E.c(8),{title:i,description:t}=l,s=$e();let c;e[0]!==s?(c=s?n.jsx(Pe,{host:s}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==i?(a=(i||t)&&n.jsxs("div",{className:"space-y-2",children:[i&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:i}),t&&n.jsx("p",{className:"text-base text-muted-foreground leading-6",children:t})]}),e[2]=t,e[3]=i,e[4]=a):a=e[4];let o;return e[5]!==c||e[6]!==a?(o=n.jsxs("div",{className:"grid gap-10",children:[c,a]}),e[5]=c,e[6]=a,e[7]=o):o=e[7],o}function ae(l){const e=E.c(9),{title:i,description:t,actionLabel:s,onRetry:c}=l;let a;e[0]!==t||e[1]!==i?(a=n.jsx(k,{title:i,description:t}),e[0]=t,e[1]=i,e[2]=a):a=e[2];let o;e[3]!==s||e[4]!==c?(o=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:c,children:s}),e[3]=s,e[4]=c,e[5]=o):o=e[5];let m;return e[6]!==a||e[7]!==o?(m=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[a,o]})}),e[6]=a,e[7]=o,e[8]=m):m=e[8],m}function re(l){const e=E.c(11),{org:i,initialSiteUrl:t}=l,{data:s}=Se.useSession(),c=s?.user?.email;let a;e[0]!==t||e[1]!==c?(a=Ce({siteUrl:t,email:c}),e[0]=t,e[1]=c,e[2]=a):a=e[2];const o=a;let m;e[3]!==o||e[4]!==i.id?(m=n.jsx(be,{href:o,orgId:i.id}),e[3]=o,e[4]=i.id,e[5]=m):m=e[5];const d=m;let u;return e[6]!==t||e[7]!==d||e[8]!==i||e[9]!==s?.user?.email?(u=n.jsx(He,{children:v=>{const{reset:p}=v;return n.jsx(Ve,{fallback:j=>{const{error:g,resetError:S}=j;return n.jsx(R,{visual:d,children:n.jsx(ut,{orgName:i.name,message:g instanceof Error?g.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{p(),S()}})})},children:n.jsx(M.Suspense,{fallback:n.jsx(ke,{visual:d}),children:n.jsx(ft,{org:i,initialSiteUrl:t,sessionEmail:s?.user?.email},`${i.id}:${t??""}`)})})}}),e[6]=t,e[7]=d,e[8]=i,e[9]=s?.user?.email,e[10]=u):u=e[10],u}function ke(l){const e=E.c(3),{visual:i}=l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(k,{}),n.jsx(we,{})]}),e[0]=t):t=e[0];let s;return e[1]!==i?(s=n.jsx(R,{align:"fill",visual:i,children:t}),e[1]=i,e[2]=s):s=e[2],s}function ut(l){const e=E.c(10),{orgName:i,message:t,onRetry:s}=l,c=`A configuração de commerce continuará em ${i}.`;let a;e[0]!==c?(a=n.jsx(k,{title:"Diagnóstico de commerce",description:c}),e[0]=c,e[1]=a):a=e[1];let o;e[2]!==t?(o=n.jsx(le,{message:t}),e[2]=t,e[3]=o):o=e[3];let m;e[4]!==s?(m=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:s,children:"Tentar novamente"}),e[4]=s,e[5]=m):m=e[5];let d;return e[6]!==a||e[7]!==o||e[8]!==m?(d=n.jsxs("div",{className:"grid gap-10",children:[a,o,m]}),e[6]=a,e[7]=o,e[8]=m,e[9]=d):d=e[9],d}function ft(l){const e=E.c(109),{org:i,initialSiteUrl:t,sessionEmail:s}=l;let c;e[0]!==i.id||e[1]!==i.slug?(c={connectionId:Xe,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=c):c=e[2];const a=Je(c),[o,m]=M.useState(t??""),[d,u]=M.useState(null),v=M.useRef(!1),p=Ze.COMMERCE_DISCOVERY(i.id),j=et(i.id),g=_e.commerceDiscoveryConnection(i.id,p);let S;e[3]!==p||e[4]!==a?(S=async()=>{const f=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(f)},e[3]=p,e[4]=a,e[5]=S):S=e[5];let _;e[6]!==g||e[7]!==S?(_={queryKey:g,queryFn:S,retry:!1},e[6]=g,e[7]=S,e[8]=_):_=e[8];const I=Ue(_),r=_e.commerceDiscoveryVirtualMcp(i.id,j);let h;e[9]!==a||e[10]!==j?(h=async()=>{const f=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:j}});return xe(f)},e[9]=a,e[10]=j,e[11]=h):h=e[11];let C;e[12]!==r||e[13]!==h?(C={queryKey:r,queryFn:h,retry:!1},e[12]=r,e[13]=h,e[14]=C):C=e[14];const O=Ue(C);let $;e[15]!==a?($=async f=>{const x=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:f}});return xe(x)},e[15]=a,e[16]=$):$=e[16];let P;e[17]!==I||e[18]!==i.id||e[19]!==O?(P=(f,x)=>{se("commerce_onboarding_setup_succeeded",{domain:ve(x)??void 0,organization_id:i.id}),u(null),I.refetch(),O.refetch()},e[17]=I,e[18]=i.id,e[19]=O,e[20]=P):P=e[20];let A;e[21]!==i.id?(A=(f,x)=>{se("commerce_onboarding_setup_failed",{domain:ve(x)??void 0,organization_id:i.id,error:f instanceof Error?f.message:String(f)}),u(f instanceof Error?f.message:"A configuração do Commerce Discovery falhou.")},e[21]=i.id,e[22]=A):A=e[22];let Q;e[23]!==A||e[24]!==$||e[25]!==P?(Q={mutationFn:$,retry:!1,onSuccess:P,onError:A},e[23]=A,e[24]=$,e[25]=P,e[26]=Q):Q=e[26];const b=Te(Q),Ae=!!I.data.item&&!!O.data.item,Ee=I.data.item,W=typeof Ee?.metadata?.siteUrl=="string"?Ee.metadata.siteUrl:void 0,ce=t||o||"";let G;e[27]!==W||e[28]!==ce?(G=Qe(ce,W),e[27]=W,e[28]=ce,e[29]=G):G=e[29];const Y=Ae&&G,J=t||o||W||"";let X;e[30]!==J||e[31]!==s?(X=Ce({siteUrl:J,email:s}),e[30]=J,e[31]=s,e[32]=X):X=e[32];const me=X;let Z;e[33]!==me||e[34]!==i.id?(Z=n.jsx(be,{href:me,orgId:i.id}),e[33]=me,e[34]=i.id,e[35]=Z):Z=e[35];const y=Z;let ee;e[36]!==b?(ee=f=>{const x=pe(f);if(!x.ok){u(Oe(x.error));return}u(null),b.mutate(x.value)},e[36]=b,e[37]=ee):ee=e[37];const D=ee;let te;e[38]!==t||e[39]!==D||e[40]!==Y?(te=f=>{!f||v.current||Y||!t||(v.current=!0,D(t))},e[38]=t,e[39]=D,e[40]=Y,e[41]=te):te=e[41];const de=te;let ie;e[42]!==i.id||e[43]!==D||e[44]!==o?(ie=f=>{f.preventDefault();const x=pe(o);x.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(x.value).hostname,organization_id:i.id}),D(o)},e[42]=i.id,e[43]=D,e[44]=o,e[45]=ie):ie=e[45];const z=ie;if(Y){const f=i.slug;let x;e[46]===Symbol.for("react.memo_cache_sentinel")?(x=crypto.randomUUID(),e[46]=x):x=e[46];let T;e[47]!==i.slug?(T={org:f,taskId:x},e[47]=i.slug,e[48]=T):T=e[48];let U;e[49]!==i.id?(U=tt(i.id),e[49]=i.id,e[50]=U):U=e[50];const L=J||void 0;let N;e[51]!==U.id||e[52]!==L?(N={virtualmcpid:U.id,connect:"1",siteUrl:L},e[51]=U.id,e[52]=L,e[53]=N):N=e[53];let w;return e[54]!==T||e[55]!==N?(w=n.jsx(Be,{to:"/$org/$taskId",params:T,search:N,replace:!0}),e[54]=T,e[55]=N,e[56]=w):w=e[56],w}if(b.isPending){let f;return e[57]!==y?(f=n.jsx(ke,{visual:y}),e[57]=y,e[58]=f):f=e[58],f}if(t){let f,x;if(e[59]!==y||e[60]!==z||e[61]!==t||e[62]!==d||e[63]!==i.name||e[64]!==b.isPending||e[65]!==o){x=Symbol.for("react.early_return_sentinel");e:if(f=pe(t),!f.ok){const fe=`A configuração de commerce continuará em ${i.name}.`;let V;e[68]!==fe?(V=n.jsx(k,{title:"Diagnóstico de commerce",description:fe}),e[68]=fe,e[69]=V):V=e[69];const ge=n.jsx(le,{message:Oe(f.error)});let B;e[70]!==z||e[71]!==d||e[72]!==b.isPending||e[73]!==o?(B=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[70]=z,e[71]=d,e[72]=b.isPending,e[73]=o,e[74]=B):B=e[74];let K;e[75]!==V||e[76]!==ge||e[77]!==B?(K=n.jsxs("div",{className:"grid gap-10",children:[V,ge,B]}),e[75]=V,e[76]=ge,e[77]=B,e[78]=K):K=e[78];let oe;e[79]!==y||e[80]!==K?(oe=n.jsx(R,{visual:y,children:K}),e[79]=y,e[80]=K,e[81]=oe):oe=e[81],x=oe;break e}e[59]=y,e[60]=z,e[61]=t,e[62]=d,e[63]=i.name,e[64]=b.isPending,e[65]=o,e[66]=f,e[67]=x}else f=e[66],x=e[67];if(x!==Symbol.for("react.early_return_sentinel"))return x;const T=`O Commerce Discovery está sendo preparado para ${f.value}.`;let U;e[82]!==T?(U=n.jsx(k,{title:"Diagnóstico de commerce",description:T}),e[82]=T,e[83]=U):U=e[83];let L;e[84]!==z||e[85]!==d||e[86]!==b.isPending||e[87]!==o?(L=d?n.jsxs(n.Fragment,{children:[n.jsx(le,{message:d}),n.jsx(he,{siteUrl:o,error:null,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z})]}):n.jsx(we,{}),e[84]=z,e[85]=d,e[86]=b.isPending,e[87]=o,e[88]=L):L=e[88];let N;e[89]!==U||e[90]!==L||e[91]!==de?(N=n.jsxs("div",{ref:de,className:"grid gap-10",children:[U,L]}),e[89]=U,e[90]=L,e[91]=de,e[92]=N):N=e[92];let w;return e[93]!==y||e[94]!==N?(w=n.jsx(R,{visual:y,children:N}),e[93]=y,e[94]=N,e[95]=w):w=e[95],w}const ue=`A configuração de commerce continuará em ${i.name}.`;let F;e[96]!==ue?(F=n.jsx(k,{title:"Diagnóstico de commerce",description:ue}),e[96]=ue,e[97]=F):F=e[97];let q;e[98]!==z||e[99]!==d||e[100]!==b.isPending||e[101]!==o?(q=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[98]=z,e[99]=d,e[100]=b.isPending,e[101]=o,e[102]=q):q=e[102];let H;e[103]!==F||e[104]!==q?(H=n.jsxs("div",{className:"grid gap-10",children:[F,q]}),e[103]=F,e[104]=q,e[105]=H):H=e[105];let ne;return e[106]!==y||e[107]!==H?(ne=n.jsx(R,{visual:y,children:H}),e[106]=y,e[107]=H,e[108]=ne):ne=e[108],ne}function he(l){const e=E.c(20),{siteUrl:i,error:t,isSubmitting:s,onSiteUrlChange:c,onSubmit:a}=l;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=o):o=e[0];let m;e[1]!==c?(m=_=>c(_.target.value),e[1]=c,e[2]=m):m=e[2];const d=!!t;let u;e[3]!==s||e[4]!==i||e[5]!==m||e[6]!==d?(u=n.jsx(Ye,{id:"commerce-site-url",type:"text",inputMode:"url",value:i,onChange:m,placeholder:"https://example.com","aria-invalid":d,disabled:s}),e[3]=s,e[4]=i,e[5]=m,e[6]=d,e[7]=u):u=e[7];let v;e[8]!==t?(v=t?n.jsx(le,{message:t}):null,e[8]=t,e[9]=v):v=e[9];let p;e[10]!==u||e[11]!==v?(p=n.jsxs("div",{className:"grid gap-2",children:[o,u,v]}),e[10]=u,e[11]=v,e[12]=p):p=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(it,{size:16}),e[13]=j):j=e[13];let g;e[14]!==s?(g=n.jsxs(je,{type:"submit",size:"xl",className:"w-full",disabled:s,children:["Continuar",j]}),e[14]=s,e[15]=g):g=e[15];let S;return e[16]!==a||e[17]!==p||e[18]!==g?(S=n.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[p,g]}),e[16]=a,e[17]=p,e[18]=g,e[19]=S):S=e[19],S}function le(l){const e=E.c(2),{message:i}=l;let t;return e[0]!==i?(t=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}),e[0]=i,e[1]=t):t=e[1],t}export{Li as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as M,C as $,aY as L,K as k,l as w,j as I}from"./index-DZ3hzzf1.js";import{u as D}from"./use-registry-connections-701IXXum.js";import{d as K}from"./use-organization-settings-C_QN8e5A.js";import{S as E}from"./constants-BHDe7bIw.js";import{u as Q}from"./useInfiniteQuery-D1UM76v9.js";import{c as F}from"./use-mcp-client-BIXuHEwh.js";import{i as H,f as Y}from"./extract-connection-data-DQK5y-ef.js";import{r as q,R as G}from"./retry-CErkP7V6.js";import{g as T}from"./connection-slug-eyAPH6o3.js";import{C as U}from"./card-dggHqb7D.js";import{I as V}from"./integration-icon-BRokQ8N8.js";function fe(){const s=M.c(6),e=D(),t=K(),a=$().project.enabledPlugins??[];let o;if(s[0]!==a||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),a.includes("private-registry")&&t(E)&&o.push({id:E,title:"Private Registry",icon:null}),s[0]=a,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const z=24,_=3;function A(s){return s.id.includes("community-registry")}function B(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(a=>t.map(o=>({field:o,operator:"contains",value:a})))}}function S(s,e,t,a,o){const l=s.map(u=>u.id).sort().join(","),r=B(o),{data:p,fetchNextPage:d,hasNextPage:m,isFetchingNextPage:g,isLoading:C}=Q({queryKey:k.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:u})=>{const n=u??{};return await Promise.all(s.map(async i=>{const h=n[i.id];if(h==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);try{return await q(async()=>{let f=null;try{f=await F({connectionId:i.id,orgId:e,orgSlug:t});const x={limit:z};h&&(x.cursor=h),r&&(x.where=r);const N=await f.callTool({name:j,arguments:x}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,b=Y(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:b,nextCursor:P}}finally{await f?.close().catch(()=>{})}},{maxAttempts:_,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(f){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${_} attempts:`,f instanceof G?f.cause:f),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:u=>{const n={};let c=!1;for(const i of u)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,c=!0):n[i.registryId]="EXHAUSTED");return c?n:void 0},staleTime:3600*1e3,placeholderData:L,retry:!1,enabled:s.length>0}),y=[];if(p?.pages)for(const u of p.pages)for(const n of u)for(const c of n.items)y.push({...c,_sourceName:c._sourceName??n.registryTitle,_sourceIcon:c._sourceIcon??n.registryIcon,_registryId:c._registryId??n.registryId});return{items:y,hasMore:m??!1,isLoadingMore:g,isInitialLoading:C,fetchNextPage:()=>{m&&!g&&d()}}}function me(s,e){const t=M.c(16),{org:a}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const p=r,d=S(l,a.id,a.slug,!0,e),m=S(p,a.id,a.slug,!0,e);let g;if(t[4]!==m.items||t[5]!==d.items){const h=new Set;g=[];const j=[...d.items,...m.items];for(const f of j){const x=`${f._registryId}:${f.id}`;h.has(x)||(h.add(x),g.push(f))}t[4]=m.items,t[5]=d.items,t[6]=g}else g=t[6];const C=d.isInitialLoading||m.isInitialLoading,y=d.isLoadingMore||m.isLoadingMore,u=d.hasMore||m.hasMore;let n;t[7]!==m||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),m.hasMore&&m.fetchNextPage()},t[7]=m,t[8]=d,t[9]=n):n=t[9];const c=n;let i;return t[10]!==u||t[11]!==C||t[12]!==y||t[13]!==g||t[14]!==c?(i={items:g,hasMore:u,isLoadingMore:y,isInitialLoading:C,loadMore:c},t[10]=u,t[11]=C,t[12]=y,t[13]=g,t[14]=c,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function de(s){const e=new Map;for(const o of s){const l=T(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],a=new Set;for(const o of s){const l=T(o);if(a.has(l))continue;a.add(l);const r=e.get(l),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:l,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function pe(s){const e=M.c(37),{connection:t,onClick:a,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:p,className:d,fallbackIcon:m}=s,g=l===void 0?!1:l,C=a&&"hover:bg-muted/50";let y;e[0]!==d||e[1]!==C?(y=w("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",C,d),e[0]=d,e[1]=C,e[2]=y):y=e[2];let u;e[3]!==t.icon||e[4]!==t.title||e[5]!==m?(u=I.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=t.icon,e[4]=t.title,e[5]=m,e[6]=u):u=e[6];let n;e[7]!==o||e[8]!==g?(n=o&&I.jsx("div",{className:w("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:O,children:o}),e[7]=o,e[8]=g,e[9]=n):n=e[9];let c;e[10]!==n?(c=I.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=c):c=e[11];let i;e[12]!==u||e[13]!==c?(i=I.jsxs("div",{className:"flex items-start justify-between",children:[u,c]}),e[12]=u,e[13]=c,e[14]=i):i=e[14];let h;e[15]!==t.title?(h=I.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=h):h=e[16];const j=t.description||"No description";let f;e[17]!==j?(f=I.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=f):f=e[18];let x;e[19]!==f||e[20]!==h?(x=I.jsxs("div",{className:"flex flex-col gap-1",children:[h,f]}),e[19]=f,e[20]=h,e[21]=x):x=e[21];let N;e[22]!==r?(N=r&&I.jsx("div",{children:r}),e[22]=r,e[23]=N):N=e[23];let v;e[24]!==x||e[25]!==N||e[26]!==i?(v=I.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,x,N]}),e[24]=x,e[25]=N,e[26]=i,e[27]=v):v=e[27];let P;e[28]!==p?(P=p&&I.jsx("div",{className:"border-t border-border mt-auto",children:I.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:J,children:p})}),e[28]=p,e[29]=P):P=e[29];let b;e[30]!==v||e[31]!==P?(b=I.jsxs("div",{className:"flex flex-col flex-1",children:[v,P]}),e[30]=v,e[31]=P,e[32]=b):b=e[32];let R;return e[33]!==a||e[34]!==b||e[35]!==y?(R=I.jsx(U,{className:y,onClick:a,children:b}),e[33]=a,e[34]=b,e[35]=y,e[36]=R):R=e[36],R}function J(s){return s.stopPropagation()}function O(s){return s.stopPropagation()}export{pe as C,me as a,de as g,fe as u};
|