decocms 4.462.1 → 4.462.2
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-BQdX39pt.js → AlertCircle-BOqaZFXA.js} +1 -1
- package/dist/client/assets/{AreaChart-DGA1ooZj.js → AreaChart-BVBZ_mBW.js} +1 -1
- package/dist/client/assets/{ArrowLeft-6EbZWTcH.js → ArrowLeft-BsFMaTJ5.js} +1 -1
- package/dist/client/assets/{ArrowUp-2XhoOsi0.js → ArrowUp-Bi8YJGtE.js} +1 -1
- package/dist/client/assets/{Building02-DkmblV_t.js → Building02-BG4IPwQ3.js} +1 -1
- package/dist/client/assets/{CartesianChart-CBSx0vVi.js → CartesianChart-BROP1iuM.js} +1 -1
- package/dist/client/assets/{Check-DT07hOsy.js → Check-ChBZV9OV.js} +1 -1
- package/dist/client/assets/{CheckCircle-DKVKsPck.js → CheckCircle-D49A5hws.js} +1 -1
- package/dist/client/assets/{ChevronUp-Bf0RRY9i.js → ChevronUp-wB5J5ntl.js} +1 -1
- package/dist/client/assets/{Copy01-onj9VSIV.js → Copy01-C4tt-_AN.js} +1 -1
- package/dist/client/assets/{CreditCard01-CunAqtsE.js → CreditCard01-DCvyy0kz.js} +1 -1
- package/dist/client/assets/{DotsVertical-BlZNH3M2.js → DotsVertical-BWwzMO41.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DLyMMN4K.js → ErrorBarContext-Ct0GvI3W.js} +1 -1
- package/dist/client/assets/{Image01-D-zCGCY4.js → Image01-B4l0All3.js} +1 -1
- package/dist/client/assets/{Key01-BSZJTaKJ.js → Key01-DNpH0NnO.js} +1 -1
- package/dist/client/assets/{Line-Cu8o9uY5.js → Line-Bq7EY1pw.js} +1 -1
- package/dist/client/assets/{Link01-BgOzUKXX.js → Link01-DZVgeeWe.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CG-HmcZF.js → LinkBroken01-CNbQoBrl.js} +1 -1
- package/dist/client/assets/{LinkExternal01-UbkWQoBv.js → LinkExternal01-D73wyIiU.js} +1 -1
- package/dist/client/assets/{Monitor01-vP9TH_Iv.js → Monitor01-BJ23zU-n.js} +1 -1
- package/dist/client/assets/{Palette-VovT0PnZ.js → Palette-BKZ5R7W4.js} +1 -1
- package/dist/client/assets/{Plus-DQzzAz_7.js → Plus-CP_oegJ7.js} +1 -1
- package/dist/client/assets/{SearchMd-D6hQenCX.js → SearchMd-D2OTQFME.js} +1 -1
- package/dist/client/assets/{Sector-RlVKS-cJ.js → Sector-OlKrChyD.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Cv1HC6f2.js → ShoppingBag01-BfMGWAwv.js} +1 -1
- package/dist/client/assets/{Sun-4pXqabGH.js → Sun-BAfhxpb-.js} +1 -1
- package/dist/client/assets/{Tool01-R5YlhrWO.js → Tool01-B_dduyQs.js} +1 -1
- package/dist/client/assets/{Trash01-1y1rCSQ7.js → Trash01-C4sE_NGv.js} +1 -1
- package/dist/client/assets/{Upload01-4H_HtY1H.js → Upload01-qBk1AINH.js} +1 -1
- package/dist/client/assets/{User01-Cc8kWxTi.js → User01-DcjCdViP.js} +1 -1
- package/dist/client/assets/{UserSquare-DwmYgSB5.js → UserSquare-CQZbVq0f.js} +1 -1
- package/dist/client/assets/{Users01-CYu_OK-x.js → Users01-DR0sKzFO.js} +1 -1
- package/dist/client/assets/{X-Bix2CJil.js → X-DJN31Nfv.js} +1 -1
- package/dist/client/assets/{XAxis-BRJUR_Yx.js → XAxis-C3Bf1J_u.js} +1 -1
- package/dist/client/assets/{XClose-D1JVUlwn.js → XClose-D0KEw8ZX.js} +1 -1
- package/dist/client/assets/{ZoomOut-DK7mmj_3.js → ZoomOut-UxLkEy8R.js} +1 -1
- package/dist/client/assets/{access-gate-E9akvl7M.js → access-gate-RAaA3S4I.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-C9NnYS0B.js → add-connection-dialog-BY0I55_H.js} +1 -1
- package/dist/client/assets/{agent-analytics-BpvLWqp9.js → agent-analytics-BkAfBBox.js} +1 -1
- package/dist/client/assets/agent-app-BjfUl_0f.js +1 -0
- package/dist/client/assets/{agent-assets-F0nAoteT.js → agent-assets-B3yLb2yB.js} +1 -1
- package/dist/client/assets/{agent-automation-CVWUvLWe.js → agent-automation-B2a9NwZW.js} +1 -1
- package/dist/client/assets/{agent-automations-CP-T_ZYT.js → agent-automations-4swr6ii9.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-Jt-weFtl.js → agent-connect-sources-DScLzDRG.js} +1 -1
- package/dist/client/assets/agent-deck-qy9xDSPf.js +1 -0
- package/dist/client/assets/{agent-e2e-RBJsPRE-.js → agent-e2e-BYVtzJn1.js} +1 -1
- package/dist/client/assets/{agent-experiments-CKwxukPG.js → agent-experiments-BytI8p3-.js} +1 -1
- package/dist/client/assets/{agent-file-BPv1WL5h.js → agent-file-YzyYVZ_N.js} +1 -1
- package/dist/client/assets/{agent-hosting-B1n_QjSO.js → agent-hosting-XjyAni_P.js} +1 -1
- package/dist/client/assets/{agent-icon-zpWPhOfj.js → agent-icon-DGDGzDPg.js} +1 -1
- package/dist/client/assets/agent-library-DmwLcUW5.js +1 -0
- package/dist/client/assets/agent-library-file-BhecoKGR.js +1 -0
- package/dist/client/assets/{agent-monitor-rhzeTPAW.js → agent-monitor-BeZr1N-B.js} +1 -1
- package/dist/client/assets/{agent-overview-DawzNEwc.js → agent-overview-qqA1EvR2.js} +1 -1
- package/dist/client/assets/agent-settings-Cg5Aii0O.js +1 -0
- package/dist/client/assets/{agent-site-editor-CF1Vr1s-.js → agent-site-editor-3yAc0dAv.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-nkVrwBja.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-DybB0nyP.js → agent-site-editor-content-BVsrDzv_.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CYHo-ORA.js → agent-site-editor-preview-CWeO_adL.js} +3 -3
- package/dist/client/assets/agent-view-5udch1Zo.js +1 -0
- package/dist/client/assets/{agent-view-guard-CdHrEVQK.js → agent-view-guard--aoytX6B.js} +1 -1
- package/dist/client/assets/{agents-list-BUtJHEBq.js → agents-list-Bh-3TBuf.js} +1 -1
- package/dist/client/assets/{ai-providers--62RVeJI.js → ai-providers-DKS3l98n.js} +1 -1
- package/dist/client/assets/{alert-D7D03BKP.js → alert-DSsZdX1z.js} +1 -1
- package/dist/client/assets/{alert-dialog-CyLBdAzL.js → alert-dialog-CiySziMD.js} +1 -1
- package/dist/client/assets/{analytics-sections-St-vkcN9.js → analytics-sections-Cl2mCPG9.js} +1 -1
- package/dist/client/assets/{api-keys-8GLO1uKc.js → api-keys-DT79lla9.js} +1 -1
- package/dist/client/assets/api-keys-TdHJQ9tA.js +1 -0
- package/dist/client/assets/app-editor-BMX-mtW-.js +1 -0
- package/dist/client/assets/{asset-utils-BXloR6dL.js → asset-utils-Co49serB.js} +1 -1
- package/dist/client/assets/{auth-ydnDmdni.js → auth-Cs4gU6Jt.js} +1 -1
- package/dist/client/assets/{auth-catchall-DV9J64DV.js → auth-catchall-472LoEBQ.js} +1 -1
- package/dist/client/assets/{auth-entry-oEfwo4SD.js → auth-entry-wcuFRPik.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CnSdMp2k.js → auth-split-layout-wSdRvsPt.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-0pLi3EbJ.js → authenticate-and-persist-oauth-VlIk_G_o.js} +1 -1
- package/dist/client/assets/{automation-list-row-Cs1Mmss0.js → automation-list-row-CuueSCf2.js} +1 -1
- package/dist/client/assets/{automation-runs-DADbYz16.js → automation-runs-BnertJ4X.js} +1 -1
- package/dist/client/assets/{automations-bWRzJt79.js → automations-DdJEP87b.js} +1 -1
- package/dist/client/assets/{autosend-BGaION3N.js → autosend-D7eBSjvh.js} +1 -1
- package/dist/client/assets/{avatar-CmK1yw1p.js → avatar-BeFOPb9J.js} +1 -1
- package/dist/client/assets/{badge-DEsF_1Ia.js → badge-SOygJ_ut.js} +1 -1
- package/dist/client/assets/{block-document-BEKsZQFG.js → block-document-Cu1aHoUW.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-I99wRxXQ.js → blocks-preview-workspace-context-BUj7HSJ8.js} +1 -1
- package/dist/client/assets/{blog-schema-ChdnOShd.js → blog-schema-BMIbFol2.js} +1 -1
- package/dist/client/assets/{buckets-CxWDcQDs.js → buckets-BA7hLRYf.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CkwvsCJn.js → build-improve-prompt-doc-DRPd_i83.js} +1 -1
- package/dist/client/assets/{calendar-CJu_GHUv.js → calendar-oXQevmTG.js} +1 -1
- package/dist/client/assets/{capability-load-error-Ljpou6Bo.js → capability-load-error-dMTmC9nh.js} +1 -1
- package/dist/client/assets/{category-editor-BP6pLKwh.js → category-editor-1_2fvb3e.js} +1 -1
- package/dist/client/assets/{chart-D88KLoUP.js → chart-VsbCVKFV.js} +1 -1
- package/dist/client/assets/{chat-context-Bx9MVwv5.js → chat-context-DiXJfhIa.js} +1 -1
- package/dist/client/assets/{chat-draft-BY29_iSs.js → chat-draft-Bpba7nd9.js} +1 -1
- package/dist/client/assets/{checkbox-C49TGIp0.js → checkbox-Dz205M-t.js} +1 -1
- package/dist/client/assets/{choose-editor-DB0cnGpT.js → choose-editor-sM1ArvsC.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-C3RYiVe8.js → claim-phase-copy-Dd94Yylk.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DwRQR0Ku.js → cli-auth-success-B9VS9AxW.js} +1 -1
- package/dist/client/assets/{client-icons-DAZktl5s.js → client-icons-pHlGrnda.js} +1 -1
- package/dist/client/assets/{collapsible-syvMi5BG.js → collapsible-CfObde3Q.js} +1 -1
- package/dist/client/assets/{collection-detail-CjilUV-o.js → collection-detail-Db-KUOBe.js} +1 -1
- package/dist/client/assets/{collection-display-button-BeOcroLk.js → collection-display-button-BkekuxeX.js} +1 -1
- package/dist/client/assets/{collection-search-DHFp5D4H.js → collection-search-D2PZ787d.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-ge6vt6wC.js → collection-table-wrapper-CiNVnoGZ.js} +1 -1
- package/dist/client/assets/{collection-tabs-DXzpq1Uc.js → collection-tabs-BPj0wxo8.js} +1 -1
- package/dist/client/assets/{column-rules-BEG-LiIK.js → column-rules-DHSys_Pp.js} +1 -1
- package/dist/client/assets/{combobox-B6ZiAdlR.js → combobox-Cio7ykEV.js} +1 -1
- package/dist/client/assets/{command-D7RcR1At.js → command-CxzepSXP.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-M9JXIs4F.js → companion-mcps-section-Cv04Xa58.js} +1 -1
- package/dist/client/assets/{config-DPgm9uDo.js → config-Ct9Qi8LT.js} +1 -1
- package/dist/client/assets/{connect-DPzJM3Ss.js → connect-CGibdNE5.js} +1 -1
- package/dist/client/assets/{connect-layout-BkW0QYIq.js → connect-layout-BxAxcInI.js} +1 -1
- package/dist/client/assets/{connection-8CqSsDm5.js → connection-DbyDLRig.js} +1 -1
- package/dist/client/assets/{connection-card-XhoPzocB.js → connection-card-DUnGN1LQ.js} +1 -1
- package/dist/client/assets/{connection-detail-C7APaNGj.js → connection-detail-CYpkfAUI.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BmHNz6u_.js → connection-form-helpers-B-IGiex0.js} +1 -1
- package/dist/client/assets/{connections-BWEZddgp.js → connections-8PptZe-N.js} +1 -1
- package/dist/client/assets/{context-BcZ7togB.js → context-CqJX50Y5.js} +1 -1
- package/dist/client/assets/{context-menu-hfM0OJ90.js → context-menu-X12cIwS3.js} +1 -1
- package/dist/client/assets/{core.esm-BDakG4hN.js → core.esm-BND19H8a.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-kX3bAwvy.js → create-organization-dialog-DvoetHmh.js} +1 -1
- package/dist/client/assets/{daily-pulse-DLNh3BNN.js → daily-pulse-VPctcCpq.js} +1 -1
- package/dist/client/assets/{decopilot-BVdjTDzA.js → decopilot-RuTJJBbl.js} +1 -1
- package/dist/client/assets/{device-hint--Pl8erT8.js → device-hint-BJfRFQKk.js} +1 -1
- package/dist/client/assets/{dialog-DfdkHhmb.js → dialog-D_5RxDc9.js} +1 -1
- package/dist/client/assets/{discover-B_YJeQ0t.js → discover-DtRS1x6t.js} +1 -1
- package/dist/client/assets/{domain-settings-BNKv7CG9.js → domain-settings-BGARHR_o.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CfJbVT9R.js → download-app-dialog-RU0ZYOfB.js} +1 -1
- package/dist/client/assets/{drawer-CIqQnl1u.js → drawer-Br_av5UR.js} +1 -1
- package/dist/client/assets/{editor-DPVBnzyg.js → editor-KC3-U1Hv.js} +1 -1
- package/dist/client/assets/{empty-state-DSS4pT1g.js → empty-state-Bzg2RaeW.js} +1 -1
- package/dist/client/assets/{empty-state-BRfCy1KK.js → empty-state-DNTQ1C-X.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BFK1aCsO.js → extract-connection-data-BFG_cq-0.js} +1 -1
- package/dist/client/assets/{feature-gate-lUmvuNGP.js → feature-gate-B2dCnM8L.js} +1 -1
- package/dist/client/assets/{feature-paywall-BHVpt9vY.js → feature-paywall-CVOfOt8x.js} +1 -1
- package/dist/client/assets/{file-explorer-BhvSUItT.js → file-explorer-wKCmBF67.js} +1 -1
- package/dist/client/assets/{file-preview-Pk-Bxrs3.js → file-preview-VEd_A7P9.js} +1 -1
- package/dist/client/assets/{file-share-button-Drokhk1O.js → file-share-button-DkiNZpp9.js} +1 -1
- package/dist/client/assets/{file-type-icon-Dak7C2hB.js → file-type-icon-CfnH9Twn.js} +1 -1
- package/dist/client/assets/flat-project-DkZ9ut26.js +1 -0
- package/dist/client/assets/{folder-icon-BV7RkSpo.js → folder-icon-CzsWuPW5.js} +1 -1
- package/dist/client/assets/{form-L-QwU058.js → form-juLaUBrF.js} +1 -1
- package/dist/client/assets/{gateway-client-DIx8y90K.js → gateway-client-CZQ4II3C.js} +1 -1
- package/dist/client/assets/{general-4i0UazBb.js → general-DxW1EaZc.js} +1 -1
- package/dist/client/assets/{home-DrUnBj11.js → home-m5VhYXeH.js} +1 -1
- package/dist/client/assets/{icon-button-CNx5vjvd.js → icon-button-CMxGCJDP.js} +1 -1
- package/dist/client/assets/{index-D6hcVQMy.js → index-BC7i1Aoz.js} +1 -1
- package/dist/client/assets/{index-DLxL4E4g.js → index-BgwBy5oM.js} +1 -1
- package/dist/client/assets/{index-qxTKzwUa.js → index-C1hd3ai4.js} +1 -1
- package/dist/client/assets/{index-DLUvq6N4.js → index-C5X8q_Pi.js} +1 -1
- package/dist/client/assets/{index-yySMOeUT.js → index-CCXcZJGG.js} +1 -1
- package/dist/client/assets/{index-BBAhA6Le.js → index-CZNblbQa.js} +1 -1
- package/dist/client/assets/{index-BSNgOILO.js → index-CpnRViDi.js} +3 -3
- package/dist/client/assets/{index-CmfXJaKn.js → index-CsKm2ubF.js} +2 -2
- package/dist/client/assets/{index-D-j5tLoV.js → index-CyAv4Ino.js} +1 -1
- package/dist/client/assets/{index-BIS-YXel.js → index-CycACfp6.js} +1 -1
- package/dist/client/assets/{index-hw5atO08.js → index-CzdEzd_G.js} +1 -1
- package/dist/client/assets/{index-Cha6sREf.js → index-DCcjp4nP.js} +1 -1
- package/dist/client/assets/{index-CpCp6flP.js → index-DyC292ZS.js} +1 -1
- package/dist/client/assets/{index-0eJRh8R4.js → index-G0I4ayW-.js} +1 -1
- package/dist/client/assets/{index-slTQzhAF.js → index-WJJsnt-n.js} +1 -1
- package/dist/client/assets/{index-redirect-BsL3Wy60.js → index-redirect-_gwqEShi.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BV5hUiLD.js → infiniteQueryObserver-DaqTQDCS.js} +1 -1
- package/dist/client/assets/{infra-billing-CTgKPdho.js → infra-billing-DCtNAzlT.js} +1 -1
- package/dist/client/assets/{input-4qEEcM12.js → input-BhJziSQi.js} +1 -1
- package/dist/client/assets/input-DFO5Hmip.js +17 -0
- package/dist/client/assets/{input-BNzPL_iy.js → input-hKftpNOz.js} +1 -1
- package/dist/client/assets/{integration-icon-BonC-ogs.js → integration-icon-CTkfXIOR.js} +1 -1
- package/dist/client/assets/{label-bFgvSx58.js → label-Bfbz6otc.js} +1 -1
- package/dist/client/assets/{layout-C6WqLGyR.js → layout-ZwTrfTZi.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BBL3IdDh.js → legacy-agents-deep-DMwbwAKI.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CfhJpa5K.js → legacy-main-redirect-BGY6ia4w.js} +1 -1
- package/dist/client/assets/library-DlOv00rX.js +1 -0
- package/dist/client/assets/{library-tab-BB8_-aXb.js → library-tab-BcgjMyrL.js} +1 -1
- package/dist/client/assets/{login-DHRUorQv.js → login-DCqry8Ay.js} +1 -1
- package/dist/client/assets/{markdown-Bm0EnhxB.js → markdown-Bx2p9OGj.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DrzyJZxY.js → mcp-app-renderer-d-JulMSx.js} +1 -1
- package/dist/client/assets/{mcp-oauth-NtoAIxeI.js → mcp-oauth-BOCq2t4w.js} +1 -1
- package/dist/client/assets/{members-rL_0NXs3.js → members-xhc9KLWq.js} +1 -1
- package/dist/client/assets/{memory-57liTbov.js → memory-VJT_lSNB.js} +1 -1
- package/dist/client/assets/{mini-report-page-2z90zMGC.js → mini-report-page-YCYdK64Z.js} +1 -1
- package/dist/client/assets/{mock-board-2vyeBIpi.js → mock-board-DcCpR66D.js} +1 -1
- package/dist/client/assets/{monaco-editor-CgPa2BkS.js → monaco-editor-CkJpx19Y.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B8BCbzN2.js → monitoring-stats-row-Cqs-6_S6.js} +1 -1
- package/dist/client/assets/{multi-select-Eun7kW76.js → multi-select-DW-NLuy4.js} +1 -1
- package/dist/client/assets/{mustache-C8I_o4kv.js → mustache-Q-UGwUPM.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BBDXUa7t.js → new-project-dialog-BR_BdAk-.js} +1 -1
- package/dist/client/assets/{oauth-callback-BRlmMjq0.js → oauth-callback-CRloSDTl.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-dNKGDRz2.js → oauth-callback-ai-provider-2uzVHGZK.js} +1 -1
- package/dist/client/assets/{onboarding-DuoOHH_e.js → onboarding-DkT61UKY.js} +1 -1
- package/dist/client/assets/{openai-conversation-CsZhzcK_.js → openai-conversation-Bo2nNgKY.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BBCxpQYT.js → optimistic-project-sidebar-views-DfbOaqQl.js} +1 -1
- package/dist/client/assets/{org-file-open-context-B_XQOD8z.js → org-file-open-context-BHXXOOHS.js} +1 -1
- package/dist/client/assets/{organization-choice-CZP-vgCu.js → organization-choice-B8_GAtl-.js} +1 -1
- package/dist/client/assets/{orgs-DqPSkSGZ.js → orgs-BuJtkddf.js} +1 -1
- package/dist/client/assets/{page-seo-form-3EgL9cU4.js → page-seo-form-5o5iVNld.js} +1 -1
- package/dist/client/assets/{pair-BNiFxIdB.js → pair-gpe5yzQs.js} +1 -1
- package/dist/client/assets/{plan-ladder-BJXeUQY6.js → plan-ladder-DionZok_.js} +1 -1
- package/dist/client/assets/{popover-DwltHyyo.js → popover-DH3Sl61q.js} +1 -1
- package/dist/client/assets/{post-calendar-Dn93fgop.js → post-calendar-tH162nXm.js} +1 -1
- package/dist/client/assets/{post-editor-Df-Ydp56.js → post-editor-D1gbYoHN.js} +1 -1
- package/dist/client/assets/{preview-content-llp8A1Fx.js → preview-content-SoUMkfQg.js} +1 -1
- package/dist/client/assets/{preview-dialog-C0rIAVwJ.js → preview-dialog-DPOzbA4Y.js} +1 -1
- package/dist/client/assets/{preview-panel-kwICD-IP.js → preview-panel-CywYdFpJ.js} +1 -1
- package/dist/client/assets/{profile-CKI2V6L4.js → profile-Dmb0eg_9.js} +1 -1
- package/dist/client/assets/{project-app-view-n3cNFnjF.js → project-app-view-gFsgFZJs.js} +1 -1
- package/dist/client/assets/{project-feed-CrcM01NE.js → project-feed-LDtRi-aY.js} +1 -1
- package/dist/client/assets/{project-icon-BbgRznbE.js → project-icon-DxklOC8j.js} +1 -1
- package/dist/client/assets/project-reports-DA_DcXq0.js +1 -0
- package/dist/client/assets/project-tasks-6O_Gw9mX.js +1 -0
- package/dist/client/assets/{projects-C92Fpsys.js → projects-Dq4GZ2RU.js} +1 -1
- package/dist/client/assets/{projects-empty-state-jalgUMXc.js → projects-empty-state-LXUf6lw8.js} +1 -1
- package/dist/client/assets/{prompts-I5dsKQL_.js → prompts-DpoYq-C8.js} +1 -1
- package/dist/client/assets/record-editor-CiRyw1Eu.js +1 -0
- package/dist/client/assets/{redirect-editor-Be2R_jDZ.js → redirect-editor-h2jfnY0r.js} +1 -1
- package/dist/client/assets/{reports-8DYzRzah.js → reports-BkGvj-AQ.js} +1 -1
- package/dist/client/assets/reports-C9YxMpwW.js +1 -0
- package/dist/client/assets/{reports-onboarding-DHU4Avz5.js → reports-onboarding-D2nAyEQg.js} +1 -1
- package/dist/client/assets/{reports-tab-DRzkM6pV.js → reports-tab-C4Iuixxf.js} +2 -2
- package/dist/client/assets/{repositories-CIMUlOvj.js → repositories-CInM2D5H.js} +1 -1
- package/dist/client/assets/{repository-binding-DLsaqYxe.js → repository-binding-ebck0c8n.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BuXUq4VL.js → repository-import-picker-CTs8TUdw.js} +1 -1
- package/dist/client/assets/{repository-picker-BiHs5x47.js → repository-picker-BwC54VM6.js} +1 -1
- package/dist/client/assets/{require-capability-BEya1FVv.js → require-capability-C0TsXxTO.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DxbZpHcW.js → required-auth-layout-D4fpdDYn.js} +1 -1
- package/dist/client/assets/{reset-password-Cka0kEpf.js → reset-password-BW6tqvrs.js} +1 -1
- package/dist/client/assets/{resizable-B88Tf4WJ.js → resizable-DENddsry.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-B5oufvSh.js → resolve-tab-icon-BGgWJEJh.js} +1 -1
- package/dist/client/assets/{review-settings-CjaZPAVN.js → review-settings-KWioU3vH.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-Bx6xpmAj.js → rich-text-link-control-DdGTIpxo.js} +1 -1
- package/dist/client/assets/{roles-CQY7V_Nv.js → roles-B73i-5IT.js} +1 -1
- package/dist/client/assets/{route-BJUf6dcj.js → route-CwP5bQeO.js} +1 -1
- package/dist/client/assets/{route-Chcgj5js.js → route-Do1Yrs9w.js} +1 -1
- package/dist/client/assets/route-XcpEoNu9.js +1 -0
- package/dist/client/assets/{runnable-block-editor-36tIZdMB.js → runnable-block-editor-Dl0N0zCW.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-C9BC0S3N.js → sandbox-lifecycle-context-B_NAJSjm.js} +1 -1
- package/dist/client/assets/{schema-2UaHsULm.js → schema-bIq2BT73.js} +1 -1
- package/dist/client/assets/{scroll-area-BYHvZ2mI.js → scroll-area-DgvMLOUX.js} +1 -1
- package/dist/client/assets/{search-input-B_YLozB3.js → search-input-Dxc4Q9oE.js} +1 -1
- package/dist/client/assets/{search-toggle-gk1lAOE-.js → search-toggle-BB2lVgeF.js} +1 -1
- package/dist/client/assets/{secret-picker-TXboPuNL.js → secret-picker-CBx3NT_r.js} +1 -1
- package/dist/client/assets/{secrets-B0siWpRR.js → secrets-Bds2fazx.js} +1 -1
- package/dist/client/assets/{sections-editor-DbE334qL.js → sections-editor-BHKheRNV.js} +1 -1
- package/dist/client/assets/{select-CGUBnSdo.js → select-ERtFaSl0.js} +1 -1
- package/dist/client/assets/{select-model-CvAltrce.js → select-model-DMNOi0UH.js} +1 -1
- package/dist/client/assets/{seo-editor-B_4BH5be.js → seo-editor-Cl9glbjm.js} +1 -1
- package/dist/client/assets/{separator-C5Q36va9.js → separator-CuY7Q1Gl.js} +1 -1
- package/dist/client/assets/{settings-tab-BEu6uPlX.js → settings-tab-D7GiwWK4.js} +1 -1
- package/dist/client/assets/{sheet-7Pf6aTpk.js → sheet-nJD4St3t.js} +1 -1
- package/dist/client/assets/{shell-layout-iAP3M_t2.js → shell-layout-CsK_iJoM.js} +1 -1
- package/dist/client/assets/{skills-beo1viZi.js → skills-BpYdnG8K.js} +1 -1
- package/dist/client/assets/{sso-nlgrPDDd.js → sso-CUH5oWF7.js} +1 -1
- package/dist/client/assets/{suggestion-BoHqZ2zm.js → suggestion-CVmYJ2-l.js} +1 -1
- package/dist/client/assets/{switch-DS7j-ERy.js → switch-BhR8nlxD.js} +1 -1
- package/dist/client/assets/{synced-repos--TVpMVGF.js → synced-repos-C5uktY6M.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CqKc2Jnq.js → tab-icon-glyph-DDGnTEUb.js} +1 -1
- package/dist/client/assets/{table-B9nrZOlA.js → table-BghtXeZn.js} +1 -1
- package/dist/client/assets/{tabs-C4Ipd_wa.js → tabs-BdEjeb3h.js} +1 -1
- package/dist/client/assets/{task-board-DsbM6d_k.js → task-board-CC3VTzd7.js} +1 -1
- package/dist/client/assets/{task-route-Dw_pjXIQ.js → task-route-CzV6Ggve.js} +1 -1
- package/dist/client/assets/{task-status-Bu8dWbMG.js → task-status-MdR-wgNu.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CoNiVl0J.js → taskboard-analytics-CjgkuySj.js} +1 -1
- package/dist/client/assets/{tasks-BpRBMq0r.js → tasks-B7Pdi00T.js} +1 -1
- package/dist/client/assets/tasks-Lm1DDtMB.js +1 -0
- package/dist/client/assets/{textarea-5M2oFUCk.js → textarea-CFMwKhM9.js} +1 -1
- package/dist/client/assets/{thread-analytics-DBgLHsuG.js → thread-analytics-BeZ0CZhF.js} +1 -1
- package/dist/client/assets/{thread-button-D6_ujRz8.js → thread-button-DdmUMrmT.js} +1 -1
- package/dist/client/assets/{thread-intent-DYi-88yf.js → thread-intent-Dg3GQUH3.js} +1 -1
- package/dist/client/assets/{thread-route-Ddedz3K3.js → thread-route-BPJPEkBO.js} +1 -1
- package/dist/client/assets/{thread-route-D8jj7JQn.js → thread-route-C5YO0tNH.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CQZ4Xzqy.js → thread-sheet-body-Ci751mbw.js} +1 -1
- package/dist/client/assets/{toggle-group-B-XGJasE.js → toggle-group-DLp7Wh-7.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Cme8sKPF.js → toolbar-icon-button-CMClok1k.js} +1 -1
- package/dist/client/assets/{tooltip-CyP-7aI0.js → tooltip-17PKNCMM.js} +1 -1
- package/dist/client/assets/{track-B2INqJw_.js → track-A4Z9PFKK.js} +1 -1
- package/dist/client/assets/{types-BGNIxZfy.js → types-Zt76-Urn.js} +1 -1
- package/dist/client/assets/{usage-stats-DzFZMIXh.js → usage-stats-Di6th6eM.js} +1 -1
- package/dist/client/assets/{use-ai-providers-4F-zKGq7.js → use-ai-providers-DXMywQjn.js} +1 -1
- package/dist/client/assets/{use-automations-CObCkDjZ.js → use-automations-BIkU0R2i.js} +1 -1
- package/dist/client/assets/{use-autosave-lnP7w6IA.js → use-autosave-D7Dc_Y3x.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-DeR1Tqdr.js → use-chat-layout-state-CcVNkckt.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-B89SfaFP.js → use-chat-navigation-EErRoLjo.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CAj_vE5f.js → use-clock-tick-Bs0g2LMm.js} +1 -1
- package/dist/client/assets/{use-connect-companion-C08Ls9V4.js → use-connect-companion-BV3jBqGw.js} +1 -1
- package/dist/client/assets/{use-connection-DsbJp2WH.js → use-connection-hWK0p_4I.js} +1 -1
- package/dist/client/assets/{use-copy-gILaQNS5.js → use-copy-eIJpbbHo.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B9llzBQy.js → use-create-virtual-mcp-CFCczIE_.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-JG2XlcuE.js → use-date-fns-locale-CViyxf02.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BDX075Uf.js → use-debounced-autosave-B4SAaEhH.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CkSh2sdJ.js → use-debounced-value-Dws83Fd6.js} +1 -1
- package/dist/client/assets/{use-deco-credits-B6M50c5m.js → use-deco-credits-YDPWVl4H.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-GRYBUdoh.js → use-decopilot-events-BlCOqvv5.js} +1 -1
- package/dist/client/assets/{use-delete-connection-M4g6mXhR.js → use-delete-connection-CEwDeoWa.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DoRISvgr.js → use-deployment-admin-B2zM8cA7.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-BPOBE2S-.js → use-ensure-project-folder-jggJOZhf.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-apV5WYRi.js → use-fast-preview-draft-url-B8A09d5h.js} +1 -1
- package/dist/client/assets/{use-file-configs-BmdGrQgB.js → use-file-configs-WonDx6od.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BhcJa6Dv.js → use-infinite-scroll-CvbHrO1A.js} +1 -1
- package/dist/client/assets/{use-join-requests-B6pi4oC9.js → use-join-requests-Dkum0YOb.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Bn7Q_nKJ.js → use-main-panel-tabs-DM4i9k_8.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BwGIXOfQ.js → use-mcp-auth-status-CifzBBCu.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bm7mYuOR.js → use-mcp-client-C7yhsDUq.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CSphD1Ew.js → use-mcp-prompts-BZp7FUGA.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Yl5gKY2j.js → use-mcp-tools-B-fAu-Lb.js} +1 -1
- package/dist/client/assets/{use-members-BkFO1Bt8.js → use-members-muYuUKl8.js} +1 -1
- package/dist/client/assets/{use-mobile-D-nsnibB.js → use-mobile-h60o0kDh.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-ilYOi1P6.js → use-navigate-to-agent-DpJjb9Ad.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-DRLHOxEJ.js +1 -0
- package/dist/client/assets/{use-open-billing-url-BJSxQsX7.js → use-open-billing-url-CqRpsDrV.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Ch8FFgkf.js → use-org-auth-client-CPl2reDK.js} +1 -1
- package/dist/client/assets/{use-org-fs-D7r3cXXb.js → use-org-fs-DuUomCai.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-YBN6v1a-.js → use-org-repo-syncs-4sBt09GE.js} +1 -1
- package/dist/client/assets/{use-org-sso-ColeXCJP.js → use-org-sso-DHgm8_xi.js} +1 -1
- package/dist/client/assets/{use-organization-roles-5OyxiKHR.js → use-organization-roles-BV3iU524.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bkbee1TC.js → use-organization-settings-C9LFE9dH.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CFkRSy6M.js → use-panel-navigate-BoWMxqfw.js} +1 -1
- package/dist/client/assets/{use-project-scope-BhC0oTXz.js → use-project-scope-Bq9_CxnF.js} +1 -1
- package/dist/client/assets/{use-releases-BmqYrGh7.js → use-releases-BBaBeMfL.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CCwARN0J.js → use-reports-diagnostic-G1zwph_0.js} +1 -1
- package/dist/client/assets/{use-secrets-tjcKGh8r.js → use-secrets-Ct52FR_G.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BuZjO6fr.js → use-section-preview-base-DOtesyFx.js} +1 -1
- package/dist/client/assets/{use-session-runtime-ComyTd-K.js → use-session-runtime-DCyDQGsH.js} +1 -1
- package/dist/client/assets/{use-tags-oEpdgu7W.js → use-tags-pyv75hiG.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BAFH41CD.js → use-task-board-analytics-BJyBRcs8.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CJEARXda.js → use-task-board-events-Bz8ommc9.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DNM-o2cs.js → use-task-metadata-C_1RsAj0.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BsDhHRrs.js → use-thread-analytics-CVwQKqXG.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Cv0FzPvX.js → use-thread-outputs-Co6FxFAd.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-SgJx2z0R.js +1 -0
- package/dist/client/assets/{useQueries-BtiLqqyQ.js → useQueries-4js0NmfF.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BCL_lLFm.js +1 -0
- package/dist/client/assets/{users-DyQGgOV3.js → users-DFphiLPz.js} +1 -1
- package/dist/client/assets/{utils-C41e_wcL.js → utils-7wkojbq8.js} +1 -1
- package/dist/client/assets/{variant-calendar-B4sM-EEp.js → variant-calendar-hQb_6Knv.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DYorwBPR.js → variant-matcher-override-B7_BSavX.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Dqx01hDb.js → view-mode-toggle-I-eGSI3M.js} +1 -1
- package/dist/client/assets/{virtual-mcp-k-QS-zY_.js → virtual-mcp-CZeK9_Zn.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DCZ8xzM-.js +0 -1
- package/dist/client/assets/agent-deck-D-q8ZKHY.js +0 -1
- package/dist/client/assets/agent-library-DOYiSA2I.js +0 -1
- package/dist/client/assets/agent-library-file-B0o-BaD1.js +0 -1
- package/dist/client/assets/agent-settings-C4N5XRQB.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CzC0UMgl.js +0 -2
- package/dist/client/assets/agent-view-BchMOwqQ.js +0 -1
- package/dist/client/assets/api-keys-WRek4yc5.js +0 -1
- package/dist/client/assets/app-editor-BP33ySjF.js +0 -1
- package/dist/client/assets/flat-project-CqacAsy2.js +0 -1
- package/dist/client/assets/input-C5EZjiM5.js +0 -17
- package/dist/client/assets/library-ChuqB8UQ.js +0 -1
- package/dist/client/assets/project-reports-B7UkSmH1.js +0 -1
- package/dist/client/assets/project-tasks-DRbeO-yg.js +0 -1
- package/dist/client/assets/record-editor-Bb9CxLRe.js +0 -1
- package/dist/client/assets/reports-BpSqXBgV.js +0 -1
- package/dist/client/assets/route-DIenLn_2.js +0 -1
- package/dist/client/assets/tasks-B8Jp1enk.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-BMeMurTo.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CguvOv70.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CjC1GQYU.js +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-Bo2nNgKY.js","assets/index-CsKm2ubF.js","assets/index-BeFSZLR9.css","assets/index-CyAv4Ino.js","assets/gateway-client-CZQ4II3C.js","assets/dialog-D_5RxDc9.js","assets/X-DJN31Nfv.js","assets/form-juLaUBrF.js","assets/label-Bfbz6otc.js","assets/input-BhJziSQi.js","assets/utils-CVEq3hMx.js","assets/org-file-open-context-BHXXOOHS.js","assets/use-mobile-h60o0kDh.js","assets/use-panel-navigate-BoWMxqfw.js","assets/thread-route-C5YO0tNH.js","assets/use-project-scope-Bq9_CxnF.js","assets/repository-binding-ebck0c8n.js","assets/use-mcp-client-C7yhsDUq.js","assets/auth-Cs4gU6Jt.js","assets/tooltip-17PKNCMM.js","assets/index-CZNblbQa.js","assets/XClose-D0KEw8ZX.js","assets/icon-button-CMxGCJDP.js","assets/file-type-icon-CfnH9Twn.js","assets/use-chat-navigation-EErRoLjo.js","assets/autosend-D7eBSjvh.js","assets/location-zK0I9Ia6.js","assets/shell-layout-CsK_iJoM.js","assets/avatar-BeFOPb9J.js","assets/User01-DcjCdViP.js","assets/Building02-BG4IPwQ3.js","assets/UserSquare-CQZbVq0f.js","assets/agent-icon-DGDGzDPg.js","assets/AlertCircle-BOqaZFXA.js","assets/Tool01-B_dduyQs.js","assets/ArrowUp-Bi8YJGtE.js","assets/ArrowLeft-BsFMaTJ5.js","assets/LinkBroken01-CNbQoBrl.js","assets/ShoppingBag01-BfMGWAwv.js","assets/ZoomOut-UxLkEy8R.js","assets/CheckCircle-D49A5hws.js","assets/Check-ChBZV9OV.js","assets/ChevronUp-wB5J5ntl.js","assets/Copy01-C4tt-_AN.js","assets/CreditCard01-DCvyy0kz.js","assets/DotsVertical-BWwzMO41.js","assets/Image01-B4l0All3.js","assets/Palette-BKZ5R7W4.js","assets/Key01-DNpH0NnO.js","assets/Link01-DZVgeeWe.js","assets/LinkExternal01-D73wyIiU.js","assets/Monitor01-BJ23zU-n.js","assets/Sun-BAfhxpb-.js","assets/Plus-CP_oegJ7.js","assets/SearchMd-D2OTQFME.js","assets/Trash01-C4sE_NGv.js","assets/Upload01-qBk1AINH.js","assets/Users01-DR0sKzFO.js","assets/download-app-dialog-RU0ZYOfB.js","assets/use-clock-tick-Bs0g2LMm.js","assets/command-CxzepSXP.js","assets/index-CzdEzd_G.js","assets/integration-icon-CTkfXIOR.js","assets/project-icon-DxklOC8j.js","assets/new-project-dialog-BR_BdAk-.js","assets/repository-import-picker-CTs8TUdw.js","assets/use-navigate-to-agent-DpJjb9Ad.js","assets/thread-intent-Dg3GQUH3.js","assets/backoff-8mStPHYB.js","assets/task-board-CC3VTzd7.js","assets/schema-bIq2BT73.js","assets/slugify-CEUa2lfQ.js","assets/repository-picker-BwC54VM6.js","assets/useInfiniteQuery-SgJx2z0R.js","assets/infiniteQueryObserver-DaqTQDCS.js","assets/collection-search-D2PZ787d.js","assets/use-debounced-value-Dws83Fd6.js","assets/use-organization-settings-C9LFE9dH.js","assets/use-is-desktop-app-BNujXJc_.js","assets/required-auth-layout-D4fpdDYn.js","assets/use-org-sso-DHgm8_xi.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-Bpba7nd9.js","assets/use-session-runtime-DCyDQGsH.js","assets/chat-context-DiXJfhIa.js","assets/use-decopilot-events-BlCOqvv5.js","assets/use-ai-providers-DXMywQjn.js","assets/select-ERtFaSl0.js","assets/usage-stats-Di6th6eM.js","assets/use-copy-eIJpbbHo.js","assets/markdown-Bx2p9OGj.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/tabs-BdEjeb3h.js","assets/use-deco-credits-YDPWVl4H.js","assets/toggle-group-DLp7Wh-7.js","assets/tool-namespace-DmnQIdtF.js","assets/use-open-billing-url-CqRpsDrV.js","assets/decopilot-RuTJJBbl.js","assets/checkbox-Dz205M-t.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-DH3Sl61q.js","assets/drawer-Br_av5UR.js","assets/index-BgwBy5oM.js","assets/input-hKftpNOz.js","assets/suggestion-CVmYJ2-l.js","assets/use-mcp-prompts-BZp7FUGA.js","assets/use-org-fs-DuUomCai.js","assets/question-004-sINsf4GQ.js","assets/use-members-muYuUKl8.js","assets/use-org-auth-client-CPl2reDK.js","assets/feature-paywall-CVOfOt8x.js","assets/plan-ladder-DionZok_.js","assets/add-connection-dialog-BY0I55_H.js","assets/extract-connection-data-BFG_cq-0.js","assets/metadata-D72DunRR.js","assets/connection-DbyDLRig.js","assets/connection-card-DUnGN1LQ.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-CFMwKhM9.js","assets/use-connection-hWK0p_4I.js","assets/connection-form-helpers-B-IGiex0.js","assets/authenticate-and-persist-oauth-VlIk_G_o.js","assets/mcp-oauth-BOCq2t4w.js","assets/collection-tabs-BPj0wxo8.js","assets/badge-SOygJ_ut.js","assets/use-infinite-scroll-CvbHrO1A.js","assets/useSuspenseInfiniteQuery-BCL_lLFm.js","assets/use-task-board-events-Bz8ommc9.js","assets/use-chat-layout-state-CcVNkckt.js","assets/use-file-configs-WonDx6od.js","assets/site-slug-DebpOoQq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aO as Le,c as R,b as B,r as P,l as z,j as n,au as re,bM as Ut,av as se,bL as Ue,B as Y,at as Ss,as as Cs,bN as Ns,bK as Is,x as Se,aU as Ts,e4 as we,e5 as gt,a2 as _s,e as Ms,t as Ee,q as ee,X as Ce,d as rt,e1 as Ds,Z as Rs,K as Es,m as Ps,I as Ls,F as Us,H as Fs,G as Ae,aj as xt,ah as vt,ai as bt,h as Os,aG as zs,aF as $s,ak as Bs,cQ as Ks,cU as ye,aK as qs,cW as Qs,aL as At,aP as Ws,a as Ys,U as Gs,V as Hs,ay as tt,a7 as Ft,bT as Js,aE as Zs}from"./index-CsKm2ubF.js";import{c as Xs,d as Ot,P as en,i as tn}from"./index-CyAv4Ino.js";import{s as zt}from"./XClose-D0KEw8ZX.js";import{I as sn}from"./icon-button-CMxGCJDP.js";import{F as nn}from"./file-type-icon-CfnH9Twn.js";import{a as on}from"./use-chat-navigation-EErRoLjo.js";import{b as rn}from"./location-zK0I9Ia6.js";import{d as an,K as ln,b as Vn}from"./shell-layout-CsK_iJoM.js";import{a as cn}from"./repository-binding-ebck0c8n.js";import{w as dn,A as un}from"./autosend-D7eBSjvh.js";import{s as pn,r as yt,i as fn,c as hn,w as mn,H as gn}from"./chat-draft-Bpba7nd9.js";import{u as xn}from"./use-session-runtime-DCyDQGsH.js";import{i as $t}from"./LinkBroken01-CNbQoBrl.js";import{i as Bt}from"./ArrowUp-Bi8YJGtE.js";import{n as Kt}from"./ShoppingBag01-BfMGWAwv.js";import{i as it}from"./Check-ChBZV9OV.js";import{t as We,aK as qt,a2 as Qt,aL as st,f as at,as as vn,_ as bn,aM as An,q as Wt,aN as Yt,I as yn,aO as jn}from"./agent-icon-DGDGzDPg.js";import{a as Gt}from"./Image01-B4l0All3.js";import{h as kn}from"./UserSquare-CQZbVq0f.js";import{i as wn}from"./Upload01-qBk1AINH.js";import{i as lt}from"./X-DJN31Nfv.js";import{a as Fe,b as Ye,c as Ge,h as Sn,j as Cn,k as Nn,l as In,m as Tn,n as _n,o as Mn,u as Vt,p as Dn,e as Rn,s as En,d as Pn}from"./chat-context-DiXJfhIa.js";import{o as Ln,z as Un,q as Fn,c as On}from"./thread-intent-Dg3GQUH3.js";import{i as zn}from"./AlertCircle-BOqaZFXA.js";import{a as $n}from"./Copy01-C4tt-_AN.js";import{a as nt,b as ct,d as dt,f as ut,F as Ht}from"./form-juLaUBrF.js";import{c as Bn,S as Kn,b as qn,a as Qn,d as Wn}from"./select-ERtFaSl0.js";import{t as Jt}from"./ChevronUp-wB5J5ntl.js";import{T as He,a as Je,b as Ze}from"./tooltip-17PKNCMM.js";import{i as Yn}from"./ArrowLeft-BsFMaTJ5.js";import{i as Zt,M as Gn,S as Hn}from"./usage-stats-Di6th6eM.js";import{c as Jn,b as Zn}from"./tabs-BdEjeb3h.js";import{d as Xn,h as eo,c as to,b as so,D as no}from"./dialog-D_5RxDc9.js";import{e as Oe,f as oo,c as ro,g as io}from"./use-decopilot-events-BlCOqvv5.js";import{u as ao}from"./use-deco-credits-YDPWVl4H.js";import{I as lo}from"./input-BhJziSQi.js";import{T as jt,a as Vo}from"./toggle-group-DLp7Wh-7.js";import{s as co}from"./tool-namespace-DmnQIdtF.js";import{t as uo}from"./utils-CVEq3hMx.js";import{u as po}from"./use-open-billing-url-CqRpsDrV.js";import{M as fo,m as pt,g as ho,a as mo}from"./decopilot-RuTJJBbl.js";import{a as Xt,b as es,P as ts}from"./popover-DH3Sl61q.js";import{c as go,b as xo,a as vo,D as bo}from"./drawer-Br_av5UR.js";import{u as ss}from"./use-mobile-h60o0kDh.js";import{t as Ao}from"./Tool01-B_dduyQs.js";import{d as yo,a as jo}from"./use-organization-settings-C9LFE9dH.js";import{u as ns,c as ko,d as wo}from"./use-ai-providers-DXMywQjn.js";import{M as So}from"./index-BgwBy5oM.js";import{p as os,u as Co,T as No,a as Io,U as To}from"./input-hKftpNOz.js";import{d as _o,g as kt,s as Mo}from"./gateway-client-CZQ4II3C.js";import{u as Do}from"./use-mcp-client-C7yhsDUq.js";import{l as Ro,g as Eo}from"./use-mcp-prompts-BZp7FUGA.js";import{i as Po}from"./Link01-DZVgeeWe.js";import{s as wt}from"./Plus-CP_oegJ7.js";import"./suggestion-CVmYJ2-l.js";import{p as Lo,q as Uo}from"./question-004-sINsf4GQ.js";import{A as Fo}from"./avatar-BeFOPb9J.js";import{u as Oo}from"./use-members-muYuUKl8.js";import{F as St}from"./feature-paywall-CVOfOt8x.js";import{A as zo}from"./add-connection-dialog-BY0I55_H.js";import{u as $o}from"./use-task-board-events-Bz8ommc9.js";import{d as Bo}from"./use-chat-layout-state-CcVNkckt.js";import{u as Ko}from"./use-is-desktop-app-BNujXJc_.js";const qo=Le("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const Qo=Le("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const Wo=Le("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Yo=Le("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Go=Le("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",dl=44,Ho={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-warning/5 after:pointer-events-none after:-z-10"},Jo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Zo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,f=B(),[m,h]=P.useState(d),[g,x]=P.useState(!1);let v;e[0]!==c?(v=()=>{x(!0),c?.()},e[0]=c,e[1]=v):v=e[1];const b=v;if(g)return null;const j=Jo[p],A=Ho[p];let k;e[2]!==j||e[3]!==A?(k=z("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",j,A),e[2]=j,e[3]=A,e[4]=k):k=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=()=>h(Xo),e[5]=w):w=e[5];const y=m&&"rounded-b-none",C=!m&&"rounded-b-xl";let S;e[6]!==y||e[7]!==C?(S=z("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",y,C),e[6]=y,e[7]=C,e[8]=S):S=e[8];const I=Zo[p];let N;e[9]!==I?(N=z("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let M;e[11]!==s||e[12]!==N?(M=n.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=M):M=e[13];let E;e[14]!==o?(E=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=E):E=e[15];let D;e[16]!==r?(D=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=D):D=e[17];const L=m?"rotate(180deg)":"rotate(0deg)";let _;e[18]!==L?(_=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Jt,{size:16,style:{transform:L,transition:`transform 180ms ${et}`}})}),e[18]=L,e[19]=_):_=e[19];let U;e[20]!==f?(U=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=U):U=e[21];let F;e[22]!==f?(F=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=F):F=e[23];let q,$;e[24]!==b?(q=le=>{le.stopPropagation(),b()},$=le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),le.stopPropagation(),b())},e[24]=b,e[25]=q,e[26]=$):(q=e[25],$=e[26]);let O;e[27]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(lt,{size:16}),e[27]=O):O=e[27];let W;e[28]!==U||e[29]!==F||e[30]!==q||e[31]!==$?(W=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":U,title:F,onClick:q,onKeyDown:$,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:O}),e[28]=U,e[29]=F,e[30]=q,e[31]=$,e[32]=W):W=e[32];let X;e[33]!==m||e[34]!==M||e[35]!==E||e[36]!==D||e[37]!==_||e[38]!==W||e[39]!==S?(X=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":m,onClick:w,className:S,children:[M,E,D,_,W]}),e[33]=m,e[34]=M,e[35]=E,e[36]=D,e[37]=_,e[38]=W,e[39]=S,e[40]=X):X=e[40];const te=m?"1fr":"0fr";let J;e[41]!==te?(J={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${et}`},e[41]=te,e[42]=J):J=e[42];let ae;e[43]===Symbol.for("react.memo_cache_sentinel")?(ae={overflow:"hidden",minHeight:0},e[43]=ae):ae=e[43];const T=m?1:0;let Q;e[44]!==T?(Q={opacity:T,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=T,e[45]=Q):Q=e[45];let Z;e[46]!==i?(Z=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=Z):Z=e[47];let H;e[48]!==V||e[49]!==i?(H=V?n.jsx("div",{className:z("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=H):H=e[50];let ne;e[51]!==Z||e[52]!==H?(ne=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,H]}),e[51]=Z,e[52]=H,e[53]=ne):ne=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ce;e[57]!==Q||e[58]!==ne||e[59]!==G?(ce=n.jsx("div",{style:ae,children:n.jsxs("div",{className:"flex flex-col",style:Q,children:[ne,G]})}),e[57]=Q,e[58]=ne,e[59]=G,e[60]=ce):ce=e[60];let ie;e[61]!==J||e[62]!==ce?(ie=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:ce}),e[61]=J,e[62]=ce,e[63]=ie):ie=e[63];let fe;return e[64]!==X||e[65]!==ie||e[66]!==k||e[67]!==p?(fe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:k,children:[X,ie]}),e[64]=X,e[65]=ie,e[66]=k,e[67]=p,e[68]=fe):fe=e[68],fe}function Xo(t){return!t}const er=re({content:se().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Ue(["pending","in_progress","completed"]),activeForm:se().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),rs=re({todos:Ut(er)}),tr="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";Ln({description:tr,inputSchema:Un(rs),execute:async({todos:t})=>({ok:!0,count:t.length})});const sr="tool-todo_write",nr=new Set(["input-available","output-available"]);function or(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==sr||typeof i.state!="string"||!nr.has(i.state))continue;const a=rs.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function is(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:uo(co(o)),input:s.input})}return e}function as(t){return t.at(-1)}function ls(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function rr(t){return t?t.message.startsWith("[CREDITS]"):!1}const ir={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function ar(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&rr(s))return{...ir,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(k=>k.type==="tool-user_ask").filter(k=>k.state!=="output-available").length,c=V.some(Zt),p=ls(l),f=is(V),m=or(e),h=r?null:pn(s),g=r?null:Fn(s),x=!r&&!!s&&!h&&!g,v=f.length>0||r&&i,b=p.length>0,A=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||v||b||c))&&!x;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:h,hasTodos:m.length>0,showError:x,showWarning:A,hasApprovals:v,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:m}}function Vs(){const t=R.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=Fe(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=ar({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function ul(){const t=Vs(),e=Oe("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const Ct="start-task",lr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
3
|
+
|
|
4
|
+
1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
|
|
5
|
+
2. Call TASK_BOARD_ITEM_LIST. Its \`repos\` are this organization's repositories — the only valid values for a task's repo, so pick the one the report is about and never invent a name.
|
|
6
|
+
3. Call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, assigneeId "super-agent", and onDuplicate "return_existing". That assignment is what queues the work; the duplicate option makes the tool hand back an existing task when one already covers this report instead of opening a second one.
|
|
7
|
+
4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. If the output says \`deduplicated: true\`, say the report was already tracked by that task and quote its \`duplicateReason\`. Never invent a URL. Do NOT implement the fix here; the task's own run does that, and the reporter gets an email when its PR is ready for review.
|
|
8
|
+
|
|
9
|
+
The report follows.`;function Vr(t){return{...t,content:[{type:"paragraph",content:[Xs({id:Ct,name:Ct,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:lr}}]})]},...t.content??[]]}}function cr(){const t=R.c(24),e=B(),s=on();if(!s)return null;let o,r,i,a;t[0]!==s.path||t[1]!==e?(o=rn(s.path),a="flex px-3 pt-3",r="surface-inset flex h-7 min-w-0 items-center gap-1.5 rounded-full pr-0.5 pl-2.5 text-xs text-foreground",i=e("chat.input.openFileContext",{name:o}),t[0]=s.path,t[1]=e,t[2]=o,t[3]=r,t[4]=i,t[5]=a):(o=t[2],r=t[3],i=t[4],a=t[5]);let l,V;t[6]!==o?(l=n.jsx(nn,{filename:o,className:"h-4 w-3 shrink-0"}),V=n.jsx("span",{className:"truncate",children:o}),t[6]=o,t[7]=l,t[8]=V):(l=t[7],V=t[8]);let d;t[9]!==e?(d=e("chat.input.openFileDismiss"),t[9]=e,t[10]=d):d=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(zt,{size:12}),t[11]=u):u=t[11];let c;t[12]!==s.dismiss||t[13]!==d?(c=n.jsx(sn,{label:d,size:"icon-sm",onClick:s.dismiss,children:u}),t[12]=s.dismiss,t[13]=d,t[14]=c):c=t[14];let p;t[15]!==r||t[16]!==i||t[17]!==l||t[18]!==V||t[19]!==c?(p=n.jsxs("span",{className:r,title:i,children:[l,V,c]}),t[15]=r,t[16]=i,t[17]=l,t[18]=V,t[19]=c,t[20]=p):p=t[20];let f;return t[21]!==a||t[22]!==p?(f=n.jsx("div",{className:a,children:p}),t[21]=a,t[22]=p,t[23]=f):f=t[23],f}function dr(t){const e=R.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=B();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==V?(d=z("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Yn,{size:14}),e[4]=c):c=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:c}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let m;e[10]!==a||e[11]!==f||e[12]!==o?(m=a("chat.pagination.counter",{current:f,total:o}),e[10]=a,e[11]=f,e[12]=o,e[13]=m):m=e[13];let h;e[14]!==m?(h=n.jsx("span",{className:"tabular-nums text-xs",children:m}),e[14]=m,e[15]=h):h=e[15];const g=s===o-1,x=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let v;e[16]!==x?(v=z("p-0.5 transition-colors rounded-lg",x),e[16]=x,e[17]=v):v=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx($t,{size:14}),e[20]=j):j=e[20];let A;e[21]!==i||e[22]!==g||e[23]!==v||e[24]!==b?(A=n.jsx("button",{type:"button",onClick:i,disabled:g,className:v,"aria-label":b,children:j}),e[21]=i,e[22]=g,e[23]=v,e[24]=b,e[25]=A):A=e[25];let k;return e[26]!==A||e[27]!==p||e[28]!==h?(k=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,h,A]}),e[26]=A,e[27]=p,e[28]=h,e[29]=k):k=e[29],k}function cs(t){const e=R.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(dr,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function ur(t){const e=R.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,c=o?s:!r,p=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==c||e[1]!==i?(f=()=>{c||i()},e[0]=c,e[1]=i,e[2]=f):f=e[2];const m=c&&"opacity-50 cursor-not-allowed";let h;e[3]!==m?(h=z("h-7 px-2.5 text-xs",m),e[3]=m,e[4]=h):h=e[4];let g;e[5]!==c||e[6]!==u||e[7]!==f||e[8]!==h?(g=n.jsx(Y,{type:"button",size:"sm","aria-disabled":c,onClick:f,className:h,children:u}),e[5]=c,e[6]=u,e[7]=f,e[8]=h,e[9]=g):g=e[9];const x=g;if(!p)return x;let v;e[10]!==x?(v=n.jsx(He,{asChild:!0,children:x}),e[10]=x,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;return e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16],j}function ds(t,e,s){return t.findIndex(o=>e(o)===s)}function Nt(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function It(t,e,s,o,r){if(t.length===0)return null;const i=ds(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function pr(t){return!t.isStreaming&&t.allAnswered}function us(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[d,u]=P.useState(V),[c,p]=P.useState(!1),f=Ss({resolver:Cs(o),defaultValues:r}),m=f.watch(),h=ds(e,s,d),g=h>=0?e[h]:void 0,x=a(m[d]),v=Nt(e,s,m,a),b=pr({isStreaming:i,allAnswered:v}),j=()=>{if(h>0){const I=e[h-1];I&&u(s(I))}},A=()=>{if(h>=0&&h<e.length-1){const I=e[h+1];I&&u(s(I))}},k=()=>{const I=f.getValues(),N=It(e,s,I,a,d);N&&u(N)},w=()=>{f.handleSubmit(I=>{const N=I;for(const M of e)l(M,N[s(M)])})()},y=P.useRef(w);y.current=w;const C=()=>{b&&(p(!1),y.current())},S=()=>{const I=f.getValues();if(Nt(e,s,I,a)){if(i){p(!0);return}p(!1),y.current()}else{const N=It(e,s,I,a,d);N&&u(N)}};return P.useEffect(()=>{if(c&&!i){if(!v){p(!1);return}p(!1),y.current()}},[c,i,v]),{form:f,activeKey:d,setActiveKey:u,currentIndex:h,currentPart:g,isCurrentAnswered:x,isAllAnswered:v,canSubmit:b,goPrev:j,goNext:A,advanceToNextUnanswered:k,submit:C,submitOrAdvance:S}}const ps="chat.approval.defaultDenyReason";function fs(t){const e=R.c(36),{onYolo:s}=t,o=B(),[r,i]=Se();let a,l,V,d,u,c,p,f,m;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const j=we.find(w=>w.value===r.toolApprovalLevel)??we[0];let A;e[13]!==s||e[14]!==r||e[15]!==i?(A=w=>{const y=w,C=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:y}),y==="auto"&&s(C)},e[13]=s,e[14]=r,e[15]=i,e[16]=A):A=e[16];const k=A;V=Kn,f=r.toolApprovalLevel,m=k,l=qn,u="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=fr,a=Qn,d=o(j.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=d,e[8]=u,e[9]=c,e[10]=p,e[11]=f,e[12]=m}else a=e[4],l=e[5],V=e[6],d=e[7],u=e[8],c=e[9],p=e[10],f=e[11],m=e[12];let h;e[17]!==a||e[18]!==d?(h=n.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=h):h=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==c||e[23]!==p||e[24]!==h?(g=n.jsx(l,{size:u,className:c,onClick:p,children:h}),e[20]=l,e[21]=u,e[22]=c,e[23]=p,e[24]=h,e[25]=g):g=e[25];let x;e[26]!==o?(x=we.map(j=>n.jsx(Bn,{value:j.value,children:o(j.labelKey)},j.value)),e[26]=o,e[27]=x):x=e[27];let v;e[28]!==x?(v=n.jsx(Wn,{children:x}),e[28]=x,e[29]=v):v=e[29];let b;return e[30]!==V||e[31]!==v||e[32]!==f||e[33]!==m||e[34]!==g?(b=n.jsxs(V,{value:f,onValueChange:m,children:[g,v]}),e[30]=V,e[31]=v,e[32]=f,e[33]=m,e[34]=g,e[35]=b):b=e[35],b}function fr(t){return t.stopPropagation()}function hs(t){const e=R.c(8),{input:s}=t,o=B();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(i=n.jsx("div",{className:"px-4",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:r})}),e[6]=r,e[7]=i):i=e[7],i}function hr(t){const e=R.c(38),{approval:s,onRespond:o}=t,r=B(),[i]=Se(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(ps),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(d=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=d):d=e[8];const u=d;let c;e[9]!==s.approvalId||e[10]!==o?(c=C=>o(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=o,e[11]=c):c=e[11];const p=c;let f;e[12]!==p?(f=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(fs,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const m=f;let h;e[14]!==r?(h=r("chat.approval.denyButton"),e[14]=r,e[15]=h):h=e[15];let g;e[16]!==V||e[17]!==h?(g=n.jsx(Y,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:V,children:h}),e[16]=V,e[17]=h,e[18]=g):g=e[18];let x;e[19]!==r?(x=r("chat.approval.acceptButton"),e[19]=r,e[20]=x):x=e[20];let v;e[21]!==u||e[22]!==x?(v=n.jsx(Y,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:x}),e[21]=u,e[22]=x,e[23]=v):v=e[23];let b;e[24]!==g||e[25]!==v?(b=n.jsxs(n.Fragment,{children:[g,v]}),e[24]=g,e[25]=v,e[26]=b):b=e[26];const j=b;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(We,{size:14}),e[27]=A):A=e[27];let k;e[28]!==r?(k=r("chat.approval.needsApproval"),e[28]=r,e[29]=k):k=e[29];let w;e[30]!==s.input?(w=n.jsx(hs,{input:s.input}),e[30]=s.input,e[31]=w):w=e[31];let y;return e[32]!==s.friendlyName||e[33]!==m||e[34]!==j||e[35]!==k||e[36]!==w?(y=n.jsx(pe,{icon:A,label:k,title:s.friendlyName,defaultExpanded:!0,footerLeft:m,footerRight:j,children:w}),e[32]=s.friendlyName,e[33]=m,e[34]=j,e[35]=k,e[36]=w,e[37]=y):y=e[37],y}const mr=Ns(se(),re({approved:Is().optional(),levelOverride:Ue(["auto","readonly"]).optional()}));function gr(t){const e=R.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=B(),[a]=Se(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(br)),e[0]=s,e[1]=V):V=e[1];const d=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,M)=>{const E=M;typeof E?.approved=="boolean"&&r(N.approvalId,E.approved,E.approved===!1?i(ps):void 0,E.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let c;e[6]!==s||e[7]!==d||e[8]!==o||e[9]!==u?(c={parts:s,partKey:vr,schema:mr,defaultValues:d,isStreaming:o,hasAnswer:xr,onSubmit:u},e[6]=s,e[7]=d,e[8]=o,e[9]=u,e[10]=c):c=e[10];const p=us(c);let f;e[11]!==s||e[12]!==p?(f=N=>{p.form.reset(Object.fromEntries(s.map(M=>[M.approvalId,{approved:!0,levelOverride:N}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const m=f,h=p.currentPart,g=p.form;let x;e[14]!==p?(x=N=>{N.preventDefault(),p.submit()},e[14]=p,e[15]=x):x=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(We,{size:14}),e[16]=v):v=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const j=h?.friendlyName??"";let A;e[20]!==m?(A=n.jsx(fs,{onYolo:m}),e[20]=m,e[21]=A):A=e[21];let k;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==A?(k=n.jsx(cs,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:A}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=A,e[27]=k):k=e[27];let w;e[28]!==h||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(w=h?n.jsx(Ar,{approvalId:h.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=h,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=w):w=e[31];let y;e[32]!==h?(y=h?n.jsx(hs,{input:h.input}):null,e[32]=h,e[33]=y):y=e[33];let C;e[34]!==k||e[35]!==w||e[36]!==y||e[37]!==b||e[38]!==j?(C=n.jsx(pe,{icon:v,label:b,title:j,defaultExpanded:!0,footerLeft:k,footerRight:w,children:y}),e[34]=k,e[35]=w,e[36]=y,e[37]=b,e[38]=j,e[39]=C):C=e[39];let S;e[40]!==C||e[41]!==x?(S=n.jsx("form",{onSubmit:x,children:C}),e[40]=C,e[41]=x,e[42]=S):S=e[42];let I;return e[43]!==p.form||e[44]!==S?(I=n.jsx(nt,{...g,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function xr(t){return typeof t?.approved=="boolean"}function vr(t){return t.approvalId}function br(t){return[t.approvalId,{approved:void 0}]}function Ar(t){const e=R.c(7),{approvalId:s,control:o,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,c=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(Y,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(Y,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":c,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(Ts,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function yr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(We,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function jr(t){const e=R.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(yr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=n.jsx(hr,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==r?(i=n.jsx(gr,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function kr(t){const e=R.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=B();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let d;e[5]!==r||e[6]!==V?(d=n.jsx(Y,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:r,children:V}),e[5]=r,e[6]=V,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let c;e[10]!==l||e[11]!==u?(c=n.jsx(Y,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:l,children:u}),e[10]=l,e[11]=u,e[12]=c):c=e[12];let p;e[13]!==d||e[14]!==c?(p=n.jsxs(n.Fragment,{children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15];const f=p;let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(qt,{size:14}),e[16]=m):m=e[16];let h;e[17]!==i?(h=i("chat.proposePlan.planReady"),e[17]=i,e[18]=h):h=e[18];let g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let x;e[21]!==s.plan?(x=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx(Gn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=x):x=e[22];let v;return e[23]!==f||e[24]!==x||e[25]!==h||e[26]!==g?(v=n.jsx(pe,{icon:m,label:h,title:g,defaultExpanded:!0,footerRight:f,children:x}),e[23]=f,e[24]=x,e[25]=h,e[26]=g,e[27]=v):v=e[27],v}function wr(t){const e=R.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=as(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==o||e[4]!==r?(l=n.jsx(kr,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function ms(t){return t?"response"in t?t.response:t.option??t.draft:""}const Tt=re({response:se().min(1,"Response is required")}),Sr=re({option:se().nullable(),draft:se()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Cr=re({response:Ue(["yes","no"])});function Nr(t){switch(t.type){case"text":return Tt;case"choice":return Sr;case"confirm":return Cr;default:return Tt}}function Ir(t){const e={};for(const s of t)e[s.toolCallId]=Nr(s.input);return re(e)}function Tr(t){const e=R.c(7),{control:s,name:o,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:d}=V,u=d.value??"";return n.jsxs(ct,{children:[n.jsx(dt,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Qt,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...d,value:u,type:"text",placeholder:r||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),n.jsx(ut,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Ht,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function gs(t,e){const s=R.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{if(an(a.target)||a.metaKey||a.ctrlKey||a.altKey)return;const l=Number.parseInt(a.key,10);l>=1&&l<=t&&(a.preventDefault(),e(l-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),P.useEffect(o,r)}function _r(t){const e=R.c(51),{control:s,name:o,options:r}=t,i=B(),a=`${o}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:V}=gt(l),d=`${o}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:c}=gt(u),p=V.value,f=c.value??"";let m;if(e[6]!==V||e[7]!==r?(m=L=>{const _=r[L];_!=null&&V.onChange(_)},e[6]=V,e[7]=r,e[8]=m):m=e[8],gs(r.length,m),r.length===0)return null;const h=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let x;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let L;e[16]!==V||e[17]!==p||e[18]!==i?(L=(_,U)=>{const F=p===_;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(_),className:z("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",F&&"bg-accent/50",!F&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:_}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",F?"bg-chart-1 text-white":"bg-muted text-foreground"),children:U+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:_})]},`${U}-${_}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=L):L=e[19],x=r.map(L),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=x}else x=e[15];const v=h&&"bg-accent/50",b=!h&&"hover:bg-accent/30";let j;e[20]!==v||e[21]!==b?(j=z("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",v,b),e[20]=v,e[21]=b,e[22]=j):j=e[22];let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Qt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const k=h?f:"";let w;e[24]!==c||e[25]!==V||e[26]!==p?(w=L=>{c.onChange(L.target.value),p!==null&&V.onChange(null)},e[24]=c,e[25]=V,e[26]=p,e[27]=w):w=e[27];let y;e[28]!==V||e[29]!==p?(y=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=y):y=e[30];let C;e[31]!==i?(C=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=C):C=e[32];let S;e[33]!==i?(S=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=S):S=e[34];let I;e[35]!==k||e[36]!==w||e[37]!==y||e[38]!==C||e[39]!==S?(I=n.jsx("input",{type:"text",value:k,onChange:w,onFocus:y,placeholder:C,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=k,e[36]=w,e[37]=y,e[38]=C,e[39]=S,e[40]=I):I=e[40];let N;e[41]!==j||e[42]!==I?(N=n.jsxs("label",{className:j,children:[A,I]}),e[41]=j,e[42]=I,e[43]=N):N=e[43];let M;e[44]!==N||e[45]!==g||e[46]!==x?(M=n.jsx(dt,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[x,N]})}),e[44]=N,e[45]=g,e[46]=x,e[47]=M):M=e[47];let E;e[48]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(ut,{}),e[48]=E):E=e[48];let D;return e[49]!==M?(D=n.jsxs(ct,{children:[M,E]}),e[49]=M,e[50]=D):D=e[50],D}function Mr(t){const e=R.c(8),{control:s,name:o}=t,r=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=c=>{l.current?.onChange(a[c]??"")},e[1]=V):V=e[1],gs(a.length,V);let d;e[2]!==r?(d=c=>{const{field:p}=c;return l.current=p,n.jsxs(ct,{children:[n.jsx(dt,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const m=p.value===f;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:z("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",m&&"bg-accent/50",!m&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0",m?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),n.jsx(ut,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==d?(u=n.jsx(Ht,{control:s,name:o,render:d}),e[4]=s,e[5]=o,e[6]=d,e[7]=u):u=e[7],u}function _t(t){const e=R.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(Tr,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(_r,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(Mr,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Dr(t){const e=R.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=Ir(s.map(Lr)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Pr)),e[2]=s,e[3]=l):l=e[3];const V=l;let d;e[4]!==r?(d=($,O)=>{const W=ms(O);W&&r($,W)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Er,schema:a,defaultValues:V,isStreaming:o,hasAnswer:Rr,onSubmit:d},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const c=us(u),p=c.currentPart,f=B();let m;e[12]!==p||e[13]!==c||e[14]!==f?(m=()=>{const $=p;if(!$)return;const O=f("chat.userAskQuestion.skipMessage"),W=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${W}.option`,null),c.form.setValue(`${W}.draft`,O)):c.form.setValue(`${W}.response`,O),c.advanceToNextUnanswered()},e[12]=p,e[13]=c,e[14]=f,e[15]=m):m=e[15];const h=m;let g;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==s.length?(g=n.jsx(cs,{currentIndex:c.currentIndex,total:s.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=s.length,e[20]=g):g=e[20];const x=g;let v;e[21]!==f?(v=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=v):v=e[22];let b;e[23]!==h||e[24]!==v?(b=n.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-7",children:v}),e[23]=h,e[24]=v,e[25]=b):b=e[25];let j;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(j=n.jsx(ur,{isStreaming:o,isAllAnswered:c.isAllAnswered,isCurrentAnswered:c.isCurrentAnswered,onAdvanceOrSubmit:c.submitOrAdvance}),e[26]=c.isAllAnswered,e[27]=c.isCurrentAnswered,e[28]=c.submitOrAdvance,e[29]=o,e[30]=j):j=e[30];let A;e[31]!==b||e[32]!==j?(A=n.jsxs(n.Fragment,{children:[b,j]}),e[31]=b,e[32]=j,e[33]=A):A=e[33];const k=A;if(s.length===1){const $=s[0];if(!$?.input)return null;const O=c.form;let W;e[34]!==c?(W=ne=>{ne.preventDefault(),c.submit()},e[34]=c,e[35]=W):W=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(st,{size:14}),e[36]=X):X=e[36];let te;e[37]!==f?(te=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=te):te=e[38];let J;e[39]!==$.input?.prompt||e[40]!==f?(J=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=J):J=e[41];const ae=$.input;let T;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==ae?(T=n.jsx(_t,{input:ae,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=ae,e[45]=T):T=e[45];let Q;e[46]!==k||e[47]!==te||e[48]!==J||e[49]!==T?(Q=n.jsx(pe,{icon:X,label:te,title:J,defaultExpanded:!0,footerRight:k,children:T}),e[46]=k,e[47]=te,e[48]=J,e[49]=T,e[50]=Q):Q=e[50];let Z;e[51]!==W||e[52]!==Q?(Z=n.jsx("form",{onSubmit:W,autoComplete:"off",children:Q}),e[51]=W,e[52]=Q,e[53]=Z):Z=e[53];let H;return e[54]!==c.form||e[55]!==Z?(H=n.jsx(nt,{...O,children:Z}),e[54]=c.form,e[55]=Z,e[56]=H):H=e[56],H}const w=c.form;let y;e[57]!==c?(y=$=>{$.preventDefault(),c.submit()},e[57]=c,e[58]=y):y=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(st,{size:14}),e[59]=C):C=e[59];let S;e[60]!==f?(S=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=S):S=e[61];const I=c.currentIndex+1;let N;e[62]!==s.length||e[63]!==f||e[64]!==I?(N=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=N):N=e[65];let M;e[66]!==p?.input?.prompt||e[67]!==f?(M=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=M):M=e[68];const E=c.activeKey,D=c.setActiveKey;let L;if(e[69]!==c.form||e[70]!==s){let $;e[72]!==c.form?($=O=>n.jsx(Jn,{value:O.toolCallId,className:"mt-0",children:n.jsx(_t,{input:O.input,control:c.form.control,toolCallId:O.toolCallId})},O.toolCallId),e[72]=c.form,e[73]=$):$=e[73],L=s.map($),e[69]=c.form,e[70]=s,e[71]=L}else L=e[71];let _;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==L?(_=n.jsx(Zn,{value:E,onValueChange:D,children:L}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=L,e[77]=_):_=e[77];let U;e[78]!==x||e[79]!==k||e[80]!==S||e[81]!==N||e[82]!==M||e[83]!==_?(U=n.jsx(pe,{icon:C,label:S,count:N,title:M,defaultExpanded:!0,footerLeft:x,footerRight:k,children:_}),e[78]=x,e[79]=k,e[80]=S,e[81]=N,e[82]=M,e[83]=_,e[84]=U):U=e[84];let F;e[85]!==y||e[86]!==U?(F=n.jsx("form",{onSubmit:y,autoComplete:"off",children:U}),e[85]=y,e[86]=U,e[87]=F):F=e[87];let q;return e[88]!==c.form||e[89]!==F?(q=n.jsx(nt,{...w,children:F}),e[88]=c.form,e[89]=F,e[90]=q):q=e[90],q}function Rr(t){return!!ms(t)}function Er(t){return t.toolCallId}function Pr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Lr(t){return{toolCallId:t.toolCallId,input:t.input}}function Ur(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function xs(t){const e=R.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Fr),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Ur,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(Dr,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Fr(t){return t.state==="input-available"}function Or(t){const e=R.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=B();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(qt,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const c=V.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==i?(f=i("chat.suggestTask.notNow"),e[8]=i,e[9]=f):f=e[9];let m;e[10]!==o||e[11]!==p||e[12]!==f?(m=n.jsx(Y,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:f}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13];let h;e[14]!==r||e[15]!==l?(h=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=h):h=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let x;e[19]!==o||e[20]!==h||e[21]!==g?(x=n.jsx(Y,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:h,children:g}),e[19]=o,e[20]=h,e[21]=g,e[22]=x):x=e[22];let v;e[23]!==x||e[24]!==m?(v=n.jsxs(n.Fragment,{children:[m,x]}),e[23]=x,e[24]=m,e[25]=v):v=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let j;return e[28]!==V.title||e[29]!==v||e[30]!==b||e[31]!==u?(j=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,footerRight:v,children:b}),e[28]=V.title,e[29]=v,e[30]=b,e[31]=u,e[32]=j):j=e[32],j}function zr(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function $r(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=zr(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Qr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(Br),e[4]=s,e[5]=V):V=e[5];let d;e[6]!==V?(d=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=n.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function Br(t,e){return n.jsx(Kr,{todo:t},e)}function Kr(t){const e=R.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(qr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=z("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const d=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==d||e[5]!==u?(c=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==c?(p=n.jsxs("span",{className:V,children:[i,c]}),e[7]=i,e[8]=V,e[9]=c,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=n.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[a,p]}),e[11]=a,e[12]=p,e[13]=f):f=e[13],f}function qr(t){const e=R.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=i):i=e[0];let a;return e[1]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Qr(t){const e=R.c(13),{status:s}=t,o=B();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==a?(V=n.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const Wr={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},Yr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Gr(t){const e=R.c(46),{source:s,onDone:o}=t,r=B(),i=_s(),[a]=Se(),[l,V]=P.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=P.useState(""),[c,p]=P.useState(!1),f=l==="brl"?"R$":"$";let m;e[0]!==l||e[1]!==i?(m=async _=>{const{url:U}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:_,currency:l});return U},e[0]=l,e[1]=i,e[2]=m):m=e[2];let h;e[3]!==o?(h=_=>{_&&window.open(_,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=h):h=e[4];let g;e[5]!==r?(g=_=>{Ee.error(r("credits.topUp.failed",{message:_.message}))},e[5]=r,e[6]=g):g=e[6];let x;e[7]!==m||e[8]!==h||e[9]!==g?(x={mutationFn:m,onSuccess:h,onError:g},e[7]=m,e[8]=h,e[9]=g,e[10]=x):x=e[10];const{mutate:v,isPending:b}=Ms(x);let j;e[11]!==l||e[12]!==s||e[13]!==v?(j=(_,U)=>{ee("credits_topup_clicked",{amount_cents:_,currency:l,tier_label:U,source:s}),v(_)},e[11]=l,e[12]=s,e[13]=v,e[14]=j):j=e[14];const A=j,k=parseFloat(d),w=!isNaN(k)&&k>=1;let y,C,S;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=_=>{_&&V(_)},C=n.jsx(jt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=n.jsx(jt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=y,e[16]=C,e[17]=S):(y=e[15],C=e[16],S=e[17]);let I;e[18]!==l?(I=n.jsx("div",{className:"mb-4",children:n.jsxs(Vo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:y,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=Wr[l];let M;if(e[20]!==A||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==N){let _;e[26]!==A||e[27]!==f||e[28]!==b||e[29]!==r?(_=U=>{const{dollars:F,labelKey:q}=U;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>A(F*100,Yr[q]??"preset"),className:z("relative flex flex-col items-center gap-1 py-5 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,F]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(q)})]},F)},e[26]=A,e[27]=f,e[28]=b,e[29]=r,e[30]=_):_=e[30],M=N.map(_),e[20]=A,e[21]=f,e[22]=b,e[23]=r,e[24]=N,e[25]=M}else M=e[25];let E;e[31]!==M?(E=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:M}),e[31]=M,e[32]=E):E=e[32];let D;e[33]!==A||e[34]!==f||e[35]!==d||e[36]!==k||e[37]!==w||e[38]!==b||e[39]!==c||e[40]!==r?(D=c?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),n.jsx(lo,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:d,onChange:_=>u(_.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(Y,{className:"h-10",disabled:!w||b,onClick:()=>A(Math.round(k*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:r("credits.topUp.enterCustom")}),e[33]=A,e[34]=f,e[35]=d,e[36]=k,e[37]=w,e[38]=b,e[39]=c,e[40]=r,e[41]=D):D=e[41];let L;return e[42]!==E||e[43]!==D||e[44]!==I?(L=n.jsxs("div",{children:[I,E,D]}),e[42]=E,e[43]=D,e[44]=I,e[45]=L):L=e[45],L}const Hr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Jr(t){const e=R.c(47),{onDismiss:s}=t,{org:o}=Ce(),r=rt(),{decoKeyId:i}=ao(),a=B(),l=Oe("credits");let V,d;if(e[0]!==o.id?(V=()=>{ee("credits_exhausted_shown",{organization_id:o.id})},d=[o.id],e[0]=o.id,e[1]=V,e[2]=d):(V=e[1],d=e[2]),P.useEffect(V,d),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[5]=c):c=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.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"}),e[7]=f):f=e[7];let m;e[8]!==a?(m=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx(Xn,{className:"text-xl font-semibold tracking-tight",children:m}),e[10]=m,e[11]=h):h=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let x;e[14]!==g?(x=n.jsx(eo,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=x):x=e[15];let v;e[16]!==x||e[17]!==h?(v=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(to,{className:"relative gap-4",children:[f,n.jsxs("div",{children:[h,x]})]})]}),e[16]=x,e[17]=h,e[18]=v):v=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"rounded-xl border border-border p-5",children:n.jsx(Gr,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Hr.map(N=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(it,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(N)})]},N))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let j;e[23]!==a?(j=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=j):j=e[24];let A;e[25]!==s||e[26]!==j?(A=n.jsx(Y,{variant:"ghost",size:"sm",onClick:s,children:j}),e[25]=s,e[26]=j,e[27]=A):A=e[27];let k;e[28]!==r||e[29]!==s||e[30]!==o.slug?(k=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=k):k=e[31];let w;e[32]!==a?(w=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=w):w=e[33];let y;e[34]!==k||e[35]!==w?(y=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:k,children:w}),e[34]=k,e[35]=w,e[36]=y):y=e[36];let C;e[37]!==A||e[38]!==y?(C=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[A,y]}),e[37]=A,e[38]=y,e[39]=C):C=e[39];let S;e[40]!==v||e[41]!==b||e[42]!==C?(S=n.jsxs(so,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Zr,children:[v,b,C]}),e[40]=v,e[41]=b,e[42]=C,e[43]=S):S=e[43];let I;return e[44]!==S||e[45]!==u?(I=n.jsx(no,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function Zr(t){return t.preventDefault()}const Xr={trial_exhausted:{label:"chat.subscriptionLimit.trialLabel",title:"chat.subscriptionLimit.trialTitle"},monthly_exhausted:{label:"chat.subscriptionLimit.monthlyLabel",title:"chat.subscriptionLimit.monthlyTitle"},runs_exhausted:{label:"chat.subscriptionLimit.runsLabel",title:"chat.subscriptionLimit.runsTitle"}};function ei(t){const e=R.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=B(),{label:a,title:l}=Xr[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(at,{size:14}),e[0]=V):V=e[0];let d;e[1]!==a||e[2]!==i?(d=i(a),e[1]=a,e[2]=i,e[3]=d):d=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let c;e[7]!==s||e[8]!==r||e[9]!==i?(c=s==="trial_exhausted"?n.jsx(Y,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=c):c=e[10];let p;return e[11]!==o||e[12]!==d||e[13]!==u||e[14]!==c?(p=n.jsx(pe,{icon:V,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=d,e[13]=u,e[14]=c,e[15]=p):p=e[15],p}const ti={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function Mt(t){const e=R.c(21),{kind:s,onDismiss:o}=t,r=B(),i=rt(),{org:a}=Ce(),{label:l,title:V}=ti[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(at,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let c;e[4]!==r||e[5]!==V?(c=r(V),e[4]=r,e[5]=V,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,e[9]=a.slug,e[10]=p):p=e[10];let f;e[11]!==r?(f=r("chat.planRefused.seePlans"),e[11]=r,e[12]=f):f=e[12];let m;e[13]!==p||e[14]!==f?(m=n.jsx(Y,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=m):m=e[15];let h;return e[16]!==o||e[17]!==u||e[18]!==c||e[19]!==m?(h=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:m}),e[16]=o,e[17]=u,e[18]=c,e[19]=m,e[20]=h):h=e[20],h}function vs(t){const e=si(t);if(e!==null){const d=vs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const d=V[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||o&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function si(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:o,message:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const ni={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=R.c(29),s=B(),{variant:o,onDismiss:r}=t,i=o==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,V=i?zn:Rs;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const v=ni[t.finishReason];return v?s(v):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let c;e[8]!==i||e[9]!==u?(c=i?vs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=c):c=e[10];const{summary:p,rawDetails:f}=c;let m;e[11]!==V?(m=n.jsx(V,{size:14}),e[11]=V,e[12]=m):m=e[12];let h;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(h=i?n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=h):h=e[17];let g;e[18]!==f||e[19]!==s?(g=f?n.jsxs("details",{className:"group mx-4",children:[n.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[n.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Ee.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ee.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:n.jsx($n,{className:"size-3.5"})}),n.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:f})]})]}):null,e[18]=f,e[19]=s,e[20]=g):g=e[20];let x;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==m||e[25]!==h||e[26]!==g||e[27]!==o?(x=n.jsx(pe,{icon:m,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:h,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=m,e[25]=h,e[26]=g,e[27]=o,e[28]=x):x=e[28],x}function ze(t){const e=R.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=B(),{error:V,clearError:d,finishReason:u,clearFinishReason:c,messages:p,isStreaming:f,submit:m,sendMessage:h}=Fe(),[g,x]=Se(),{virtualMcpId:v,createTaskWithMessage:b}=Ye(),{chatMode:j,simpleModeTier:A}=Ge(),k=Oe("credits"),{mutate:w}=po("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let y;e[2]!==w?(y=()=>w(),e[2]=w,e[3]=y):y=e[3];const C=y;let S;e[4]!==j||e[5]!==A||e[6]!==v||e[7]!==a?(S=oe=>({...a?{voiceMode:!0}:{},tier:A,mode:j,toolApprovalLevel:oe,agent:v?{id:v}:void 0}),e[4]=j,e[5]=A,e[6]=v,e[7]=a,e[8]=S):S=e[8];const I=S;let N;e[9]!==g.toolApprovalLevel?(N=g.toolApprovalLevel??Ds(),e[9]=g.toolApprovalLevel,e[10]=N):N=e[10];const M=N,E=p.at(-1),D=E?.role==="assistant"?E.parts:[],L=D.filter(ai),_=D.filter(Zt),U=ls(D),F=is(D);let q;e[11]!==V||e[12]!==h||e[13]!==l?(q=()=>{if(V){const ue={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};h(ue)}},e[11]=V,e[12]=h,e[13]=l,e[14]=q):q=e[14];const $=q;let O;e[15]!==h||e[16]!==l?(O=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};h(oe)},e[15]=h,e[16]=l,e[17]=O):O=e[17];const W=O;let X;e[18]!==I||e[19]!==M||e[20]!==m?(X=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:ue}},I(M))},e[18]=I,e[19]=M,e[20]=m,e[21]=X):X=e[21];const te=X;let J;e[22]!==I||e[23]!==M||e[24]!==m?(J=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{accepted:ue}},I(M))},e[22]=I,e[23]=M,e[24]=m,e[25]=J):J=e[25];const ae=J;let T;e[26]!==b||e[27]!==g||e[28]!==x||e[29]!==l||e[30]!==v?(T=oe=>{x({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:v,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:oe})}]}})},e[26]=b,e[27]=g,e[28]=x,e[29]=l,e[30]=v,e[31]=T):T=e[31];const Q=T,Z=ii;let H;e[32]!==I||e[33]!==m?(H=(oe,ue,Be,be)=>{m({kind:"approval",approvalId:oe,approved:ue,...Be?{reason:Be}:{}},I(be))},e[32]=I,e[33]=m,e[34]=H):H=e[34];const ne=H,G=Vs();if(G.isCreditExhausted){let oe;return e[35]!==k||e[36]!==d||e[37]!==i?(oe=k?n.jsx(Jr,{onDismiss:d}):n.jsx("div",{className:z(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(Mt,{kind:"ai_budget_exhausted",onDismiss:d})}),e[35]=k,e[36]=d,e[37]=i,e[38]=oe):oe=e[38],oe}const{showError:ce,showWarning:ie,hasApprovals:fe}=G,le=L.map(ri).join("|"),$e=as(U)?.toolCallId??"",ht=F.map(oi).join("|"),Ne=!i&&"absolute bottom-full left-0 right-0";let Ve;e[39]!==Ne?(Ve=z(Ne),e[39]=Ne,e[40]=Ve):Ve=e[40];let he;e[41]!==G.todos?(he=n.jsx($r,{todos:G.todos}),e[41]=G.todos,e[42]=he):he=e[42];let ge;e[43]!==d||e[44]!==G.subscriptionErrorKind||e[45]!==C?(ge=G.subscriptionErrorKind&&n.jsx(ei,{kind:G.subscriptionErrorKind,onDismiss:d,onSubscribe:C}),e[43]=d,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=ge):ge=e[46];let de;e[47]!==d||e[48]!==G.planRefusal?(de=G.planRefusal&&n.jsx(Mt,{kind:G.planRefusal,onDismiss:d}),e[47]=d,e[48]=G.planRefusal,e[49]=de):de=e[49];let xe;e[50]!==d||e[51]!==V||e[52]!==$||e[53]!==ce?(xe=ce&&n.jsx(Qe,{variant:"error",error:V,onDismiss:d,onFixInChat:$}),e[50]=d,e[51]=V,e[52]=$,e[53]=ce,e[54]=xe):xe=e[54];let je;e[55]!==c||e[56]!==u||e[57]!==W||e[58]!==ie?(je=ie&&n.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:c,onContinue:W}),e[55]=c,e[56]=u,e[57]=W,e[58]=ie,e[59]=je):je=e[59];const Ie=fe&&n.jsx(jr,{approvals:F,isStreaming:f,onRespond:ne},ht),_e=G.hasPlans&&n.jsx(wr,{plans:U,isStreaming:f,onApprove:Q,onDismiss:Z},$e),Me=G.hasTaskSuggestion&&n.jsx(Or,{parts:_,isStreaming:f,onRespond:ae},_.at(-1)?.toolCallId??"");let ve;e[60]!==G.isWaitingForUserInput||e[61]!==te||e[62]!==f||e[63]!==le||e[64]!==L?(ve=G.isWaitingForUserInput&&n.jsx(xs,{userAskParts:L,isStreaming:f,onSubmit:te},le),e[60]=G.isWaitingForUserInput,e[61]=te,e[62]=f,e[63]=le,e[64]=L,e[65]=ve):ve=e[65];let ke;return e[66]!==Ve||e[67]!==he||e[68]!==ge||e[69]!==de||e[70]!==xe||e[71]!==je||e[72]!==Ie||e[73]!==_e||e[74]!==Me||e[75]!==ve?(ke=n.jsxs("div",{className:Ve,children:[he,ge,de,xe,je,Ie,_e,Me,ve]}),e[66]=Ve,e[67]=he,e[68]=ge,e[69]=de,e[70]=xe,e[71]=je,e[72]=Ie,e[73]=_e,e[74]=Me,e[75]=ve,e[76]=ke):ke=e[76],ke}function oi(t){return t.approvalId}function ri(t){return t.toolCallId}function ii(){document.querySelector("[data-chat-input]")?.focus()}function ai(t){return t.type==="tool-user_ask"}ze.Error=function(e){return n.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};ze.Warning=function(e){return n.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};ze.UserAskQuestion=xs;function bs(t){const e=R.c(20),{taskId:s}=t,o=B(),r=Sn(s),i=Cn(r),a=Nn(),{stop:l,removeLocalMessage:V}=Fe();if(i.length===0)return null;let d;e[0]!==o?(d=o("chat.queueTray.sendNow"),e[0]=o,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Bt,{size:14}),e[4]=c):c=e[4];let p;e[5]!==d||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:c})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==o?(f=o("chat.queueTray.sendNow"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=n.jsxs(Ze,{delayDuration:400,children:[p,m]}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let g;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(g=(x,v)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:v+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:x.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,x.messageId).then(b=>{b&&(In(s,x.messageId),V(x.messageId))})},children:n.jsx(zt,{className:"size-3.5"})})})]},x.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=g):g=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),h]}),i.map(g)]})}const li={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function Vi(t,e){return li[t]?.test(e)??!1}function ci(t){return ko(t)&&Vi(t.providerId,t.modelId)}function di(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const ui={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function pi(t){const e=R.c(32),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:V,onClose:d}=t,u=B(),c=ns(),p=new Set(c.map(fi)),f=Tn([r,o,i],p),m=f?.keyId??null,[h,g]=P.useState(m??c[0]?.id??null),x=c.some(F=>F.id===h)?h:m??c[0]?.id??null,v=x?c.find(F=>F.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",j=ui[s];let A;e[0]!==u||e[1]!==j?(A=u(j),e[0]=u,e[1]=j,e[2]=A):A=e[2];let k;e[3]!==A?(k=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=k):k=e[4];let w;e[5]!==V||e[6]!==u||e[7]!==r?(w=r&&n.jsx("button",{type:"button",onClick:V,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:u("chat.modelPreferences.reset")}),e[5]=V,e[6]=u,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==k||e[10]!==w?(y=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[k,w]}),e[9]=k,e[10]=w,e[11]=y):y=e[11];const C="flex-1 min-h-0",S=P.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(fo,{}),e[12]=I):I=e[12];const N=So,M=!0,E=di(m?f:null,v?.providerId??"deco");let D;e[13]!==x||e[14]!==l||e[15]!==g?(D=F=>{const q=F.keyId??x??"";g(q),l({keyId:q,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=l,e[15]=g,e[16]=D):D=e[16];let L;e[17]!==N||e[18]!==x||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==E||e[23]!==D?(L=n.jsx(N,{compact:M,filterModels:a,onClose:d,credentialId:x,onCredentialChange:g,selectedModel:E,onModelChange:D}),e[17]=N,e[18]=x,e[19]=a,e[20]=d,e[21]=g,e[22]=E,e[23]=D,e[24]=L):L=e[24];let _;e[25]!==S||e[26]!==L||e[27]!==I?(_=n.jsx("div",{className:C,children:n.jsx(S,{fallback:I,children:L})}),e[25]=S,e[26]=L,e[27]=I,e[28]=_):_=e[28];let U;return e[29]!==_||e[30]!==y?(U=n.jsxs("div",{className:b,children:[y,_]}),e[29]=_,e[30]=y,e[31]=U):U=e[31],U}function fi(t){return t.id}const hi=["fast","smart","thinking"];function As(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Dt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function mi(t){const e=R.c(28),{tier:s,pillIcon:o,groups:r}=t,i=B();let a;e[0]!==i?(a=As(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,d]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{y.onSelect(),d(!1)},e[2]=u):u=e[2];const c=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=z("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=z("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[4]=m):m=e[4];const h=l[s];let g;e[5]!==h?(g=n.jsx("span",{className:m,children:h}),e[5]=h,e[6]=g):g=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Jt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=x):x=e[7];let v;e[8]!==o||e[9]!==p||e[10]!==g?(v=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(Xt,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[o,g,x]})})})}),e[8]=o,e[9]=p,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16];let A;if(e[17]!==r||e[18]!==i){let y;e[20]!==i?(y=C=>n.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>c(S),className:z("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",S.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[S.icon&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(it,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&n.jsx(xi,{label:S.title,render:S.modelOverride})]},S.key))},C.key),e[20]=i,e[21]=y):y=e[21],A=r.map(y),e[17]=r,e[18]=i,e[19]=A}else A=e[19];let k;e[22]!==A?(k=n.jsx(es,{align:"end",className:"p-1 w-64",onOpenAutoFocus:gi,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:A})}),e[22]=A,e[23]=k):k=e[23];let w;return e[24]!==V||e[25]!==j||e[26]!==k?(w=n.jsxs(ts,{open:V,onOpenChange:d,children:[j,k]}),e[24]=V,e[25]=j,e[26]=k,e[27]=w):w=e[27],w}function gi(t){return t.preventDefault()}function xi(t){const e=R.c(38),{label:s,render:o}=t,r=B(),i=ss(),[a,l]=P.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const d=V;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const c=a&&"opacity-100";let p;e[4]!==c?(p=z("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg bg-background border border-border/60 shadow-sm","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",c),e[4]=c,e[5]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(bn,{size:14}),e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==p?(m=n.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=m):m=e[9];const h=m;if(i){let j;e[10]!==h?(j=n.jsx(go,{asChild:!0,children:h}),e[10]=h,e[11]=j):j=e[11];let A;e[12]!==s||e[13]!==r?(A=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=A):A=e[14];let k;e[15]!==A?(k=n.jsx(xo,{className:"sr-only",children:A}),e[15]=A,e[16]=k):k=e[16];let w;e[17]!==a||e[18]!==o?(w=a&&o(d),e[17]=a,e[18]=o,e[19]=w):w=e[19];let y;e[20]!==w||e[21]!==k?(y=n.jsxs(vo,{className:"p-0 flex flex-col max-h-[95vh]",children:[k,w]}),e[20]=w,e[21]=k,e[22]=y):y=e[22];let C;return e[23]!==a||e[24]!==y||e[25]!==j?(C=n.jsxs(bo,{open:a,onOpenChange:l,children:[j,y]}),e[23]=a,e[24]=y,e[25]=j,e[26]=C):C=e[26],C}let g;e[27]!==h?(g=n.jsx(Xt,{asChild:!0,children:h}),e[27]=h,e[28]=g):g=e[28];let x;e[29]!==a||e[30]!==o?(x=a&&o(d),e[29]=a,e[30]=o,e[31]=x):x=e[31];let v;e[32]!==x?(v=n.jsx(es,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:x}),e[32]=x,e[33]=v):v=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==v?(b=n.jsxs(ts,{open:a,onOpenChange:l,children:[g,v]}),e[34]=a,e[35]=g,e[36]=v,e[37]=b):b=e[37],b}function Rt(t){return t==="fast"?n.jsx(at,{size:16}):t==="thinking"?n.jsx(vn,{size:16}):n.jsx(Ao,{size:16})}function vi(t){const e=R.c(13),s=Dn();let o;e[0]!==t||e[1]!==s.tiers?(o=d=>{const u=s.tiers[d];return u?u.title??u.modelId:t.chat[d]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function bi(){const t=R.c(24),e=B(),{simpleModeTier:s,setSimpleModeTier:o}=Ge(),r=yo(),i=ns(),a=wo(i),l=vi(a),{data:V,error:d}=_n();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const c=u,p=Mn(),f=Vt()?.lockedHarness==="claude-code",m=Oe("model_choice"),h=oo(),g=ro();if(!h||!m)return null;let x,v;if(t[2]!==a||t[3]!==g||t[4]!==f||t[5]!==r||t[6]!==o||t[7]!==e||t[8]!==s||t[9]!==l||t[10]!==p||t[11]!==c||t[12]!==d){const w=As(e);x="decopilot",v=hi.map(y=>{const C=l[y],S=c.tiers[y];return{key:`decopilot-${y}`,icon:Rt(y),title:w[y],subtitle:g?C??e(Dt[y]):e(Dt[y]),active:s===y,onSelect:()=>o(y),modelOverride:g?I=>n.jsxs(n.Fragment,{children:[d&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(pi,{tier:y,orgSlot:r.tiers[y],userSlot:S,autoSlot:a.chat[y],filterModels:f?ci:void 0,onClose:I,onPick:N=>p.mutate({tier:y,slot:N}),onReset:()=>p.mutate({tier:y,slot:null})},`${y}:${S?.keyId??"org"}:${S?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=g,t[4]=f,t[5]=r,t[6]=o,t[7]=e,t[8]=s,t[9]=l,t[10]=p,t[11]=c,t[12]=d,t[13]=x,t[14]=v}else x=t[13],v=t[14];let b;t[15]!==x||t[16]!==v?(b=[{key:x,rows:v}],t[15]=x,t[16]=v,t[17]=b):b=t[17];const j=b;let A;t[18]!==s?(A=Rt(s),t[18]=s,t[19]=A):A=t[19];let k;return t[20]!==j||t[21]!==A||t[22]!==s?(k=n.jsx(mi,{tier:s,pillIcon:A,groups:j}),t[20]=j,t[21]=A,t[22]=s,t[23]=k):k=t[23],k}function ys(t){const e=R.c(3),[s]=Se();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&Lo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Ai={name:"switch-005",dataUri:"data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0VAAAAOAAADTGF2ZjYyLjMuMTAwAAAAAAAAAAAAAAD/+1DAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABkAABU4ABMTEx0dHR0nJycnMTExMTs7OztERERETk5OTlhYWFhiYmJibGxsbHZ2dnZ/f39/iYmJiZOTk5OdnZ2dp6enp7GxsbG7u7u7xMTExM7Ozs7Y2NjY4uLi4uzs7Oz29vb2/////wAAAABMYXZjNjIuMTEAAAAAAAAAAAAAAAAkBVYAAAAAAAAVOPCP8KUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//tQxAAACEwDXvQRAAG8Ii93HtACUCAABAKCJwfaCEHwfeoEAQdEAYygIHBOCAIAgCAJh9QIOg+D5/ygPh/wfB8DuKAgCHyn9QPh/5SCDv+CEHAQdxOD4B27c39tbckkqYbBAYAN9bNJLB+aXAf5wQAKdzxfbmrVIRQ4xNx3HwnoDmLhfMhgJiiw/HREXNCHqjvHEPEG8QjBYlxQNepJAT0kC8ip6JzSWj1TasoG+iyycbf2Uil1ovf1f/oUtR1qP+s1WSBFKoAAU02BDjMhuP/7UsQEgws8bRpd8YABJYPeBf9wCGXTGxBYcw5AJFMFMAmQQAhGAxgLBgHIAMYAAALhgAchipbe/91aU1VV4zcZj1Vf1XgYCIMBNrsBAIGs9/Ue4i/xFPeqCqwViI9/UeLf///rOngdA3OPHFjmOBv+EQnGahgaZxVplmkAH5JadDTQlNCEuGNiWYbCCONWdUJg6HXNazFdu1T+VgaEpOP70exv7f2/4b/yH//2/4cqCX/zWRUrIw+IPNMNlDnjAXQas/I4AzmYifA0tMSCgQDF//tSxBCDSzzi3k/sQwEyCtjJ/rBZAk+Uqj1YhA5YMCAAMwgOUchTkK7OR7LbMl0W1H6SvzG0Q2ZzfKUhnmTobv9DNhS1v7P8h//8Gv8gTRt1jReZ7YEjmMQg9hhwwMycHooasFmZyjcZGBKJD+IwbMCQQLoi+IQXCcIoydKoilI2MWFS5uJdDEu2taRrYI2ZSqKY50pJLv2NfjUAAuQAMfqVQ/T3PDQgMJMeEZ45hJzY6MNoFMxqTj1zNGQKJjAxEsSCBgQJBSIL0mcKYQJfVAn/+1LEGwLKlEKrD3MiYcuMkVa/wABB8Vh6M1q1epbvXwWBURhkyEhWZ/////////////9gjZ/Wt4w+4MNMCpE4TBYQl4w1IHvMDdA2zBngBMwc8COMDhCpDAfgOAAgrBgNYU+YC0FBGAkAMpgWoSCYAGESGBGAKBgXgJOdiOJmMCmNwCYNDJhYRPykRCJhTBnEUzlsjv4UNLj/z97n3Mv/7z1nZqyitYAZIqErIwMwJAqEw0GAAMFptJMaqFwB8CQIWlhuhuDAwNjfuwrQFAYXCf/7UsQVAA+9PTP42gYRdiIu9zBwAPbFUCi0DAhgNcS+7cDwVgM05A9bUDeuQMyE/u3CygVISgZhpIau/9PhdQG2C9DpxZZJmn/dn/Psmt0EFm////l84ThUTopE4VD/9JkubOGasTvN30C20G21qgUCkVCoUCgPMywrPCGly27V5q5t24vl/8jSlSAPCxzNseNCw3oh3NGBu4BZJ5hv7DRSfR/+eWG7nA8IKh2Olv5iz3q5m3//Joxo3JqNyYkSuGt/k6D4DeoBOHmHdl0dkZYA//tSxAUAC4B1Z/2DADEcA17Z/uhI4Yoik/TrZo+ww7UtmpW4LDWu2IacoJKJJeTSM+ZmAYBEiU+ZnnAwCn1VVVV6JUJQVnioKhrgqdKgqGpUFeCp0sDR3ztQNREDRUFioKuxKCpYGQBlRIBk+aLwb8KblGQVDdphPYTUdBOGbVpAaTF6ZdjEV0iRUZRCYkA4oUQDx5zqDugtXvza/7fuNNvfZ+j9v+T/2f//J/4cAAOTpE5K4zksR9MfIB+TDcQTI4gNs1XKAzEFUrGkxABYEBb/+1LEEYNKrEjgT/TCwYYVmUX+mHoKgWhKU5Eiw9SFIRmppw+3fYo4siPhUFeexM8KgIO6wVuPDDy01qeRaVbw357//y3+o8M0pBNlNLCGBzGKwyYw2IIFOE1WNTjRM6x8MlA1AxDhUHTAkEiyKpnbWrLcaOBotBUKbk1pypcWDAIK00AhKLGkUco6q9VWvM53mcaq3tVa8zjTM/tX//EDP//////////XAAmrwAAPoKwcw0ShDCZD/BQlhzinxQdorsOuXTEIC01ZkJyu4k/qPP/7UsQUAEjkrrkvZaPBIRXUoe5QObfMhYKX9RVgTPqCSCaSCaSC0XVdV1f/////6IAlguuAJSiDRNloNBsZg+0+Ts8MMCn81WUTRAlIi+GHECD0y8AWDIqswYsxGOSKVV7MqOni8tkVOip0fZX/////9HrMCbAz2EHGS4GKAAiRAAAYAcDdKd4G6Z/nwYgJ0ZAIgZyC8aPAs/iPBhwMpWDQNARltNS5Y61v//9i8Yl4SkFkIGTkAc0UBrIYLPA4MYBEy+YLMRuY4nhTC3hZA68H//tSxCoAyQC6mY6CkWDJBIsBz/QUrgNmahSzcrYw0/HhfnMAZBojDsgTFkDR5MDkG/DZEbk2FCmowqdqv2TYABiJwqqYjaQRGZ1URZ1DhSsdiHX/GBu0QpzIBNSaLqZ0ARkwFARxMrpt/Eh47mbQAhhU6sisFUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LESoHHJCRaj/dmYAIAQAAQAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsSLg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsShg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",duration:.609,format:"mp3",license:"CC0",author:"Kenney"},yi=ln.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),ji=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function ki(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:ji.map(wi)}),t[0]=e):e=t[0],e}function wi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Si({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,V]=P.useState(!1),d=ys(Ai),{org:u}=Ce(),{editor:c}=Ot(),p=P.useRef(null),f=pt(o),m=()=>{!f||r||(V(!1),p.current?.click())},h=async T=>{const Q=T.target.files;if(!Q||Q.length===0||!c)return;const Z=Array.from(Q);try{let H=c.state.selection.from;for(const ne of Z)await os(c,o??null,ne,H,i,a),H=c.state.selection.to}finally{p.current&&(p.current.value="")}},g=Do({connectionId:s,orgId:u.id,orgSlug:u.slug}),x=Es.virtualMcpPrompts(s,u.id),{data:v,isLoading:b}=Ps({queryKey:x,queryFn:()=>Ro(g),staleTime:6e4,enabled:l&&!!g}),j=v?.prompts??[],[A,k]=P.useState(null),{chatMode:w,setChatMode:y}=Ge(),[C,S]=Se(),I=Vt()?.lockedHarness!=="claude-code",N=we.find(T=>T.value===C.toolApprovalLevel)??we[0],M=a(N.shortKey),E=T=>{const Q=we.find(Z=>Z.value===T);if(Q){if(Q.value===C.toolApprovalLevel){V(!1);return}d(),ee("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:Q.value,source:"tools_popover"}),S({...C,toolApprovalLevel:Q.value}),V(!1)}},D=w==="plan",L=()=>{d();const T=D?"default":"plan";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},_=()=>{e(),V(!1)},U=async(T,Q)=>{if(!c||!g)return;const Z=kt(T._meta),H={from:c.state.selection.from,to:c.state.selection.to};try{const ne=await Eo(g,T.name,Q);tn(c,H,{id:T.name,name:Mo(T.name,Z),metadata:ne.messages,char:"/",kind:"prompt",args:Q})}catch{Ee.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async T=>{V(!1);const Q=!!(T.arguments&&T.arguments.length>0);if(ee("chat_prompt_inserted",{prompt_name:T.name,with_arguments:Q}),Q){k(T);return}await U(T)},q=async T=>{A&&(await U(A,T),k(null))},$=()=>{d();const T=w==="gen-image"?"default":"gen-image";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},O=()=>{d();const T=w==="web-search"?"default":"web-search";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},W=()=>{d();const T=w==="deep-research"?"default":"deep-research";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},X=w==="gen-image",te=w==="web-search",J=w==="deep-research",ae=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:ho(o??null),className:"hidden",onChange:h,disabled:r});return n.jsxs(n.Fragment,{children:[ae,n.jsxs(Ls,{open:l,onOpenChange:T=>{T&&!l&&ee("chat_tools_popover_opened",{chat_mode:w}),V(T)},children:[n.jsx(Us,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:z("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[n.jsx(An,{size:14}),n.jsx("span",{className:z("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:a("chat.toolsPopover.tools")})]})}),n.jsxs(Fs,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?n.jsxs(Ae,{onClick:m,disabled:r,children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(Ae,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:T=>T.preventDefault(),children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(Ae,{onClick:L,className:z(D&&"text-special"),children:[n.jsx(Kt,{size:16,className:z(D&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:z("text-xs text-muted-foreground",D&&"text-special font-medium"),children:yi})]}),n.jsxs(Ae,{onClick:$,className:z(X&&"text-special"),children:[n.jsx(Gt,{size:16,className:z(X&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),X&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:O,className:z(te&&"text-special"),children:[n.jsx(Wt,{size:16,className:z(te&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:W,className:z(J&&"text-special"),children:[n.jsx(Yt,{size:16,className:z(J&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),J&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(xt,{children:[n.jsxs(vt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),n.jsx(bt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Os,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):j.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):j.map(T=>n.jsxs(Ae,{onClick:()=>F(T),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:T.title||_o(T.name,kt(T._meta))}),T.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:T.description})]},T.name))})]}),I&&n.jsxs(xt,{children:[n.jsxs(vt,{className:"gap-2",children:[n.jsx(We,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:M})]}),n.jsx(bt,{className:"w-48 p-1.5",children:n.jsx(zs,{value:C.toolApprovalLevel,onValueChange:E,children:we.map(T=>n.jsx($s,{value:T.value,children:a(T.labelKey)},T.value))})})]}),n.jsxs(Ae,{onClick:_,children:[n.jsx(Po,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(P.Suspense,{children:n.jsx(ki,{})})]})]})]}),n.jsx(en,{prompt:A,setPrompt:k,onSubmit:q})]})}const Ci=[{src:"/connections/github.png",name:"GitHub"},{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/linear.png",name:"Linear"},{src:"/connections/shopify.png",name:"Shopify"},{src:"/connections/firecrawl.png",name:"Firecrawl"},{src:"/connections/perplexity.png",name:"Perplexity"}];function Ni(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:Ci.map(Ii)}),t[0]=e):e=t[0],e}function Ii(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Ti(t){const e=R.c(10),{onClick:s}=t,o=B();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=z("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ni,{}),V=n.jsx(Bs,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let d;return e[7]!==s||e[8]!==a?(d=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Re=48;function _i(){const t=R.c(9),[e,s]=P.useState("idle"),[o,r]=P.useState(""),[i,a]=P.useState(""),[l,V]=P.useState(Ri),d=P.useRef(null),u=P.useRef(null),c=P.useRef(null),p=P.useRef(null),f=P.useRef(0),m=P.useRef(!1),h=P.useRef(""),g=P.useRef(""),x=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let v;t[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(Di),p.current?.getTracks().forEach(Mi),c.current=null,u.current=null,p.current=null},t[0]=v):v=t[0];const b=v;let j;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=N=>{p.current=N;const M=new AudioContext;u.current=M;const E=M.createMediaStreamSource(N),D=M.createAnalyser();D.fftSize=128,D.smoothingTimeConstant=.8,E.connect(D),c.current=D;const L=new Uint8Array(D.frequencyBinCount),_=()=>{if(!c.current)return;c.current.getByteFrequencyData(L);const U=[];for(let F=0;F<Re;F++){const q=Math.floor(F/Re*L.length);U.push(Math.max(.04,(L[q]??0)/255))}V(U),f.current=requestAnimationFrame(_)};_()};j=async()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N)return s("unsupported"),"unsupported";let M;try{M=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),g.current="",h.current="",m.current=!0,s("recording"),I(M);const E=new N;d.current=E,E.interimResults=!0,E.continuous=!0,E.lang=navigator.language||"en-US",E.onresult=D=>{if(d.current!==E)return;let L="",_="";for(let U=D.resultIndex;U<D.results.length;U++){const F=D.results[U],q=F?.[0]?.transcript??"";F?.isFinal?_=_+q:L=L+q}_&&(h.current=h.current+_,r(h.current)),g.current=L,a(L)},E.onerror=D=>{d.current===E&&D.error!=="no-speech"&&(m.current=!1,d.current=null,b(),s(D.error==="not-allowed"?"permission-denied":"idle"))},E.onend=()=>{if(d.current===E&&m.current)try{E.start()}catch{}};try{E.start()}catch{return m.current=!1,d.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=j}else j=t[1];const A=j;let k;t[2]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{m.current=!1,d.current?.stop(),b(),s("idle"),V(Array(Re).fill(.05)),a("");const I=(h.current+(g.current?" "+g.current:"")).trim();return r(""),h.current="",g.current="",I},t[2]=k):k=t[2];const w=k;let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),V(Array(Re).fill(.05)),h.current="",g.current=""},t[3]=y):y=t[3];const C=y;let S;return t[4]!==i||t[5]!==e||t[6]!==o||t[7]!==l?(S={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:x,startRecording:A,stopRecording:w,cancelRecording:C},t[4]=i,t[5]=e,t[6]=o,t[7]=l,t[8]=S):S=t[8],S}function Mi(t){return t.stop()}function Di(){}function Ri(){return Array(Re).fill(.05)}function Ei(t){const e=R.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(Pi),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=r):r=e[3],r}function Pi(t,e){return n.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}const Pe=12e3,Et=re({token:se(),expiresAt:qs()});Qs("provider",[re({provider:ye("elevenlabs"),conversationToken:se().min(1)}),re({provider:ye("openai"),transport:ye("webrtc")})]);const Li=Ks([Et.extend({provider:ye("elevenlabs").default("elevenlabs"),conversationToken:se().min(1)}),Et.extend({provider:ye("openai"),transport:ye("webrtc")})]);re({token:se().min(1).max(4096),text:se().trim().min(1).max(Pe)});const js=re({request:se().trim().min(1).max(Pe)}),ot=5e3;Ut(re({role:Ue(["user","agent"]),text:se().min(1).max(ot)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=ot,{message:"Voice transcript is too long"});function pl(t){const e=[];let s=ot;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}re({token:se().min(1).max(4096),sdp:se().min(1).max(1e5),language:Ue(["en","pt"]).default("en")}).strict();const Ui=re({sdp:se().min(1).max(1e5)});async function Fi(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await At(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-Bo2nNgKY.js");return{startOpenAIConversation:V}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131]));return l(r,s,o)}const{Conversation:i}=await At(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=js.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return o.aborted&&(await a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const V=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?a.sendContextualUpdate(V):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
10
|
+
${V}
|
|
11
|
+
Briefly report this update. Do not delegate it as new work.`)}}}const Oi=re({background:ye(!0),status:ye("started"),jobId:se().min(1)}),zi=re({item:re({id:se().min(1),title:se(),status:se()})}),$i=t=>`${t}:react-msg`;function ks(t,e){const s=t.findIndex(r=>r.id===e&&r.role==="user");if(s<0)return null;const o=[];for(const r of t.slice(s+1))if(!r.metadata?.subtaskJobId){if(r.role==="user")break;r.role==="assistant"&&o.push(r)}return o}function Pt(t,e){const s=[],o=[];for(const r of ks(t,e)??[])for(const i of r.parts){if(!("state"in i)||i.state!=="output-available"||!("output"in i))continue;const a=i.type;if(a==="tool-subtask"){const l=Oi.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(a==="tool-TASK_BOARD_ITEM_CREATE"){const l=zi.safeParse(i.output);l.success&&o.push(l.data.item)}}return{backgroundJobs:s,tasks:o}}function Lt(t,e){const s=ks(t,e);if(!s)return null;const o=s.at(-1);if(!o||o.parts.some(l=>"state"in l&&["approval-requested","input-streaming","input-available"].includes(String(l.state))))return null;const r=o.parts.findLast(l=>l.type==="text"||l.type==="dynamic-tool"||l.type.startsWith("tool-"));if(r?.type!=="text")return"";if(r.state==="streaming")return null;const i=r.text.replace(/```[\s\S]*?```/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+\.\s+)/gm,"").replace(/[*_`]/g,"").trim();if(!i)return"";if(i.length<=Pe)return i;const a=i.slice(0,Pe-1);return`${a.slice(0,a.lastIndexOf(" "))}…`}class Bi{constructor(e,s){this.url=e,this.language=s}url;language;state={phase:"idle",muted:!1,working:!1,error:null};listeners=new Set;generation=0;conversation;startupAbort;userSpeaking=!1;token;timer;expires;bindings;jobs=new Map;announcements=[];lastActivity=0;approvalReported=!1;cleanup=Promise.resolve();dispatchQueue=Promise.resolve();lastContext="";lastWorkStatus="";utterance=0;seenUserEvents=new Set;tasks=new Map;boardUpdates=new Map;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;outputVolume=()=>this.conversation?.getOutputVolume()??0;patch(e){if(!Object.entries(e).every(([s,o])=>this.state[s]===o)){this.state={...this.state,...e};for(const s of this.listeners)s()}}updateBindings(e,s){if(this.bindings=e,!s&&this.state.phase!=="idle"){this.stop();return}this.conversation&&(this.updateContext(),this.collectResults())}requestStatus(e){return e.result!==void 0?"finished":e.accepted?e.background?"running_in_background":this.bindings?.messages.some(s=>s.id===e.messageId)?"running":"queued":"submitting"}status(){const e=this.bindings;return{status:e?.isWaitingForApprovals?"approval_required":e?.error||e?.status==="error"?"failed":e?.isStreaming||e?.isRunInProgress?"working":"idle",requests:[...this.jobs.values()].slice(-6).map(s=>({id:s.messageId,request:s.request.slice(0,200),status:this.requestStatus(s),result:s.result?.slice(0,500)})),tasks:[...this.tasks.values()].slice(-10).map(s=>({title:s.title.slice(0,120),status:s.status}))}}updateContext(){const e=this.bindings?.voiceContext??"";e!==this.lastContext&&(this.lastContext=e,this.conversation?.publishUpdate({text:`Current Studio view, supplied as context only:
|
|
12
|
+
${e.slice(0,12e3)}`,delivery:"context",contextId:"studio-view"}))}collectResults(){const e=this.bindings;if(!e||!this.conversation)return;const s=e.isStreaming||e.isRunInProgress;if(this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus(),e.isWaitingForApprovals){this.approvalReported||(this.approvalReported=!0,this.report("The Studio agent needs the user's approval. The approval controls are visible in this chat. Ask the user to review them; do not approve on their behalf."));return}this.approvalReported=!1;for(const o of this.jobs.values()){if(!o.accepted||o.result!==void 0)continue;if(o.background){this.collectBackground(o,s);continue}const r=e.messages.findIndex(l=>l.id===o.messageId);if(r<0)continue;const i=r>=0&&e.messages.slice(r+1).some(l=>l.role==="user");if(s&&!i)continue;let a;if(!s&&!i&&(e.error||e.status==="error"))a="The agent's run failed. Ask the user to return to the chat for the error details; do not claim completion.";else if(!s&&!i&&e.finishReason&&["error","length","content-filter","aborted"].includes(e.finishReason))a=`The run ended with status ${e.finishReason}; successful completion is not established.`;else{const l=Lt(e.messages,o.messageId);if(l===null)continue;a=l;const V=Pt(e.messages,o.messageId);if(this.track(V.tasks),V.backgroundJobs.length){o.background=V.backgroundJobs,this.collectBackground(o,s);continue}}this.finish(o,a||"The agent finished without a final text response. Do not infer that the requested change succeeded.")}this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus()}collectBackground(e,s){const o=this.bindings?.messages??[],r=[];for(const i of e.background??[]){const a=$i(i),l=o.findIndex(u=>u.id===a);if(l<0)return;const V=o.slice(l+1).some(u=>u.role==="user");if(s&&!V)return;const d=Lt(o,a);if(d===null)return;this.track(Pt(o,a).tasks),r.push(d)}this.finish(e,r.filter(Boolean).join(`
|
|
13
|
+
`)||"The background work finished without a final text response. Do not infer that the requested change succeeded.")}finish(e,s){e.result=s,this.report(JSON.stringify({requestId:e.messageId,request:e.delegationId?void 0:e.request,result:s}),e.delegationId)}track(e){for(const s of e)this.tasks.has(s.id)||this.tasks.set(s.id,this.boardUpdates.get(s.id)??s)}publishWorkStatus(){const e=JSON.stringify(this.status());e!==this.lastWorkStatus&&(this.lastWorkStatus=e,this.conversation?.publishUpdate({delivery:"context",contextId:"studio-work",text:e}))}taskUpdated=e=>{const s={id:e.id,title:e.title,status:e.status};this.boardUpdates.delete(e.id),this.boardUpdates.set(e.id,s);for(const r of this.boardUpdates.keys()){if(this.boardUpdates.size<=200)break;this.boardUpdates.delete(r)}const o=this.tasks.get(e.id);!o||!this.conversation||o.status===e.status||(this.tasks.set(e.id,s),this.report(JSON.stringify({task:e.title,status:e.status})),this.publishWorkStatus())};taskDeleted=e=>{const s=this.tasks.get(e);!s||!this.conversation||(this.tasks.delete(e),this.report(JSON.stringify({task:s.title,status:"deleted"})),this.publishWorkStatus())};report(e,s){const o={text:e,delegationId:s,delivery:"context"};this.conversation?.publishUpdate(o),this.announcements.push({...o,delivery:"announce"})}flushAnnouncements(){if(!(!this.conversation||!this.announcements.length||this.userSpeaking||this.state.phase!=="listening"||Date.now()-this.lastActivity<1800)){this.lastActivity=Date.now();for(const e of this.announcements.splice(0))this.conversation.publishUpdate(e)}}delegate=async e=>{if(this.utterance===0&&!e.delegationId)return{status:"rejected",reason:"Wait for a spoken user request before delegating work."};const s=js.safeParse(e);if(!s.success)return{status:"rejected",reason:"A complete, non-empty request is required."};if(this.jobs.size>=40)return{status:"rejected",reason:"This voice session has reached its request limit. Continue in the text chat."};const o=s.data.request,r=[...this.jobs.values()].find(V=>e.delegationId?V.delegationId===e.delegationId:V.utterance===this.utterance||V.request===o&&V.result===void 0);if(r)return{status:r.result!==void 0?"finished":r.accepted?"accepted":"submitting",requestId:r.messageId,result:r.result?.slice(0,2e3),note:"This utterance already has a work request; do not submit it again."};const i=this.generation,a={messageId:crypto.randomUUID(),utterance:this.utterance,request:o,accepted:!1,delegationId:e.delegationId};this.jobs.set(a.messageId,a);const l=this.dispatchQueue.then(async()=>i!==this.generation||!this.conversation?!1:this.bindings?.sendVoiceMessage?.(a.messageId,o,e.transcript)??!1);this.dispatchQueue=l.catch(()=>{});try{const V=await l;return i!==this.generation?{status:"disconnected"}:V?(a.accepted=!0,this.collectResults(),{status:"accepted",requestId:a.messageId,note:"Work is running or queued in Studio. Keep conversing. A background event will supply its actual result."}):(this.jobs.delete(a.messageId),{status:"rejected",reason:"Studio did not accept the request. No work has been confirmed."})}catch{return this.jobs.delete(a.messageId),{status:"rejected",reason:"Studio could not accept the request. Do not claim it started."}}};async start(){if(this.state.phase!=="idle"&&this.state.phase!=="error")return;this.stop();const e=++this.generation,s=new AbortController;this.startupAbort=s;const o=()=>e===this.generation;this.patch({phase:"connecting",error:null,muted:!1});try{if(await this.cleanup,!o())return;const r=fetch(this.url,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"conversation",language:this.language}),signal:AbortSignal.timeout(5e4)}).then(async d=>{if(!d.ok)throw new Error("Voice unavailable");return Li.parse(await d.json())});this.cleanup=r.then(async d=>{o()||await this.revoke(d.token)}).catch(()=>{});const i=await r;if(!o())return;this.token=i.token;const a=Fi(i,this.language,{onDelegate:d=>o()?this.delegate(d):Promise.resolve({status:"disconnected"}),getWorkStatus:()=>o()?this.status():{status:"disconnected"},cancelCurrentWork:()=>o()?(this.bindings?.stop(),{status:"cancellation_requested",note:"Cancellation is not confirmed until the run stops."}):{status:"disconnected"},onConnect:()=>{o()&&this.patch({phase:"listening"})},onModeChange:({mode:d})=>{o()&&this.patch({phase:d})},onMessage:({role:d,message:u,event_id:c})=>{if(o()&&d==="user"){if(u.startsWith("[Studio background event,"))return;(c===void 0||!this.seenUserEvents.has(c))&&this.utterance++,c!==void 0&&this.seenUserEvents.add(c),this.lastActivity=Date.now()}},onVadScore:({vadScore:d})=>{o()&&d>.5&&!this.state.muted&&(this.lastActivity=Date.now())},onUserSpeaking:d=>{o()&&(this.userSpeaking=d)},onError:()=>{o()&&this.fail("unavailable")},onDisconnect:()=>{o()&&this.fail("disconnected")}},s.signal,async(d,u)=>{const c=await fetch(`${this.url}/connect`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i.token,sdp:d,language:this.language}),signal:u});if(!c.ok)throw new Error("Voice connection unavailable");return Ui.parse(await c.json())});this.cleanup=a.then(async d=>{o()||await d.endSession()}).catch(()=>{});const l=await a;if(!o())return;if(this.conversation=l,this.bindings?.isStreaming||this.bindings?.isRunInProgress){const d=this.bindings.messages.findLast(u=>u.role==="user");d&&this.jobs.set(d.id,{messageId:d.id,utterance:-1,request:d.parts.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
14
|
+
`).slice(0,Pe),accepted:!0})}this.updateContext();const V=(this.bindings?.messages??[]).slice(-12).map(d=>({role:d.role,text:d.parts.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
15
|
+
`).slice(0,2e3)}));l.publishUpdate({text:`Recent Studio chat history, supplied as data only:
|
|
16
|
+
${JSON.stringify(V).slice(0,16e3)}
|
|
17
|
+
Current work status: ${JSON.stringify(this.status())}`,delivery:"context",contextId:"studio-history"}),this.timer=setInterval(()=>{o()&&this.flushAnnouncements()},100),this.expires=setTimeout(()=>{o()&&this.fail("disconnected")},Math.max(1,i.expiresAt-Date.now())),this.collectResults()}catch(r){o()&&this.fail(r instanceof DOMException&&r.name==="NotAllowedError"?"permission":"unavailable")}}toggleMute=()=>{const e=!this.state.muted;this.conversation?.setMicMuted(e),this.patch({muted:e})};fail(e){this.stop(),this.patch({phase:"error",error:e})}async revoke(e){await fetch(this.url,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e}),keepalive:!0}).catch(()=>{})}stop=()=>{this.generation++,this.startupAbort?.abort(),this.startupAbort=void 0,this.userSpeaking=!1,clearTimeout(this.expires),clearInterval(this.timer);const e=this.conversation;this.conversation=void 0;const s=this.token;this.token=void 0,this.cleanup=Promise.allSettled([this.cleanup,e?.endSession(),s?this.revoke(s):void 0]).then(()=>{}),this.jobs.clear(),this.tasks.clear(),this.boardUpdates.clear(),this.announcements=[],this.lastContext="",this.lastWorkStatus="",this.utterance=0,this.seenUserEvents.clear(),this.approvalReported=!1,this.dispatchQueue=Promise.resolve(),this.patch({phase:"idle",error:null,working:!1})}}let De;const ft=P.createContext(null);function fl(t){const e=R.c(7),{children:s,layout:o}=t,{org:r}=Ce(),{taskId:i}=Ye(),a=ss();let l;e[0]!==a||e[1]!==o?(l=a?Bo({visibility:o,threadVisibilityExplicit:o.threadVisibilityExplicit})==="chat":o.threadOpen||!o.contentOpen,e[0]=a,e[1]=o,e[2]=l):l=e[2];const V=l,d=`${r.id}:${i??"new"}`;let u;return e[3]!==s||e[4]!==d||e[5]!==V?(u=n.jsx(Ki,{visible:V,children:s},d),e[3]=s,e[4]=d,e[5]=V,e[6]=u):u=e[6],u}function Ki(t){const e=R.c(35),{children:s,visible:o}=t,{org:r}=Ce(),{taskId:i,createTask:a,activeTask:l}=Ye(),d=jo("voice_mode")&&!0&&!l?.metadata?.read_only;let u;e[0]!==r.slug||e[1]!==i?(u=()=>new Bi(`/api/${encodeURIComponent(r.slug)}/threads/${encodeURIComponent(i??"")}/voice/sessions`,Ws()==="pt-BR"?"pt":"en"),e[0]=r.slug,e[1]=i,e[2]=u):u=e[2];const[c]=P.useState(u);let p,f;e[3]!==d||e[4]!==c||e[5]!==o?(p=()=>{(!d||!o)&&c.stop()},f=[c,d,o],e[3]=d,e[4]=c,e[5]=o,e[6]=p,e[7]=f):(p=e[6],f=e[7]),P.useLayoutEffect(p,f);let m;e[8]!==c?(m=()=>c.getSnapshot().phase!=="idle",e[8]=c,e[9]=m):m=e[9];const h=P.useSyncExternalStore(c.subscribe,m);let g;e[10]!==h||e[11]!==r.slug||e[12]!==c.taskDeleted||e[13]!==c.taskUpdated?(g={orgSlug:r.slug,enabled:h,onUpdate:c.taskUpdated,onDelete:c.taskDeleted},e[10]=h,e[11]=r.slug,e[12]=c.taskDeleted,e[13]=c.taskUpdated,e[14]=g):g=e[14],$o(g);let x;e[15]!==d||e[16]!==r.id||e[17]!==c||e[18]!==i?(x=()=>y=>{if(d&&i&&De?.orgId===r.id&&De.threadId===i){const S=De.expires>Date.now();De=void 0,S&&c.start()}const C=()=>c.stop();return window.addEventListener("pagehide",C),()=>{window.removeEventListener("pagehide",C),c.stop()}},e[15]=d,e[16]=r.id,e[17]=c,e[18]=i,e[19]=x):x=e[19];const[v]=P.useState(x);let b;e[20]!==a||e[21]!==d||e[22]!==r.id||e[23]!==c||e[24]!==i?(b=()=>{if(d){if(!i){const y=a();De={orgId:r.id,threadId:y,expires:Date.now()+3e4};return}c.start()}},e[20]=a,e[21]=d,e[22]=r.id,e[23]=c,e[24]=i,e[25]=b):b=e[25];const j=b;let A;e[26]!==d||e[27]!==c||e[28]!==j?(A={session:c,enabled:d,start:j},e[26]=d,e[27]=c,e[28]=j,e[29]=A):A=e[29];let k;e[30]!==s?(k=n.jsx("div",{className:"contents",ref:v,children:s}),e[30]=s,e[31]=k):k=e[31];let w;return e[32]!==A||e[33]!==k?(w=n.jsx(ft,{value:A,children:k}),e[32]=A,e[33]=k,e[34]=w):w=e[34],w}function hl(t){const e=R.c(4),{children:s}=t,o=P.useContext(ft),r=Fe();let i,a;return e[0]!==o||e[1]!==r?(i=()=>{o?.session.updateBindings(r,o.enabled)},a=[o,r],e[0]=o,e[1]=r,e[2]=i,e[3]=a):(i=e[2],a=e[3]),P.useLayoutEffect(i,a),s}function ws(){const t=R.c(4),e=P.useContext(ft),s=P.useSyncExternalStore(e?.session.subscribe??qi,e?.session.getSnapshot??Qi),o=s?.phase!==void 0&&s.phase!=="idle";let r;return t[0]!==e||t[1]!==s||t[2]!==o?(r={active:o,context:e,snapshot:s},t[0]=e,t[1]=s,t[2]=o,t[3]=r):r=t[3],r}const qi=()=>()=>{},Qi=()=>null;function Wi(){const t=R.c(9),e=B(),{context:s}=ws();if(!s?.enabled||!navigator.mediaDevices?.getUserMedia)return null;const o=s.start;let r;t[0]!==e?(r=e("chat.voice.start"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e?(i=e("chat.voice.start"),t[2]=e,t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(qo,{size:18}),t[4]=a):a=t[4];let l;return t[5]!==s.start||t[6]!==r||t[7]!==i?(l=n.jsx(Y,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:o,"aria-label":r,title:i,children:a}),t[5]=s.start,t[6]=r,t[7]=i,t[8]=l):l=t[8],l}function Yi({session:t,phase:e,muted:s}){const[o]=P.useState(()=>r=>{if(!r||matchMedia("(prefers-reduced-motion: reduce)").matches)return;let i=0,a=requestAnimationFrame(function l(){const V=Math.min(1,t.outputVolume());i+=(V-i)*(V>i?.55:.12),r.style.setProperty("--voice-level",i.toFixed(3)),a=requestAnimationFrame(l)});return()=>cancelAnimationFrame(a)});return n.jsx("div",{ref:o,className:"studio-voice-orb","data-phase":e,"data-muted":s,"aria-hidden":"true"})}function ml(){const t=R.c(65),e=B(),{taskId:s}=Ye(),o=Fe(),{context:r,snapshot:i,active:a}=ws();if(!a||!r||!i)return null;const{session:l}=r;let V;t[0]!==i.error||t[1]!==i.muted||t[2]!==i.phase||t[3]!==e?(V=i.error?e(`chat.voice.${i.error}`):i.muted?e("chat.voice.muted"):e(`chat.voice.${i.phase}`),t[0]=i.error,t[1]=i.muted,t[2]=i.phase,t[3]=e,t[4]=V):V=t[4];const d=V;let u;t[5]!==e?(u=e("chat.voice.title"),t[5]=e,t[6]=u):u=t[6];let c;t[7]!==l||t[8]!==i.muted||t[9]!==i.phase?(c=n.jsx(Yi,{session:l,phase:i.phase,muted:i.muted}),t[7]=l,t[8]=i.muted,t[9]=i.phase,t[10]=c):c=t[10];let p;t[11]!==d?(p=n.jsx("p",{role:"status",className:"max-w-sm text-center text-sm text-muted-foreground",children:d}),t[11]=d,t[12]=p):p=t[12];let f;t[13]!==i.working||t[14]!==e?(f=i.working&&n.jsx("p",{className:"text-center text-xs text-muted-foreground",children:e("chat.voice.backgroundWork")}),t[13]=i.working,t[14]=e,t[15]=f):f=t[15];let m;t[16]!==r.start||t[17]!==i.phase||t[18]!==e?(m=i.phase==="error"&&n.jsx(Y,{variant:"outline",onClick:r.start,children:e("chat.voice.retry")}),t[16]=r.start,t[17]=i.phase,t[18]=e,t[19]=m):m=t[19];let h;t[20]!==c||t[21]!==p||t[22]!==f||t[23]!==m?(h=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-7 overflow-y-auto px-6 py-8",children:[c,p,f,m]}),t[20]=c,t[21]=p,t[22]=f,t[23]=m,t[24]=h):h=t[24];let g;t[25]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ze,{inline:!0,voiceMode:!0}),t[25]=g):g=t[25];let x;t[26]!==s?(x=s&&n.jsx(bs,{taskId:s}),t[26]=s,t[27]=x):x=t[27];let v;t[28]!==x?(v=n.jsxs("div",{className:"max-h-[55%] shrink-0 overflow-y-auto px-3",children:[g,x]}),t[28]=x,t[29]=v):v=t[29];const b=i.phase==="connecting"||i.phase==="error",j=i.muted?"chat.voice.unmute":"chat.voice.mute";let A;t[30]!==e||t[31]!==j?(A=e(j),t[30]=e,t[31]=j,t[32]=A):A=t[32];const k=i.muted?"chat.voice.unmute":"chat.voice.mute";let w;t[33]!==e||t[34]!==k?(w=e(k),t[33]=e,t[34]=k,t[35]=w):w=t[35];let y;t[36]!==i.muted?(y=i.muted?n.jsx(Wo,{size:18}):n.jsx(Yo,{size:18}),t[36]=i.muted,t[37]=y):y=t[37];let C;t[38]!==l.toggleMute||t[39]!==i.muted||t[40]!==b||t[41]!==A||t[42]!==w||t[43]!==y?(C=n.jsx(Y,{variant:"outline",size:"icon",disabled:b,"aria-label":A,title:w,"aria-pressed":i.muted,onClick:l.toggleMute,children:y}),t[38]=l.toggleMute,t[39]=i.muted,t[40]=b,t[41]=A,t[42]=w,t[43]=y,t[44]=C):C=t[44];const S=l.stop;let I;t[45]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(Qo,{size:16}),t[45]=I):I=t[45];let N;t[46]!==e?(N=e("chat.voice.backToChat"),t[46]=e,t[47]=N):N=t[47];let M;t[48]!==l.stop||t[49]!==N?(M=n.jsxs(Y,{variant:"outline",onClick:S,children:[I,N]}),t[48]=l.stop,t[49]=N,t[50]=M):M=t[50];let E;t[51]!==o.isRunInProgress||t[52]!==o.isStreaming||t[53]!==o.stop||t[54]!==e?(E=(o.isStreaming||o.isRunInProgress)&&n.jsx(Y,{variant:"outline",size:"icon","aria-label":e("chat.voice.stopWork"),title:e("chat.voice.stopWork"),onClick:o.stop,children:n.jsx(Go,{size:16})}),t[51]=o.isRunInProgress,t[52]=o.isStreaming,t[53]=o.stop,t[54]=e,t[55]=E):E=t[55];let D;t[56]!==C||t[57]!==M||t[58]!==E?(D=n.jsxs("div",{className:"flex shrink-0 items-center justify-center gap-3 px-4 py-6",children:[C,M,E]}),t[56]=C,t[57]=M,t[58]=E,t[59]=D):D=t[59];let L;return t[60]!==u||t[61]!==D||t[62]!==h||t[63]!==v?(L=n.jsxs("section",{"aria-label":u,className:"absolute inset-0 flex min-h-0 flex-col bg-background",children:[h,v,D]}),t[60]=u,t[61]=D,t[62]=h,t[63]=v,t[64]=L):L=t[64],L}function Gi(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function Ke(t){const e=R.c(7),{message:s,icon:o}=t;let r;e[0]!==o?(r=o??n.jsx(Ft,{size:14,className:"shrink-0"}),e[0]=o,e[1]=r):r=e[1];const i=s??"";let a;e[2]!==i?(a=n.jsx("span",{className:"text-sm",children:i}),e[2]=i,e[3]=a):a=e[3];let l;return e[4]!==r||e[5]!==a?(l=n.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[r,a]}),e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Hi(t,e,s){const o=R.c(7),{editor:r}=Ot(),i=B(),[a,l]=P.useState(!1),V=P.useRef(0);let d,u;return o[0]!==s||o[1]!==r||o[2]!==e||o[3]!==t||o[4]!==i?(d=()=>{const c=h=>{h.dataTransfer?.types.includes("Files")&&(h.preventDefault(),V.current=V.current+1,l(!0))},p=h=>{h.preventDefault(),V.current=Math.max(0,V.current-1),V.current===0&&l(!1)},f=Ji,m=h=>{if(h.preventDefault(),V.current=0,l(!1),s||!r||!t||!pt(t))return;const g=h.dataTransfer?.files;if(!g||g.length===0)return;const x=Array.from(g);(async()=>{let v=r.state.selection.from;for(const b of x)await os(r,t,b,v,e,i),v=r.state.selection.to})()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",p),window.addEventListener("dragover",f),window.addEventListener("drop",m),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",p),window.removeEventListener("dragover",f),window.removeEventListener("drop",m)}},u=[r,t,e,i,s],o[0]=s,o[1]=r,o[2]=e,o[3]=t,o[4]=i,o[5]=d,o[6]=u):(d=o[5],u=o[6]),P.useEffect(d,u),a}function Ji(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function Zi(t){const e=R.c(14),{selectedModel:s}=t,o=B();let r,i,a;if(e[0]!==s||e[1]!==o){const{parts:d}=mo(s);e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(wn,{size:24}),e[5]=a):a=e[5],r="text-sm font-medium";let u;e[6]!==o?(u=c=>o(c),e[6]=o,e[7]=u):u=e[7],i=o("chat.input.dropFilesHere",{fileTypes:d.map(u).join(", ")}),e[0]=s,e[1]=o,e[2]=r,e[3]=i,e[4]=a}else r=e[2],i=e[3],a=e[4];let l;e[8]!==r||e[9]!==i?(l=n.jsx("span",{className:r,children:i}),e[8]=r,e[9]=i,e[10]=l):l=e[10];let V;return e[11]!==a||e[12]!==l?(V=n.jsxs(n.Fragment,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=V):V=e[13],V}function Xi(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ft,{size:24}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.jsxs(n.Fragment,{children:[s,n.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function ea(t){const e=R.c(11),{selectedModel:s,onUnsupportedFile:o,disabled:r}=t,i=Hi(s,o,r);let a;e[0]!==s?(a=pt(s),e[0]=s,e[1]=a):a=e[1];const l=a,V=i?"opacity-100":"opacity-0 pointer-events-none",d=l?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let u;e[2]!==V||e[3]!==d?(u=z("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",V,d),e[2]=V,e[3]=d,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==l?(c=l?n.jsx(Zi,{selectedModel:s}):n.jsx(Xi,{}),e[5]=s,e[6]=l,e[7]=c):c=e[7];let p;return e[8]!==u||e[9]!==c?(p=n.jsx("div",{className:u,children:c}),e[8]=u,e[9]=c,e[10]=p):p=e[10],p}function qe(t){const e=R.c(14),{onClick:s,label:o,icon:r,colorClass:i,maxWidthClass:a}=t;let l;e[0]!==i?(l=z("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",i),e[0]=i,e[1]=l):l=e[1];let V;e[2]!==a?(V=z("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",a),e[2]=a,e[3]=V):V=e[3];let d;e[4]!==o||e[5]!==V?(d=n.jsx("span",{className:V,children:o}),e[4]=o,e[5]=V,e[6]=d):d=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(lt,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=u):u=e[7];let c;return e[8]!==r||e[9]!==o||e[10]!==s||e[11]!==l||e[12]!==d?(c=n.jsxs("button",{type:"button",onClick:s,title:o,"aria-label":o,className:l,children:[r,d,u]}),e[8]=r,e[9]=o,e[10]=s,e[11]=l,e[12]=d,e[13]=c):c=e[13],c}function ta(){const t=R.c(6),e=rt(),{org:s,locator:o}=Ce(),{create:r}=On();let i;return t[0]!==r||t[1]!==o||t[2]!==e||t[3]!==s.id||t[4]!==s.slug?(i=async a=>{const{tiptapDoc:l,virtualMcp:V,taskIntake:d}=a,u=d===void 0?!1:d,c=crypto.randomUUID(),p=V?.id??tt(s.id).id;dn(sessionStorage,o,c,{tiptapDoc:u&&l?Vr(l):l});try{await r({id:c,virtual_mcp_id:p})}catch{}const f={autosend:un};u&&(f.sidepanel=!0,f.mainpanel=!1),Js(e,Zs({org:s.slug,agentId:p,superAgentId:tt(s.id).id}),{search:()=>({...f,thread:c}),replace:!1})},t[0]=r,t[1]=o,t[2]=e,t[3]=s.id,t[4]=s.slug,t[5]=i):i=t[5],i}function gl({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:s=!1}){const o=B(),r=Rn(),i=Vt(),a=r?.messages??[],l=r?.isStreaming??!1,V=r?.isRunInProgress??!1,d=r?.stop??(()=>{}),u=i?.taskId??"",c=u||gn,p=ta(),{selectedModel:f,selectedVirtualMcp:m,isModelsLoading:h,tiptapDocRef:g,imageModel:x,webSearchModel:v,deepResearchModel:b,chatMode:j,setChatMode:A}=Ge(),{data:k}=Ys.useSession(),w=k?.user?.id,{org:y,locator:C}=Ce(),[S,I]=Gs(Hs.homeTaskMode(C),!0),N=s&&S,M=tt(y.id).id,E=cn(m?.id),D=xn(E?.id).runtime==="cms",L=ys(Uo),[_,U]=P.useState(!1),{unsupportedFile:F,onUnsupportedFile:q,clearUnsupportedFile:$}=Co(),O=_i(),W=P.useRef(void 0),X=async()=>{W.current=ie;const K=await O.startRecording();ee("chat_voice_started",{thread_id:u,outcome:K==="recording"?"started":K==="unsupported"?"unsupported":K==="permission-denied"?"permission_denied":"unknown"})},te=()=>{ee("chat_voice_confirmed",{thread_id:u});const K=O.stopRecording();Ve.current?.syncVoiceText(W.current,K),Ve.current?.focus()},J=()=>{ee("chat_voice_cancelled",{thread_id:u}),O.cancelRecording(),Ve.current?.restoreContent(W.current)};P.useEffect(()=>{if(O.status!=="recording")return;const K=(O.transcript+(O.interimTranscript?" "+O.interimTranscript:"")).trim();Ve.current?.syncVoiceText(W.current,K)},[O.transcript,O.interimTranscript,O.status]);const ae=i?.activeTask??null,T=ae?.created_by,Q=!!(w&&T&&T!==w),{data:Z}=Oo({enabled:Q}),H=(Z?.data?.members??[]).find(K=>K.userId===T),ne=H?.user?.name??H?.user?.email?.split("@")[0]??null,G=Ko(),ce=En({isDesktopApp:G,harnessId:ae?.harness_id}),[ie,fe]=P.useState(()=>yt(sessionStorage,C,c)??void 0),le=K=>{fe(K),g.current=K,mn(sessionStorage,C,c,K,{onQuotaExceeded:({docSizeBytes:me})=>{ee("chat_draft_quota_exceeded",{thread_id:u||null,doc_size_bytes:me}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},$e=P.useRef(u);if($e.current!==u){$e.current=u;const K=yt(sessionStorage,C,c)??void 0;fe(K),g.current=K}const Ne=[...a].reverse().find(K=>K.role==="assistant")?.metadata?.modelLimits?.contextWindow??f?.limits?.contextWindow,Ve=P.useRef(null),he=P.useRef(!1),ge=j==="plan",de=K=>{L(),ee("chat_mode_changed",{from_mode:K,to_mode:"default",source:"pill_dismiss"}),A("default")};P.useEffect(()=>{const K=me=>{Vn(me)&&me.code==="KeyL"&&(me.preventDefault(),me.shiftKey&&A(j==="plan"?"default":"plan"),Ve.current?.focus())};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[j,A]);const xe=Pn(a),Ie=[...a].reverse().find(K=>K.role==="assistant"&&K.metadata?.usage)?.metadata?.usage?.contextTokens??0,_e=Oe("chat"),Me=io(),[ve,ke]=P.useState(!1),[oe,ue]=P.useState(!1),Be=!h&&!fn(ie),be=Gi({hasDraft:Be,isStreaming:l,isRunInProgress:V}),Xe=be==="send",Te=be==="stop",mt=K=>{if(K?.preventDefault(),!_e){ke(!0);return}if(Me){ue(!0);return}if(be==="send"&&ie){if(ee("chat_message_sent",{thread_id:u||null,mode:j,model_id:f?.modelId??null,model_provider:f?.providerId??null,virtual_mcp_id:m?.id??null,submission:K?"button_or_enter":"programmatic"}),r){if(r.isSendInFlight()){Ee.info(o("chat.input.stillSendingPreviousMessage"));return}r.sendMessage(ie)}else N&&ee("task_report_submitted",{source:"home"}),p({tiptapDoc:ie,virtualMcp:N?null:m,taskIntake:N});hn(sessionStorage,C,c),le(void 0)}else be==="stop"&&(ee("chat_message_stopped",{thread_id:u}),d())};if(Q)return n.jsx(Ke,{message:ne?o("chat.input.readOnlyOthersChatNamed",{name:ne}):o("chat.input.readOnlyOthersChat"),icon:ne?n.jsx(Fo,{shape:"circle",size:"2xs",url:H?.user?.image??void 0,fallback:ne.slice(0,2).toUpperCase()}):void 0});if(ae?.metadata?.read_only)return n.jsx(Ke,{message:o("chat.input.readOnlyThread")});if(ce)return n.jsx(Ke,{message:o("chat.input.codingAgentRequiresDesktop")});if(D){if(!i)return n.jsx(Ke,{message:o("chat.input.fastPreviewUnavailable")});const K=()=>{const me=i.createTask({runtime:"sandbox"});ee("coding_session_started",{thread_id:me})};return n.jsxs("button",{type:"button",onClick:K,className:"group flex w-full items-center gap-3 rounded-2xl border border-border bg-background/60 px-4 py-3.5 text-left shadow-sm backdrop-blur-sm transition-colors hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[n.jsx(yn,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:o("chat.fastPreview.startCodingSession")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.fastPreview.chatNeedsSession")})]}),n.jsx($t,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return n.jsxs(n.Fragment,{children:[ve&&n.jsx(St,{feature:"chat",onDismiss:()=>ke(!1)}),oe&&n.jsx(St,{feature:"chat",copy:{title:o("chat.input.allowanceExhaustedTitle")},onDismiss:()=>ue(!1)}),n.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:n.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&n.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),r&&i&&n.jsx(ze,{}),r&&i&&u?n.jsx(bs,{taskId:u}):null,n.jsx(No,{tiptapDoc:ie,setTiptapDoc:le,disabled:O.status==="recording",enterToSubmit:!0,placeholder:o(N?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:mt,suggestionOpenRef:he,children:n.jsxs("form",{onSubmit:mt,className:z("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[n.jsx(ea,{selectedModel:f,onUnsupportedFile:q,disabled:O.status==="recording"}),n.jsx(cr,{}),n.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:n.jsx(Io,{ref:Ve,disabled:O.status==="recording",virtualMcpId:m?.id??M,showFileUploader:!0,selectedModel:f,onUnsupportedFile:q,suggestionOpenRef:he})}),n.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:O.status==="recording"?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[n.jsx(Ei,{data:O.waveformData.slice(0,28)}),n.jsx("button",{type:"button",onClick:J,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":o("chat.input.cancelRecording"),children:n.jsx(lt,{size:16})}),n.jsx("button",{type:"button",onClick:te,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":o("chat.input.useTranscription"),children:n.jsx(it,{size:16})})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s&&n.jsx(Y,{type:"button",size:"sm",variant:S?"secondary":"ghost","aria-pressed":S,onClick:()=>I(!S),className:"h-8",children:o("chat.input.taskMode")}),n.jsx(Si,{disabled:!1,onOpenConnections:()=>{ee("connections_dialog_opened",{source:"tools_popover",mode:"add"}),U(!0)},virtualMcpId:m?.id??M,selectedModel:f,isStreaming:l,onUnsupportedFile:q}),ge&&n.jsx(qe,{onClick:()=>de("plan"),label:o("chat.input.planMode"),icon:n.jsx(Kt,{size:14,className:"shrink-0"}),colorClass:"text-violet-600 dark:text-violet-400 hover:bg-violet-500/10",maxWidthClass:"@[320px]/chat-bottom:max-w-32"}),j==="gen-image"&&x&&n.jsx(qe,{onClick:()=>de("gen-image"),label:o("chat.input.createImage"),icon:n.jsx(Gt,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),j==="web-search"&&v&&n.jsx(qe,{onClick:()=>de("web-search"),label:o("chat.input.webSearch"),icon:n.jsx(Wt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),j==="deep-research"&&b&&n.jsx(qe,{onClick:()=>de("deep-research"),label:o("chat.input.deepResearch"),icon:n.jsx(Yt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),Ne&&Ie>0&&n.jsx(Hn,{usage:xe,totalTokens:Ie,contextWindow:Ne,onOpenContextPanel:t})]}),n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n.jsx(bi,{}),n.jsx(Wi,{}),O.isSupported&&n.jsx(Y,{type:"button",onClick:X,disabled:!1,variant:"ghost",size:"icon",className:z("size-8 transition-colors",O.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:O.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),"aria-label":O.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),children:n.jsx(kn,{size:18})}),n.jsx(Y,{type:Te?"button":"submit",onClick:K=>{Te&&(K.preventDefault(),K.stopPropagation(),d())},variant:Xe||Te?"default":"ghost",size:N?"sm":"icon",disabled:!Xe&&!Te,className:z(N?"h-8 px-3 transition-all":"size-8 transition-all",!Xe&&!Te&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:o(be==="stop"?l?"chat.input.stopGenerating":"chat.input.cancelRun":N?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":o(be==="stop"?l?"chat.input.stopGenerating":"chat.input.cancelRun":N?"chat.input.startTask":"chat.input.sendMessage"),children:Te?n.jsx(jn,{size:20}):n.jsxs(n.Fragment,{children:[N&&o("chat.input.startTask"),n.jsx(Bt,{size:20})]})})]})]})})]})},u),s&&N&&n.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:o("chat.input.taskHint")}),e&&n.jsx(Ti,{onClick:()=>{ee("connections_banner_clicked",{source:"home_chat_input"}),ee("connections_dialog_opened",{source:"home_banner",mode:"add"}),U(!0)}})]})}),n.jsx(zo,{mode:"browse",open:_,onOpenChange:U,defaultTab:"all"}),n.jsx(To,{info:F,onClose:$})]})}export{hl as C,dl as H,Gr as T,ml as V,fl as a,gl as b,Jr as c,ul as d,Pe as e,pl as f,ws as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as H,r as C,b as G,j as h,t as N,Z as xe,B as ke,o as de,X as ue,K as Z,q as $,es as me,c$ as oe,et as z,l as we}from"./index-CmfXJaKn.js";import{S as fe,s as be}from"./suggestion-BoHqZ2zm.js";import{f as Pe,h as _e,j as Ce,i as B,k as Se,P as ie,l as Fe,c as Ie,u as De,n as je,d as ve,e as Me,F as Re,s as Le,b as Ae}from"./index-D-j5tLoV.js";import{d as Ee,h as Ne,c as Te,b as Qe,D as $e}from"./dialog-DfdkHhmb.js";import{aX as Oe}from"./agent-icon-zpWPhOfj.js";import"./chat-context-Bx9MVwv5.js";import{m as Ue,i as qe,a as Ke}from"./decopilot-BVdjTDzA.js";import{u as pe}from"./use-mcp-client-Bm7mYuOR.js";import{b as ze}from"./repository-binding-DLsaqYxe.js";import{g as Be}from"./use-project-scope-BhC0oTXz.js";import{g as ne,s as he}from"./gateway-client-DIx8y90K.js";import{l as ae,g as ge}from"./use-mcp-prompts-CSphD1Ew.js";import{f as He,a as Je}from"./use-org-fs-D7r3cXXb.js";async function Xe(t,e,n,s,i,o){if(!Ue(e)){N.error("Selected model does not support file uploads");return}const c=n.type||"application/octet-stream";if(!qe(c,e)){const p=Ke(e).parts.map(x=>o(x)).join(", "),w=e?.title??"This model";i?i({fileName:n.name,modelName:w,accepted:p}):N.error(`"${n.name}" can't be attached`,{description:`${w} accepts ${p}.`});return}const d=10*1024*1024;if(n.size>d){N.error(`File "${n.name}" exceeds 10MB limit`);return}try{const p=new FileReader,w=new Promise((r,u)=>{p.onload=()=>{const a=p.result;if(typeof a!="string"){u(new Error("Failed to read file as data URL"));return}const k=a.includes(",")?a.split(",")[1]??a:a;r(k)},p.onerror=u});p.readAsDataURL(n);const x=await w,f={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:x};Pe(t,{from:s,to:s},f)}catch(p){console.error("Failed to process file:",p),N.error(`Failed to load file "${n.name}"`)}}function Ve(t){const e=H.c(9),{editor:n,selectedModel:s,onUnsupportedFile:i}=t,o=G(),c=C.useRef(Ye);let d,p;e[0]!==n||e[1]!==i||e[2]!==s||e[3]!==o?(d=()=>{c.current=async(f,r)=>{await Xe(n,s,f,r,i,o)}},p=[n,s,i,o],e[0]=n,e[1]=i,e[2]=s,e[3]=o,e[4]=d,e[5]=p):(d=e[4],p=e[5]),C.useEffect(d,p);let w,x;return e[6]!==n?(w=()=>{if(n?.isDestroyed)return;const f=new _e("fileDropHandler");n.state.plugins.find(a=>a.spec.key===f)&&n.unregisterPlugin(f);const u=new Ce({key:f,props:{handleDrop:(a,k,F,S)=>{if(S)return!1;const b=k.dataTransfer?.files;if(!b||b.length===0)return!1;k.preventDefault();const j=a.posAtCoords({left:k.clientX,top:k.clientY});if(!j)return!1;const I=Array.from(b);return(async()=>{let M=j.pos;for(const D of I)await c.current?.(D,M),M=a.state.selection.to})(),!0},handlePaste:(a,k)=>{const F=k.clipboardData?.items;if(!F)return!1;const S=Array.from(F).filter(We);return S.length===0?!1:(k.preventDefault(),(async()=>{let b=a.state.selection.from;for(const j of S){const I=j.getAsFile();I&&(await c.current?.(I,b),b=a.state.selection.to)}})(),!0)}}});return n.registerPlugin(u),()=>{n?.isDestroyed||n.unregisterPlugin(f)}},x=[n],e[6]=n,e[7]=w,e[8]=x):(w=e[7],x=e[8]),C.useEffect(w,x),null}function We(t){return t.kind==="file"}function Ye(){return Promise.resolve()}function Ct(t){const e=H.c(43),{info:n,onClose:s}=t,i=G(),o=n!==null;let c;e[0]!==s?(c=v=>!v&&s(),e[0]=s,e[1]=c):c=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=d):d=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:d.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=p):p=e[3];let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:h.jsx(xe,{size:18})}),e[4]=w):w=e[4];let x;e[5]!==i?(x=i("chat.uploader.fileTypeNotSupported"),e[5]=i,e[6]=x):x=e[6];let f;e[7]!==x?(f=h.jsx(Ee,{className:"text-xl font-semibold tracking-tight",children:x}),e[7]=x,e[8]=f):f=e[8];const r=n?.fileName;let u;e[9]!==r?(u=h.jsxs("span",{className:"font-medium text-foreground",children:["“",r,"”"]}),e[9]=r,e[10]=u):u=e[10];let a;e[11]!==i?(a=i("chat.uploader.cantAttachToChat"),e[11]=i,e[12]=a):a=e[12];let k;e[13]!==a||e[14]!==u?(k=h.jsxs(Ne,{className:"mt-1.5 text-sm leading-relaxed",children:[u," ",a]}),e[13]=a,e[14]=u,e[15]=k):k=e[15];let F;e[16]!==k||e[17]!==f?(F=h.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,h.jsxs(Te,{className:"relative gap-4",children:[w,h.jsxs("div",{children:[f,k]})]})]}),e[16]=k,e[17]=f,e[18]=F):F=e[18];const S=n?.modelName??"";let b;e[19]!==i||e[20]!==S?(b=i("chat.uploader.accepts",{modelName:S}),e[19]=i,e[20]=S,e[21]=b):b=e[21];let j;e[22]!==b?(j=h.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:b}),e[22]=b,e[23]=j):j=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=h.jsx(Oe,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const M=n?.accepted;let D;e[25]!==M?(D=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,h.jsx("span",{className:"capitalize",children:M})]}),e[25]=M,e[26]=D):D=e[26];let l;e[27]!==j||e[28]!==D?(l=h.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:h.jsxs("div",{className:"rounded-xl border border-border p-4",children:[j,D]})}),e[27]=j,e[28]=D,e[29]=l):l=e[29];let m;e[30]!==i?(m=i("chat.uploader.gotIt"),e[30]=i,e[31]=m):m=e[31];let y;e[32]!==s||e[33]!==m?(y=h.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:h.jsx(ke,{onClick:s,children:m})}),e[32]=s,e[33]=m,e[34]=y):y=e[34];let _;e[35]!==F||e[36]!==l||e[37]!==y?(_=h.jsxs(Qe,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ze,children:[F,l,y]}),e[35]=F,e[36]=l,e[37]=y,e[38]=_):_=e[38];let R;return e[39]!==o||e[40]!==c||e[41]!==_?(R=h.jsx($e,{open:o,onOpenChange:c,children:_}),e[39]=o,e[40]=c,e[41]=_,e[42]=R):R=e[42],R}function Ze(t){return t.preventDefault()}function St(){const t=H.c(3),[e,n]=C.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>n(null),t[0]=s):s=t[0];let i;return t[1]!==e?(i={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:s},t[1]=e,t[2]=i):i=t[2],i}const Ge=t=>{const e=H.c(53),{editor:n,virtualMcpId:s,suggestionOpenRef:i}=t,o=G(),c=de(),{org:d}=ue(),p=ze();let w;e[0]!==p?(w=Be(p),e[0]=p,e[1]=w):w=e[1];const x=w;let f;e[2]!==d.id||e[3]!==d.slug||e[4]!==s?(f={connectionId:s,orgId:d.id,orgSlug:d.slug},e[2]=d.id,e[3]=d.slug,e[4]=s,e[5]=f):f=e[5];const r=pe(f);let u;e[6]!==d.id||e[7]!==s?(u=Z.virtualMcpResources(s,d.id),e[6]=d.id,e[7]=s,e[8]=u):u=e[8];const a=u,[k,F]=C.useState("categories");let S;e[9]!==k?(S=()=>k,e[9]=k,e[10]=S):S=e[10];const b=C.useEffectEvent(S),j=C.useRef(null),I=C.useRef(!1),M=s??"default";let D;e[11]!==k||e[12]!==d.id||e[13]!==M?(D=["at-mention",d.id,M,k],e[11]=k,e[12]=d.id,e[13]=M,e[14]=D):D=e[14];const l=D;let m;e[15]!==o?(m=o("chat.mentionAt.agentsTitle"),e[15]=o,e[16]=m):m=e[16];let y;e[17]!==o?(y=o("chat.mentionAt.agentsDescription"),e[17]=o,e[18]=y):y=e[18];let _;e[19]!==m||e[20]!==y?(_={name:"agents",title:m,description:y,kind:"category",drillable:!0},e[19]=m,e[20]=y,e[21]=_):_=e[21];let R;e[22]!==o?(R=o("chat.mentionAt.resourcesTitle"),e[22]=o,e[23]=R):R=e[23];let v;e[24]!==o?(v=o("chat.mentionAt.resourcesDescription"),e[24]=o,e[25]=v):v=e[25];let T;e[26]!==R||e[27]!==v?(T={name:"resources",title:R,description:v,kind:"category",drillable:!0},e[26]=R,e[27]=v,e[28]=T):T=e[28];let O;e[29]!==T||e[30]!==_?(O=[_,T],e[29]=T,e[30]=_,e[31]=O):O=e[31];const q=O;let g;e[32]!==r||e[33]!==n||e[34]!==o?(g=async U=>{const{item:P,range:K}=U;if($("chat_picker_item_selected",{picker:"@",item_kind:P.kind,item_name:P.name}),P.kind!=="category"&&(I.current=!0),P.kind==="category")return F(P.name==="agents"?"agents":"resources"),!1;if(P.kind==="agent"&&P.agentId){B(n,K,{id:P.agentId,name:P.name,metadata:{agentId:P.agentId,title:P.name},char:"@"}),F("categories");return}if(P.kind==="resource"&&P.uri&&r){try{const Q=await me(r,P.uri);B(n,K,{id:P.uri,name:P.uri,metadata:Q.contents,char:"@"})}catch(Q){console.error("[at-mention] Failed to fetch resource:",Q),N.error(o("chat.mentionAt.failedToLoadResource"))}F("categories");return}},e[32]=r,e[33]=n,e[34]=o,e[35]=g):g=e[35];const ee=g;let J;e[36]!==p||e[37]!==q||e[38]!==r||e[39]!==x||e[40]!==b||e[41]!==c||e[42]!==a||e[43]!==s?(J=async U=>{const{query:P}=U,K=b();if(K==="categories"){if(!P.trim())return q;const A=P.toLowerCase(),L=p.filter(E=>E.status==="active"&&(!E.id||!oe(E.id))&&!x.has(E.id)&&E.id!==s&&(E.title.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A))).map(et),Y=await(async()=>{if(!r)return[];let E=c.getQueryData(a);return E||(E=await c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4})),(E?.resources??[]).filter(re=>re.uri.toLowerCase().includes(A)||re.name?.toLowerCase().includes(A)||re.description?.toLowerCase().includes(A)).map(tt)})();return[...L,...Y]}if(K==="agents"){let A=p.filter(L=>L.status==="active"&&(!L.id||!oe(L.id))&&!x.has(L.id)&&L.id!==s);if(P.trim()){const L=P.toLowerCase();A=A.filter(Y=>Y.title.toLowerCase().includes(L)||Y.description?.toLowerCase().includes(L))}return A.map(st)}if(!r)return[];let Q=c.getQueryData(a);Q?c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4}).catch(rt):Q=await c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4});let W=Q?.resources??[];if(P.trim()){const A=P.toLowerCase();W=W.filter(L=>L.uri.toLowerCase().includes(A)||L.name?.toLowerCase().includes(A)||L.description?.toLowerCase().includes(A))}return W.map(nt)},e[36]=p,e[37]=q,e[38]=r,e[39]=x,e[40]=b,e[41]=c,e[42]=a,e[43]=s,e[44]=J):J=e[44];const te=J;let X;e[45]!==i?(X=U=>{if(i&&(i.current=U),U)j.current=Date.now(),I.current=!1,$("chat_picker_opened",{picker:"@"});else{const P=j.current;$("chat_picker_closed",{picker:"@",outcome:I.current?"selected":"dismissed",duration_ms:P?Date.now()-P:null}),j.current=null,F("categories")}},e[45]=i,e[46]=X):X=e[46];const se=X;let V;return e[47]!==n||e[48]!==te||e[49]!==ee||e[50]!==se||e[51]!==l?(V=h.jsx(fe,{editor:n,char:"@",pluginKey:"atDropdownMenu",queryKey:l,queryFn:te,onSelect:ee,onOpenChange:se}),e[47]=n,e[48]=te,e[49]=ee,e[50]=se,e[51]=l,e[52]=V):V=e[52],V};function et(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function tt(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}function st(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function rt(){}function nt(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function le(t,e,n,s,i,o,c){try{const d=await ge(n,s,o);B(t,e,{id:s,name:he(s,i),metadata:d.messages,char:"/",kind:"prompt",args:o})}catch(d){console.error("[slash] Failed to fetch prompt:",d),N.error(c.t("chat.mentionSlash.failedLoadPrompt"))}}async function ot(t,e,n,s,i){try{const o=await me(n,s);B(t,e,{id:s,name:s,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),N.error(i.t("chat.mentionSlash.failedLoadResource"))}}async function it(t,e,n,s,i){try{const{files:o,omittedPaths:c}=await He(n,s.volume,s.path),d={sandboxPath:s.sandboxPath,volume:s.volume,path:s.path,files:o,omittedPaths:c};B(t,e,{id:s.id,name:s.name,metadata:d,char:"/",kind:"skill"})}catch(o){console.error("[slash] Failed to fetch skill:",o),N.error(i.t("chat.mentionSlash.failedLoadSkill"))}}const at=({editor:t,virtualMcpId:e,suggestionOpenRef:n})=>{const s=G(),i=de(),{org:o}=ue(),c=pe({connectionId:e,orgId:o.id,orgSlug:o.slug}),d=Z.virtualMcpPrompts(e,o.id),p=Z.virtualMcpResources(e,o.id),w=Z.slashSkills(o.id),x=["slash-mention",o.id,e??"default"],[f,r]=C.useState(null),[u,a]=C.useState(null),k=Se(t);k&&(k.onEditChip=async l=>{if(c)try{const y=(await ce(i,d,c)).find(_=>_.name===l.promptId);if(!y?.arguments||y.arguments.length===0)return;a({...l,prompt:y})}catch(m){console.error("[slash] Failed to load prompt for editing:",m),N.error(s("chat.mentionSlash.failedLoadPrompt"))}});const F=C.useRef(null),S=C.useRef(!1),b=async({item:l,range:m})=>{if($("chat_picker_item_selected",{picker:"/",item_kind:l.kind,item_name:l.name}),S.current=!0,!!c)if(l.kind==="prompt"){if(l.arguments&&l.arguments.length>0){r({range:m,item:l});return}const y=ne(l._meta);await le(t,m,c,l.name,y,void 0,{t:s})}else l.kind==="skill"?l.skill&&await it(t,m,o.slug,l.skill,{t:s}):l.uri&&await ot(t,m,c,l.uri,{t:s})},j=async l=>{if(!f||!c)return;const{range:m,item:y}=f,_=ne(y._meta);await le(t,m,c,y.name,_,l,{t:s}),r(null)},I=async l=>{if(!(!u||!c)){if(!Fe(t,u.pos,u.promptId)){N.error(s("chat.mentionSlash.failedUpdatePrompt")),a(null);return}try{const m=await ge(c,u.promptId,l),y=ne(u.prompt._meta);t.chain().focus().setNodeSelection(u.pos).deleteSelection().insertContentAt(u.pos,Ie({id:u.promptId,name:he(u.promptId,y),metadata:m.messages,char:"/",kind:"prompt",args:l})).run(),$("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:u.promptId})}catch(m){console.error("[slash] Failed to update prompt:",m),N.error(s("chat.mentionSlash.failedUpdatePrompt"))}a(null)}},M=async l=>{const{query:m}=l;if(!c)return[];const[y,_,R]=await Promise.all([ce(i,d,c),ct(i,p,c),lt(i,w,o.slug)]),v=m.trim().toLowerCase(),T=(y??[]).filter(g=>!v||g.name.toLowerCase().includes(v)||g.title?.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name,title:g.title,description:g.description,kind:"prompt",arguments:g.arguments,_meta:g._meta})),O=(_??[]).filter(g=>!v||g.uri.toLowerCase().includes(v)||g.name?.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name??g.uri,title:g.name,description:g.description,kind:"resource",uri:g.uri})),q=(R??[]).filter(g=>!v||g.name.toLowerCase().includes(v)||g.id.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name,title:g.name,description:g.description??void 0,kind:"skill",skill:g}));return[...T,...O,...q]},D=f?.item.kind==="prompt"?{name:f.item.name,title:f.item.title,arguments:f.item.arguments,description:f.item.description,_meta:f.item._meta}:null;return h.jsxs(h.Fragment,{children:[h.jsx(fe,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:x,queryFn:M,onSelect:b,onOpenChange:l=>{if(n&&(n.current=l),l)F.current=Date.now(),S.current=!1,$("chat_picker_opened",{picker:"/"});else{const m=F.current;$("chat_picker_closed",{picker:"/",outcome:S.current?"selected":"dismissed",duration_ms:m?Date.now()-m:null}),F.current=null}}}),h.jsx(ie,{prompt:D,setPrompt:()=>r(null),onSubmit:j}),h.jsx(ie,{prompt:u?.prompt??null,setPrompt:()=>a(null),onSubmit:I,defaultValues:u?.args},u?`edit-${u.promptId}-${u.pos}`:"edit-idle")]})};async function ce(t,e,n){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>ae(n),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>ae(n),staleTime:6e4}).catch(()=>{}),s?.prompts??[]}async function lt(t,e,n){const s=t.getQueryData(e),i=()=>t.fetchQuery({queryKey:e,queryFn:()=>Je(n),staleTime:6e4});return s?(i().catch(()=>{}),s):i().catch(()=>[])}async function ct(t,e,n){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>z(n),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>z(n),staleTime:6e4}).catch(()=>{}),s?.resources??[]}const ye="Ask anything, / for prompts & skills, @ for agents & resources...";function dt(t){return[Le.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),be.configure({placeholder:()=>t.current??ye,showOnlyWhenEditable:!1}),Me,Re]}function Ft({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:s=!1,placeholder:i,onSubmit:o,suggestionOpenRef:c,children:d}){const p=C.useRef(o),w=C.useRef(e),x=C.useRef(s),f=C.useRef(i),r=De({extensions:dt(f),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":i??ye,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(u,a)=>a.key==="Enter"&&!a.shiftKey&&x.current&&!c?.current?(a.preventDefault(),p.current?.(),!0):!1},onUpdate:({editor:u})=>{w.current(u?.getJSON())}});return C.useEffect(()=>{r?.setEditable(!n)},[r,n]),C.useEffect(()=>{p.current=o},[o]),C.useEffect(()=>{w.current=e},[e]),C.useEffect(()=>{x.current=s},[s]),C.useEffect(()=>{f.current=i},[i]),C.useEffect(()=>{if(!r||r.isDestroyed)return;const u=JSON.stringify(r.getJSON()),a=JSON.stringify(t||{type:"doc",content:[]});u!==a&&r.commands.setContent(t||{type:"doc",content:[]})},[r,t]),h.jsx(je.Provider,{value:{editor:r},children:d})}function It(t){const e=H.c(29),{disabled:n,virtualMcpId:s,showFileUploader:i,selectedModel:o,onUnsupportedFile:c,suggestionOpenRef:d,ref:p,className:w}=t,x=n===void 0?!1:n,f=i===void 0?!1:i,{editor:r}=ve();let u,a;if(e[0]!==r?(u=()=>({focus:()=>{r?.commands.focus()},clear:()=>{r?.commands.clearContent(!0)},appendText:y=>{if(!r)return;const _=r.state.doc.textContent.trim()==="";r.commands.focus("end"),_||r.commands.insertContent(" "),r.commands.insertContent(y)},syncVoiceText:(y,_)=>{if(r&&(r.commands.setContent(y||{type:"doc",content:[]}),_)){r.commands.focus("end");const R=r.state.doc.textContent.trim().length>0;r.commands.insertContent({type:"text",text:R?" "+_:_})}},restoreContent:y=>{r&&r.commands.setContent(y||{type:"doc",content:[]})}}),a=[r],e[0]=r,e[1]=u,e[2]=a):(u=e[1],a=e[2]),C.useImperativeHandle(p??null,u,a),!r)return null;const k=x&&"cursor-not-allowed opacity-70",F=x&&"[&_.ProseMirror]:cursor-not-allowed";let S;e[3]!==w||e[4]!==k||e[5]!==F?(S=we("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",w,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0","[&_.ProseMirror_p.is-editor-empty:first-child::before]:w-full","[&_.ProseMirror_p.is-editor-empty:first-child::before]:break-words",k,F),e[3]=w,e[4]=k,e[5]=F,e[6]=S):S=e[6];let b;e[7]!==r||e[8]!==S?(b=h.jsx(Ae,{editor:r,className:S}),e[7]=r,e[8]=S,e[9]=b):b=e[9];const j=s??null;let I;e[10]!==r||e[11]!==d||e[12]!==j?(I=h.jsx(C.Suspense,{fallback:null,children:h.jsx(at,{editor:r,virtualMcpId:j,suggestionOpenRef:d})}),e[10]=r,e[11]=d,e[12]=j,e[13]=I):I=e[13];const M=s??null;let D;e[14]!==r||e[15]!==d||e[16]!==M?(D=h.jsx(C.Suspense,{fallback:null,children:h.jsx(Ge,{editor:r,virtualMcpId:M,suggestionOpenRef:d})}),e[14]=r,e[15]=d,e[16]=M,e[17]=D):D=e[17];let l;e[18]!==x||e[19]!==r||e[20]!==c||e[21]!==o||e[22]!==f?(l=f&&o&&!x?h.jsx(Ve,{editor:r,selectedModel:o,onUnsupportedFile:c}):null,e[18]=x,e[19]=r,e[20]=c,e[21]=o,e[22]=f,e[23]=l):l=e[23];let m;return e[24]!==I||e[25]!==D||e[26]!==l||e[27]!==b?(m=h.jsxs(h.Fragment,{children:[b,I,D,l]}),e[24]=I,e[25]=D,e[26]=l,e[27]=b,e[28]=m):m=e[28],m}export{Ft as T,Ct as U,It as a,Xe as p,St as u};
|
|
1
|
+
import{c as H,r as C,b as G,j as h,t as N,Z as xe,B as ke,o as de,X as ue,K as Z,q as $,es as me,c$ as oe,et as z,l as we}from"./index-CsKm2ubF.js";import{S as fe,s as be}from"./suggestion-CVmYJ2-l.js";import{f as Pe,h as _e,j as Ce,i as B,k as Se,P as ie,l as Fe,c as Ie,u as De,n as je,d as ve,e as Me,F as Re,s as Le,b as Ae}from"./index-CyAv4Ino.js";import{d as Ee,h as Ne,c as Te,b as Qe,D as $e}from"./dialog-D_5RxDc9.js";import{aX as Oe}from"./agent-icon-DGDGzDPg.js";import"./chat-context-DiXJfhIa.js";import{m as Ue,i as qe,a as Ke}from"./decopilot-RuTJJBbl.js";import{u as pe}from"./use-mcp-client-C7yhsDUq.js";import{b as ze}from"./repository-binding-ebck0c8n.js";import{g as Be}from"./use-project-scope-Bq9_CxnF.js";import{g as ne,s as he}from"./gateway-client-CZQ4II3C.js";import{l as ae,g as ge}from"./use-mcp-prompts-BZp7FUGA.js";import{f as He,a as Je}from"./use-org-fs-DuUomCai.js";async function Xe(t,e,n,s,i,o){if(!Ue(e)){N.error("Selected model does not support file uploads");return}const c=n.type||"application/octet-stream";if(!qe(c,e)){const p=Ke(e).parts.map(x=>o(x)).join(", "),w=e?.title??"This model";i?i({fileName:n.name,modelName:w,accepted:p}):N.error(`"${n.name}" can't be attached`,{description:`${w} accepts ${p}.`});return}const d=10*1024*1024;if(n.size>d){N.error(`File "${n.name}" exceeds 10MB limit`);return}try{const p=new FileReader,w=new Promise((r,u)=>{p.onload=()=>{const a=p.result;if(typeof a!="string"){u(new Error("Failed to read file as data URL"));return}const k=a.includes(",")?a.split(",")[1]??a:a;r(k)},p.onerror=u});p.readAsDataURL(n);const x=await w,f={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:x};Pe(t,{from:s,to:s},f)}catch(p){console.error("Failed to process file:",p),N.error(`Failed to load file "${n.name}"`)}}function Ve(t){const e=H.c(9),{editor:n,selectedModel:s,onUnsupportedFile:i}=t,o=G(),c=C.useRef(Ye);let d,p;e[0]!==n||e[1]!==i||e[2]!==s||e[3]!==o?(d=()=>{c.current=async(f,r)=>{await Xe(n,s,f,r,i,o)}},p=[n,s,i,o],e[0]=n,e[1]=i,e[2]=s,e[3]=o,e[4]=d,e[5]=p):(d=e[4],p=e[5]),C.useEffect(d,p);let w,x;return e[6]!==n?(w=()=>{if(n?.isDestroyed)return;const f=new _e("fileDropHandler");n.state.plugins.find(a=>a.spec.key===f)&&n.unregisterPlugin(f);const u=new Ce({key:f,props:{handleDrop:(a,k,F,S)=>{if(S)return!1;const b=k.dataTransfer?.files;if(!b||b.length===0)return!1;k.preventDefault();const j=a.posAtCoords({left:k.clientX,top:k.clientY});if(!j)return!1;const I=Array.from(b);return(async()=>{let M=j.pos;for(const D of I)await c.current?.(D,M),M=a.state.selection.to})(),!0},handlePaste:(a,k)=>{const F=k.clipboardData?.items;if(!F)return!1;const S=Array.from(F).filter(We);return S.length===0?!1:(k.preventDefault(),(async()=>{let b=a.state.selection.from;for(const j of S){const I=j.getAsFile();I&&(await c.current?.(I,b),b=a.state.selection.to)}})(),!0)}}});return n.registerPlugin(u),()=>{n?.isDestroyed||n.unregisterPlugin(f)}},x=[n],e[6]=n,e[7]=w,e[8]=x):(w=e[7],x=e[8]),C.useEffect(w,x),null}function We(t){return t.kind==="file"}function Ye(){return Promise.resolve()}function Ct(t){const e=H.c(43),{info:n,onClose:s}=t,i=G(),o=n!==null;let c;e[0]!==s?(c=v=>!v&&s(),e[0]=s,e[1]=c):c=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=d):d=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:d.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=p):p=e[3];let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:h.jsx(xe,{size:18})}),e[4]=w):w=e[4];let x;e[5]!==i?(x=i("chat.uploader.fileTypeNotSupported"),e[5]=i,e[6]=x):x=e[6];let f;e[7]!==x?(f=h.jsx(Ee,{className:"text-xl font-semibold tracking-tight",children:x}),e[7]=x,e[8]=f):f=e[8];const r=n?.fileName;let u;e[9]!==r?(u=h.jsxs("span",{className:"font-medium text-foreground",children:["“",r,"”"]}),e[9]=r,e[10]=u):u=e[10];let a;e[11]!==i?(a=i("chat.uploader.cantAttachToChat"),e[11]=i,e[12]=a):a=e[12];let k;e[13]!==a||e[14]!==u?(k=h.jsxs(Ne,{className:"mt-1.5 text-sm leading-relaxed",children:[u," ",a]}),e[13]=a,e[14]=u,e[15]=k):k=e[15];let F;e[16]!==k||e[17]!==f?(F=h.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,h.jsxs(Te,{className:"relative gap-4",children:[w,h.jsxs("div",{children:[f,k]})]})]}),e[16]=k,e[17]=f,e[18]=F):F=e[18];const S=n?.modelName??"";let b;e[19]!==i||e[20]!==S?(b=i("chat.uploader.accepts",{modelName:S}),e[19]=i,e[20]=S,e[21]=b):b=e[21];let j;e[22]!==b?(j=h.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:b}),e[22]=b,e[23]=j):j=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=h.jsx(Oe,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const M=n?.accepted;let D;e[25]!==M?(D=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,h.jsx("span",{className:"capitalize",children:M})]}),e[25]=M,e[26]=D):D=e[26];let l;e[27]!==j||e[28]!==D?(l=h.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:h.jsxs("div",{className:"rounded-xl border border-border p-4",children:[j,D]})}),e[27]=j,e[28]=D,e[29]=l):l=e[29];let m;e[30]!==i?(m=i("chat.uploader.gotIt"),e[30]=i,e[31]=m):m=e[31];let y;e[32]!==s||e[33]!==m?(y=h.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:h.jsx(ke,{onClick:s,children:m})}),e[32]=s,e[33]=m,e[34]=y):y=e[34];let _;e[35]!==F||e[36]!==l||e[37]!==y?(_=h.jsxs(Qe,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ze,children:[F,l,y]}),e[35]=F,e[36]=l,e[37]=y,e[38]=_):_=e[38];let R;return e[39]!==o||e[40]!==c||e[41]!==_?(R=h.jsx($e,{open:o,onOpenChange:c,children:_}),e[39]=o,e[40]=c,e[41]=_,e[42]=R):R=e[42],R}function Ze(t){return t.preventDefault()}function St(){const t=H.c(3),[e,n]=C.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>n(null),t[0]=s):s=t[0];let i;return t[1]!==e?(i={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:s},t[1]=e,t[2]=i):i=t[2],i}const Ge=t=>{const e=H.c(53),{editor:n,virtualMcpId:s,suggestionOpenRef:i}=t,o=G(),c=de(),{org:d}=ue(),p=ze();let w;e[0]!==p?(w=Be(p),e[0]=p,e[1]=w):w=e[1];const x=w;let f;e[2]!==d.id||e[3]!==d.slug||e[4]!==s?(f={connectionId:s,orgId:d.id,orgSlug:d.slug},e[2]=d.id,e[3]=d.slug,e[4]=s,e[5]=f):f=e[5];const r=pe(f);let u;e[6]!==d.id||e[7]!==s?(u=Z.virtualMcpResources(s,d.id),e[6]=d.id,e[7]=s,e[8]=u):u=e[8];const a=u,[k,F]=C.useState("categories");let S;e[9]!==k?(S=()=>k,e[9]=k,e[10]=S):S=e[10];const b=C.useEffectEvent(S),j=C.useRef(null),I=C.useRef(!1),M=s??"default";let D;e[11]!==k||e[12]!==d.id||e[13]!==M?(D=["at-mention",d.id,M,k],e[11]=k,e[12]=d.id,e[13]=M,e[14]=D):D=e[14];const l=D;let m;e[15]!==o?(m=o("chat.mentionAt.agentsTitle"),e[15]=o,e[16]=m):m=e[16];let y;e[17]!==o?(y=o("chat.mentionAt.agentsDescription"),e[17]=o,e[18]=y):y=e[18];let _;e[19]!==m||e[20]!==y?(_={name:"agents",title:m,description:y,kind:"category",drillable:!0},e[19]=m,e[20]=y,e[21]=_):_=e[21];let R;e[22]!==o?(R=o("chat.mentionAt.resourcesTitle"),e[22]=o,e[23]=R):R=e[23];let v;e[24]!==o?(v=o("chat.mentionAt.resourcesDescription"),e[24]=o,e[25]=v):v=e[25];let T;e[26]!==R||e[27]!==v?(T={name:"resources",title:R,description:v,kind:"category",drillable:!0},e[26]=R,e[27]=v,e[28]=T):T=e[28];let O;e[29]!==T||e[30]!==_?(O=[_,T],e[29]=T,e[30]=_,e[31]=O):O=e[31];const q=O;let g;e[32]!==r||e[33]!==n||e[34]!==o?(g=async U=>{const{item:P,range:K}=U;if($("chat_picker_item_selected",{picker:"@",item_kind:P.kind,item_name:P.name}),P.kind!=="category"&&(I.current=!0),P.kind==="category")return F(P.name==="agents"?"agents":"resources"),!1;if(P.kind==="agent"&&P.agentId){B(n,K,{id:P.agentId,name:P.name,metadata:{agentId:P.agentId,title:P.name},char:"@"}),F("categories");return}if(P.kind==="resource"&&P.uri&&r){try{const Q=await me(r,P.uri);B(n,K,{id:P.uri,name:P.uri,metadata:Q.contents,char:"@"})}catch(Q){console.error("[at-mention] Failed to fetch resource:",Q),N.error(o("chat.mentionAt.failedToLoadResource"))}F("categories");return}},e[32]=r,e[33]=n,e[34]=o,e[35]=g):g=e[35];const ee=g;let J;e[36]!==p||e[37]!==q||e[38]!==r||e[39]!==x||e[40]!==b||e[41]!==c||e[42]!==a||e[43]!==s?(J=async U=>{const{query:P}=U,K=b();if(K==="categories"){if(!P.trim())return q;const A=P.toLowerCase(),L=p.filter(E=>E.status==="active"&&(!E.id||!oe(E.id))&&!x.has(E.id)&&E.id!==s&&(E.title.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A))).map(et),Y=await(async()=>{if(!r)return[];let E=c.getQueryData(a);return E||(E=await c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4})),(E?.resources??[]).filter(re=>re.uri.toLowerCase().includes(A)||re.name?.toLowerCase().includes(A)||re.description?.toLowerCase().includes(A)).map(tt)})();return[...L,...Y]}if(K==="agents"){let A=p.filter(L=>L.status==="active"&&(!L.id||!oe(L.id))&&!x.has(L.id)&&L.id!==s);if(P.trim()){const L=P.toLowerCase();A=A.filter(Y=>Y.title.toLowerCase().includes(L)||Y.description?.toLowerCase().includes(L))}return A.map(st)}if(!r)return[];let Q=c.getQueryData(a);Q?c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4}).catch(rt):Q=await c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4});let W=Q?.resources??[];if(P.trim()){const A=P.toLowerCase();W=W.filter(L=>L.uri.toLowerCase().includes(A)||L.name?.toLowerCase().includes(A)||L.description?.toLowerCase().includes(A))}return W.map(nt)},e[36]=p,e[37]=q,e[38]=r,e[39]=x,e[40]=b,e[41]=c,e[42]=a,e[43]=s,e[44]=J):J=e[44];const te=J;let X;e[45]!==i?(X=U=>{if(i&&(i.current=U),U)j.current=Date.now(),I.current=!1,$("chat_picker_opened",{picker:"@"});else{const P=j.current;$("chat_picker_closed",{picker:"@",outcome:I.current?"selected":"dismissed",duration_ms:P?Date.now()-P:null}),j.current=null,F("categories")}},e[45]=i,e[46]=X):X=e[46];const se=X;let V;return e[47]!==n||e[48]!==te||e[49]!==ee||e[50]!==se||e[51]!==l?(V=h.jsx(fe,{editor:n,char:"@",pluginKey:"atDropdownMenu",queryKey:l,queryFn:te,onSelect:ee,onOpenChange:se}),e[47]=n,e[48]=te,e[49]=ee,e[50]=se,e[51]=l,e[52]=V):V=e[52],V};function et(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function tt(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}function st(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function rt(){}function nt(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function le(t,e,n,s,i,o,c){try{const d=await ge(n,s,o);B(t,e,{id:s,name:he(s,i),metadata:d.messages,char:"/",kind:"prompt",args:o})}catch(d){console.error("[slash] Failed to fetch prompt:",d),N.error(c.t("chat.mentionSlash.failedLoadPrompt"))}}async function ot(t,e,n,s,i){try{const o=await me(n,s);B(t,e,{id:s,name:s,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),N.error(i.t("chat.mentionSlash.failedLoadResource"))}}async function it(t,e,n,s,i){try{const{files:o,omittedPaths:c}=await He(n,s.volume,s.path),d={sandboxPath:s.sandboxPath,volume:s.volume,path:s.path,files:o,omittedPaths:c};B(t,e,{id:s.id,name:s.name,metadata:d,char:"/",kind:"skill"})}catch(o){console.error("[slash] Failed to fetch skill:",o),N.error(i.t("chat.mentionSlash.failedLoadSkill"))}}const at=({editor:t,virtualMcpId:e,suggestionOpenRef:n})=>{const s=G(),i=de(),{org:o}=ue(),c=pe({connectionId:e,orgId:o.id,orgSlug:o.slug}),d=Z.virtualMcpPrompts(e,o.id),p=Z.virtualMcpResources(e,o.id),w=Z.slashSkills(o.id),x=["slash-mention",o.id,e??"default"],[f,r]=C.useState(null),[u,a]=C.useState(null),k=Se(t);k&&(k.onEditChip=async l=>{if(c)try{const y=(await ce(i,d,c)).find(_=>_.name===l.promptId);if(!y?.arguments||y.arguments.length===0)return;a({...l,prompt:y})}catch(m){console.error("[slash] Failed to load prompt for editing:",m),N.error(s("chat.mentionSlash.failedLoadPrompt"))}});const F=C.useRef(null),S=C.useRef(!1),b=async({item:l,range:m})=>{if($("chat_picker_item_selected",{picker:"/",item_kind:l.kind,item_name:l.name}),S.current=!0,!!c)if(l.kind==="prompt"){if(l.arguments&&l.arguments.length>0){r({range:m,item:l});return}const y=ne(l._meta);await le(t,m,c,l.name,y,void 0,{t:s})}else l.kind==="skill"?l.skill&&await it(t,m,o.slug,l.skill,{t:s}):l.uri&&await ot(t,m,c,l.uri,{t:s})},j=async l=>{if(!f||!c)return;const{range:m,item:y}=f,_=ne(y._meta);await le(t,m,c,y.name,_,l,{t:s}),r(null)},I=async l=>{if(!(!u||!c)){if(!Fe(t,u.pos,u.promptId)){N.error(s("chat.mentionSlash.failedUpdatePrompt")),a(null);return}try{const m=await ge(c,u.promptId,l),y=ne(u.prompt._meta);t.chain().focus().setNodeSelection(u.pos).deleteSelection().insertContentAt(u.pos,Ie({id:u.promptId,name:he(u.promptId,y),metadata:m.messages,char:"/",kind:"prompt",args:l})).run(),$("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:u.promptId})}catch(m){console.error("[slash] Failed to update prompt:",m),N.error(s("chat.mentionSlash.failedUpdatePrompt"))}a(null)}},M=async l=>{const{query:m}=l;if(!c)return[];const[y,_,R]=await Promise.all([ce(i,d,c),ct(i,p,c),lt(i,w,o.slug)]),v=m.trim().toLowerCase(),T=(y??[]).filter(g=>!v||g.name.toLowerCase().includes(v)||g.title?.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name,title:g.title,description:g.description,kind:"prompt",arguments:g.arguments,_meta:g._meta})),O=(_??[]).filter(g=>!v||g.uri.toLowerCase().includes(v)||g.name?.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name??g.uri,title:g.name,description:g.description,kind:"resource",uri:g.uri})),q=(R??[]).filter(g=>!v||g.name.toLowerCase().includes(v)||g.id.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name,title:g.name,description:g.description??void 0,kind:"skill",skill:g}));return[...T,...O,...q]},D=f?.item.kind==="prompt"?{name:f.item.name,title:f.item.title,arguments:f.item.arguments,description:f.item.description,_meta:f.item._meta}:null;return h.jsxs(h.Fragment,{children:[h.jsx(fe,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:x,queryFn:M,onSelect:b,onOpenChange:l=>{if(n&&(n.current=l),l)F.current=Date.now(),S.current=!1,$("chat_picker_opened",{picker:"/"});else{const m=F.current;$("chat_picker_closed",{picker:"/",outcome:S.current?"selected":"dismissed",duration_ms:m?Date.now()-m:null}),F.current=null}}}),h.jsx(ie,{prompt:D,setPrompt:()=>r(null),onSubmit:j}),h.jsx(ie,{prompt:u?.prompt??null,setPrompt:()=>a(null),onSubmit:I,defaultValues:u?.args},u?`edit-${u.promptId}-${u.pos}`:"edit-idle")]})};async function ce(t,e,n){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>ae(n),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>ae(n),staleTime:6e4}).catch(()=>{}),s?.prompts??[]}async function lt(t,e,n){const s=t.getQueryData(e),i=()=>t.fetchQuery({queryKey:e,queryFn:()=>Je(n),staleTime:6e4});return s?(i().catch(()=>{}),s):i().catch(()=>[])}async function ct(t,e,n){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>z(n),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>z(n),staleTime:6e4}).catch(()=>{}),s?.resources??[]}const ye="Ask anything, / for prompts & skills, @ for agents & resources...";function dt(t){return[Le.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),be.configure({placeholder:()=>t.current??ye,showOnlyWhenEditable:!1}),Me,Re]}function Ft({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:s=!1,placeholder:i,onSubmit:o,suggestionOpenRef:c,children:d}){const p=C.useRef(o),w=C.useRef(e),x=C.useRef(s),f=C.useRef(i),r=De({extensions:dt(f),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":i??ye,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(u,a)=>a.key==="Enter"&&!a.shiftKey&&x.current&&!c?.current?(a.preventDefault(),p.current?.(),!0):!1},onUpdate:({editor:u})=>{w.current(u?.getJSON())}});return C.useEffect(()=>{r?.setEditable(!n)},[r,n]),C.useEffect(()=>{p.current=o},[o]),C.useEffect(()=>{w.current=e},[e]),C.useEffect(()=>{x.current=s},[s]),C.useEffect(()=>{f.current=i},[i]),C.useEffect(()=>{if(!r||r.isDestroyed)return;const u=JSON.stringify(r.getJSON()),a=JSON.stringify(t||{type:"doc",content:[]});u!==a&&r.commands.setContent(t||{type:"doc",content:[]})},[r,t]),h.jsx(je.Provider,{value:{editor:r},children:d})}function It(t){const e=H.c(29),{disabled:n,virtualMcpId:s,showFileUploader:i,selectedModel:o,onUnsupportedFile:c,suggestionOpenRef:d,ref:p,className:w}=t,x=n===void 0?!1:n,f=i===void 0?!1:i,{editor:r}=ve();let u,a;if(e[0]!==r?(u=()=>({focus:()=>{r?.commands.focus()},clear:()=>{r?.commands.clearContent(!0)},appendText:y=>{if(!r)return;const _=r.state.doc.textContent.trim()==="";r.commands.focus("end"),_||r.commands.insertContent(" "),r.commands.insertContent(y)},syncVoiceText:(y,_)=>{if(r&&(r.commands.setContent(y||{type:"doc",content:[]}),_)){r.commands.focus("end");const R=r.state.doc.textContent.trim().length>0;r.commands.insertContent({type:"text",text:R?" "+_:_})}},restoreContent:y=>{r&&r.commands.setContent(y||{type:"doc",content:[]})}}),a=[r],e[0]=r,e[1]=u,e[2]=a):(u=e[1],a=e[2]),C.useImperativeHandle(p??null,u,a),!r)return null;const k=x&&"cursor-not-allowed opacity-70",F=x&&"[&_.ProseMirror]:cursor-not-allowed";let S;e[3]!==w||e[4]!==k||e[5]!==F?(S=we("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",w,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0","[&_.ProseMirror_p.is-editor-empty:first-child::before]:w-full","[&_.ProseMirror_p.is-editor-empty:first-child::before]:break-words",k,F),e[3]=w,e[4]=k,e[5]=F,e[6]=S):S=e[6];let b;e[7]!==r||e[8]!==S?(b=h.jsx(Ae,{editor:r,className:S}),e[7]=r,e[8]=S,e[9]=b):b=e[9];const j=s??null;let I;e[10]!==r||e[11]!==d||e[12]!==j?(I=h.jsx(C.Suspense,{fallback:null,children:h.jsx(at,{editor:r,virtualMcpId:j,suggestionOpenRef:d})}),e[10]=r,e[11]=d,e[12]=j,e[13]=I):I=e[13];const M=s??null;let D;e[14]!==r||e[15]!==d||e[16]!==M?(D=h.jsx(C.Suspense,{fallback:null,children:h.jsx(Ge,{editor:r,virtualMcpId:M,suggestionOpenRef:d})}),e[14]=r,e[15]=d,e[16]=M,e[17]=D):D=e[17];let l;e[18]!==x||e[19]!==r||e[20]!==c||e[21]!==o||e[22]!==f?(l=f&&o&&!x?h.jsx(Ve,{editor:r,selectedModel:o,onUnsupportedFile:c}):null,e[18]=x,e[19]=r,e[20]=c,e[21]=o,e[22]=f,e[23]=l):l=e[23];let m;return e[24]!==I||e[25]!==D||e[26]!==l||e[27]!==b?(m=h.jsxs(h.Fragment,{children:[b,I,D,l]}),e[24]=I,e[25]=D,e[26]=l,e[27]=b,e[28]=m):m=e[28],m}export{Ft as T,Ct as U,It as a,Xe as p,St as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as h,r as C,l as L}from"./index-
|
|
1
|
+
import{c as k,j as h,r as C,l as L}from"./index-CsKm2ubF.js";import{n as Z}from"./LinkBroken01-CNbQoBrl.js";import{A as y}from"./agent-icon-DGDGzDPg.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as r,j as i,be as p}from"./index-
|
|
1
|
+
import{c as n,l as r,j as i,be as p}from"./index-CsKm2ubF.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as s,b as y,P as b,O as _,h as g,B as S,L as j,i as v,k as A,l as N}from"./index-
|
|
1
|
+
import{c as p,j as s,b as y,P as b,O as _,h as g,B as S,L as j,i as v,k as A,l as N}from"./index-CsKm2ubF.js";import{R}from"./required-auth-layout-D4fpdDYn.js";import{u as T}from"./use-deployment-admin-B2zM8cA7.js";const D=[{to:"/_admin/users",labelKey:"admin.layout.usersTab"},{to:"/_admin/orgs",labelKey:"admin.layout.organizationsTab"},{to:"/_admin/prompts",labelKey:"admin.layout.promptsTab"}];function K(){const e=p.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:L},e[0]=a):a=e[0];const d=A(a),r=y();let t;e[1]!==d||e[2]!==r?(t=D.map(o=>s.jsx(j,{to:o.to,className:N("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",d.startsWith(o.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r(o.labelKey)},o.to)),e[1]=d,e[2]=r,e[3]=t):t=e[3];let n;return e[4]!==t?(n=s.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:t}),e[4]=t,e[5]=n):n=e[5],n}function L(e){return e.location.pathname}function k(){const e=p.c(22),{isAdmin:a,loading:d,needsEmailVerification:r}=T(),t=y();if(d){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:s.jsx(g,{className:"size-5 text-muted-foreground"})}),e[0]=i):i=e[0],i}if(!a){let i;e[1]!==t?(i=t("admin.layout.adminDashboardArea"),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==r||e[4]!==t?(l=t(r?"admin.layout.emailVerificationRequired":"admin.layout.restrictedToDashboard"),e[3]=r,e[4]=t,e[5]=l):l=e[5];let m;e[6]!==t?(m=t("admin.layout.goHome"),e[6]=t,e[7]=m):m=e[7];let c;e[8]!==m?(c=s.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:s.jsx(j,{to:"/",children:m})}),e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==i||e[11]!==l||e[12]!==c?(h=s.jsx(v,{area:i,description:l,action:c}),e[10]=i,e[11]=l,e[12]=c,e[13]=h):h=e[13],h}let n;e[14]!==t?(n=t("admin.layout.adminDashboard"),e[14]=t,e[15]=n):n=e[15];let o;e[16]!==n?(o=s.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:s.jsx("h1",{className:"pb-4 text-xl font-medium",children:n})}),e[16]=n,e[17]=o):o=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{}),e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(b.Content,{children:s.jsx(_,{})}),e[19]=f):f=e[19];let x;return e[20]!==o?(x=s.jsxs(b,{variant:"plain",className:"h-dvh",children:[o,u,f]}),e[20]=o,e[21]=x):x=e[21],x}function P(){const e=p.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(R,{children:s.jsx(k,{})}),e[0]=a):a=e[0],a}export{P as default};
|
package/dist/client/assets/{legacy-agents-deep-BBL3IdDh.js → legacy-agents-deep-DMwbwAKI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,f as h,u as x,X as j,e6 as S,ay as b,ft as v,j as p,N as d}from"./index-
|
|
1
|
+
import{c as _,f as h,u as x,X as j,e6 as S,ay as b,ft as v,j as p,N as d}from"./index-CsKm2ubF.js";import{L}from"./legacy-main-redirect-BGY6ia4w.js";import"./thread-route-C5YO0tNH.js";function k(){const e=_.c(16);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const g=h(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const s=x(n),{org:t}=j(),f="_splat"in g&&typeof g._splat=="string"?g._splat:"";let c,a;if(e[2]!==t.id||e[3]!==t.slug||e[4]!==s||e[5]!==f){a=Symbol.for("react.early_return_sentinel");e:{const m=f.split("/").find(Boolean);if(!m){let r;e[8]!==t.slug?(r={org:t.slug},e[8]=t.slug,e[9]=r):r=e[9];let u;e[10]!==s||e[11]!==r?(u=p.jsx(d,{to:"/$org/projects",params:r,search:s,hash:!0,replace:!0}),e[10]=s,e[11]=r,e[12]=u):u=e[12],a=u;break e}const y=S({virtualMcpIdSearch:s.virtualmcpid,fallbackAgentId:b(t.id).id});c=v({org:t.slug,agentId:y,panel:m,source:"view-first",search:s})}e[2]=t.id,e[3]=t.slug,e[4]=s,e[5]=f,e[6]=c,e[7]=a}else c=e[6],a=e[7];if(a!==Symbol.for("react.early_return_sentinel"))return a;const l=c;let i;return e[13]!==t.slug||e[14]!==l?(i=l?.kind==="canonical"?p.jsx(L,{target:{route:l.route,search:l.search}}):p.jsx(d,{to:"/$org/home",params:{org:t.slug},replace:!0}),e[13]=t.slug,e[14]=l,e[15]=i):i=e[15],i}export{k as default};
|
package/dist/client/assets/{legacy-main-redirect-CfhJpa5K.js → legacy-main-redirect-BGY6ia4w.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,J as t,j as p,N as m,a6 as c,f as y,u as I,a4 as E,e6 as k,e7 as R,e8 as S,e9 as b}from"./index-
|
|
1
|
+
import{c as v,J as t,j as p,N as m,a6 as c,f as y,u as I,a4 as E,e6 as k,e7 as R,e8 as S,e9 as b}from"./index-CsKm2ubF.js";import{b as L}from"./thread-route-C5YO0tNH.js";function P(d){const a=v.c(78),{target:h}=d,{route:s,search:r}=h;switch(s.to){case c.home:{let e;return a[0]!==s.params||a[1]!==r?(e=p.jsx(m,{to:c.home,params:s.params,search:r,hash:!0,replace:!0}),a[0]=s.params,a[1]=r,a[2]=e):e=a[2],e}case c.tasks:{let e;return a[3]!==s.params||a[4]!==r?(e=p.jsx(m,{to:c.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[3]=s.params,a[4]=r,a[5]=e):e=a[5],e}case c.reports:{let e;return a[6]!==s.params||a[7]!==r?(e=p.jsx(m,{to:c.reports,params:s.params,search:r,hash:!0,replace:!0}),a[6]=s.params,a[7]=r,a[8]=e):e=a[8],e}case c.discover:{let e;return a[9]!==s.params||a[10]!==r?(e=p.jsx(m,{to:c.discover,params:s.params,search:r,hash:!0,replace:!0}),a[9]=s.params,a[10]=r,a[11]=e):e=a[11],e}case c.library:{let e;return a[12]!==s.params||a[13]!==r?(e=p.jsx(m,{to:c.library,params:s.params,search:r,hash:!0,replace:!0}),a[12]=s.params,a[13]=r,a[14]=e):e=a[14],e}case t.root:{let e;return a[15]!==s.params||a[16]!==r?(e=p.jsx(m,{to:t.root,params:s.params,search:r,hash:!0,replace:!0}),a[15]=s.params,a[16]=r,a[17]=e):e=a[17],e}case t.tasks:{let e;return a[18]!==s.params||a[19]!==r?(e=p.jsx(m,{to:t.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[18]=s.params,a[19]=r,a[20]=e):e=a[20],e}case t.reports:{let e;return a[21]!==s.params||a[22]!==r?(e=p.jsx(m,{to:t.reports,params:s.params,search:r,hash:!0,replace:!0}),a[21]=s.params,a[22]=r,a[23]=e):e=a[23],e}case t.siteEditor:{let e;return a[24]!==s.params||a[25]!==r?(e=p.jsx(m,{to:t.siteEditor,params:s.params,search:r,hash:!0,replace:!0}),a[24]=s.params,a[25]=r,a[26]=e):e=a[26],e}case t.siteEditorContent:{let e;return a[27]!==s.params||a[28]!==r?(e=p.jsx(m,{to:t.siteEditorContent,params:s.params,search:r,hash:!0,replace:!0}),a[27]=s.params,a[28]=r,a[29]=e):e=a[29],e}case t.siteEditorCode:{let e;return a[30]!==s.params||a[31]!==r?(e=p.jsx(m,{to:t.siteEditorCode,params:s.params,search:r,hash:!0,replace:!0}),a[30]=s.params,a[31]=r,a[32]=e):e=a[32],e}case t.settings:{let e;return a[33]!==s.params||a[34]!==r?(e=p.jsx(m,{to:t.settings,params:s.params,search:r,hash:!0,replace:!0}),a[33]=s.params,a[34]=r,a[35]=e):e=a[35],e}case t.assets:{let e;return a[36]!==s.params||a[37]!==r?(e=p.jsx(m,{to:t.assets,params:s.params,search:r,hash:!0,replace:!0}),a[36]=s.params,a[37]=r,a[38]=e):e=a[38],e}case t.hosting:{let e;return a[39]!==s.params||a[40]!==r?(e=p.jsx(m,{to:t.hosting,params:s.params,search:r,hash:!0,replace:!0}),a[39]=s.params,a[40]=r,a[41]=e):e=a[41],e}case t.e2e:{let e;return a[42]!==s.params||a[43]!==r?(e=p.jsx(m,{to:t.e2e,params:s.params,search:r,hash:!0,replace:!0}),a[42]=s.params,a[43]=r,a[44]=e):e=a[44],e}case t.analytics:{let e;return a[45]!==s.params||a[46]!==r?(e=p.jsx(m,{to:t.analytics,params:s.params,search:r,hash:!0,replace:!0}),a[45]=s.params,a[46]=r,a[47]=e):e=a[47],e}case t.experiments:{let e;return a[48]!==s.params||a[49]!==r?(e=p.jsx(m,{to:t.experiments,params:s.params,search:r,hash:!0,replace:!0}),a[48]=s.params,a[49]=r,a[50]=e):e=a[50],e}case t.monitor:{let e;return a[51]!==s.params||a[52]!==r?(e=p.jsx(m,{to:t.monitor,params:s.params,search:r,hash:!0,replace:!0}),a[51]=s.params,a[52]=r,a[53]=e):e=a[53],e}case t.automations:{let e;return a[54]!==s.params||a[55]!==r?(e=p.jsx(m,{to:t.automations,params:s.params,search:r,hash:!0,replace:!0}),a[54]=s.params,a[55]=r,a[56]=e):e=a[56],e}case t.automation:{let e;return a[57]!==s.params||a[58]!==r?(e=p.jsx(m,{to:t.automation,params:s.params,search:r,hash:!0,replace:!0}),a[57]=s.params,a[58]=r,a[59]=e):e=a[59],e}case t.app:{let e;return a[60]!==s.params||a[61]!==r?(e=p.jsx(m,{to:t.app,params:s.params,search:r,hash:!0,replace:!0}),a[60]=s.params,a[61]=r,a[62]=e):e=a[62],e}case t.view:{let e;return a[63]!==s.params||a[64]!==r?(e=p.jsx(m,{to:t.view,params:s.params,search:r,hash:!0,replace:!0}),a[63]=s.params,a[64]=r,a[65]=e):e=a[65],e}case t.outputFile:{let e;return a[66]!==s.params||a[67]!==r?(e=p.jsx(m,{to:t.outputFile,params:s.params,search:r,hash:!0,replace:!0}),a[66]=s.params,a[67]=r,a[68]=e):e=a[68],e}case t.outputDeck:{let e;return a[69]!==s.params||a[70]!==r?(e=p.jsx(m,{to:t.outputDeck,params:s.params,search:r,hash:!0,replace:!0}),a[69]=s.params,a[70]=r,a[71]=e):e=a[71],e}case t.libraryFile:{let e;return a[72]!==s.params||a[73]!==r?(e=p.jsx(m,{to:t.libraryFile,params:s.params,search:r,hash:!0,replace:!0}),a[72]=s.params,a[73]=r,a[74]=e):e=a[74],e}case t.connectSources:{let e;return a[75]!==s.params||a[76]!==r?(e=p.jsx(m,{to:t.connectSources,params:s.params,search:r,hash:!0,replace:!0}),a[75]=s.params,a[76]=r,a[77]=e):e=a[77],e}}}function A(d){const a=v.c(17),{children:h}=d;let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const r=y(s);let e;a[1]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},a[1]=e):e=a[1];const u=I(e),j=L(),g=E(),i=r.org;if(!i||r.taskId!==void 0||r._splat!==void 0)return h??null;let n,f;a[2]!==j||a[3]!==g||a[4]!==i||a[5]!==r.agentId||a[6]!==u?(n=k({agentIdParam:r.agentId,virtualMcpIdSearch:u.virtualmcpid,fallbackAgentId:j}),f=(u.main!==void 0?R({org:i,agentId:n,main:u.main,search:u}):null)??S({org:i,routePath:g,search:u}),a[2]=j,a[3]=g,a[4]=i,a[5]=r.agentId,a[6]=u,a[7]=n,a[8]=f):(n=a[7],f=a[8]);const o=f;if(o?.kind==="same-route"){let l;return a[9]!==o.search?(l=p.jsx(m,{to:".",search:o.search,hash:!0,replace:!0}),a[9]=o.search,a[10]=l):l=a[10],l}if(o?.kind==="canonical"){let l;return a[11]!==o?(l=p.jsx(P,{target:o}),a[11]=o,a[12]=l):l=a[12],l}if(r.agentId!==void 0&&r.agentId===n&&u.virtualmcpid!==void 0){let l;a[13]!==u?(l=b(u),a[13]=u,a[14]=l):l=a[14];let x;return a[15]!==l?(x=p.jsx(m,{to:".",search:l,hash:!0,replace:!0}),a[15]=l,a[16]=x):x=a[16],x}return h??null}export{P as L,A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as k,d as B,u as I,n as N,j as u}from"./index-CsKm2ubF.js";import{l as $,b as A,H as U}from"./location-zK0I9Ia6.js";import{u as q}from"./use-mobile-h60o0kDh.js";import{u as z,C as M}from"./index-DCcjp4nP.js";import{L as S}from"./preview-panel-CywYdFpJ.js";import{L as D}from"./library-tab-BcgjMyrL.js";import"./thread-button-DdmUMrmT.js";import"./agent-icon-DGDGzDPg.js";import"./AlertCircle-BOqaZFXA.js";import"./Tool01-B_dduyQs.js";import"./ArrowUp-Bi8YJGtE.js";import"./ArrowLeft-BsFMaTJ5.js";import"./LinkBroken01-CNbQoBrl.js";import"./ShoppingBag01-BfMGWAwv.js";import"./ZoomOut-UxLkEy8R.js";import"./Building02-BG4IPwQ3.js";import"./CheckCircle-D49A5hws.js";import"./Check-ChBZV9OV.js";import"./ChevronUp-wB5J5ntl.js";import"./UserSquare-CQZbVq0f.js";import"./Copy01-C4tt-_AN.js";import"./CreditCard01-DCvyy0kz.js";import"./DotsVertical-BWwzMO41.js";import"./Image01-B4l0All3.js";import"./Palette-BKZ5R7W4.js";import"./XClose-D0KEw8ZX.js";import"./Key01-DNpH0NnO.js";import"./Link01-DZVgeeWe.js";import"./LinkExternal01-D73wyIiU.js";import"./Monitor01-BJ23zU-n.js";import"./Sun-BAfhxpb-.js";import"./Plus-CP_oegJ7.js";import"./SearchMd-D2OTQFME.js";import"./Trash01-C4sE_NGv.js";import"./Upload01-qBk1AINH.js";import"./User01-DcjCdViP.js";import"./Users01-DR0sKzFO.js";import"./X-DJN31Nfv.js";import"./use-chat-layout-state-CcVNkckt.js";import"./use-file-configs-WonDx6od.js";import"./use-organization-settings-C9LFE9dH.js";import"./schema-bIq2BT73.js";import"./task-board-CC3VTzd7.js";import"./site-slug-DebpOoQq.js";import"./thread-route-C5YO0tNH.js";import"./use-panel-navigate-BoWMxqfw.js";import"./use-project-scope-Bq9_CxnF.js";import"./repository-binding-ebck0c8n.js";import"./use-mcp-client-C7yhsDUq.js";import"./auth-Cs4gU6Jt.js";import"./thread-intent-Dg3GQUH3.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";import"./sheet-nJD4St3t.js";import"./tooltip-17PKNCMM.js";import"./index-CZNblbQa.js";import"./toolbar-icon-button-CMClok1k.js";import"./shell-layout-CsK_iJoM.js";import"./avatar-BeFOPb9J.js";import"./download-app-dialog-RU0ZYOfB.js";import"./dialog-D_5RxDc9.js";import"./use-clock-tick-Bs0g2LMm.js";import"./command-CxzepSXP.js";import"./index-CzdEzd_G.js";import"./integration-icon-CTkfXIOR.js";import"./project-icon-DxklOC8j.js";import"./new-project-dialog-BR_BdAk-.js";import"./input-BhJziSQi.js";import"./label-Bfbz6otc.js";import"./repository-import-picker-CTs8TUdw.js";import"./use-navigate-to-agent-DpJjb9Ad.js";import"./repository-picker-BwC54VM6.js";import"./useInfiniteQuery-SgJx2z0R.js";import"./infiniteQueryObserver-DaqTQDCS.js";import"./collection-search-D2PZ787d.js";import"./use-debounced-value-Dws83Fd6.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-D4fpdDYn.js";import"./autosend-D7eBSjvh.js";import"./use-org-sso-DHgm8_xi.js";import"./resizable-DENddsry.js";import"./icon-button-CMxGCJDP.js";import"./preview-content-SoUMkfQg.js";import"./file-share-button-DkiNZpp9.js";import"./use-org-fs-DuUomCai.js";import"./popover-DH3Sl61q.js";import"./file-preview-VEd_A7P9.js";import"./utils-7wkojbq8.js";import"./editor-KC3-U1Hv.js";import"./file-type-icon-CfnH9Twn.js";import"./markdown-Bx2p9OGj.js";import"./org-file-open-context-BHXXOOHS.js";import"./search-toggle-BB2lVgeF.js";import"./alert-dialog-CiySziMD.js";import"./use-chat-navigation-EErRoLjo.js";import"./use-org-repo-syncs-4sBt09GE.js";import"./textarea-CFMwKhM9.js";import"./preview-dialog-DPOzbA4Y.js";import"./folder-icon-CzsWuPW5.js";import"./skill-md-ChfVs4uF.js";import"./empty-state-Bzg2RaeW.js";import"./view-mode-toggle-I-eGSI3M.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./table-BghtXeZn.js";import"./use-members-muYuUKl8.js";import"./use-org-auth-client-CPl2reDK.js";function Di(){const t=k.c(49),P=B();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x={strict:!1},t[0]=x):x=t[0];const{preview:i,expanded:O}=I(x);let b;t[1]!==P?(b=e=>P({to:".",search:p=>({...p,...e.path!==void 0&&{path:e.path},preview:e.preview,expanded:e.expanded})}),t[1]=P,t[2]=b):b=t[2];const o=b;let v;t[3]!==o?(v=()=>o({}),t[3]=o,t[4]=v):v=t[4];const r=v,E=q(),y=z().threadOpen&&!E;if(i&&(O||y)){let e,p,a,m,l;if(t[5]!==r||t[6]!==i||t[7]!==o){let T;t[13]!==i?(T=i.lastIndexOf("/"),t[13]=i,t[14]=T):T=t[14];const H=i.slice(0,Math.max(T,0));p=M.Content,e=N.Breadcrumbs,a="page",t[15]!==r?(m={onSelect:r},t[15]=r,t[16]=m):m=t[16];let C;t[17]!==o?(C=_=>({key:`folder:${_.path}`,label:_.label,onSelect:()=>o({path:_.path})}),t[17]=o,t[18]=C):C=t[18];const R=$(H,U).map(C);let h;t[19]!==i?(h=A(i),t[19]=i,t[20]=h):h=t[20];let L;t[21]!==h?(L={key:"file",label:h},t[21]=h,t[22]=L):L=t[22],l=[...R,L],t[5]=r,t[6]=i,t[7]=o,t[8]=e,t[9]=p,t[10]=a,t[11]=m,t[12]=l}else e=t[8],p=t[9],a=t[10],m=t[11],l=t[12];let n;t[23]!==e||t[24]!==a||t[25]!==m||t[26]!==l?(n=u.jsx(e,{after:a,parent:m,items:l}),t[23]=e,t[24]=a,t[25]=m,t[26]=l,t[27]=n):n=t[27];let f;t[28]!==y||t[29]!==i||t[30]!==o?(f=y?void 0:()=>o({preview:i}),t[28]=y,t[29]=i,t[30]=o,t[31]=f):f=t[31];let d;t[32]!==f?(d={expanded:!0,onToggle:f},t[32]=f,t[33]=d):d=t[33];let c;t[34]!==r||t[35]!==i||t[36]!==d?(c=u.jsx(S,{previewPath:i,onClose:r,expand:d},i),t[34]=r,t[35]=i,t[36]=d,t[37]=c):c=t[37];let w;return t[38]!==p||t[39]!==n||t[40]!==c?(w=u.jsxs(p,{children:[n,c]}),t[38]=p,t[39]=n,t[40]=c,t[41]=w):w=t[41],w}let s;t[42]!==r||t[43]!==i||t[44]!==o?(s=i&&u.jsx(S,{variant:"aside",previewPath:i,onClose:r,expand:{expanded:!1,onToggle:()=>o({preview:i,expanded:!0})}},i),t[42]=r,t[43]=i,t[44]=o,t[45]=s):s=t[45];let g;t[46]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(D,{filePreview:"side"}),t[46]=g):g=t[46];let j;return t[47]!==s?(j=u.jsx(M.Content,{aside:s,children:g}),t[47]=s,t[48]=j):j=t[48],j}export{Di as default};
|