decocms 4.496.0 → 4.497.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-BVT17h1W.js → ActiveShapeUtils-BfToWUeb.js} +1 -1
- package/dist/client/assets/{AlertCircle-DY8bqCha.js → AlertCircle-uVTE_i_c.js} +1 -1
- package/dist/client/assets/{AreaChart-C85WUbhU.js → AreaChart-D-XLuzTF.js} +1 -1
- package/dist/client/assets/{ArrowLeft--XLYCrc5.js → ArrowLeft-D8kMxyF3.js} +1 -1
- package/dist/client/assets/{ArrowUp-YDXnrJ7G.js → ArrowUp-baihphF6.js} +1 -1
- package/dist/client/assets/{BarChart-CJTCxyya.js → BarChart-CmpYBluB.js} +1 -1
- package/dist/client/assets/{Building02-NwIw90j5.js → Building02-C-k2Qn__.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DgAbcYNa.js → CategoricalChart-MIe_roxn.js} +1 -1
- package/dist/client/assets/{CheckCircle-nhmFTvE6.js → CheckCircle-BgOw0_dD.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DTio1rjg.js → ChevronSelectorVertical-e0qa2qKk.js} +1 -1
- package/dist/client/assets/{ChevronUp-CqUEILrt.js → ChevronUp-B7O2Z2_x.js} +1 -1
- package/dist/client/assets/{Copy01-CvPIDjuG.js → Copy01-BR4eoDaW.js} +1 -1
- package/dist/client/assets/{CreditCard01-DCfqvozy.js → CreditCard01-pJwQfpbv.js} +1 -1
- package/dist/client/assets/{DotsVertical-CSCmFu8Q.js → DotsVertical-DOuXLsMk.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-9--7esXK.js → ErrorBarContext-BvlCrLLk.js} +1 -1
- package/dist/client/assets/{Globe04-DG7jBKGP.js → Globe04-CYweJqdP.js} +1 -1
- package/dist/client/assets/{Image01-cbCHFYmk.js → Image01-S90CE8VS.js} +1 -1
- package/dist/client/assets/{Key01-04C5Cb93.js → Key01-B5JsqJav.js} +1 -1
- package/dist/client/assets/{Link01-Cq7ZQK57.js → Link01-Dz3IyYPr.js} +1 -1
- package/dist/client/assets/{LinkBroken01-ydPCJGh6.js → LinkBroken01-BKVx2uSk.js} +1 -1
- package/dist/client/assets/{Monitor01-BosmGMIH.js → Monitor01-KqB9ZF5U.js} +1 -1
- package/dist/client/assets/{Play-BGed4f8X.js → Play-CygY0DVf.js} +1 -1
- package/dist/client/assets/{Plus-CS-imxjk.js → Plus-Bj_QsLcq.js} +1 -1
- package/dist/client/assets/{SearchMd-DpDuLpr9.js → SearchMd-CVAVwuts.js} +1 -1
- package/dist/client/assets/{Sector-DmYQYvNe.js → Sector-CRN92mNE.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-CAuMgtYk.js → ShoppingBag01-DhR5OJ_o.js} +1 -1
- package/dist/client/assets/{Sun-DNYaWg-8.js → Sun-BCMSoFWP.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-TWyW2jhZ.js → SwitchHorizontal01-fI9_GGzc.js} +1 -1
- package/dist/client/assets/{Tool01-PXS7oM2l.js → Tool01-Dpcs_fEX.js} +1 -1
- package/dist/client/assets/{Trash01-DD84camw.js → Trash01-BwiN-bXW.js} +1 -1
- package/dist/client/assets/{Upload01-B7IJQr07.js → Upload01-nkaaAbTH.js} +1 -1
- package/dist/client/assets/{User01-eOIeHV7h.js → User01-BSbwHeDW.js} +1 -1
- package/dist/client/assets/{UserSquare-D5P__qW1.js → UserSquare-CG780QF2.js} +1 -1
- package/dist/client/assets/{Users01-UUMGKcsN.js → Users01-BuQlctw3.js} +1 -1
- package/dist/client/assets/{XAxis-D93kHNyl.js → XAxis-BIvxXYwH.js} +1 -1
- package/dist/client/assets/{XClose-TrpNsToi.js → XClose-CohaLXz5.js} +1 -1
- package/dist/client/assets/{ZoomOut-DmuBfqXK.js → ZoomOut-BSXGk2sm.js} +1 -1
- package/dist/client/assets/{access-gate-CzXMCDQe.js → access-gate-DOzt68zj.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Co74MHAY.js → add-connection-dialog-BHghNpDD.js} +1 -1
- package/dist/client/assets/{agent-analytics-D8I2BkKH.js → agent-analytics-652550mA.js} +1 -1
- package/dist/client/assets/agent-app-CdQYM_ZA.js +1 -0
- package/dist/client/assets/{agent-assets-DeODDcT0.js → agent-assets-CO2mf3B-.js} +1 -1
- package/dist/client/assets/{agent-automation-Dkp6V5Sj.js → agent-automation-Bvt8DrKn.js} +1 -1
- package/dist/client/assets/{agent-automations-BV-Io4eo.js → agent-automations-DDRyU4rP.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DEzxvIm0.js → agent-connect-sources-DCAIhIe3.js} +1 -1
- package/dist/client/assets/agent-deck-BsXvzeBG.js +1 -0
- package/dist/client/assets/{agent-e2e-BfCWUHGd.js → agent-e2e-BDY9ZD6D.js} +1 -1
- package/dist/client/assets/{agent-experiments---UoWIs9.js → agent-experiments-BxeTATqf.js} +1 -1
- package/dist/client/assets/{agent-file-VG03O57l.js → agent-file-BmYB54QY.js} +1 -1
- package/dist/client/assets/{agent-hosting-DSyte2d6.js → agent-hosting-RRRWwDeW.js} +1 -1
- package/dist/client/assets/{agent-icon-qroW1Utf.js → agent-icon-CIAqO6q_.js} +1 -1
- package/dist/client/assets/agent-library-D-aCuCTB.js +1 -0
- package/dist/client/assets/agent-library-file-BuoS_Z6e.js +1 -0
- package/dist/client/assets/{agent-monitor-Csn8HW-o.js → agent-monitor-DsQakvWJ.js} +1 -1
- package/dist/client/assets/{agent-overview-DEew4Ktb.js → agent-overview-3FcxOPM6.js} +1 -1
- package/dist/client/assets/agent-settings-bSj1beF7.js +1 -0
- package/dist/client/assets/{agent-site-editor-uBf1cOid.js → agent-site-editor-KhAad4Sw.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B8CEWJnJ.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-B2KIymmj.js → agent-site-editor-content-Fitmb8o7.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CBMBSUB9.js → agent-site-editor-preview-DnnUYHiU.js} +3 -3
- package/dist/client/assets/{agent-view-guard-D7znUA8E.js → agent-view-guard-CKn2tf5j.js} +1 -1
- package/dist/client/assets/agent-view-wYzAXyAR.js +1 -0
- package/dist/client/assets/{agents-list-C-Vfe442.js → agents-list-DSQETxBR.js} +1 -1
- package/dist/client/assets/{ai-providers-DYkLkRTi.js → ai-providers-DdDoqHhw.js} +1 -1
- package/dist/client/assets/{alert-CknKmC4I.js → alert-DWd3_VEN.js} +1 -1
- package/dist/client/assets/{alert-dialog-BEcI3FD3.js → alert-dialog-ivXO19po.js} +1 -1
- package/dist/client/assets/{analytics-sections-DkIfraxE.js → analytics-sections-Bhuxqwzw.js} +1 -1
- package/dist/client/assets/api-keys-2HQGF5-h.js +1 -0
- package/dist/client/assets/{api-keys-RdHH5-HO.js → api-keys-DjqDXSVz.js} +1 -1
- package/dist/client/assets/app-editor-i2ce0F8B.js +1 -0
- package/dist/client/assets/{asset-utils-D1WmQlcr.js → asset-utils-jXJjDaKi.js} +1 -1
- package/dist/client/assets/{auth-DQ7KFfQG.js → auth-C16DiwpU.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bj80qHUZ.js → auth-catchall-CMZXJiIT.js} +1 -1
- package/dist/client/assets/{auth-entry-CVAWLxXS.js → auth-entry-D2I0FV-M.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DO_EbQUI.js → auth-split-layout-lGr4mQP-.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BPoB61oq.js → authenticate-and-persist-oauth-BzcsLm_G.js} +1 -1
- package/dist/client/assets/{automation-list-row-DwzUqOw8.js → automation-list-row-BIpt7Z6o.js} +1 -1
- package/dist/client/assets/{automation-runs-Bp65TXd7.js → automation-runs-Dx7LKstr.js} +1 -1
- package/dist/client/assets/{automations-CqVssJOq.js → automations-CbuyiPha.js} +1 -1
- package/dist/client/assets/{autosend-CcQyaIGA.js → autosend-8Zl7NQ67.js} +1 -1
- package/dist/client/assets/{avatar-Cv41gISF.js → avatar-PHlRD3By.js} +1 -1
- package/dist/client/assets/{badge-Ba3u97Pl.js → badge-BTJCq3tr.js} +1 -1
- package/dist/client/assets/{block-document-CTLqTC_r.js → block-document-BKlsJNkE.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DjdV5Qlt.js → blocks-preview-workspace-context-D9S2qjUS.js} +1 -1
- package/dist/client/assets/{blog-schema-B-FGyljD.js → blog-schema-B0HiB2cA.js} +1 -1
- package/dist/client/assets/{board-analytics-CAsp769l.js → board-analytics-DYBHTjV-.js} +1 -1
- package/dist/client/assets/{buckets-CdAJQdCr.js → buckets-DNw0rMyq.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DrohBDE-.js → build-improve-prompt-doc-CmTPuV4H.js} +1 -1
- package/dist/client/assets/{calendar-CgbisEND.js → calendar-Bpz7Lz-y.js} +1 -1
- package/dist/client/assets/{capability-load-error-BXZ3jboY.js → capability-load-error-B3pMqWw1.js} +1 -1
- package/dist/client/assets/{category-editor-CT5MZmjt.js → category-editor-DLwiIFGA.js} +1 -1
- package/dist/client/assets/{chart-DwidbVF_.js → chart-5JvOgFAK.js} +1 -1
- package/dist/client/assets/{chat-context-22ccNySK.js → chat-context-3OXKEqSh.js} +1 -1
- package/dist/client/assets/{chat-draft-N3NbVf44.js → chat-draft-oK0pqHaC.js} +1 -1
- package/dist/client/assets/{checkbox-C0LvF7-W.js → checkbox-CRsuhP53.js} +1 -1
- package/dist/client/assets/{choose-editor-qFu7w2K7.js → choose-editor-PDE1zqLa.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BFltSmg_.js → claim-phase-copy-BOnhDNWe.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DXxpngeJ.js → cli-auth-success-DFy-lvLA.js} +1 -1
- package/dist/client/assets/{client-icons-CnVFxZ_i.js → client-icons-GrM8G8gc.js} +1 -1
- package/dist/client/assets/{collapsible-Cu-qIf8C.js → collapsible-z-JwdUiM.js} +1 -1
- package/dist/client/assets/{collection-detail-BVSz_Cdh.js → collection-detail-Dhq8Wz0G.js} +1 -1
- package/dist/client/assets/{collection-display-button-Pi1sZkcY.js → collection-display-button-COwoiqJ0.js} +1 -1
- package/dist/client/assets/{collection-search-Bo0RkeZA.js → collection-search-ZrNbDYaq.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-5r6oHUdW.js → collection-table-wrapper-BxHhUj6Y.js} +1 -1
- package/dist/client/assets/{collection-tabs-BA6WZZHi.js → collection-tabs-CZnO-KJm.js} +1 -1
- package/dist/client/assets/{column-rules-DTQgaEq6.js → column-rules-CU0QM4zZ.js} +1 -1
- package/dist/client/assets/{combobox-DvC3aUQL.js → combobox-bRQw-jDN.js} +1 -1
- package/dist/client/assets/{command-Z9XxdQ7J.js → command--1ySxBzC.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-UDqr78P2.js → companion-mcps-section-DbOOs4Di.js} +1 -1
- package/dist/client/assets/{config-DMRqiLdR.js → config-DxkhWHvI.js} +1 -1
- package/dist/client/assets/{connect-CZP0LsuB.js → connect-Cy-QXX6T.js} +1 -1
- package/dist/client/assets/{connect-layout-vkDPzLhT.js → connect-layout-B_xraWMz.js} +1 -1
- package/dist/client/assets/{connection-card-uIuWBJMs.js → connection-card-Dd1Miwos.js} +1 -1
- package/dist/client/assets/{connection-detail-CuXCNQCD.js → connection-detail-BhSOyfOS.js} +1 -1
- package/dist/client/assets/{connection-CTQgZPtk.js → connection-eFBHXnq8.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CLLIaKV6.js → connection-form-helpers-CjAkllf4.js} +1 -1
- package/dist/client/assets/{connections-DXNCmB8T.js → connections-DptsGWqU.js} +1 -1
- package/dist/client/assets/{context-BWyGxyVQ.js → context-DvjPJlI1.js} +1 -1
- package/dist/client/assets/{context-menu-D9MgVZQW.js → context-menu-DTbN-B-u.js} +1 -1
- package/dist/client/assets/{core.esm-BI45RQ70.js → core.esm-BmdNjDzv.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-C91DEkEa.js → create-organization-dialog-BRn1itMS.js} +1 -1
- package/dist/client/assets/{daily-pulse-B38J6G9s.js → daily-pulse-C_sHN310.js} +1 -1
- package/dist/client/assets/{device-hint-7yMCN-Os.js → device-hint-BA8nYrWU.js} +1 -1
- package/dist/client/assets/{discover-lgSKE5DK.js → discover-DGp_fHdG.js} +1 -1
- package/dist/client/assets/{domain-settings-c_5HmpJ-.js → domain-settings-Bz6k7ub5.js} +1 -1
- package/dist/client/assets/{drawer-D2dqAMx2.js → drawer-wiDylD44.js} +1 -1
- package/dist/client/assets/{editor-jgAlbT28.js → editor-DbVDLInM.js} +1 -1
- package/dist/client/assets/{empty-state-lGlHfKio.js → empty-state-CpJixEa0.js} +1 -1
- package/dist/client/assets/{empty-state-DR-VrfEb.js → empty-state-GrM64x-h.js} +1 -1
- package/dist/client/assets/{extract-connection-data-rmLW_gvu.js → extract-connection-data-BFr1XefI.js} +1 -1
- package/dist/client/assets/{feature-gate-C3ALU4KU.js → feature-gate-DIjgMR-H.js} +1 -1
- package/dist/client/assets/{feature-paywall-AtCK-SZi.js → feature-paywall-DygeAwCp.js} +1 -1
- package/dist/client/assets/{file-explorer-CXoqHKQi.js → file-explorer-sgwcJgTB.js} +1 -1
- package/dist/client/assets/{file-preview-D3qj3-ZX.js → file-preview-KMq6kQbY.js} +1 -1
- package/dist/client/assets/{file-share-button-v1acUQhc.js → file-share-button-BmW3xptu.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cw2ugH1T.js → file-type-icon-CH0zVmFE.js} +1 -1
- package/dist/client/assets/flat-project-B1VoRXiA.js +1 -0
- package/dist/client/assets/{folder-icon-BRkty9N7.js → folder-icon-Dvr9Xy_h.js} +1 -1
- package/dist/client/assets/{form-Ce4lrl07.js → form-ChrFSKbl.js} +1 -1
- package/dist/client/assets/{general-BoFQ5PDD.js → general-CSM1Afsf.js} +1 -1
- package/dist/client/assets/{home-DBwVydAm.js → home-CmR382BT.js} +1 -1
- package/dist/client/assets/{icon-button-BzCBL3cR.js → icon-button-BEh8g82p.js} +1 -1
- package/dist/client/assets/{index-2xZGo1OZ.js → index-1lCyt6wZ.js} +1 -1
- package/dist/client/assets/{index-BJTeBjsQ.js → index-5v4d81Co.js} +1 -1
- package/dist/client/assets/{index-DEPeya4x.js → index-BL1llwK-.js} +1 -1
- package/dist/client/assets/{index-BjUlsUMg.js → index-BdbMrrND.js} +1 -1
- package/dist/client/assets/{index-DkUf25py.js → index-Br_k5ZoS.js} +1 -1
- package/dist/client/assets/{index-C7aH47aJ.js → index-BvNW8UPM.js} +1 -1
- package/dist/client/assets/{index-CwyPrlmP.js → index-CAxew9_u.js} +1 -1
- package/dist/client/assets/{index-D7Q80Ibd.js → index-CNBMfDzu.js} +3 -3
- package/dist/client/assets/{index-COZCf2PU.js → index-Dp4NtPWu.js} +1 -1
- package/dist/client/assets/{index-DI6dvB42.js → index-Dpzy6FT0.js} +1 -1
- package/dist/client/assets/{index-AwfdJWsb.js → index-E8HkK7le.js} +2 -2
- package/dist/client/assets/{index-BzVl4964.js → index-FPsrk3s0.js} +1 -1
- package/dist/client/assets/{index-xJHUGJmd.js → index-GNzYGBzv.js} +1 -1
- package/dist/client/assets/{index-redirect-3-u4Q02Y.js → index-redirect-B_k2XKG7.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BoYQIhRm.js → infiniteQueryObserver-B_6kT4Pu.js} +1 -1
- package/dist/client/assets/{infra-billing-DRk7Hgam.js → infra-billing-DntZ94Fv.js} +1 -1
- package/dist/client/assets/{input-C-7hE1b2.js → input-Bf9hsVol.js} +1 -1
- package/dist/client/assets/{input-BJm-bJdI.js → input-DzGUnaT4.js} +3 -3
- package/dist/client/assets/{integration-icon-WQ1MJmJE.js → integration-icon-BMM9bKRw.js} +1 -1
- package/dist/client/assets/{jira-icon-w0P2pjzT.js → jira-icon-Cj12G8eH.js} +1 -1
- package/dist/client/assets/{label-BEIrQZc-.js → label-DAC0PXH6.js} +1 -1
- package/dist/client/assets/{layout-pNLUGjKH.js → layout-DH0wfMvp.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DQLIe0rx.js → legacy-agents-deep-DKcmw_C9.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DDC0imIe.js → legacy-main-redirect-xF3AIf85.js} +1 -1
- package/dist/client/assets/library-IZ6uiAlE.js +1 -0
- package/dist/client/assets/{library-tab-DIJB0pOD.js → library-tab-C0sI5AvO.js} +1 -1
- package/dist/client/assets/{login-Blmg5PpX.js → login-CyNOjPxx.js} +1 -1
- package/dist/client/assets/{markdown-C_1El3UD.js → markdown-D9Q4_EWf.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-B9dOa3ev.js → mcp-app-renderer-CJllCuFA.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D1ywKFbc.js → mcp-oauth-Cm-FGk67.js} +1 -1
- package/dist/client/assets/{mcp-oauth-IPmD_N5m.js → mcp-oauth-D5hp_76q.js} +1 -1
- package/dist/client/assets/{members-DkW4wjLL.js → members-aCVioT1N.js} +1 -1
- package/dist/client/assets/{memory-pQ7XA0lM.js → memory-Fzdui2vo.js} +1 -1
- package/dist/client/assets/{mini-report-page-B6fFtRpy.js → mini-report-page-BTvq-myp.js} +1 -1
- package/dist/client/assets/{mock-board-wk6TYt7w.js → mock-board-BctOoM75.js} +1 -1
- package/dist/client/assets/{monaco-editor-D3D0ilFy.js → monaco-editor-DxsHSHr3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CG8CcLbD.js → monitoring-stats-row-BPpGukbV.js} +1 -1
- package/dist/client/assets/{multi-select-zXW_B1rE.js → multi-select-BEZlzNPL.js} +1 -1
- package/dist/client/assets/{mustache-Fgl0g-Er.js → mustache-C_2NGupD.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CDF0Rsm8.js → new-project-dialog-CBz8t6bW.js} +1 -1
- package/dist/client/assets/{oauth-callback-Dfc-046A.js → oauth-callback-D-TIiYCW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CR3Sx1WR.js → oauth-callback-ai-provider-COJwjuqo.js} +1 -1
- package/dist/client/assets/{onboarding-Fj_h1pZF.js → onboarding-BvA8qKid.js} +1 -1
- package/dist/client/assets/{openai-conversation-ZCiR-nel.js → openai-conversation-DMNH07wd.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-gdyjY474.js → optimistic-project-sidebar-views-B82d2Iyt.js} +1 -1
- package/dist/client/assets/{organization-choice-C6SRJ7u5.js → organization-choice-DZk2VZFD.js} +1 -1
- package/dist/client/assets/{orgs-COfkZLkX.js → orgs-D1rtBs1u.js} +1 -1
- package/dist/client/assets/{page-seo-form-COwmjwMF.js → page-seo-form-DC_uQ_yb.js} +1 -1
- package/dist/client/assets/{pair-DH8DyC8q.js → pair-BHsCddMQ.js} +1 -1
- package/dist/client/assets/{plan-ladder-BiocTbbz.js → plan-ladder-D5P8cNNU.js} +1 -1
- package/dist/client/assets/{popover-qqnMuKN1.js → popover-BiATgeVZ.js} +1 -1
- package/dist/client/assets/{post-calendar-BkJyfSYh.js → post-calendar-XwNvndsR.js} +1 -1
- package/dist/client/assets/{post-editor-CYX-gw_e.js → post-editor-CIVzwScJ.js} +1 -1
- package/dist/client/assets/{preview-content-wDBnyIay.js → preview-content-D4a4Kxnw.js} +1 -1
- package/dist/client/assets/{preview-dialog-CZ8zzX0u.js → preview-dialog-DXvP_rSt.js} +1 -1
- package/dist/client/assets/{preview-panel-Ck3MEGJq.js → preview-panel-9m4lCkpb.js} +1 -1
- package/dist/client/assets/{product-picker-dialog-DdC0pd1-.js → product-picker-dialog-BFXbOjF7.js} +1 -1
- package/dist/client/assets/{profile-D0Plzjli.js → profile-UHLqhuh9.js} +1 -1
- package/dist/client/assets/{project-app-view-BGndj_I_.js → project-app-view-7PLU79fP.js} +1 -1
- package/dist/client/assets/{project-feed-DaaaTGHC.js → project-feed-BMzjV3aS.js} +1 -1
- package/dist/client/assets/{project-icon-B-WU0_0D.js → project-icon-CtWmpx-o.js} +1 -1
- package/dist/client/assets/project-reports-BFIkPtSH.js +1 -0
- package/dist/client/assets/project-tasks-DD_fl4Sm.js +1 -0
- package/dist/client/assets/{projects-ok5J9tL9.js → projects-BKfqSW6u.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DW2UrEaZ.js → projects-empty-state-CansCxa8.js} +1 -1
- package/dist/client/assets/{prompts-CNAdfpQM.js → prompts-DF0ao_FF.js} +1 -1
- package/dist/client/assets/record-editor-VsMWy81Y.js +1 -0
- package/dist/client/assets/redirect-editor-DaEa0GfW.js +1 -0
- package/dist/client/assets/{reports-CzOE1tR3.js → reports-BtVp7TUw.js} +1 -1
- package/dist/client/assets/reports-CCgdm6dz.js +1 -0
- package/dist/client/assets/{reports-onboarding-BmEr1mIf.js → reports-onboarding-DJFr_1o0.js} +1 -1
- package/dist/client/assets/{reports-tab-DKCT0JIU.js → reports-tab-lxUznXDf.js} +2 -2
- package/dist/client/assets/{repositories-CQq6WnJq.js → repositories-D-XY1mEG.js} +1 -1
- package/dist/client/assets/{repository-binding-BNg5TQOZ.js → repository-binding-DJSfVmK0.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CcMvghJ5.js → repository-import-picker-CN4nBNQQ.js} +1 -1
- package/dist/client/assets/{repository-picker-SvnnQoi6.js → repository-picker-Bq1Xf_Nc.js} +1 -1
- package/dist/client/assets/{require-capability-DlJRrlRZ.js → require-capability-tnxMTQ41.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CDNeII8u.js → required-auth-layout-OT71YdwW.js} +1 -1
- package/dist/client/assets/{reset-password-Dbn4jIkW.js → reset-password-b4ZAeKZf.js} +1 -1
- package/dist/client/assets/{resizable-CZ4aTSlX.js → resizable-zpo8XDIL.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CXK_bXUY.js → resolve-tab-icon-DELF6fBY.js} +1 -1
- package/dist/client/assets/{review-settings-BDPAXKXb.js → review-settings-C7_0upab.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-ClVdMqVI.js → rich-text-link-control-r6aMgCnO.js} +1 -1
- package/dist/client/assets/{roles-DOI1mfYR.js → roles-BNqONgK2.js} +1 -1
- package/dist/client/assets/{route-CKk6J4lQ.js → route-2S2BeRzM.js} +1 -1
- package/dist/client/assets/route-Bo2LQsMZ.js +1 -0
- package/dist/client/assets/{route-C_x1XS5V.js → route-ClCedNlY.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-DxlrjseU.js → runnable-block-editor-TLQt5HEP.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-CDjLFL25.js → sandbox-lifecycle-context-B3tBEBAU.js} +1 -1
- package/dist/client/assets/schema-DAFIdNnw.js +1 -0
- package/dist/client/assets/{scroll-area-BJzbQI7x.js → scroll-area-D65kWya9.js} +1 -1
- package/dist/client/assets/{search-input-CWqVQgLT.js → search-input-CZqwR2Em.js} +1 -1
- package/dist/client/assets/{search-toggle-CZJ34jiu.js → search-toggle-CZvcgEuO.js} +1 -1
- package/dist/client/assets/{secret-picker-fggAfKvz.js → secret-picker-D9zGuUhM.js} +1 -1
- package/dist/client/assets/{secrets-aGD7EHkw.js → secrets-BL-nilzb.js} +1 -1
- package/dist/client/assets/{sections-editor-d3ZH3NnB.js → sections-editor-Cj-wrCnm.js} +1 -1
- package/dist/client/assets/{select-6ljk5DPS.js → select-JMx_Daeq.js} +1 -1
- package/dist/client/assets/{select-model-BKzRZEfy.js → select-model-DcZybkpW.js} +1 -1
- package/dist/client/assets/{seo-editor-cv3-M4dT.js → seo-editor-5GEPfBh6.js} +1 -1
- package/dist/client/assets/{separator-BJL1NbSA.js → separator-BQJNbeVU.js} +1 -1
- package/dist/client/assets/{settings-tab-BAGW7JQB.js → settings-tab-yEsrogNk.js} +1 -1
- package/dist/client/assets/{sheet-CiBJ72wj.js → sheet-ft1vIPTI.js} +1 -1
- package/dist/client/assets/{shell-layout-CGcdMFur.js → shell-layout-BfZ3aLwK.js} +1 -1
- package/dist/client/assets/{skills-DRGboJI3.js → skills-DIxWKIpf.js} +1 -1
- package/dist/client/assets/{slider-Dx78M_Dr.js → slider-DzfY-AKn.js} +1 -1
- package/dist/client/assets/{sortable.esm--kYjBfXA.js → sortable.esm-C25gMPOU.js} +1 -1
- package/dist/client/assets/{sso-BbuCPd_C.js → sso-DMISGA1g.js} +1 -1
- package/dist/client/assets/{suggestion-53Llg-e1.js → suggestion-CkSKi3Ko.js} +1 -1
- package/dist/client/assets/{switch-nJdDORbC.js → switch-D1o5UUPU.js} +1 -1
- package/dist/client/assets/{symbol-DPWCgLFf.js → symbol-BihNL2x9.js} +1 -1
- package/dist/client/assets/{synced-repos-63wThZ7a.js → synced-repos-THZeI2TX.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-C1TUieB9.js → tab-icon-glyph-D-qnzCLe.js} +1 -1
- package/dist/client/assets/{table-DRoBPaFJ.js → table-_5HbhT_S.js} +1 -1
- package/dist/client/assets/{tabs-DDxLPvSM.js → tabs-BaVhZf2S.js} +1 -1
- package/dist/client/assets/{task-board-BWigQAz0.js → task-board-BhjqCSbG.js} +1 -1
- package/dist/client/assets/{task-route-BAXJnQiB.js → task-route-RXmOd-Sg.js} +1 -1
- package/dist/client/assets/{task-status-HT2A-rBc.js → task-status-BMH2aOWE.js} +1 -1
- package/dist/client/assets/taskboard-analytics-BfqBcYab.js +1 -0
- package/dist/client/assets/tasks-BOGH2SxB.js +1 -0
- package/dist/client/assets/{tasks-qzLf1kZw.js → tasks-BmHnYLCK.js} +1 -1
- package/dist/client/assets/{textarea-BemV8MtB.js → textarea-DUqfavim.js} +1 -1
- package/dist/client/assets/{thread-analytics-xCoRSlkG.js → thread-analytics-CaZ650wR.js} +1 -1
- package/dist/client/assets/{thread-button-D7_O34uV.js → thread-button-C_voRhAW.js} +1 -1
- package/dist/client/assets/{thread-intent-DWaXIzM6.js → thread-intent-DIdLWs3T.js} +1 -1
- package/dist/client/assets/{thread-route-kfygoR33.js → thread-route-Bsh0W3WI.js} +1 -1
- package/dist/client/assets/{thread-route-BrqTE6Me.js → thread-route-C0aHNen1.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CN1lXMVz.js → thread-sheet-body-Ck9K6X-O.js} +1 -1
- package/dist/client/assets/{time-range-picker-C761CjtW.js → time-range-picker-CNwi7PKe.js} +1 -1
- package/dist/client/assets/{toggle-group-NJ6o2Ub6.js → toggle-group-B-oqQV0Q.js} +1 -1
- package/dist/client/assets/{tool-namespace-D4Qkj0Hw.js → tool-namespace-D73-Yt47.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-zP-xIu_D.js → toolbar-icon-button-CWTFjB2x.js} +1 -1
- package/dist/client/assets/{tooltip-a0H1qyBK.js → tooltip-Bgaj6wao.js} +1 -1
- package/dist/client/assets/{tooltipContext-B3CTU34j.js → tooltipContext-Hyh6Z90v.js} +1 -1
- package/dist/client/assets/{track-CS4z8T1x.js → track-bmLGXYyb.js} +1 -1
- package/dist/client/assets/{types-Bx_rltIM.js → types-DSarHVWN.js} +1 -1
- package/dist/client/assets/{url-slug-CDmaNVX6.js → url-slug-BCtPmKcV.js} +1 -1
- package/dist/client/assets/{usage-stats-AcDv8Dsz.js → usage-stats-CPP4mykS.js} +1 -1
- package/dist/client/assets/{use-ai-providers-zmp15jyt.js → use-ai-providers-4IWNnMYR.js} +1 -1
- package/dist/client/assets/{use-automations-BZM3cLj4.js → use-automations-BNBMB7NJ.js} +1 -1
- package/dist/client/assets/{use-autosave-B0YK0x6h.js → use-autosave-CCI_H2Jh.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-Bcmu5rP3.js → use-chat-layout-state-CbsP3hVN.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-Cc_f0d0S.js → use-chat-navigation-Bvo_pyzq.js} +1 -1
- package/dist/client/assets/{use-clock-tick-AzE8VO15.js → use-clock-tick-BH2s8rwm.js} +1 -1
- package/dist/client/assets/{use-connect-companion-8hS3GtOc.js → use-connect-companion-D-T5tZi4.js} +1 -1
- package/dist/client/assets/{use-connection-CI8uhNVS.js → use-connection-B7mxZZZr.js} +1 -1
- package/dist/client/assets/{use-copy-CQYz3fr0.js → use-copy-BDIhU1a3.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DHX0--iP.js → use-create-virtual-mcp-DzT7Wi_g.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-9fXcEdhO.js → use-date-fns-locale-CcYc8FC-.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DHqky-9Q.js → use-debounced-autosave-BZQvNBgR.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CeEbKwrV.js → use-debounced-value-DogqGlHA.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BC6kbiHd.js → use-deco-credits-D8fC6T0N.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Dd86Tcia.js → use-decopilot-events-CG41uF0G.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DVwUwOIY.js → use-delete-connection-B8gkfexB.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DAj-k6S1.js → use-deployment-admin-DMHoNV8K.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-DmmxnF8g.js → use-ensure-project-folder-BXtCOD89.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BiKkW-Ju.js → use-fast-preview-draft-url-ClgFfcai.js} +1 -1
- package/dist/client/assets/{use-file-configs-CyNbQHOb.js → use-file-configs-CfHrYQ0D.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DvyXq-Gj.js → use-infinite-scroll-Doz-tD5w.js} +1 -1
- package/dist/client/assets/{use-join-requests-Dt-0BSi5.js → use-join-requests-C6Zrd-wF.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-B_s-ZlV6.js → use-main-panel-tabs-BI-yjZaf.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D873xSfO.js → use-mcp-auth-status-DT1RFPS5.js} +1 -1
- package/dist/client/assets/{use-mcp-client-G9kTaeLN.js → use-mcp-client-HXdOgSo1.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-TIlwVbKk.js → use-mcp-prompts-Dc22OpBz.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Y4CsChTF.js → use-mcp-tools-SgFCxAm4.js} +1 -1
- package/dist/client/assets/{use-members-G69DqUHv.js → use-members-BnU8sD2a.js} +1 -1
- package/dist/client/assets/{use-mobile-lU_VA-Wz.js → use-mobile-DMhjc8sS.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C6i1wdll.js → use-navigate-to-agent-8FxeDEql.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-C-_W9FQg.js +1 -0
- package/dist/client/assets/{use-open-billing-url-D2RlzIda.js → use-open-billing-url-CGiwz5yQ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-qcwb5Xwg.js → use-org-auth-client-CjFoGBiw.js} +1 -1
- package/dist/client/assets/{use-org-fs-r_UASbiH.js → use-org-fs-Brfqc0DM.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CXCL1qVI.js → use-org-repo-syncs-Dn8ueEn8.js} +1 -1
- package/dist/client/assets/{use-org-sso-CMW8M6X6.js → use-org-sso-5XSC3bo7.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BrmyYVth.js → use-organization-roles-CPEXva6v.js} +1 -1
- package/dist/client/assets/{use-organization-settings-X0pPEcR2.js → use-organization-settings-C1JjAa2e.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CoagQzmq.js → use-panel-navigate-B5g-cXoX.js} +1 -1
- package/dist/client/assets/{use-project-scope-DfhWNvXs.js → use-project-scope-C_W_iYCG.js} +1 -1
- package/dist/client/assets/{use-releases-NV2VbJG3.js → use-releases-aiz7Xp_5.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-6rpu_ggR.js → use-reports-diagnostic-Dx6jRAHR.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BMDgKkRX.js → use-sandbox-events-VQD2dbMh.js} +1 -1
- package/dist/client/assets/{use-secrets-DHJQDVTM.js → use-secrets-COPHY6zn.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BV9hqpLn.js → use-section-preview-base-DPHgFiJr.js} +1 -1
- package/dist/client/assets/{use-tags-BJ2Hh6BN.js → use-tags-NK0RVjrR.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BCuCs7sP.js → use-task-board-analytics-CDUEw4yr.js} +1 -1
- package/dist/client/assets/{use-task-board-events-UhXVQ3a7.js → use-task-board-events-DtM0CgpV.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DFJZfuP4.js → use-task-board-item-prs-uJK_d1d_.js} +1 -1
- package/dist/client/assets/{use-task-board-items-jZeevl5p.js → use-task-board-items-ByQWsAvO.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CU_uNdjx.js → use-task-metadata-YcyCc5iY.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-8O_JAIrn.js → use-thread-analytics-VXUKGF1M.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CLewPMZ8.js → use-thread-outputs-CcHD0dx2.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BtM1Ign2.js +1 -0
- package/dist/client/assets/{useQueries-BZgifabX.js → useQueries-D6R5SUUn.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DxUIRGU7.js +1 -0
- package/dist/client/assets/{users-rimZAqXM.js → users-CpYFV7v9.js} +1 -1
- package/dist/client/assets/{utils-C3P6RRqb.js → utils-DcA-ys_Q.js} +1 -1
- package/dist/client/assets/{variant-calendar-1RNKsmjA.js → variant-calendar-BCj7kcYa.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BybutIRM.js → variant-matcher-override-uy8AIyK6.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C5yHwVoW.js → view-mode-toggle-Fs_5ypxv.js} +1 -1
- package/dist/client/assets/{virtual-mcp-B1D6GXag.js → virtual-mcp-BQkclqkV.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-Binkw30f.js → watch-sse-pool-afzfEiDL.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +624 -620
- package/package.json +1 -1
- package/dist/client/assets/agent-app-CwZ2kAfk.js +0 -1
- package/dist/client/assets/agent-deck-XD5-oNlw.js +0 -1
- package/dist/client/assets/agent-library-CF-9ULgs.js +0 -1
- package/dist/client/assets/agent-library-file-C-qUhWdr.js +0 -1
- package/dist/client/assets/agent-settings-BSWQd9s-.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BEv9_ttW.js +0 -2
- package/dist/client/assets/agent-view-BVhy8qXU.js +0 -1
- package/dist/client/assets/api-keys-ZMfH16wP.js +0 -1
- package/dist/client/assets/app-editor-Bexwu6y3.js +0 -1
- package/dist/client/assets/flat-project-C-qoLMQo.js +0 -1
- package/dist/client/assets/library-C6afhHWm.js +0 -1
- package/dist/client/assets/project-reports-We-E3RnV.js +0 -1
- package/dist/client/assets/project-tasks-DEpXI9YC.js +0 -1
- package/dist/client/assets/record-editor-p5Q3f0yi.js +0 -1
- package/dist/client/assets/redirect-editor-CtcJbNoE.js +0 -1
- package/dist/client/assets/reports-CNpDrbV0.js +0 -1
- package/dist/client/assets/route-D9aStTQZ.js +0 -1
- package/dist/client/assets/schema-C3CtA8cz.js +0 -1
- package/dist/client/assets/taskboard-analytics-D34967tP.js +0 -1
- package/dist/client/assets/tasks-C199SCss.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-CI1Vo0BF.js +0 -1
- package/dist/client/assets/useInfiniteQuery-K_CnrRFE.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CstC5ADZ.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-
|
|
2
|
-
import{a_ as Le,c as D,b as B,r as E,l as O,j as o,aV as rt,aD as re,bU as Ut,aE as ne,bT as Fe,B as Y,aC as Ss,aB as Cs,cX as Ns,bS as Is,F as Se,b7 as Ts,eg as we,eh as mt,aa as _s,e as Ms,I as Ds,t as Ee,y as ee,a2 as Ce,d as it,ah as at,v as Rs,aK as Ps,s as Es,q as Us,D as Ls,ed as Fs,a4 as zs,K as Os,m as $s,X as Bs,T as Ks,V as qs,U as ye,as as gt,aq as xt,ar as vt,h as Qs,aR as Ws,aQ as Ys,at as Gs,cW as Hs,c$ as je,aW as Js,d1 as Zs,aX as bt,a$ as Xs,a as en,a0 as tn,a1 as sn,aJ as tt,af as Lt,bY as nn,aP as on}from"./index-AwfdJWsb.js";import{i as Ft,c as rn,d as an,e as zt,P as ln,f as Vn,S as cn}from"./usage-stats-AcDv8Dsz.js";import{s as Ot}from"./XClose-TrpNsToi.js";import{I as dn}from"./icon-button-BzCBL3cR.js";import{F as un}from"./file-type-icon-Cw2ugH1T.js";import{a as pn}from"./use-chat-navigation-Cc_f0d0S.js";import{b as fn}from"./location-BjlyegC2.js";import{d as hn,K as mn,b as gn}from"./shell-layout-CGcdMFur.js";import{a as $t}from"./repository-binding-BNg5TQOZ.js";import{w as xn,A as vn}from"./autosend-CcQyaIGA.js";import{s as bn,r as At,i as An,c as yn,w as jn,H as kn}from"./chat-draft-N3NbVf44.js";import{t as wn,z as Sn,l as Cn,r as Nn,d as In,f as Tn,h as _n,c as Mn}from"./thread-intent-DWaXIzM6.js";import{a as ze,u as We,b as Ye,c as Ge,i as Dn,k as Rn,m as Pn,n as En,o as Un,p as Ln,q as Fn,v as zn,e as On,s as $n,d as Bn}from"./chat-context-22ccNySK.js";import{i as Bt}from"./LinkBroken01-ydPCJGh6.js";import{i as Kt}from"./ArrowUp-YDXnrJ7G.js";import{n as qt}from"./ShoppingBag01-CAuMgtYk.js";import{a as He,aL as Qt,a2 as Wt,aO as st,h as lt,at as Kn,t as qn,aP as Qn,u as Yt,aQ as Gt,K as Wn,aR as Yn}from"./agent-icon-qroW1Utf.js";import{a as Ht}from"./Image01-cbCHFYmk.js";import{h as Gn}from"./UserSquare-D5P__qW1.js";import{i as Hn}from"./Upload01-B7IJQr07.js";import{i as Jn}from"./AlertCircle-DY8bqCha.js";import{a as Zn}from"./Copy01-CvPIDjuG.js";import{a as nt,b as Vt,d as ct,f as dt,F as Jt}from"./form-Ce4lrl07.js";import{c as Xn,S as eo,b as to,a as so,d as no}from"./select-6ljk5DPS.js";import{t as Zt}from"./ChevronUp-CqUEILrt.js";import{T as Je,a as Ze,b as Xe}from"./tooltip-a0H1qyBK.js";import{i as oo}from"./ArrowLeft--XLYCrc5.js";import{c as ro,b as io}from"./tabs-DDxLPvSM.js";import{e as Oe,f as ao,c as lo,g as Vo}from"./use-decopilot-events-Dd86Tcia.js";import{u as co}from"./use-deco-credits-BC6kbiHd.js";import{T as yt,a as uo}from"./toggle-group-NJ6o2Ub6.js";import{a as po,d as fo,g as jt,s as ho}from"./tool-namespace-D4Qkj0Hw.js";import{t as mo}from"./utils-CVEq3hMx.js";import{u as go}from"./use-open-billing-url-D2RlzIda.js";import{M as xo,a as vo,m as ut,g as bo,b as Ao}from"./index-2xZGo1OZ.js";import{a as Xt,b as es,P as ts}from"./popover-qqnMuKN1.js";import{c as yo,b as jo,a as ko,D as wo}from"./drawer-D2dqAMx2.js";import{u as ss}from"./use-mobile-lU_VA-Wz.js";import{t as So}from"./Tool01-PXS7oM2l.js";import{d as Co,a as No}from"./use-organization-settings-X0pPEcR2.js";import{u as ns,c as Io,d as To}from"./use-ai-providers-zmp15jyt.js";import{p as os,u as _o,T as Mo,a as Do,U as Ro}from"./input-C-7hE1b2.js";import{a as Po}from"./use-mcp-client-G9kTaeLN.js";import{l as Eo,g as Uo}from"./use-mcp-prompts-TIlwVbKk.js";import{i as Lo}from"./Link01-Cq7ZQK57.js";import{s as kt}from"./Plus-CS-imxjk.js";import"./suggestion-53Llg-e1.js";import{p as Fo,q as zo}from"./question-004-sINsf4GQ.js";import{A as Oo}from"./avatar-Cv41gISF.js";import{u as $o}from"./use-members-G69DqUHv.js";import{F as wt}from"./feature-paywall-AtCK-SZi.js";import{A as Bo}from"./add-connection-dialog-Co74MHAY.js";import{u as Ko}from"./use-task-board-events-UhXVQ3a7.js";import{h as qo}from"./use-chat-layout-state-Bcmu5rP3.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 Wo=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 Yo=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 Go=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 Ho=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)",ol=44,Jo={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"},Zo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Xo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=D.c(69),{icon:s,label:n,count:r,title:i,footerLeft:a,footerRight:l,children:c,defaultExpanded:d,variant:u,onClose:V}=t,p=u===void 0?"default":u,f=B(),[h,m]=E.useState(d),[g,x]=E.useState(!1);let v;e[0]!==V?(v=()=>{x(!0),V?.()},e[0]=V,e[1]=v):v=e[1];const b=v;if(g)return null;const j=Zo[p],A=Jo[p];let k;e[2]!==j||e[3]!==A?(k=O("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=()=>m(er),e[5]=w):w=e[5];const y=h&&"rounded-b-none",C=!h&&"rounded-b-xl";let S;e[6]!==y||e[7]!==C?(S=O("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=Xo[p];let N;e[9]!==I?(N=O("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let M;e[11]!==s||e[12]!==N?(M=o.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=M):M=e[13];let P;e[14]!==n?(P=o.jsx("span",{className:"flex-1 min-w-0 truncate",children:n}),e[14]=n,e[15]=P):P=e[15];let R;e[16]!==r?(R=r?o.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=R):R=e[17];const U=h?"rotate(180deg)":"rotate(0deg)";let _;e[18]!==U?(_=o.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:o.jsx(Zt,{size:16,style:{transform:U,transition:`transform 180ms ${et}`}})}),e[18]=U,e[19]=_):_=e[19];let L;e[20]!==f?(L=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=L):L=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=Ve=>{Ve.stopPropagation(),b()},$=Ve=>{(Ve.key==="Enter"||Ve.key===" ")&&(Ve.preventDefault(),Ve.stopPropagation(),b())},e[24]=b,e[25]=q,e[26]=$):(q=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=o.jsx(rt,{size:16}),e[27]=z):z=e[27];let W;e[28]!==L||e[29]!==F||e[30]!==q||e[31]!==$?(W=o.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,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:z}),e[28]=L,e[29]=F,e[30]=q,e[31]=$,e[32]=W):W=e[32];let X;e[33]!==h||e[34]!==M||e[35]!==P||e[36]!==R||e[37]!==_||e[38]!==W||e[39]!==S?(X=o.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:w,className:S,children:[M,P,R,_,W]}),e[33]=h,e[34]=M,e[35]=P,e[36]=R,e[37]=_,e[38]=W,e[39]=S,e[40]=X):X=e[40];const te=h?"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=h?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?o.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:o.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):o.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=Z):Z=e[47];let H;e[48]!==c||e[49]!==i?(H=c?o.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:c}):null,e[48]=c,e[49]=i,e[50]=H):H=e[50];let oe;e[51]!==Z||e[52]!==H?(oe=o.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,H]}),e[51]=Z,e[52]=H,e[53]=oe):oe=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?o.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:a}),o.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ie;e[57]!==Q||e[58]!==oe||e[59]!==G?(ie=o.jsx("div",{style:ae,children:o.jsxs("div",{className:"flex flex-col",style:Q,children:[oe,G]})}),e[57]=Q,e[58]=oe,e[59]=G,e[60]=ie):ie=e[60];let le;e[61]!==J||e[62]!==ie?(le=o.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:ie}),e[61]=J,e[62]=ie,e[63]=le):le=e[63];let pe;return e[64]!==X||e[65]!==le||e[66]!==k||e[67]!==p?(pe=o.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:k,children:[X,le]}),e[64]=X,e[65]=le,e[66]=k,e[67]=p,e[68]=pe):pe=e[68],pe}function er(t){return!t}const tr=re({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Fe(["pending","in_progress","completed"]),activeForm:ne().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(tr)}),sr="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.";wn({description:sr,inputSchema:Sn(rs),execute:async({todos:t})=>({ok:!0,count:t.length})});const nr="tool-todo_write",or=new Set(["input-available","output-available"]);function rr(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const n=s.parts;if(Array.isArray(n))for(let r=n.length-1;r>=0;r--){const i=n[r];if(i.type!==nr||typeof i.state!="string"||!or.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 n="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:n,friendlyName:mo(po(n)),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 ir(t){return t?t.message.startsWith("[CREDITS]"):!1}const ar={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function lr(t){const{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&ir(s))return{...ar,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],c=l,u=!!c.filter(k=>k.type==="tool-user_ask").filter(k=>k.state!=="output-available").length,V=c.some(Ft),p=ls(l),f=is(c),h=rr(e),m=r?null:bn(s),g=r?null:Cn(s),x=!r&&!!s&&!m&&!g,v=f.length>0||r&&i,b=p.length>0,A=!r&&!!n&&n!=="stop"&&!(n==="tool-calls"&&(u||v||b||V))&&!x;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:m,hasTodos:h.length>0,showError:x,showWarning:A,hasApprovals:v,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:V,todos:h}}function Vs(){const t=D.c(6),{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=ze(),a=s??null,l=n??null;let c;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(c=lr({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]=c):c=t[5],c}function rl(){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 St="start-task",Vr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-DMNH07wd.js","assets/index-E8HkK7le.js","assets/index-D7k-FSss.css","assets/usage-stats-CPP4mykS.js","assets/tool-namespace-D73-Yt47.js","assets/form-ChrFSKbl.js","assets/label-DAC0PXH6.js","assets/utils-CVEq3hMx.js","assets/markdown-D9Q4_EWf.js","assets/use-copy-BDIhU1a3.js","assets/Copy01-BR4eoDaW.js","assets/ZoomOut-BSXGk2sm.js","assets/location-BjlyegC2.js","assets/use-mobile-DMhjc8sS.js","assets/use-panel-navigate-B5g-cXoX.js","assets/thread-route-Bsh0W3WI.js","assets/use-project-scope-C_W_iYCG.js","assets/repository-binding-DJSfVmK0.js","assets/use-mcp-client-HXdOgSo1.js","assets/auth-C16DiwpU.js","assets/tooltip-Bgaj6wao.js","assets/index-5v4d81Co.js","assets/agent-icon-CIAqO6q_.js","assets/AlertCircle-uVTE_i_c.js","assets/Tool01-Dpcs_fEX.js","assets/ArrowUp-baihphF6.js","assets/ArrowLeft-D8kMxyF3.js","assets/LinkBroken01-BKVx2uSk.js","assets/ShoppingBag01-DhR5OJ_o.js","assets/Building02-C-k2Qn__.js","assets/CheckCircle-BgOw0_dD.js","assets/ChevronUp-B7O2Z2_x.js","assets/ChevronSelectorVertical-e0qa2qKk.js","assets/UserSquare-CG780QF2.js","assets/CreditCard01-pJwQfpbv.js","assets/DotsVertical-DOuXLsMk.js","assets/Image01-S90CE8VS.js","assets/Globe04-CYweJqdP.js","assets/SwitchHorizontal01-fI9_GGzc.js","assets/Key01-B5JsqJav.js","assets/Link01-Dz3IyYPr.js","assets/Monitor01-KqB9ZF5U.js","assets/Sun-BCMSoFWP.js","assets/Play-CygY0DVf.js","assets/Plus-Bj_QsLcq.js","assets/SearchMd-CVAVwuts.js","assets/Trash01-BwiN-bXW.js","assets/Upload01-nkaaAbTH.js","assets/User01-BSbwHeDW.js","assets/Users01-BuQlctw3.js","assets/XClose-CohaLXz5.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/use-decopilot-events-CG41uF0G.js","assets/thread-intent-DIdLWs3T.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-afzfEiDL.js","assets/task-board-BhjqCSbG.js","assets/schema-DAFIdNnw.js","assets/slugify-CEUa2lfQ.js","assets/chat-context-3OXKEqSh.js","assets/autosend-8Zl7NQ67.js","assets/use-ai-providers-4IWNnMYR.js","assets/use-chat-navigation-Bvo_pyzq.js","assets/use-organization-settings-C1JjAa2e.js","assets/icon-button-BEh8g82p.js","assets/file-type-icon-CH0zVmFE.js","assets/shell-layout-BfZ3aLwK.js","assets/avatar-PHlRD3By.js","assets/use-clock-tick-BH2s8rwm.js","assets/command--1ySxBzC.js","assets/index-Br_k5ZoS.js","assets/integration-icon-BMM9bKRw.js","assets/project-icon-CtWmpx-o.js","assets/new-project-dialog-CBz8t6bW.js","assets/repository-import-picker-CN4nBNQQ.js","assets/use-navigate-to-agent-8FxeDEql.js","assets/repository-picker-Bq1Xf_Nc.js","assets/useInfiniteQuery-BtM1Ign2.js","assets/infiniteQueryObserver-B_6kT4Pu.js","assets/collection-search-ZrNbDYaq.js","assets/use-debounced-value-DogqGlHA.js","assets/required-auth-layout-OT71YdwW.js","assets/use-org-sso-5XSC3bo7.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-oK0pqHaC.js","assets/select-JMx_Daeq.js","assets/index-BdQq_4o_.js","assets/tabs-BaVhZf2S.js","assets/use-deco-credits-D8fC6T0N.js","assets/toggle-group-B-oqQV0Q.js","assets/use-open-billing-url-CGiwz5yQ.js","assets/index-1lCyt6wZ.js","assets/checkbox-CRsuhP53.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-BiATgeVZ.js","assets/drawer-wiDylD44.js","assets/input-Bf9hsVol.js","assets/suggestion-CkSKi3Ko.js","assets/use-chat-layout-state-CbsP3hVN.js","assets/use-file-configs-CfHrYQ0D.js","assets/site-slug-DebpOoQq.js","assets/use-mcp-prompts-Dc22OpBz.js","assets/use-org-fs-Brfqc0DM.js","assets/question-004-sINsf4GQ.js","assets/use-members-BnU8sD2a.js","assets/use-org-auth-client-CjFoGBiw.js","assets/feature-paywall-DygeAwCp.js","assets/plan-ladder-D5P8cNNU.js","assets/add-connection-dialog-BHghNpDD.js","assets/extract-connection-data-BFr1XefI.js","assets/metadata-D72DunRR.js","assets/connection-eFBHXnq8.js","assets/url-slug-BCtPmKcV.js","assets/connection-card-Dd1Miwos.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-DUqfavim.js","assets/use-connection-B7mxZZZr.js","assets/connection-form-helpers-CjAkllf4.js","assets/authenticate-and-persist-oauth-BzcsLm_G.js","assets/mcp-oauth-D5hp_76q.js","assets/mcp-oauth-Cm-FGk67.js","assets/collection-tabs-CZnO-KJm.js","assets/badge-BTJCq3tr.js","assets/use-infinite-scroll-Doz-tD5w.js","assets/useSuspenseInfiniteQuery-DxUIRGU7.js","assets/use-task-board-events-DtM0CgpV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a_ as Le,c as D,b as B,r as E,l as O,j as o,aV as rt,aD as re,bU as Ut,aE as ne,bT as Fe,B as Y,aC as Ss,aB as Cs,cX as Ns,bS as Is,F as Se,b7 as Ts,eg as we,eh as mt,aa as _s,e as Ms,I as Ds,t as Ee,y as ee,a2 as Ce,d as it,ah as at,v as Rs,aK as Ps,s as Es,q as Us,D as Ls,ed as Fs,a4 as zs,K as Os,m as $s,X as Bs,T as Ks,V as qs,U as ye,as as gt,aq as xt,ar as vt,h as Qs,aR as Ws,aQ as Ys,at as Gs,cW as Hs,c$ as je,aW as Js,d1 as Zs,aX as bt,a$ as Xs,a as en,a0 as tn,a1 as sn,aJ as tt,af as Lt,bY as nn,aP as on}from"./index-E8HkK7le.js";import{i as Ft,c as rn,d as an,e as zt,P as ln,f as Vn,S as cn}from"./usage-stats-CPP4mykS.js";import{s as Ot}from"./XClose-CohaLXz5.js";import{I as dn}from"./icon-button-BEh8g82p.js";import{F as un}from"./file-type-icon-CH0zVmFE.js";import{a as pn}from"./use-chat-navigation-Bvo_pyzq.js";import{b as fn}from"./location-BjlyegC2.js";import{d as hn,K as mn,b as gn}from"./shell-layout-BfZ3aLwK.js";import{a as $t}from"./repository-binding-DJSfVmK0.js";import{w as xn,A as vn}from"./autosend-8Zl7NQ67.js";import{s as bn,r as At,i as An,c as yn,w as jn,H as kn}from"./chat-draft-oK0pqHaC.js";import{t as wn,z as Sn,l as Cn,r as Nn,d as In,f as Tn,h as _n,c as Mn}from"./thread-intent-DIdLWs3T.js";import{a as ze,u as We,b as Ye,c as Ge,i as Dn,k as Rn,m as Pn,n as En,o as Un,p as Ln,q as Fn,v as zn,e as On,s as $n,d as Bn}from"./chat-context-3OXKEqSh.js";import{i as Bt}from"./LinkBroken01-BKVx2uSk.js";import{i as Kt}from"./ArrowUp-baihphF6.js";import{n as qt}from"./ShoppingBag01-DhR5OJ_o.js";import{a as He,aL as Qt,a2 as Wt,aO as st,h as lt,at as Kn,t as qn,aP as Qn,u as Yt,aQ as Gt,K as Wn,aR as Yn}from"./agent-icon-CIAqO6q_.js";import{a as Ht}from"./Image01-S90CE8VS.js";import{h as Gn}from"./UserSquare-CG780QF2.js";import{i as Hn}from"./Upload01-nkaaAbTH.js";import{i as Jn}from"./AlertCircle-uVTE_i_c.js";import{a as Zn}from"./Copy01-BR4eoDaW.js";import{a as nt,b as Vt,d as ct,f as dt,F as Jt}from"./form-ChrFSKbl.js";import{c as Xn,S as eo,b as to,a as so,d as no}from"./select-JMx_Daeq.js";import{t as Zt}from"./ChevronUp-B7O2Z2_x.js";import{T as Je,a as Ze,b as Xe}from"./tooltip-Bgaj6wao.js";import{i as oo}from"./ArrowLeft-D8kMxyF3.js";import{c as ro,b as io}from"./tabs-BaVhZf2S.js";import{e as Oe,f as ao,c as lo,g as Vo}from"./use-decopilot-events-CG41uF0G.js";import{u as co}from"./use-deco-credits-D8fC6T0N.js";import{T as yt,a as uo}from"./toggle-group-B-oqQV0Q.js";import{a as po,d as fo,g as jt,s as ho}from"./tool-namespace-D73-Yt47.js";import{t as mo}from"./utils-CVEq3hMx.js";import{u as go}from"./use-open-billing-url-CGiwz5yQ.js";import{M as xo,a as vo,m as ut,g as bo,b as Ao}from"./index-1lCyt6wZ.js";import{a as Xt,b as es,P as ts}from"./popover-BiATgeVZ.js";import{c as yo,b as jo,a as ko,D as wo}from"./drawer-wiDylD44.js";import{u as ss}from"./use-mobile-DMhjc8sS.js";import{t as So}from"./Tool01-Dpcs_fEX.js";import{d as Co,a as No}from"./use-organization-settings-C1JjAa2e.js";import{u as ns,c as Io,d as To}from"./use-ai-providers-4IWNnMYR.js";import{p as os,u as _o,T as Mo,a as Do,U as Ro}from"./input-Bf9hsVol.js";import{a as Po}from"./use-mcp-client-HXdOgSo1.js";import{l as Eo,g as Uo}from"./use-mcp-prompts-Dc22OpBz.js";import{i as Lo}from"./Link01-Dz3IyYPr.js";import{s as kt}from"./Plus-Bj_QsLcq.js";import"./suggestion-CkSKi3Ko.js";import{p as Fo,q as zo}from"./question-004-sINsf4GQ.js";import{A as Oo}from"./avatar-PHlRD3By.js";import{u as $o}from"./use-members-BnU8sD2a.js";import{F as wt}from"./feature-paywall-DygeAwCp.js";import{A as Bo}from"./add-connection-dialog-BHghNpDD.js";import{u as Ko}from"./use-task-board-events-DtM0CgpV.js";import{h as qo}from"./use-chat-layout-state-CbsP3hVN.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 Wo=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 Yo=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 Go=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 Ho=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)",ol=44,Jo={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"},Zo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Xo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=D.c(69),{icon:s,label:n,count:r,title:i,footerLeft:a,footerRight:l,children:c,defaultExpanded:d,variant:u,onClose:V}=t,p=u===void 0?"default":u,f=B(),[h,m]=E.useState(d),[g,x]=E.useState(!1);let v;e[0]!==V?(v=()=>{x(!0),V?.()},e[0]=V,e[1]=v):v=e[1];const b=v;if(g)return null;const j=Zo[p],A=Jo[p];let k;e[2]!==j||e[3]!==A?(k=O("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=()=>m(er),e[5]=w):w=e[5];const y=h&&"rounded-b-none",C=!h&&"rounded-b-xl";let S;e[6]!==y||e[7]!==C?(S=O("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=Xo[p];let N;e[9]!==I?(N=O("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let M;e[11]!==s||e[12]!==N?(M=o.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=M):M=e[13];let P;e[14]!==n?(P=o.jsx("span",{className:"flex-1 min-w-0 truncate",children:n}),e[14]=n,e[15]=P):P=e[15];let R;e[16]!==r?(R=r?o.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=R):R=e[17];const U=h?"rotate(180deg)":"rotate(0deg)";let _;e[18]!==U?(_=o.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:o.jsx(Zt,{size:16,style:{transform:U,transition:`transform 180ms ${et}`}})}),e[18]=U,e[19]=_):_=e[19];let L;e[20]!==f?(L=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=L):L=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=Ve=>{Ve.stopPropagation(),b()},$=Ve=>{(Ve.key==="Enter"||Ve.key===" ")&&(Ve.preventDefault(),Ve.stopPropagation(),b())},e[24]=b,e[25]=q,e[26]=$):(q=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=o.jsx(rt,{size:16}),e[27]=z):z=e[27];let W;e[28]!==L||e[29]!==F||e[30]!==q||e[31]!==$?(W=o.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,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:z}),e[28]=L,e[29]=F,e[30]=q,e[31]=$,e[32]=W):W=e[32];let X;e[33]!==h||e[34]!==M||e[35]!==P||e[36]!==R||e[37]!==_||e[38]!==W||e[39]!==S?(X=o.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:w,className:S,children:[M,P,R,_,W]}),e[33]=h,e[34]=M,e[35]=P,e[36]=R,e[37]=_,e[38]=W,e[39]=S,e[40]=X):X=e[40];const te=h?"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=h?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?o.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:o.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):o.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=Z):Z=e[47];let H;e[48]!==c||e[49]!==i?(H=c?o.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:c}):null,e[48]=c,e[49]=i,e[50]=H):H=e[50];let oe;e[51]!==Z||e[52]!==H?(oe=o.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,H]}),e[51]=Z,e[52]=H,e[53]=oe):oe=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?o.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:a}),o.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ie;e[57]!==Q||e[58]!==oe||e[59]!==G?(ie=o.jsx("div",{style:ae,children:o.jsxs("div",{className:"flex flex-col",style:Q,children:[oe,G]})}),e[57]=Q,e[58]=oe,e[59]=G,e[60]=ie):ie=e[60];let le;e[61]!==J||e[62]!==ie?(le=o.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:ie}),e[61]=J,e[62]=ie,e[63]=le):le=e[63];let pe;return e[64]!==X||e[65]!==le||e[66]!==k||e[67]!==p?(pe=o.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:k,children:[X,le]}),e[64]=X,e[65]=le,e[66]=k,e[67]=p,e[68]=pe):pe=e[68],pe}function er(t){return!t}const tr=re({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Fe(["pending","in_progress","completed"]),activeForm:ne().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(tr)}),sr="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.";wn({description:sr,inputSchema:Sn(rs),execute:async({todos:t})=>({ok:!0,count:t.length})});const nr="tool-todo_write",or=new Set(["input-available","output-available"]);function rr(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const n=s.parts;if(Array.isArray(n))for(let r=n.length-1;r>=0;r--){const i=n[r];if(i.type!==nr||typeof i.state!="string"||!or.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 n="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:n,friendlyName:mo(po(n)),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 ir(t){return t?t.message.startsWith("[CREDITS]"):!1}const ar={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function lr(t){const{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&ir(s))return{...ar,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],c=l,u=!!c.filter(k=>k.type==="tool-user_ask").filter(k=>k.state!=="output-available").length,V=c.some(Ft),p=ls(l),f=is(c),h=rr(e),m=r?null:bn(s),g=r?null:Cn(s),x=!r&&!!s&&!m&&!g,v=f.length>0||r&&i,b=p.length>0,A=!r&&!!n&&n!=="stop"&&!(n==="tool-calls"&&(u||v||b||V))&&!x;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:m,hasTodos:h.length>0,showError:x,showWarning:A,hasApprovals:v,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:V,todos:h}}function Vs(){const t=D.c(6),{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=ze(),a=s??null,l=n??null;let c;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(c=lr({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]=c):c=t[5],c}function rl(){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 St="start-task",Vr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
3
3
|
|
|
4
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
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
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
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
8
|
|
|
9
|
-
The report follows.`;function cr(t){return{...t,content:[{type:"paragraph",content:[rn({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:Vr}}]})]},...t.content??[]]}}function dr(){const t=D.c(24),e=B(),s=pn();if(!s)return null;let n,r,i,a;t[0]!==s.path||t[1]!==e?(n=fn(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:n}),t[0]=s.path,t[1]=e,t[2]=n,t[3]=r,t[4]=i,t[5]=a):(n=t[2],r=t[3],i=t[4],a=t[5]);let l,c;t[6]!==n?(l=o.jsx(un,{filename:n,className:"h-4 w-3 shrink-0"}),c=o.jsx("span",{className:"truncate",children:n}),t[6]=n,t[7]=l,t[8]=c):(l=t[7],c=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=o.jsx(Ot,{size:12}),t[11]=u):u=t[11];let V;t[12]!==s.dismiss||t[13]!==d?(V=o.jsx(dn,{label:d,size:"icon-sm",onClick:s.dismiss,children:u}),t[12]=s.dismiss,t[13]=d,t[14]=V):V=t[14];let p;t[15]!==r||t[16]!==i||t[17]!==l||t[18]!==c||t[19]!==V?(p=o.jsxs("span",{className:r,title:i,children:[l,c,V]}),t[15]=r,t[16]=i,t[17]=l,t[18]=c,t[19]=V,t[20]=p):p=t[20];let f;return t[21]!==a||t[22]!==p?(f=o.jsx("div",{className:a,children:p}),t[21]=a,t[22]=p,t[23]=f):f=t[23],f}function ur(t){const e=D.c(14),s=$t(t),n=We(),r=s?.metadata,i=n?.activeTask,a=i?.metadata?.runtime;let l;e[0]!==a?(l=_n(a),e[0]=a,e[1]=l):l=e[1];const c=l,d=!!i&&!i.partial,u=i?.metadata;let V;e[2]!==r||e[3]!==u?(V=Nn(u,r),e[2]=r,e[3]=u,e[4]=V):V=e[4];const p=!!c||d&&!!s;let f;e[5]!==r?(f=In(r),e[5]=r,e[6]=f):f=e[6];let h;e[7]!==r?(h=Tn(r),e[7]=r,e[8]=h):h=e[8];let m;return e[9]!==V||e[10]!==p||e[11]!==f||e[12]!==h?(m={runtime:V,resolved:p,projectDefault:f,previewServerUrl:h},e[9]=V,e[10]=p,e[11]=f,e[12]=h,e[13]=m):m=e[13],m}function pr(t){const e=D.c(30),{current:s,total:n,onPrev:r,onNext:i}=t,a=B();if(n<=1)return null;const l=s===0,c=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==c?(d=O("p-0.5 transition-colors rounded-lg",c),e[0]=c,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 V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(oo,{size:14}),e[4]=V):V=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=o.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:V}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let h;e[10]!==a||e[11]!==f||e[12]!==n?(h=a("chat.pagination.counter",{current:f,total:n}),e[10]=a,e[11]=f,e[12]=n,e[13]=h):h=e[13];let m;e[14]!==h?(m=o.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=m):m=e[15];const g=s===n-1,x=s===n-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let v;e[16]!==x?(v=O("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=o.jsx(Bt,{size:14}),e[20]=j):j=e[20];let A;e[21]!==i||e[22]!==g||e[23]!==v||e[24]!==b?(A=o.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]!==m?(k=o.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,m,A]}),e[26]=A,e[27]=p,e[28]=m,e[29]=k):k=e[29],k}function cs(t){const e=D.c(8),{currentIndex:s,total:n,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==n?(l=o.jsx(pr,{current:s,total:n,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=n,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=o.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function fr(t){const e=D.c(17),{isStreaming:s,isAllAnswered:n,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=n?a===void 0?"Submit":a:l===void 0?"Next":l,V=n?s:!r,p=V?n?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==V||e[1]!==i?(f=()=>{V||i()},e[0]=V,e[1]=i,e[2]=f):f=e[2];const h=V&&"opacity-50 cursor-not-allowed";let m;e[3]!==h?(m=O("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=m):m=e[4];let g;e[5]!==V||e[6]!==u||e[7]!==f||e[8]!==m?(g=o.jsx(Y,{type:"button",size:"sm","aria-disabled":V,onClick:f,className:m,children:u}),e[5]=V,e[6]=u,e[7]=f,e[8]=m,e[9]=g):g=e[9];const x=g;if(!p)return x;let v;e[10]!==x?(v=o.jsx(Je,{asChild:!0,children:x}),e[10]=x,e[11]=v):v=e[11];let b;e[12]!==p?(b=o.jsx(Ze,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;return e[14]!==v||e[15]!==b?(j=o.jsxs(Xe,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16],j}function ds(t,e,s){return t.findIndex(n=>e(n)===s)}function Ct(t,e,s,n){return t.length===0?!1:t.every(r=>n(s[e(r)]))}function Nt(t,e,s,n,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 c=e(l);if(c!==r&&!n(s[c]))return c}return null}function hr(t){return!t.isStreaming&&t.allAnswered}function us(t){const{parts:e,partKey:s,schema:n,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,c=e[0]?s(e[0]):"",[d,u]=E.useState(c),[V,p]=E.useState(!1),f=Ss({resolver:Cs(n),defaultValues:r}),h=f.watch(),m=ds(e,s,d),g=m>=0?e[m]:void 0,x=a(h[d]),v=Ct(e,s,h,a),b=hr({isStreaming:i,allAnswered:v}),j=()=>{if(m>0){const I=e[m-1];I&&u(s(I))}},A=()=>{if(m>=0&&m<e.length-1){const I=e[m+1];I&&u(s(I))}},k=()=>{const I=f.getValues(),N=Nt(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=E.useRef(w);y.current=w;const C=()=>{b&&(p(!1),y.current())},S=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),y.current()}else{const N=Nt(e,s,I,a,d);N&&u(N)}};return E.useEffect(()=>{if(V&&!i){if(!v){p(!1);return}p(!1),y.current()}},[V,i,v]),{form:f,activeKey:d,setActiveKey:u,currentIndex:m,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=D.c(36),{onYolo:s}=t,n=B(),[r,i]=Se();let a,l,c,d,u,V,p,f,h;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){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;c=eo,f=r.toolApprovalLevel,h=k,l=to,u="xs",V="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=mr,a=so,d=n(j.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=a,e[5]=l,e[6]=c,e[7]=d,e[8]=u,e[9]=V,e[10]=p,e[11]=f,e[12]=h}else a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],V=e[9],p=e[10],f=e[11],h=e[12];let m;e[17]!==a||e[18]!==d?(m=o.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=m):m=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==V||e[23]!==p||e[24]!==m?(g=o.jsx(l,{size:u,className:V,onClick:p,children:m}),e[20]=l,e[21]=u,e[22]=V,e[23]=p,e[24]=m,e[25]=g):g=e[25];let x;e[26]!==n?(x=we.map(j=>o.jsx(Xn,{value:j.value,children:n(j.labelKey)},j.value)),e[26]=n,e[27]=x):x=e[27];let v;e[28]!==x?(v=o.jsx(no,{children:x}),e[28]=x,e[29]=v):v=e[29];let b;return e[30]!==c||e[31]!==v||e[32]!==f||e[33]!==h||e[34]!==g?(b=o.jsxs(c,{value:f,onValueChange:h,children:[g,v]}),e[30]=c,e[31]=v,e[32]=f,e[33]=h,e[34]=g,e[35]=b):b=e[35],b}function mr(t){return t.stopPropagation()}function hs(t){const e=D.c(8),{input:s}=t,n=B();if(s==null){let a;e[0]!==n?(a=n("chat.approval.noInput"),e[0]=n,e[1]=a):a=e[1];let l;return e[2]!==a?(l=o.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=o.jsx("div",{className:"px-4",children:o.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 gr(t){const e=D.c(38),{approval:s,onRespond:n}=t,r=B(),[i]=Se(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==n||e[3]!==r?(l=()=>n(s.approvalId,!1,r(ps),a),e[0]=s.approvalId,e[1]=a,e[2]=n,e[3]=r,e[4]=l):l=e[4];const c=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==n?(d=()=>n(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=n,e[8]=d):d=e[8];const u=d;let V;e[9]!==s.approvalId||e[10]!==n?(V=C=>n(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=n,e[11]=V):V=e[11];const p=V;let f;e[12]!==p?(f=o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(fs,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const h=f;let m;e[14]!==r?(m=r("chat.approval.denyButton"),e[14]=r,e[15]=m):m=e[15];let g;e[16]!==c||e[17]!==m?(g=o.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:c,children:m}),e[16]=c,e[17]=m,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=o.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=o.jsxs(o.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=o.jsx(He,{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=o.jsx(hs,{input:s.input}),e[30]=s.input,e[31]=w):w=e[31];let y;return e[32]!==s.friendlyName||e[33]!==h||e[34]!==j||e[35]!==k||e[36]!==w?(y=o.jsx(ue,{icon:A,label:k,title:s.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:j,children:w}),e[32]=s.friendlyName,e[33]=h,e[34]=j,e[35]=k,e[36]=w,e[37]=y):y=e[37],y}const xr=Ns(ne(),re({approved:Is().optional(),levelOverride:Fe(["auto","readonly"]).optional()}));function vr(t){const e=D.c(46),{approvals:s,isStreaming:n,onRespond:r}=t,i=B(),[a]=Se(),l=a.toolApprovalLevel??"readonly";let c;e[0]!==s?(c=Object.fromEntries(s.map(yr)),e[0]=s,e[1]=c):c=e[1];const d=c;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,M)=>{const P=M;typeof P?.approved=="boolean"&&r(N.approvalId,P.approved,P.approved===!1?i(ps):void 0,P.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let V;e[6]!==s||e[7]!==d||e[8]!==n||e[9]!==u?(V={parts:s,partKey:Ar,schema:xr,defaultValues:d,isStreaming:n,hasAnswer:br,onSubmit:u},e[6]=s,e[7]=d,e[8]=n,e[9]=u,e[10]=V):V=e[10];const p=us(V);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 h=f,m=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=o.jsx(He,{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=m?.friendlyName??"";let A;e[20]!==h?(A=o.jsx(fs,{onYolo:h}),e[20]=h,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=o.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]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(w=m?o.jsx(jr,{approvalId:m.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=m,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=w):w=e[31];let y;e[32]!==m?(y=m?o.jsx(hs,{input:m.input}):null,e[32]=m,e[33]=y):y=e[33];let C;e[34]!==k||e[35]!==w||e[36]!==y||e[37]!==b||e[38]!==j?(C=o.jsx(ue,{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=o.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=o.jsx(nt,{...g,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function br(t){return typeof t?.approved=="boolean"}function Ar(t){return t.approvalId}function yr(t){return[t.approvalId,{approved:void 0}]}function jr(t){const e=D.c(7),{approvalId:s,control:n,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,V=u.value===!0,p=u.value===!1;return o.jsxs(o.Fragment,{children:[o.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")}),o.jsx(Y,{type:"button",variant:V?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":V,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let c;return e[3]!==n||e[4]!==a||e[5]!==l?(c=o.jsx(Ts,{control:n,name:a,render:l}),e[3]=n,e[4]=a,e[5]=l,e[6]=c):c=e[6],c}function kr(){const t=D.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(He,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.approval.preparingRequest"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.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,o.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function wr(t){const e=D.c(8),{approvals:s,isStreaming:n,onRespond:r}=t;if(n&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(kr,{}),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=o.jsx(gr,{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]!==n||e[6]!==r?(i=o.jsx(vr,{approvals:s,isStreaming:n,onRespond:r}),e[4]=s,e[5]=n,e[6]=r,e[7]=i):i=e[7],i}function Sr(t){const e=D.c(28),{plan:s,onApprove:n,onDismiss:r}=t,i=B();let a;e[0]!==n||e[1]!==s.plan?(a=()=>{n(s.plan)},e[0]=n,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let c;e[3]!==i?(c=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==c?(d=o.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:c}),e[5]=r,e[6]=c,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 V;e[10]!==l||e[11]!==u?(V=o.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]=V):V=e[12];let p;e[13]!==d||e[14]!==V?(p=o.jsxs(o.Fragment,{children:[d,V]}),e[13]=d,e[14]=V,e[15]=p):p=e[15];const f=p;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Qt,{size:14}),e[16]=h):h=e[16];let m;e[17]!==i?(m=i("chat.proposePlan.planReady"),e[17]=i,e[18]=m):m=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=o.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:o.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:o.jsx(an,{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]!==m||e[26]!==g?(v=o.jsx(ue,{icon:h,label:m,title:g,defaultExpanded:!0,footerRight:f,children:x}),e[23]=f,e[24]=x,e[25]=m,e[26]=g,e[27]=v):v=e[27],v}function Cr(t){const e=D.c(6),{plans:s,onApprove:n,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]!==n||e[4]!==r?(l=o.jsx(Sr,{plan:a,onApprove:n,onDismiss:r}),e[2]=a,e[3]=n,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 It=re({response:ne().min(1,"Response is required")}),Nr=re({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ir=re({response:Fe(["yes","no"])});function Tr(t){switch(t.type){case"text":return It;case"choice":return Nr;case"confirm":return Ir;default:return It}}function _r(t){const e={};for(const s of t)e[s.toolCallId]=Tr(s.input);return re(e)}function Mr(t){const e=D.c(7),{control:s,name:n,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=c=>{const{field:d}=c,u=d.value??"";return o.jsxs(Vt,{children:[o.jsx(ct,{children:o.jsx("div",{className:"px-2",children:o.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Wt,{size:16,className:"text-muted-foreground"})}),o.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"})]})})}),o.jsx(dt,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==n||e[5]!==a?(l=o.jsx(Jt,{control:s,name:n,render:a}),e[3]=s,e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function gs(t,e){const s=D.c(4);let n,r;s[0]!==t||s[1]!==e?(n=()=>{const i=a=>{if(hn(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]=n,s[3]=r):(n=s[2],r=s[3]),E.useEffect(n,r)}function Dr(t){const e=D.c(51),{control:s,name:n,options:r}=t,i=B(),a=`${n}.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:c}=mt(l),d=`${n}.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:V}=mt(u),p=c.value,f=V.value??"";let h;if(e[6]!==c||e[7]!==r?(h=U=>{const _=r[U];_!=null&&c.onChange(_)},e[6]=c,e[7]=r,e[8]=h):h=e[8],gs(r.length,h),r.length===0)return null;const m=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]!==c||e[12]!==p||e[13]!==r||e[14]!==i){let U;e[16]!==c||e[17]!==p||e[18]!==i?(U=(_,L)=>{const F=p===_;return o.jsxs("button",{type:"button",onClick:()=>c.onChange(_),className:O("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:[o.jsx("span",{className:O("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:L+1}),o.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:_})]},`${L}-${_}`)},e[16]=c,e[17]=p,e[18]=i,e[19]=U):U=e[19],x=r.map(U),e[11]=c,e[12]=p,e[13]=r,e[14]=i,e[15]=x}else x=e[15];const v=m&&"bg-accent/50",b=!m&&"hover:bg-accent/30";let j;e[20]!==v||e[21]!==b?(j=O("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=o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Wt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const k=m?f:"";let w;e[24]!==V||e[25]!==c||e[26]!==p?(w=U=>{V.onChange(U.target.value),p!==null&&c.onChange(null)},e[24]=V,e[25]=c,e[26]=p,e[27]=w):w=e[27];let y;e[28]!==c||e[29]!==p?(y=()=>{p!==null&&c.onChange(null)},e[28]=c,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=o.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=o.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=o.jsx(ct,{children:o.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 P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx(dt,{}),e[48]=P):P=e[48];let R;return e[49]!==M?(R=o.jsxs(Vt,{children:[M,P]}),e[49]=M,e[50]=R):R=e[50],R}function Rr(t){const e=D.c(8),{control:s,name:n}=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=E.useRef(null);let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=V=>{l.current?.onChange(a[V]??"")},e[1]=c):c=e[1],gs(a.length,c);let d;e[2]!==r?(d=V=>{const{field:p}=V;return l.current=p,o.jsxs(Vt,{children:[o.jsx(ct,{children:o.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const h=p.value===f;return o.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[o.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),o.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),o.jsx(dt,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==n||e[6]!==d?(u=o.jsx(Jt,{control:s,name:n,render:d}),e[4]=s,e[5]=n,e[6]=d,e[7]=u):u=e[7],u}function Tt(t){const e=D.c(13),{input:s,control:n,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==n||e[1]!==s.default||e[2]!==i?(a=o.jsx(Mr,{control:n,name:i,placeholder:s.default}),e[0]=n,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]!==n||e[7]!==a||e[8]!==r?(l=o.jsx(Dr,{control:n,name:r,options:a}),e[6]=n,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==n||e[11]!==i?(a=o.jsx(Rr,{control:n,name:i}),e[10]=n,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Pr(t){const e=D.c(91),{parts:s,isStreaming:n,onSubmit:r}=t;let i;e[0]!==s?(i=_r(s.map(Fr)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Lr)),e[2]=s,e[3]=l):l=e[3];const c=l;let d;e[4]!==r?(d=($,z)=>{const W=ms(z);W&&r($,W)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==n||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Ur,schema:a,defaultValues:c,isStreaming:n,hasAnswer:Er,onSubmit:d},e[6]=c,e[7]=n,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const V=us(u),p=V.currentPart,f=B();let h;e[12]!==p||e[13]!==V||e[14]!==f?(h=()=>{const $=p;if(!$)return;const z=f("chat.userAskQuestion.skipMessage"),W=$.toolCallId;$.input?.type==="choice"?(V.form.setValue(`${W}.option`,null),V.form.setValue(`${W}.draft`,z)):V.form.setValue(`${W}.response`,z),V.advanceToNextUnanswered()},e[12]=p,e[13]=V,e[14]=f,e[15]=h):h=e[15];const m=h;let g;e[16]!==V.currentIndex||e[17]!==V.goNext||e[18]!==V.goPrev||e[19]!==s.length?(g=o.jsx(cs,{currentIndex:V.currentIndex,total:s.length,onPrev:V.goPrev,onNext:V.goNext}),e[16]=V.currentIndex,e[17]=V.goNext,e[18]=V.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]!==m||e[24]!==v?(b=o.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:v}),e[23]=m,e[24]=v,e[25]=b):b=e[25];let j;e[26]!==V.isAllAnswered||e[27]!==V.isCurrentAnswered||e[28]!==V.submitOrAdvance||e[29]!==n?(j=o.jsx(fr,{isStreaming:n,isAllAnswered:V.isAllAnswered,isCurrentAnswered:V.isCurrentAnswered,onAdvanceOrSubmit:V.submitOrAdvance}),e[26]=V.isAllAnswered,e[27]=V.isCurrentAnswered,e[28]=V.submitOrAdvance,e[29]=n,e[30]=j):j=e[30];let A;e[31]!==b||e[32]!==j?(A=o.jsxs(o.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 z=V.form;let W;e[34]!==V?(W=oe=>{oe.preventDefault(),V.submit()},e[34]=V,e[35]=W):W=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=o.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]!==V.form.control||e[43]!==$.toolCallId||e[44]!==ae?(T=o.jsx(Tt,{input:ae,control:V.form.control,toolCallId:$.toolCallId}),e[42]=V.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=o.jsx(ue,{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=o.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]!==V.form||e[55]!==Z?(H=o.jsx(nt,{...z,children:Z}),e[54]=V.form,e[55]=Z,e[56]=H):H=e[56],H}const w=V.form;let y;e[57]!==V?(y=$=>{$.preventDefault(),V.submit()},e[57]=V,e[58]=y):y=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=o.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=V.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 P=V.activeKey,R=V.setActiveKey;let U;if(e[69]!==V.form||e[70]!==s){let $;e[72]!==V.form?($=z=>o.jsx(ro,{value:z.toolCallId,className:"mt-0",children:o.jsx(Tt,{input:z.input,control:V.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=V.form,e[73]=$):$=e[73],U=s.map($),e[69]=V.form,e[70]=s,e[71]=U}else U=e[71];let _;e[74]!==V.activeKey||e[75]!==V.setActiveKey||e[76]!==U?(_=o.jsx(io,{value:P,onValueChange:R,children:U}),e[74]=V.activeKey,e[75]=V.setActiveKey,e[76]=U,e[77]=_):_=e[77];let L;e[78]!==x||e[79]!==k||e[80]!==S||e[81]!==N||e[82]!==M||e[83]!==_?(L=o.jsx(ue,{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]=L):L=e[84];let F;e[85]!==y||e[86]!==L?(F=o.jsx("form",{onSubmit:y,autoComplete:"off",children:L}),e[85]=y,e[86]=L,e[87]=F):F=e[87];let q;return e[88]!==V.form||e[89]!==F?(q=o.jsx(nt,{...w,children:F}),e[88]=V.form,e[89]=F,e[90]=q):q=e[90],q}function Er(t){return!!ms(t)}function Ur(t){return t.toolCallId}function Lr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Fr(t){return{toolCallId:t.toolCallId,input:t.input}}function zr(){const t=D.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.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,o.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function xs(t){const e=D.c(7),{userAskParts:s,isStreaming:n,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Or),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(n){let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(zr,{}),e[2]=c):c=e[2],c}return null}let l;return e[3]!==n||e[4]!==r||e[5]!==a?(l=o.jsx(Pr,{parts:a,isStreaming:n,onSubmit:r}),e[3]=n,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Or(t){return t.state==="input-available"}function $r(t){const e=D.c(33),{parts:s,isStreaming:n,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,c=l?.input;if(!l||!c?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=o.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 V=c.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 h;e[10]!==n||e[11]!==p||e[12]!==f?(h=o.jsx(Y,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:n,onClick:p,children:f}),e[10]=n,e[11]=p,e[12]=f,e[13]=h):h=e[13];let m;e[14]!==r||e[15]!==l?(m=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=m):m=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]!==n||e[20]!==m||e[21]!==g?(x=o.jsx(Y,{type:"button",size:"sm",className:"h-7",disabled:n,onClick:m,children:g}),e[19]=n,e[20]=m,e[21]=g,e[22]=x):x=e[22];let v;e[23]!==x||e[24]!==h?(v=o.jsxs(o.Fragment,{children:[h,x]}),e[23]=x,e[24]=h,e[25]=v):v=e[25];let b;e[26]!==c.summary?(b=c.summary?o.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:c.summary}):null,e[26]=c.summary,e[27]=b):b=e[27];let j;return e[28]!==c.title||e[29]!==v||e[30]!==b||e[31]!==u?(j=o.jsx(ue,{icon:d,label:u,title:V,defaultExpanded:!0,footerRight:v,children:b}),e[28]=c.title,e[29]=v,e[30]=b,e[31]=u,e[32]=j):j=e[32],j}function Br(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,n=t.length;if(n>0&&s===n)return{icon:"completed",activity:"All done",progress:`${n}/${n}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${n} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${n} done`}:s>0?{icon:"pending",activity:`${n-s} pending`,progress:`${s}/${n} done`}:{icon:"pending",activity:`${n} todos`,progress:"not started"}}function Kr(t){const e=D.c(13),{todos:s}=t;if(s.length===0)return null;let n;e[0]!==s?(n=Br(s),e[0]=s,e[1]=n):n=e[1];const r=n;let i;e[2]!==r.icon?(i=o.jsx(Yr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let c;e[4]!==s?(c=s.map(qr),e[4]=s,e[5]=c):c=e[5];let d;e[6]!==c?(d=o.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:c}),e[6]=c,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=o.jsx(ue,{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 qr(t,e){return o.jsx(Qr,{todo:t},e)}function Qr(t){const e=D.c(14),{todo:s}=t,n=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=o.jsx(Wr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=n&&"text-muted-foreground";let c;e[2]!==l?(c=O("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=c):c=e[3];const d=n?"100%":"0%",u=n?"width 300ms ease 200ms":"width 150ms ease";let V;e[4]!==d||e[5]!==u?(V=o.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]=V):V=e[6];let p;e[7]!==i||e[8]!==c||e[9]!==V?(p=o.jsxs("span",{className:c,children:[i,V]}),e[7]=i,e[8]=c,e[9]=V,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=o.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 Wr(t){const e=D.c(4),{status:s}=t,n=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("svg",{viewBox:"0 0 21 21",children:o.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]!==n||e[2]!==r?(a=o.jsx("div",{className:"todo-cb mt-0.5","data-checked":n,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function Yr(t){const e=D.c(13),{status:s}=t,n=B();if(s==="completed"){let a;e[0]!==n?(a=n("chat.todoStatus.completed"),e[0]=n,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.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:o.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let c;return e[3]!==a?(c=o.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]=c):c=e[4],c}if(s==="in_progress"){let a;e[5]!==n?(a=n("chat.todoStatus.inProgress"),e[5]=n,e[6]=a):a=e[6];let l;return e[7]!==a?(l=o.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]!==n?(r=n("chat.todoStatus.pending"),e[9]=n,e[10]=r):r=e[10];let i;return e[11]!==r?(i=o.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 Gr={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"}]},Hr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Jr(t){const e=D.c(46),{source:s,onDone:n}=t,r=B(),i=_s(),[a]=Se(),[l,c]=E.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=E.useState(""),[V,p]=E.useState(!1),f=l==="brl"?"R$":"$";let h;e[0]!==l||e[1]!==i?(h=async _=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:_,currency:l});return L},e[0]=l,e[1]=i,e[2]=h):h=e[2];let m;e[3]!==n?(m=_=>{_&&window.open(_,"_blank","noopener,noreferrer"),n?.()},e[3]=n,e[4]=m):m=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]!==h||e[8]!==m||e[9]!==g?(x={mutationFn:h,onSuccess:m,onError:g},e[7]=h,e[8]=m,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=(_,L)=>{ee("credits_topup_clicked",{amount_cents:_,currency:l,tier_label:L,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=_=>{_&&c(_)},C=o.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=o.jsx(yt,{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=o.jsx("div",{className:"mb-4",children:o.jsxs(uo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:y,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=Gr[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?(_=L=>{const{dollars:F,labelKey:q}=L;return o.jsxs("button",{type:"button",disabled:b,onClick:()=>A(F*100,Hr[q]??"preset"),className:O("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:[o.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,F]}),o.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 P;e[31]!==M?(P=o.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:M}),e[31]=M,e[32]=P):P=e[32];let R;e[33]!==A||e[34]!==f||e[35]!==d||e[36]!==k||e[37]!==w||e[38]!==b||e[39]!==V||e[40]!==r?(R=V?o.jsxs("div",{className:"flex gap-2 mt-3",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),o.jsx(Ds,{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})]}),o.jsx(Y,{className:"h-10",disabled:!w||b,onClick:()=>A(Math.round(k*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):o.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]=V,e[40]=r,e[41]=R):R=e[41];let U;return e[42]!==P||e[43]!==R||e[44]!==I?(U=o.jsxs("div",{children:[I,P,R]}),e[42]=P,e[43]=R,e[44]=I,e[45]=U):U=e[45],U}const Zr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Xr(t){const e=D.c(47),{onDismiss:s}=t,{org:n}=Ce(),r=it(),{decoKeyId:i}=co(),a=B(),l=Oe("credits");let c,d;if(e[0]!==n.id?(c=()=>{ee("credits_exhausted_shown",{organization_id:n.id})},d=[n.id],e[0]=n.id,e[1]=c,e[2]=d):(c=e[1],d=e[2]),E.useEffect(c,d),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=e[4];let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=["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]=V):V=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:V.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=o.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 h;e[8]!==a?(h=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=h):h=e[9];let m;e[10]!==h?(m=o.jsx(Rs,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=m):m=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=o.jsx(Ps,{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]!==m?(v=o.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,o.jsxs(Es,{className:"relative gap-4",children:[f,o.jsxs("div",{children:[m,x]})]})]}),e[16]=x,e[17]=m,e[18]=v):v=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&o.jsxs("div",{className:"px-8 pt-5 pb-6",children:[o.jsx("div",{className:"rounded-xl border border-border p-5",children:o.jsx(Jr,{source:"exhausted_banner",onDone:s})}),o.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Zr.map(N=>o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:o.jsx(at,{size:12,className:"text-success"})}),o.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=o.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]!==n.slug?(k=()=>{r({to:"/$org/settings/ai-providers",params:{org:n.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=n.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=o.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=o.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=o.jsxs(Us,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ei,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=o.jsx(Ls,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function ei(t){return t.preventDefault()}const ti={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 si(t){const e=D.c(16),{kind:s,onDismiss:n,onSubscribe:r}=t,i=B(),{label:a,title:l}=ti[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(lt,{size:14}),e[0]=c):c=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 V;e[7]!==s||e[8]!==r||e[9]!==i?(V=s==="trial_exhausted"?o.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]=V):V=e[10];let p;return e[11]!==n||e[12]!==d||e[13]!==u||e[14]!==V?(p=o.jsx(ue,{icon:c,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:n,footerRight:V}),e[11]=n,e[12]=d,e[13]=u,e[14]=V,e[15]=p):p=e[15],p}const ni={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function _t(t){const e=D.c(21),{kind:s,onDismiss:n}=t,r=B(),i=it(),{org:a}=Ce(),{label:l,title:c}=ni[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(lt,{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 V;e[4]!==r||e[5]!==c?(V=r(c),e[4]=r,e[5]=c,e[6]=V):V=e[6];let p;e[7]!==i||e[8]!==n||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),n()},e[7]=i,e[8]=n,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 h;e[13]!==p||e[14]!==f?(h=o.jsx(Y,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=h):h=e[15];let m;return e[16]!==n||e[17]!==u||e[18]!==V||e[19]!==h?(m=o.jsx(ue,{icon:d,label:u,title:V,defaultExpanded:!0,variant:"warning",onClose:n,footerRight:h}),e[16]=n,e[17]=u,e[18]=V,e[19]=h,e[20]=m):m=e[20],m}function vs(t){const e=oi(t);if(e!==null){const d=vs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),n=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,c=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(c){const d=c[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||n&&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}:n||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function oi(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:n,message:r}=s,i=typeof n=="string"?n:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const ri={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=D.c(29),s=B(),{variant:n,onDismiss:r}=t,i=n==="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,c=i?Jn:zs;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=ri[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 V;e[8]!==i||e[9]!==u?(V=i?vs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=V):V=e[10];const{summary:p,rawDetails:f}=V;let h;e[11]!==c?(h=o.jsx(c,{size:14}),e[11]=c,e[12]=h):h=e[12];let m;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(m=i?o.jsx(Y,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):o.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]=m):m=e[17];let g;e[18]!==f||e[19]!==s?(g=f?o.jsxs("details",{className:"group mx-4",children:[o.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:[o.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:o.jsx("path",{d:"m4.5 3 3 3-3 3"})}),o.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),o.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),o.jsxs("div",{className:"relative mt-2",children:[o.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:o.jsx(Zn,{className:"size-3.5"})}),o.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]!==h||e[25]!==m||e[26]!==g||e[27]!==n?(x=o.jsx(ue,{icon:h,label:l,title:p,defaultExpanded:!0,variant:n,onClose:r,footerRight:m,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=h,e[25]=m,e[26]=g,e[27]=n,e[28]=x):x=e[28],x}function $e(t){const e=D.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:n,voiceMode:r}=s,i=n===void 0?!1:n,a=r===void 0?!1:r,l=B(),{error:c,clearError:d,finishReason:u,clearFinishReason:V,messages:p,isStreaming:f,submit:h,sendMessage:m}=ze(),[g,x]=Se(),{virtualMcpId:v,createTaskWithMessage:b}=Ye(),{chatMode:j,simpleModeTier:A}=Ge(),k=Oe("credits"),{mutate:w}=go("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=se=>({...a?{voiceMode:!0}:{},tier:A,mode:j,toolApprovalLevel:se,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??Fs(),e[9]=g.toolApprovalLevel,e[10]=N):N=e[10];const M=N,P=p.at(-1),R=P?.role==="assistant"?P.parts:[],U=R.filter(Vi),_=R.filter(Ft),L=ls(R),F=is(R);let q;e[11]!==c||e[12]!==m||e[13]!==l?(q=()=>{if(c){const ge={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:c.message})}]}]};m(ge)}},e[11]=c,e[12]=m,e[13]=l,e[14]=q):q=e[14];const $=q;let z;e[15]!==m||e[16]!==l?(z=()=>{const se={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(se)},e[15]=m,e[16]=l,e[17]=z):z=e[17];const W=z;let X;e[18]!==I||e[19]!==M||e[20]!==h?(X=(se,ge)=>{h({kind:"toolOutput",toolCallId:se.toolCallId,output:{response:ge}},I(M))},e[18]=I,e[19]=M,e[20]=h,e[21]=X):X=e[21];const te=X;let J;e[22]!==I||e[23]!==M||e[24]!==h?(J=(se,ge)=>{h({kind:"toolOutput",toolCallId:se.toolCallId,output:{accepted:ge}},I(M))},e[22]=I,e[23]=M,e[24]=h,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=se=>{x({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:v,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:se})}]}})},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=li;let H;e[32]!==I||e[33]!==h?(H=(se,ge,xe,De)=>{h({kind:"approval",approvalId:se,approved:ge,...xe?{reason:xe}:{}},I(De))},e[32]=I,e[33]=h,e[34]=H):H=e[34];const oe=H,G=Vs();if(G.isCreditExhausted){let se;return e[35]!==k||e[36]!==d||e[37]!==i?(se=k?o.jsx(Xr,{onDismiss:d}):o.jsx("div",{className:O(!i&&"absolute bottom-full left-0 right-0"),children:o.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:d})}),e[35]=k,e[36]=d,e[37]=i,e[38]=se):se=e[38],se}const{showError:ie,showWarning:le,hasApprovals:pe}=G,Ve=U.map(ai).join("|"),ft=as(L)?.toolCallId??"",Be=F.map(ii).join("|"),de=!i&&"absolute bottom-full left-0 right-0";let fe;e[39]!==de?(fe=O(de),e[39]=de,e[40]=fe):fe=e[40];let be;e[41]!==G.todos?(be=o.jsx(Kr,{todos:G.todos}),e[41]=G.todos,e[42]=be):be=e[42];let ce;e[43]!==d||e[44]!==G.subscriptionErrorKind||e[45]!==C?(ce=G.subscriptionErrorKind&&o.jsx(si,{kind:G.subscriptionErrorKind,onDismiss:d,onSubscribe:C}),e[43]=d,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=ce):ce=e[46];let Ae;e[47]!==d||e[48]!==G.planRefusal?(Ae=G.planRefusal&&o.jsx(_t,{kind:G.planRefusal,onDismiss:d}),e[47]=d,e[48]=G.planRefusal,e[49]=Ae):Ae=e[49];let ke;e[50]!==d||e[51]!==c||e[52]!==$||e[53]!==ie?(ke=ie&&o.jsx(Qe,{variant:"error",error:c,onDismiss:d,onFixInChat:$}),e[50]=d,e[51]=c,e[52]=$,e[53]=ie,e[54]=ke):ke=e[54];let he;e[55]!==V||e[56]!==u||e[57]!==W||e[58]!==le?(he=le&&o.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:V,onContinue:W}),e[55]=V,e[56]=u,e[57]=W,e[58]=le,e[59]=he):he=e[59];const Te=pe&&o.jsx(wr,{approvals:F,isStreaming:f,onRespond:oe},Be),_e=G.hasPlans&&o.jsx(Cr,{plans:L,isStreaming:f,onApprove:Q,onDismiss:Z},ft),Me=G.hasTaskSuggestion&&o.jsx($r,{parts:_,isStreaming:f,onRespond:ae},_.at(-1)?.toolCallId??"");let me;e[60]!==G.isWaitingForUserInput||e[61]!==te||e[62]!==f||e[63]!==Ve||e[64]!==U?(me=G.isWaitingForUserInput&&o.jsx(xs,{userAskParts:U,isStreaming:f,onSubmit:te},Ve),e[60]=G.isWaitingForUserInput,e[61]=te,e[62]=f,e[63]=Ve,e[64]=U,e[65]=me):me=e[65];let Ne;return e[66]!==fe||e[67]!==be||e[68]!==ce||e[69]!==Ae||e[70]!==ke||e[71]!==he||e[72]!==Te||e[73]!==_e||e[74]!==Me||e[75]!==me?(Ne=o.jsxs("div",{className:fe,children:[be,ce,Ae,ke,he,Te,_e,Me,me]}),e[66]=fe,e[67]=be,e[68]=ce,e[69]=Ae,e[70]=ke,e[71]=he,e[72]=Te,e[73]=_e,e[74]=Me,e[75]=me,e[76]=Ne):Ne=e[76],Ne}function ii(t){return t.approvalId}function ai(t){return t.toolCallId}function li(){document.querySelector("[data-chat-input]")?.focus()}function Vi(t){return t.type==="tool-user_ask"}$e.Error=function(e){return o.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};$e.Warning=function(e){return o.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};$e.UserAskQuestion=xs;function bs(t){const e=D.c(20),{taskId:s}=t,n=B(),r=Dn(s),i=Rn(r),a=Pn(),{stop:l,removeLocalMessage:c}=ze();if(i.length===0)return null;let d;e[0]!==n?(d=n("chat.queueTray.sendNow"),e[0]=n,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(Kt,{size:14}),e[4]=V):V=e[4];let p;e[5]!==d||e[6]!==u?(p=o.jsx(Je,{asChild:!0,children:o.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:V})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==n?(f=n("chat.queueTray.sendNow"),e[8]=n,e[9]=f):f=e[9];let h;e[10]!==f?(h=o.jsx(Ze,{side:"top",children:o.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=h):h=e[11];let m;e[12]!==p||e[13]!==h?(m=o.jsxs(Xe,{delayDuration:400,children:[p,h]}),e[12]=p,e[13]=h,e[14]=m):m=e[14];let g;return e[15]!==a||e[16]!==c||e[17]!==n||e[18]!==s?(g=(x,v)=>o.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[o.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}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:x.text}),o.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:o.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm",title:n("chat.queueTray.removeFromQueue"),"aria-label":n("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,x.messageId).then(b=>{b&&(En(s,x.messageId),c(x.messageId))})},children:o.jsx(Ot,{className:"size-3.5"})})})]},x.messageId),e[15]=a,e[16]=c,e[17]=n,e[18]=s,e[19]=g):g=e[19],o.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[o.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:[o.jsx("span",{children:n(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),m]}),i.map(g)]})}const ci={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function di(t,e){return ci[t]?.test(e)??!1}function ui(t){return Io(t)&&di(t.providerId,t.modelId)}function pi(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 fi={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function hi(t){const e=D.c(32),{tier:s,orgSlot:n,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:c,onClose:d}=t,u=B(),V=ns(),p=new Set(V.map(mi)),f=Un([r,n,i],p),h=f?.keyId??null,[m,g]=E.useState(h??V[0]?.id??null),x=V.some(F=>F.id===m)?m:h??V[0]?.id??null,v=x?V.find(F=>F.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",j=fi[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=o.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]!==c||e[6]!==u||e[7]!==r?(w=r&&o.jsx("button",{type:"button",onClick:c,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]=c,e[6]=u,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==k||e[10]!==w?(y=o.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=E.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(vo,{}),e[12]=I):I=e[12];const N=xo,M=!0,P=pi(h?f:null,v?.providerId??"deco");let R;e[13]!==x||e[14]!==l||e[15]!==g?(R=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]=R):R=e[16];let U;e[17]!==N||e[18]!==x||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==P||e[23]!==R?(U=o.jsx(N,{compact:M,filterModels:a,onClose:d,credentialId:x,onCredentialChange:g,selectedModel:P,onModelChange:R}),e[17]=N,e[18]=x,e[19]=a,e[20]=d,e[21]=g,e[22]=P,e[23]=R,e[24]=U):U=e[24];let _;e[25]!==S||e[26]!==U||e[27]!==I?(_=o.jsx("div",{className:C,children:o.jsx(S,{fallback:I,children:U})}),e[25]=S,e[26]=U,e[27]=I,e[28]=_):_=e[28];let L;return e[29]!==_||e[30]!==y?(L=o.jsxs("div",{className:b,children:[y,_]}),e[29]=_,e[30]=y,e[31]=L):L=e[31],L}function mi(t){return t.id}const gi=["fast","smart","thinking"];function As(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Mt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function xi(t){const e=D.c(28),{tier:s,pillIcon:n,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,[c,d]=E.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 V=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=O("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 h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=O("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]=h):h=e[4];const m=l[s];let g;e[5]!==m?(g=o.jsx("span",{className:h,children:m}),e[5]=m,e[6]=g):g=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Zt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=x):x=e[7];let v;e[8]!==n||e[9]!==p||e[10]!==g?(v=o.jsx(Je,{asChild:!0,children:o.jsx("span",{className:"inline-flex min-w-0 shrink",children:o.jsx(Xt,{asChild:!0,children:o.jsxs(Y,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[n,g,x]})})})}),e[8]=n,e[9]=p,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p?(b=o.jsx(Ze,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;e[14]!==v||e[15]!==b?(j=o.jsxs(Xe,{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=>o.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>o.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[o.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>V(S),className:O("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&&o.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&o.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&o.jsx("span",{title:i("chat.tierTrigger.selected"),children:o.jsx(at,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&o.jsx(bi,{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=o.jsx(es,{align:"end",className:"p-1 w-64",onOpenAutoFocus:vi,children:o.jsx("div",{role:"menu",className:"flex flex-col",children:A})}),e[22]=A,e[23]=k):k=e[23];let w;return e[24]!==c||e[25]!==j||e[26]!==k?(w=o.jsxs(ts,{open:c,onOpenChange:d,children:[j,k]}),e[24]=c,e[25]=j,e[26]=k,e[27]=w):w=e[27],w}function vi(t){return t.preventDefault()}function bi(t){const e=D.c(38),{label:s,render:n}=t,r=B(),i=ss(),[a,l]=E.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>l(!1),e[0]=c):c=e[0];const d=c;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 V=a&&"opacity-100";let p;e[4]!==V?(p=O("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",V),e[4]=V,e[5]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(qn,{size:14}),e[6]=f):f=e[6];let h;e[7]!==u||e[8]!==p?(h=o.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=h):h=e[9];const m=h;if(i){let j;e[10]!==m?(j=o.jsx(yo,{asChild:!0,children:m}),e[10]=m,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=o.jsx(jo,{className:"sr-only",children:A}),e[15]=A,e[16]=k):k=e[16];let w;e[17]!==a||e[18]!==n?(w=a&&n(d),e[17]=a,e[18]=n,e[19]=w):w=e[19];let y;e[20]!==w||e[21]!==k?(y=o.jsxs(ko,{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=o.jsxs(wo,{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]!==m?(g=o.jsx(Xt,{asChild:!0,children:m}),e[27]=m,e[28]=g):g=e[28];let x;e[29]!==a||e[30]!==n?(x=a&&n(d),e[29]=a,e[30]=n,e[31]=x):x=e[31];let v;e[32]!==x?(v=o.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=o.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 Dt(t){return t==="fast"?o.jsx(lt,{size:16}):t==="thinking"?o.jsx(Kn,{size:16}):o.jsx(So,{size:16})}function Ai(t){const e=D.c(13),s=zn();let n;e[0]!==t||e[1]!==s.tiers?(n=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]=n):n=e[2];const r=n;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 c;return e[9]!==i||e[10]!==a||e[11]!==l?(c={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=c):c=e[12],c}function yi(){const t=D.c(24),e=B(),{simpleModeTier:s,setSimpleModeTier:n}=Ge(),r=Co(),i=ns(),a=To(i),l=Ai(a),{data:c,error:d}=Ln();let u;t[0]!==c?(u=c===void 0?{tiers:{}}:c,t[0]=c,t[1]=u):u=t[1];const V=u,p=Fn(),f=We()?.lockedHarness==="claude-code",h=Oe("model_choice"),m=ao(),g=lo();if(!m||!h)return null;let x,v;if(t[2]!==a||t[3]!==g||t[4]!==f||t[5]!==r||t[6]!==n||t[7]!==e||t[8]!==s||t[9]!==l||t[10]!==p||t[11]!==V||t[12]!==d){const w=As(e);x="decopilot",v=gi.map(y=>{const C=l[y],S=V.tiers[y];return{key:`decopilot-${y}`,icon:Dt(y),title:w[y],subtitle:g?C??e(Mt[y]):e(Mt[y]),active:s===y,onSelect:()=>n(y),modelOverride:g?I=>o.jsxs(o.Fragment,{children:[d&&o.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),o.jsx(hi,{tier:y,orgSlot:r.tiers[y],userSlot:S,autoSlot:a.chat[y],filterModels:f?ui: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]=n,t[7]=e,t[8]=s,t[9]=l,t[10]=p,t[11]=V,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=Dt(s),t[18]=s,t[19]=A):A=t[19];let k;return t[20]!==j||t[21]!==A||t[22]!==s?(k=o.jsx(xi,{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=D.c(3),[s]=Se();let n;return e[0]!==s.enableSounds||e[1]!==t?(n=()=>{s.enableSounds&&Fo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=n):n=e[2],n}const ji={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"},ki=mn.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),wi=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Si(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center -space-x-1.5",children:wi.map(Ci)}),t[0]=e):e=t[0],e}function Ci(t){return o.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Ni({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:n,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,c]=E.useState(!1),d=ys(ji),{org:u}=Ce(),{editor:V}=zt(),p=E.useRef(null),f=ut(n),h=()=>{!f||r||(c(!1),p.current?.click())},m=async T=>{const Q=T.target.files;if(!Q||Q.length===0||!V)return;const Z=Array.from(Q);try{let H=V.state.selection.from;for(const oe of Z)await os(V,n??null,oe,H,i,a),H=V.state.selection.to}finally{p.current&&(p.current.value="")}},g=Po({connectionId:s,orgId:u.id,orgSlug:u.slug}),x=Os.virtualMcpPrompts(s,u.id),{data:v,isLoading:b}=$s({queryKey:x,queryFn:()=>Eo(g),staleTime:6e4,enabled:l&&!!g}),j=v?.prompts??[],[A,k]=E.useState(null),{chatMode:w,setChatMode:y}=Ge(),[C,S]=Se(),I=We()?.lockedHarness!=="claude-code",N=we.find(T=>T.value===C.toolApprovalLevel)??we[0],M=a(N.shortKey),P=T=>{const Q=we.find(Z=>Z.value===T);if(Q){if(Q.value===C.toolApprovalLevel){c(!1);return}d(),ee("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:Q.value,source:"tools_popover"}),S({...C,toolApprovalLevel:Q.value}),c(!1)}},R=w==="plan",U=()=>{d();const T=R?"default":"plan";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),c(!1)},_=()=>{e(),c(!1)},L=async(T,Q)=>{if(!V||!g)return;const Z=jt(T._meta),H={from:V.state.selection.from,to:V.state.selection.to};try{const oe=await Uo(g,T.name,Q);Vn(V,H,{id:T.name,name:ho(T.name,Z),metadata:oe.messages,char:"/",kind:"prompt",args:Q})}catch{Ee.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async T=>{c(!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 L(T)},q=async T=>{A&&(await L(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),c(!1)},z=()=>{d();const T=w==="web-search"?"default":"web-search";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),c(!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),c(!1)},X=w==="gen-image",te=w==="web-search",J=w==="deep-research",ae=o.jsx("input",{ref:p,type:"file",multiple:!0,accept:bo(n??null),className:"hidden",onChange:m,disabled:r});return o.jsxs(o.Fragment,{children:[ae,o.jsxs(Bs,{open:l,onOpenChange:T=>{T&&!l&&ee("chat_tools_popover_opened",{chat_mode:w}),c(T)},children:[o.jsx(Ks,{asChild:!0,children:o.jsxs(Y,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[o.jsx(Qn,{size:14}),o.jsx("span",{className:O("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")})]})}),o.jsxs(qs,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?o.jsxs(ye,{onClick:h,disabled:r,children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):o.jsxs(Xe,{children:[o.jsx(Je,{asChild:!0,children:o.jsxs(ye,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:T=>T.preventDefault(),children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),o.jsx(Ze,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),o.jsxs(ye,{onClick:U,className:O(R&&"text-special"),children:[o.jsx(qt,{size:16,className:O(R&&"text-special")}),o.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),o.jsx("span",{className:O("text-xs text-muted-foreground",R&&"text-special font-medium"),children:ki})]}),o.jsxs(ye,{onClick:$,className:O(X&&"text-special"),children:[o.jsx(Ht,{size:16,className:O(X&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),X&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:z,className:O(te&&"text-special"),children:[o.jsx(Yt,{size:16,className:O(te&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:W,className:O(J&&"text-special"),children:[o.jsx(Gt,{size:16,className:O(J&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),J&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),o.jsx(vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?o.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[o.jsx(Qs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):j.length===0?o.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):j.map(T=>o.jsxs(ye,{onClick:()=>F(T),className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"font-medium text-sm capitalize",children:T.title||fo(T.name,jt(T._meta))}),T.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:T.description})]},T.name))})]}),I&&o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx(He,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:M})]}),o.jsx(vt,{className:"w-48 p-1.5",children:o.jsx(Ws,{value:C.toolApprovalLevel,onValueChange:P,children:we.map(T=>o.jsx(Ys,{value:T.value,children:a(T.labelKey)},T.value))})})]}),o.jsxs(ye,{onClick:_,children:[o.jsx(Lo,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),o.jsx(E.Suspense,{children:o.jsx(Si,{})})]})]})]}),o.jsx(ln,{prompt:A,setPrompt:k,onSubmit:q})]})}const Ii=[{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 Ti(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center -space-x-1",children:Ii.map(_i)}),t[0]=e):e=t[0],e}function _i(t){return o.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Mi(t){const e=D.c(10),{onClick:s}=t,n=B();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=O("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]!==n?(i=n("chat.connectionsBanner.description"),e[1]=n,e[2]=i):i=e[2];let a;e[3]!==i?(a=o.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,c;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ti,{}),c=o.jsx(Gs,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=c):(l=e[5],c=e[6]);let d;return e[7]!==s||e[8]!==a?(d=o.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,c]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Pe=48;function Di(){const t=D.c(9),[e,s]=E.useState("idle"),[n,r]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(Ei),d=E.useRef(null),u=E.useRef(null),V=E.useRef(null),p=E.useRef(null),f=E.useRef(0),h=E.useRef(!1),m=E.useRef(""),g=E.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(Pi),p.current?.getTracks().forEach(Ri),V.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 P=M.createMediaStreamSource(N),R=M.createAnalyser();R.fftSize=128,R.smoothingTimeConstant=.8,P.connect(R),V.current=R;const U=new Uint8Array(R.frequencyBinCount),_=()=>{if(!V.current)return;V.current.getByteFrequencyData(U);const L=[];for(let F=0;F<Pe;F++){const q=Math.floor(F/Pe*U.length);L.push(Math.max(.04,(U[q]??0)/255))}c(L),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="",m.current="",h.current=!0,s("recording"),I(M);const P=new N;d.current=P,P.interimResults=!0,P.continuous=!0,P.lang=navigator.language||"en-US",P.onresult=R=>{if(d.current!==P)return;let U="",_="";for(let L=R.resultIndex;L<R.results.length;L++){const F=R.results[L],q=F?.[0]?.transcript??"";F?.isFinal?_=_+q:U=U+q}_&&(m.current=m.current+_,r(m.current)),g.current=U,a(U)},P.onerror=R=>{d.current===P&&R.error!=="no-speech"&&(h.current=!1,d.current=null,b(),s(R.error==="not-allowed"?"permission-denied":"idle"))},P.onend=()=>{if(d.current===P&&h.current)try{P.start()}catch{}};try{P.start()}catch{return h.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=()=>{h.current=!1,d.current?.stop(),b(),s("idle"),c(Array(Pe).fill(.05)),a("");const I=(m.current+(g.current?" "+g.current:"")).trim();return r(""),m.current="",g.current="",I},t[2]=k):k=t[2];const w=k;let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{h.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),c(Array(Pe).fill(.05)),m.current="",g.current=""},t[3]=y):y=t[3];const C=y;let S;return t[4]!==i||t[5]!==e||t[6]!==n||t[7]!==l?(S={status:e,transcript:n,interimTranscript:i,waveformData:l,isSupported:x,startRecording:A,stopRecording:w,cancelRecording:C},t[4]=i,t[5]=e,t[6]=n,t[7]=l,t[8]=S):S=t[8],S}function Ri(t){return t.stop()}function Pi(){}function Ei(){return Array(Pe).fill(.05)}function Ui(t){const e=D.c(4),{data:s}=t;let n;e[0]!==s?(n=s.map(Li),e[0]=s,e[1]=n):n=e[1];let r;return e[2]!==n?(r=o.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:n}),e[2]=n,e[3]=r):r=e[3],r}function Li(t,e){return o.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 Ue=12e3,Rt=re({token:ne(),expiresAt:Js()});Zs("provider",[re({provider:je("elevenlabs"),conversationToken:ne().min(1)}),re({provider:je("openai"),transport:je("webrtc")})]);const Fi=Hs([Rt.extend({provider:je("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Rt.extend({provider:je("openai"),transport:je("webrtc")})]);re({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Ue)});const js=re({request:ne().trim().min(1).max(Ue)}),ot=5e3;Ut(re({role:Fe(["user","agent"]),text:ne().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 il(t){const e=[];let s=ot;for(const n of t.slice(-60).reverse()){if(s<=0)break;const r=n.text.slice(-s);e.unshift({role:n.role,text:r}),s-=r.length}return e}re({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:Fe(["en","pt"]).default("en")}).strict();const zi=re({sdp:ne().min(1).max(1e5)});async function Oi(t,e,s,n,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:c}=await import("./openai-conversation-ZCiR-nel.js");return{startOpenAIConversation:c}},__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]));return l(r,s,n)}const{Conversation:i}=await bt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);n.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const c=js.safeParse(l);return JSON.stringify(c.success?await s.onDelegate(c.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 n.aborted&&(await a.endSession(),n.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const c=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(c):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
9
|
+
The report follows.`;function cr(t){return{...t,content:[{type:"paragraph",content:[rn({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:Vr}}]})]},...t.content??[]]}}function dr(){const t=D.c(24),e=B(),s=pn();if(!s)return null;let n,r,i,a;t[0]!==s.path||t[1]!==e?(n=fn(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:n}),t[0]=s.path,t[1]=e,t[2]=n,t[3]=r,t[4]=i,t[5]=a):(n=t[2],r=t[3],i=t[4],a=t[5]);let l,c;t[6]!==n?(l=o.jsx(un,{filename:n,className:"h-4 w-3 shrink-0"}),c=o.jsx("span",{className:"truncate",children:n}),t[6]=n,t[7]=l,t[8]=c):(l=t[7],c=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=o.jsx(Ot,{size:12}),t[11]=u):u=t[11];let V;t[12]!==s.dismiss||t[13]!==d?(V=o.jsx(dn,{label:d,size:"icon-sm",onClick:s.dismiss,children:u}),t[12]=s.dismiss,t[13]=d,t[14]=V):V=t[14];let p;t[15]!==r||t[16]!==i||t[17]!==l||t[18]!==c||t[19]!==V?(p=o.jsxs("span",{className:r,title:i,children:[l,c,V]}),t[15]=r,t[16]=i,t[17]=l,t[18]=c,t[19]=V,t[20]=p):p=t[20];let f;return t[21]!==a||t[22]!==p?(f=o.jsx("div",{className:a,children:p}),t[21]=a,t[22]=p,t[23]=f):f=t[23],f}function ur(t){const e=D.c(14),s=$t(t),n=We(),r=s?.metadata,i=n?.activeTask,a=i?.metadata?.runtime;let l;e[0]!==a?(l=_n(a),e[0]=a,e[1]=l):l=e[1];const c=l,d=!!i&&!i.partial,u=i?.metadata;let V;e[2]!==r||e[3]!==u?(V=Nn(u,r),e[2]=r,e[3]=u,e[4]=V):V=e[4];const p=!!c||d&&!!s;let f;e[5]!==r?(f=In(r),e[5]=r,e[6]=f):f=e[6];let h;e[7]!==r?(h=Tn(r),e[7]=r,e[8]=h):h=e[8];let m;return e[9]!==V||e[10]!==p||e[11]!==f||e[12]!==h?(m={runtime:V,resolved:p,projectDefault:f,previewServerUrl:h},e[9]=V,e[10]=p,e[11]=f,e[12]=h,e[13]=m):m=e[13],m}function pr(t){const e=D.c(30),{current:s,total:n,onPrev:r,onNext:i}=t,a=B();if(n<=1)return null;const l=s===0,c=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==c?(d=O("p-0.5 transition-colors rounded-lg",c),e[0]=c,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 V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(oo,{size:14}),e[4]=V):V=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=o.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:V}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let h;e[10]!==a||e[11]!==f||e[12]!==n?(h=a("chat.pagination.counter",{current:f,total:n}),e[10]=a,e[11]=f,e[12]=n,e[13]=h):h=e[13];let m;e[14]!==h?(m=o.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=m):m=e[15];const g=s===n-1,x=s===n-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let v;e[16]!==x?(v=O("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=o.jsx(Bt,{size:14}),e[20]=j):j=e[20];let A;e[21]!==i||e[22]!==g||e[23]!==v||e[24]!==b?(A=o.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]!==m?(k=o.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,m,A]}),e[26]=A,e[27]=p,e[28]=m,e[29]=k):k=e[29],k}function cs(t){const e=D.c(8),{currentIndex:s,total:n,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==n?(l=o.jsx(pr,{current:s,total:n,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=n,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=o.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function fr(t){const e=D.c(17),{isStreaming:s,isAllAnswered:n,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=n?a===void 0?"Submit":a:l===void 0?"Next":l,V=n?s:!r,p=V?n?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==V||e[1]!==i?(f=()=>{V||i()},e[0]=V,e[1]=i,e[2]=f):f=e[2];const h=V&&"opacity-50 cursor-not-allowed";let m;e[3]!==h?(m=O("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=m):m=e[4];let g;e[5]!==V||e[6]!==u||e[7]!==f||e[8]!==m?(g=o.jsx(Y,{type:"button",size:"sm","aria-disabled":V,onClick:f,className:m,children:u}),e[5]=V,e[6]=u,e[7]=f,e[8]=m,e[9]=g):g=e[9];const x=g;if(!p)return x;let v;e[10]!==x?(v=o.jsx(Je,{asChild:!0,children:x}),e[10]=x,e[11]=v):v=e[11];let b;e[12]!==p?(b=o.jsx(Ze,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;return e[14]!==v||e[15]!==b?(j=o.jsxs(Xe,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16],j}function ds(t,e,s){return t.findIndex(n=>e(n)===s)}function Ct(t,e,s,n){return t.length===0?!1:t.every(r=>n(s[e(r)]))}function Nt(t,e,s,n,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 c=e(l);if(c!==r&&!n(s[c]))return c}return null}function hr(t){return!t.isStreaming&&t.allAnswered}function us(t){const{parts:e,partKey:s,schema:n,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,c=e[0]?s(e[0]):"",[d,u]=E.useState(c),[V,p]=E.useState(!1),f=Ss({resolver:Cs(n),defaultValues:r}),h=f.watch(),m=ds(e,s,d),g=m>=0?e[m]:void 0,x=a(h[d]),v=Ct(e,s,h,a),b=hr({isStreaming:i,allAnswered:v}),j=()=>{if(m>0){const I=e[m-1];I&&u(s(I))}},A=()=>{if(m>=0&&m<e.length-1){const I=e[m+1];I&&u(s(I))}},k=()=>{const I=f.getValues(),N=Nt(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=E.useRef(w);y.current=w;const C=()=>{b&&(p(!1),y.current())},S=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),y.current()}else{const N=Nt(e,s,I,a,d);N&&u(N)}};return E.useEffect(()=>{if(V&&!i){if(!v){p(!1);return}p(!1),y.current()}},[V,i,v]),{form:f,activeKey:d,setActiveKey:u,currentIndex:m,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=D.c(36),{onYolo:s}=t,n=B(),[r,i]=Se();let a,l,c,d,u,V,p,f,h;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){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;c=eo,f=r.toolApprovalLevel,h=k,l=to,u="xs",V="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=mr,a=so,d=n(j.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=a,e[5]=l,e[6]=c,e[7]=d,e[8]=u,e[9]=V,e[10]=p,e[11]=f,e[12]=h}else a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],V=e[9],p=e[10],f=e[11],h=e[12];let m;e[17]!==a||e[18]!==d?(m=o.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=m):m=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==V||e[23]!==p||e[24]!==m?(g=o.jsx(l,{size:u,className:V,onClick:p,children:m}),e[20]=l,e[21]=u,e[22]=V,e[23]=p,e[24]=m,e[25]=g):g=e[25];let x;e[26]!==n?(x=we.map(j=>o.jsx(Xn,{value:j.value,children:n(j.labelKey)},j.value)),e[26]=n,e[27]=x):x=e[27];let v;e[28]!==x?(v=o.jsx(no,{children:x}),e[28]=x,e[29]=v):v=e[29];let b;return e[30]!==c||e[31]!==v||e[32]!==f||e[33]!==h||e[34]!==g?(b=o.jsxs(c,{value:f,onValueChange:h,children:[g,v]}),e[30]=c,e[31]=v,e[32]=f,e[33]=h,e[34]=g,e[35]=b):b=e[35],b}function mr(t){return t.stopPropagation()}function hs(t){const e=D.c(8),{input:s}=t,n=B();if(s==null){let a;e[0]!==n?(a=n("chat.approval.noInput"),e[0]=n,e[1]=a):a=e[1];let l;return e[2]!==a?(l=o.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=o.jsx("div",{className:"px-4",children:o.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 gr(t){const e=D.c(38),{approval:s,onRespond:n}=t,r=B(),[i]=Se(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==n||e[3]!==r?(l=()=>n(s.approvalId,!1,r(ps),a),e[0]=s.approvalId,e[1]=a,e[2]=n,e[3]=r,e[4]=l):l=e[4];const c=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==n?(d=()=>n(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=n,e[8]=d):d=e[8];const u=d;let V;e[9]!==s.approvalId||e[10]!==n?(V=C=>n(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=n,e[11]=V):V=e[11];const p=V;let f;e[12]!==p?(f=o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(fs,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const h=f;let m;e[14]!==r?(m=r("chat.approval.denyButton"),e[14]=r,e[15]=m):m=e[15];let g;e[16]!==c||e[17]!==m?(g=o.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:c,children:m}),e[16]=c,e[17]=m,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=o.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=o.jsxs(o.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=o.jsx(He,{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=o.jsx(hs,{input:s.input}),e[30]=s.input,e[31]=w):w=e[31];let y;return e[32]!==s.friendlyName||e[33]!==h||e[34]!==j||e[35]!==k||e[36]!==w?(y=o.jsx(ue,{icon:A,label:k,title:s.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:j,children:w}),e[32]=s.friendlyName,e[33]=h,e[34]=j,e[35]=k,e[36]=w,e[37]=y):y=e[37],y}const xr=Ns(ne(),re({approved:Is().optional(),levelOverride:Fe(["auto","readonly"]).optional()}));function vr(t){const e=D.c(46),{approvals:s,isStreaming:n,onRespond:r}=t,i=B(),[a]=Se(),l=a.toolApprovalLevel??"readonly";let c;e[0]!==s?(c=Object.fromEntries(s.map(yr)),e[0]=s,e[1]=c):c=e[1];const d=c;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,M)=>{const P=M;typeof P?.approved=="boolean"&&r(N.approvalId,P.approved,P.approved===!1?i(ps):void 0,P.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let V;e[6]!==s||e[7]!==d||e[8]!==n||e[9]!==u?(V={parts:s,partKey:Ar,schema:xr,defaultValues:d,isStreaming:n,hasAnswer:br,onSubmit:u},e[6]=s,e[7]=d,e[8]=n,e[9]=u,e[10]=V):V=e[10];const p=us(V);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 h=f,m=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=o.jsx(He,{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=m?.friendlyName??"";let A;e[20]!==h?(A=o.jsx(fs,{onYolo:h}),e[20]=h,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=o.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]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(w=m?o.jsx(jr,{approvalId:m.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=m,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=w):w=e[31];let y;e[32]!==m?(y=m?o.jsx(hs,{input:m.input}):null,e[32]=m,e[33]=y):y=e[33];let C;e[34]!==k||e[35]!==w||e[36]!==y||e[37]!==b||e[38]!==j?(C=o.jsx(ue,{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=o.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=o.jsx(nt,{...g,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function br(t){return typeof t?.approved=="boolean"}function Ar(t){return t.approvalId}function yr(t){return[t.approvalId,{approved:void 0}]}function jr(t){const e=D.c(7),{approvalId:s,control:n,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,V=u.value===!0,p=u.value===!1;return o.jsxs(o.Fragment,{children:[o.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")}),o.jsx(Y,{type:"button",variant:V?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":V,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let c;return e[3]!==n||e[4]!==a||e[5]!==l?(c=o.jsx(Ts,{control:n,name:a,render:l}),e[3]=n,e[4]=a,e[5]=l,e[6]=c):c=e[6],c}function kr(){const t=D.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(He,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.approval.preparingRequest"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.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,o.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function wr(t){const e=D.c(8),{approvals:s,isStreaming:n,onRespond:r}=t;if(n&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(kr,{}),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=o.jsx(gr,{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]!==n||e[6]!==r?(i=o.jsx(vr,{approvals:s,isStreaming:n,onRespond:r}),e[4]=s,e[5]=n,e[6]=r,e[7]=i):i=e[7],i}function Sr(t){const e=D.c(28),{plan:s,onApprove:n,onDismiss:r}=t,i=B();let a;e[0]!==n||e[1]!==s.plan?(a=()=>{n(s.plan)},e[0]=n,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let c;e[3]!==i?(c=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==c?(d=o.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:c}),e[5]=r,e[6]=c,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 V;e[10]!==l||e[11]!==u?(V=o.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]=V):V=e[12];let p;e[13]!==d||e[14]!==V?(p=o.jsxs(o.Fragment,{children:[d,V]}),e[13]=d,e[14]=V,e[15]=p):p=e[15];const f=p;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Qt,{size:14}),e[16]=h):h=e[16];let m;e[17]!==i?(m=i("chat.proposePlan.planReady"),e[17]=i,e[18]=m):m=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=o.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:o.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:o.jsx(an,{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]!==m||e[26]!==g?(v=o.jsx(ue,{icon:h,label:m,title:g,defaultExpanded:!0,footerRight:f,children:x}),e[23]=f,e[24]=x,e[25]=m,e[26]=g,e[27]=v):v=e[27],v}function Cr(t){const e=D.c(6),{plans:s,onApprove:n,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]!==n||e[4]!==r?(l=o.jsx(Sr,{plan:a,onApprove:n,onDismiss:r}),e[2]=a,e[3]=n,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 It=re({response:ne().min(1,"Response is required")}),Nr=re({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ir=re({response:Fe(["yes","no"])});function Tr(t){switch(t.type){case"text":return It;case"choice":return Nr;case"confirm":return Ir;default:return It}}function _r(t){const e={};for(const s of t)e[s.toolCallId]=Tr(s.input);return re(e)}function Mr(t){const e=D.c(7),{control:s,name:n,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=c=>{const{field:d}=c,u=d.value??"";return o.jsxs(Vt,{children:[o.jsx(ct,{children:o.jsx("div",{className:"px-2",children:o.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Wt,{size:16,className:"text-muted-foreground"})}),o.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"})]})})}),o.jsx(dt,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==n||e[5]!==a?(l=o.jsx(Jt,{control:s,name:n,render:a}),e[3]=s,e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function gs(t,e){const s=D.c(4);let n,r;s[0]!==t||s[1]!==e?(n=()=>{const i=a=>{if(hn(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]=n,s[3]=r):(n=s[2],r=s[3]),E.useEffect(n,r)}function Dr(t){const e=D.c(51),{control:s,name:n,options:r}=t,i=B(),a=`${n}.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:c}=mt(l),d=`${n}.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:V}=mt(u),p=c.value,f=V.value??"";let h;if(e[6]!==c||e[7]!==r?(h=U=>{const _=r[U];_!=null&&c.onChange(_)},e[6]=c,e[7]=r,e[8]=h):h=e[8],gs(r.length,h),r.length===0)return null;const m=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]!==c||e[12]!==p||e[13]!==r||e[14]!==i){let U;e[16]!==c||e[17]!==p||e[18]!==i?(U=(_,L)=>{const F=p===_;return o.jsxs("button",{type:"button",onClick:()=>c.onChange(_),className:O("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:[o.jsx("span",{className:O("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:L+1}),o.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:_})]},`${L}-${_}`)},e[16]=c,e[17]=p,e[18]=i,e[19]=U):U=e[19],x=r.map(U),e[11]=c,e[12]=p,e[13]=r,e[14]=i,e[15]=x}else x=e[15];const v=m&&"bg-accent/50",b=!m&&"hover:bg-accent/30";let j;e[20]!==v||e[21]!==b?(j=O("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=o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Wt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const k=m?f:"";let w;e[24]!==V||e[25]!==c||e[26]!==p?(w=U=>{V.onChange(U.target.value),p!==null&&c.onChange(null)},e[24]=V,e[25]=c,e[26]=p,e[27]=w):w=e[27];let y;e[28]!==c||e[29]!==p?(y=()=>{p!==null&&c.onChange(null)},e[28]=c,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=o.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=o.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=o.jsx(ct,{children:o.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 P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx(dt,{}),e[48]=P):P=e[48];let R;return e[49]!==M?(R=o.jsxs(Vt,{children:[M,P]}),e[49]=M,e[50]=R):R=e[50],R}function Rr(t){const e=D.c(8),{control:s,name:n}=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=E.useRef(null);let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=V=>{l.current?.onChange(a[V]??"")},e[1]=c):c=e[1],gs(a.length,c);let d;e[2]!==r?(d=V=>{const{field:p}=V;return l.current=p,o.jsxs(Vt,{children:[o.jsx(ct,{children:o.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const h=p.value===f;return o.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[o.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),o.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),o.jsx(dt,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==n||e[6]!==d?(u=o.jsx(Jt,{control:s,name:n,render:d}),e[4]=s,e[5]=n,e[6]=d,e[7]=u):u=e[7],u}function Tt(t){const e=D.c(13),{input:s,control:n,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==n||e[1]!==s.default||e[2]!==i?(a=o.jsx(Mr,{control:n,name:i,placeholder:s.default}),e[0]=n,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]!==n||e[7]!==a||e[8]!==r?(l=o.jsx(Dr,{control:n,name:r,options:a}),e[6]=n,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==n||e[11]!==i?(a=o.jsx(Rr,{control:n,name:i}),e[10]=n,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Pr(t){const e=D.c(91),{parts:s,isStreaming:n,onSubmit:r}=t;let i;e[0]!==s?(i=_r(s.map(Fr)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Lr)),e[2]=s,e[3]=l):l=e[3];const c=l;let d;e[4]!==r?(d=($,z)=>{const W=ms(z);W&&r($,W)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==n||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Ur,schema:a,defaultValues:c,isStreaming:n,hasAnswer:Er,onSubmit:d},e[6]=c,e[7]=n,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const V=us(u),p=V.currentPart,f=B();let h;e[12]!==p||e[13]!==V||e[14]!==f?(h=()=>{const $=p;if(!$)return;const z=f("chat.userAskQuestion.skipMessage"),W=$.toolCallId;$.input?.type==="choice"?(V.form.setValue(`${W}.option`,null),V.form.setValue(`${W}.draft`,z)):V.form.setValue(`${W}.response`,z),V.advanceToNextUnanswered()},e[12]=p,e[13]=V,e[14]=f,e[15]=h):h=e[15];const m=h;let g;e[16]!==V.currentIndex||e[17]!==V.goNext||e[18]!==V.goPrev||e[19]!==s.length?(g=o.jsx(cs,{currentIndex:V.currentIndex,total:s.length,onPrev:V.goPrev,onNext:V.goNext}),e[16]=V.currentIndex,e[17]=V.goNext,e[18]=V.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]!==m||e[24]!==v?(b=o.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:v}),e[23]=m,e[24]=v,e[25]=b):b=e[25];let j;e[26]!==V.isAllAnswered||e[27]!==V.isCurrentAnswered||e[28]!==V.submitOrAdvance||e[29]!==n?(j=o.jsx(fr,{isStreaming:n,isAllAnswered:V.isAllAnswered,isCurrentAnswered:V.isCurrentAnswered,onAdvanceOrSubmit:V.submitOrAdvance}),e[26]=V.isAllAnswered,e[27]=V.isCurrentAnswered,e[28]=V.submitOrAdvance,e[29]=n,e[30]=j):j=e[30];let A;e[31]!==b||e[32]!==j?(A=o.jsxs(o.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 z=V.form;let W;e[34]!==V?(W=oe=>{oe.preventDefault(),V.submit()},e[34]=V,e[35]=W):W=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=o.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]!==V.form.control||e[43]!==$.toolCallId||e[44]!==ae?(T=o.jsx(Tt,{input:ae,control:V.form.control,toolCallId:$.toolCallId}),e[42]=V.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=o.jsx(ue,{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=o.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]!==V.form||e[55]!==Z?(H=o.jsx(nt,{...z,children:Z}),e[54]=V.form,e[55]=Z,e[56]=H):H=e[56],H}const w=V.form;let y;e[57]!==V?(y=$=>{$.preventDefault(),V.submit()},e[57]=V,e[58]=y):y=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=o.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=V.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 P=V.activeKey,R=V.setActiveKey;let U;if(e[69]!==V.form||e[70]!==s){let $;e[72]!==V.form?($=z=>o.jsx(ro,{value:z.toolCallId,className:"mt-0",children:o.jsx(Tt,{input:z.input,control:V.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=V.form,e[73]=$):$=e[73],U=s.map($),e[69]=V.form,e[70]=s,e[71]=U}else U=e[71];let _;e[74]!==V.activeKey||e[75]!==V.setActiveKey||e[76]!==U?(_=o.jsx(io,{value:P,onValueChange:R,children:U}),e[74]=V.activeKey,e[75]=V.setActiveKey,e[76]=U,e[77]=_):_=e[77];let L;e[78]!==x||e[79]!==k||e[80]!==S||e[81]!==N||e[82]!==M||e[83]!==_?(L=o.jsx(ue,{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]=L):L=e[84];let F;e[85]!==y||e[86]!==L?(F=o.jsx("form",{onSubmit:y,autoComplete:"off",children:L}),e[85]=y,e[86]=L,e[87]=F):F=e[87];let q;return e[88]!==V.form||e[89]!==F?(q=o.jsx(nt,{...w,children:F}),e[88]=V.form,e[89]=F,e[90]=q):q=e[90],q}function Er(t){return!!ms(t)}function Ur(t){return t.toolCallId}function Lr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Fr(t){return{toolCallId:t.toolCallId,input:t.input}}function zr(){const t=D.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.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,o.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function xs(t){const e=D.c(7),{userAskParts:s,isStreaming:n,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Or),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(n){let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(zr,{}),e[2]=c):c=e[2],c}return null}let l;return e[3]!==n||e[4]!==r||e[5]!==a?(l=o.jsx(Pr,{parts:a,isStreaming:n,onSubmit:r}),e[3]=n,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Or(t){return t.state==="input-available"}function $r(t){const e=D.c(33),{parts:s,isStreaming:n,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,c=l?.input;if(!l||!c?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=o.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 V=c.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 h;e[10]!==n||e[11]!==p||e[12]!==f?(h=o.jsx(Y,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:n,onClick:p,children:f}),e[10]=n,e[11]=p,e[12]=f,e[13]=h):h=e[13];let m;e[14]!==r||e[15]!==l?(m=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=m):m=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]!==n||e[20]!==m||e[21]!==g?(x=o.jsx(Y,{type:"button",size:"sm",className:"h-7",disabled:n,onClick:m,children:g}),e[19]=n,e[20]=m,e[21]=g,e[22]=x):x=e[22];let v;e[23]!==x||e[24]!==h?(v=o.jsxs(o.Fragment,{children:[h,x]}),e[23]=x,e[24]=h,e[25]=v):v=e[25];let b;e[26]!==c.summary?(b=c.summary?o.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:c.summary}):null,e[26]=c.summary,e[27]=b):b=e[27];let j;return e[28]!==c.title||e[29]!==v||e[30]!==b||e[31]!==u?(j=o.jsx(ue,{icon:d,label:u,title:V,defaultExpanded:!0,footerRight:v,children:b}),e[28]=c.title,e[29]=v,e[30]=b,e[31]=u,e[32]=j):j=e[32],j}function Br(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,n=t.length;if(n>0&&s===n)return{icon:"completed",activity:"All done",progress:`${n}/${n}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${n} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${n} done`}:s>0?{icon:"pending",activity:`${n-s} pending`,progress:`${s}/${n} done`}:{icon:"pending",activity:`${n} todos`,progress:"not started"}}function Kr(t){const e=D.c(13),{todos:s}=t;if(s.length===0)return null;let n;e[0]!==s?(n=Br(s),e[0]=s,e[1]=n):n=e[1];const r=n;let i;e[2]!==r.icon?(i=o.jsx(Yr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let c;e[4]!==s?(c=s.map(qr),e[4]=s,e[5]=c):c=e[5];let d;e[6]!==c?(d=o.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:c}),e[6]=c,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=o.jsx(ue,{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 qr(t,e){return o.jsx(Qr,{todo:t},e)}function Qr(t){const e=D.c(14),{todo:s}=t,n=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=o.jsx(Wr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=n&&"text-muted-foreground";let c;e[2]!==l?(c=O("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=c):c=e[3];const d=n?"100%":"0%",u=n?"width 300ms ease 200ms":"width 150ms ease";let V;e[4]!==d||e[5]!==u?(V=o.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]=V):V=e[6];let p;e[7]!==i||e[8]!==c||e[9]!==V?(p=o.jsxs("span",{className:c,children:[i,V]}),e[7]=i,e[8]=c,e[9]=V,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=o.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 Wr(t){const e=D.c(4),{status:s}=t,n=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("svg",{viewBox:"0 0 21 21",children:o.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]!==n||e[2]!==r?(a=o.jsx("div",{className:"todo-cb mt-0.5","data-checked":n,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function Yr(t){const e=D.c(13),{status:s}=t,n=B();if(s==="completed"){let a;e[0]!==n?(a=n("chat.todoStatus.completed"),e[0]=n,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.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:o.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let c;return e[3]!==a?(c=o.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]=c):c=e[4],c}if(s==="in_progress"){let a;e[5]!==n?(a=n("chat.todoStatus.inProgress"),e[5]=n,e[6]=a):a=e[6];let l;return e[7]!==a?(l=o.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]!==n?(r=n("chat.todoStatus.pending"),e[9]=n,e[10]=r):r=e[10];let i;return e[11]!==r?(i=o.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 Gr={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"}]},Hr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Jr(t){const e=D.c(46),{source:s,onDone:n}=t,r=B(),i=_s(),[a]=Se(),[l,c]=E.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=E.useState(""),[V,p]=E.useState(!1),f=l==="brl"?"R$":"$";let h;e[0]!==l||e[1]!==i?(h=async _=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:_,currency:l});return L},e[0]=l,e[1]=i,e[2]=h):h=e[2];let m;e[3]!==n?(m=_=>{_&&window.open(_,"_blank","noopener,noreferrer"),n?.()},e[3]=n,e[4]=m):m=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]!==h||e[8]!==m||e[9]!==g?(x={mutationFn:h,onSuccess:m,onError:g},e[7]=h,e[8]=m,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=(_,L)=>{ee("credits_topup_clicked",{amount_cents:_,currency:l,tier_label:L,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=_=>{_&&c(_)},C=o.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=o.jsx(yt,{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=o.jsx("div",{className:"mb-4",children:o.jsxs(uo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:y,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=Gr[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?(_=L=>{const{dollars:F,labelKey:q}=L;return o.jsxs("button",{type:"button",disabled:b,onClick:()=>A(F*100,Hr[q]??"preset"),className:O("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:[o.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,F]}),o.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 P;e[31]!==M?(P=o.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:M}),e[31]=M,e[32]=P):P=e[32];let R;e[33]!==A||e[34]!==f||e[35]!==d||e[36]!==k||e[37]!==w||e[38]!==b||e[39]!==V||e[40]!==r?(R=V?o.jsxs("div",{className:"flex gap-2 mt-3",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),o.jsx(Ds,{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})]}),o.jsx(Y,{className:"h-10",disabled:!w||b,onClick:()=>A(Math.round(k*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):o.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]=V,e[40]=r,e[41]=R):R=e[41];let U;return e[42]!==P||e[43]!==R||e[44]!==I?(U=o.jsxs("div",{children:[I,P,R]}),e[42]=P,e[43]=R,e[44]=I,e[45]=U):U=e[45],U}const Zr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Xr(t){const e=D.c(47),{onDismiss:s}=t,{org:n}=Ce(),r=it(),{decoKeyId:i}=co(),a=B(),l=Oe("credits");let c,d;if(e[0]!==n.id?(c=()=>{ee("credits_exhausted_shown",{organization_id:n.id})},d=[n.id],e[0]=n.id,e[1]=c,e[2]=d):(c=e[1],d=e[2]),E.useEffect(c,d),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=e[4];let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=["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]=V):V=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:V.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=o.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 h;e[8]!==a?(h=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=h):h=e[9];let m;e[10]!==h?(m=o.jsx(Rs,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=m):m=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=o.jsx(Ps,{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]!==m?(v=o.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,o.jsxs(Es,{className:"relative gap-4",children:[f,o.jsxs("div",{children:[m,x]})]})]}),e[16]=x,e[17]=m,e[18]=v):v=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&o.jsxs("div",{className:"px-8 pt-5 pb-6",children:[o.jsx("div",{className:"rounded-xl border border-border p-5",children:o.jsx(Jr,{source:"exhausted_banner",onDone:s})}),o.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Zr.map(N=>o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:o.jsx(at,{size:12,className:"text-success"})}),o.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=o.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]!==n.slug?(k=()=>{r({to:"/$org/settings/ai-providers",params:{org:n.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=n.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=o.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=o.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=o.jsxs(Us,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ei,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=o.jsx(Ls,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function ei(t){return t.preventDefault()}const ti={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 si(t){const e=D.c(16),{kind:s,onDismiss:n,onSubscribe:r}=t,i=B(),{label:a,title:l}=ti[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(lt,{size:14}),e[0]=c):c=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 V;e[7]!==s||e[8]!==r||e[9]!==i?(V=s==="trial_exhausted"?o.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]=V):V=e[10];let p;return e[11]!==n||e[12]!==d||e[13]!==u||e[14]!==V?(p=o.jsx(ue,{icon:c,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:n,footerRight:V}),e[11]=n,e[12]=d,e[13]=u,e[14]=V,e[15]=p):p=e[15],p}const ni={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function _t(t){const e=D.c(21),{kind:s,onDismiss:n}=t,r=B(),i=it(),{org:a}=Ce(),{label:l,title:c}=ni[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(lt,{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 V;e[4]!==r||e[5]!==c?(V=r(c),e[4]=r,e[5]=c,e[6]=V):V=e[6];let p;e[7]!==i||e[8]!==n||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),n()},e[7]=i,e[8]=n,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 h;e[13]!==p||e[14]!==f?(h=o.jsx(Y,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=h):h=e[15];let m;return e[16]!==n||e[17]!==u||e[18]!==V||e[19]!==h?(m=o.jsx(ue,{icon:d,label:u,title:V,defaultExpanded:!0,variant:"warning",onClose:n,footerRight:h}),e[16]=n,e[17]=u,e[18]=V,e[19]=h,e[20]=m):m=e[20],m}function vs(t){const e=oi(t);if(e!==null){const d=vs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),n=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,c=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(c){const d=c[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||n&&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}:n||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function oi(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:n,message:r}=s,i=typeof n=="string"?n:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const ri={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=D.c(29),s=B(),{variant:n,onDismiss:r}=t,i=n==="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,c=i?Jn:zs;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=ri[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 V;e[8]!==i||e[9]!==u?(V=i?vs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=V):V=e[10];const{summary:p,rawDetails:f}=V;let h;e[11]!==c?(h=o.jsx(c,{size:14}),e[11]=c,e[12]=h):h=e[12];let m;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(m=i?o.jsx(Y,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):o.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]=m):m=e[17];let g;e[18]!==f||e[19]!==s?(g=f?o.jsxs("details",{className:"group mx-4",children:[o.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:[o.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:o.jsx("path",{d:"m4.5 3 3 3-3 3"})}),o.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),o.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),o.jsxs("div",{className:"relative mt-2",children:[o.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:o.jsx(Zn,{className:"size-3.5"})}),o.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]!==h||e[25]!==m||e[26]!==g||e[27]!==n?(x=o.jsx(ue,{icon:h,label:l,title:p,defaultExpanded:!0,variant:n,onClose:r,footerRight:m,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=h,e[25]=m,e[26]=g,e[27]=n,e[28]=x):x=e[28],x}function $e(t){const e=D.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:n,voiceMode:r}=s,i=n===void 0?!1:n,a=r===void 0?!1:r,l=B(),{error:c,clearError:d,finishReason:u,clearFinishReason:V,messages:p,isStreaming:f,submit:h,sendMessage:m}=ze(),[g,x]=Se(),{virtualMcpId:v,createTaskWithMessage:b}=Ye(),{chatMode:j,simpleModeTier:A}=Ge(),k=Oe("credits"),{mutate:w}=go("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=se=>({...a?{voiceMode:!0}:{},tier:A,mode:j,toolApprovalLevel:se,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??Fs(),e[9]=g.toolApprovalLevel,e[10]=N):N=e[10];const M=N,P=p.at(-1),R=P?.role==="assistant"?P.parts:[],U=R.filter(Vi),_=R.filter(Ft),L=ls(R),F=is(R);let q;e[11]!==c||e[12]!==m||e[13]!==l?(q=()=>{if(c){const ge={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:c.message})}]}]};m(ge)}},e[11]=c,e[12]=m,e[13]=l,e[14]=q):q=e[14];const $=q;let z;e[15]!==m||e[16]!==l?(z=()=>{const se={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(se)},e[15]=m,e[16]=l,e[17]=z):z=e[17];const W=z;let X;e[18]!==I||e[19]!==M||e[20]!==h?(X=(se,ge)=>{h({kind:"toolOutput",toolCallId:se.toolCallId,output:{response:ge}},I(M))},e[18]=I,e[19]=M,e[20]=h,e[21]=X):X=e[21];const te=X;let J;e[22]!==I||e[23]!==M||e[24]!==h?(J=(se,ge)=>{h({kind:"toolOutput",toolCallId:se.toolCallId,output:{accepted:ge}},I(M))},e[22]=I,e[23]=M,e[24]=h,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=se=>{x({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:v,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:se})}]}})},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=li;let H;e[32]!==I||e[33]!==h?(H=(se,ge,xe,De)=>{h({kind:"approval",approvalId:se,approved:ge,...xe?{reason:xe}:{}},I(De))},e[32]=I,e[33]=h,e[34]=H):H=e[34];const oe=H,G=Vs();if(G.isCreditExhausted){let se;return e[35]!==k||e[36]!==d||e[37]!==i?(se=k?o.jsx(Xr,{onDismiss:d}):o.jsx("div",{className:O(!i&&"absolute bottom-full left-0 right-0"),children:o.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:d})}),e[35]=k,e[36]=d,e[37]=i,e[38]=se):se=e[38],se}const{showError:ie,showWarning:le,hasApprovals:pe}=G,Ve=U.map(ai).join("|"),ft=as(L)?.toolCallId??"",Be=F.map(ii).join("|"),de=!i&&"absolute bottom-full left-0 right-0";let fe;e[39]!==de?(fe=O(de),e[39]=de,e[40]=fe):fe=e[40];let be;e[41]!==G.todos?(be=o.jsx(Kr,{todos:G.todos}),e[41]=G.todos,e[42]=be):be=e[42];let ce;e[43]!==d||e[44]!==G.subscriptionErrorKind||e[45]!==C?(ce=G.subscriptionErrorKind&&o.jsx(si,{kind:G.subscriptionErrorKind,onDismiss:d,onSubscribe:C}),e[43]=d,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=ce):ce=e[46];let Ae;e[47]!==d||e[48]!==G.planRefusal?(Ae=G.planRefusal&&o.jsx(_t,{kind:G.planRefusal,onDismiss:d}),e[47]=d,e[48]=G.planRefusal,e[49]=Ae):Ae=e[49];let ke;e[50]!==d||e[51]!==c||e[52]!==$||e[53]!==ie?(ke=ie&&o.jsx(Qe,{variant:"error",error:c,onDismiss:d,onFixInChat:$}),e[50]=d,e[51]=c,e[52]=$,e[53]=ie,e[54]=ke):ke=e[54];let he;e[55]!==V||e[56]!==u||e[57]!==W||e[58]!==le?(he=le&&o.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:V,onContinue:W}),e[55]=V,e[56]=u,e[57]=W,e[58]=le,e[59]=he):he=e[59];const Te=pe&&o.jsx(wr,{approvals:F,isStreaming:f,onRespond:oe},Be),_e=G.hasPlans&&o.jsx(Cr,{plans:L,isStreaming:f,onApprove:Q,onDismiss:Z},ft),Me=G.hasTaskSuggestion&&o.jsx($r,{parts:_,isStreaming:f,onRespond:ae},_.at(-1)?.toolCallId??"");let me;e[60]!==G.isWaitingForUserInput||e[61]!==te||e[62]!==f||e[63]!==Ve||e[64]!==U?(me=G.isWaitingForUserInput&&o.jsx(xs,{userAskParts:U,isStreaming:f,onSubmit:te},Ve),e[60]=G.isWaitingForUserInput,e[61]=te,e[62]=f,e[63]=Ve,e[64]=U,e[65]=me):me=e[65];let Ne;return e[66]!==fe||e[67]!==be||e[68]!==ce||e[69]!==Ae||e[70]!==ke||e[71]!==he||e[72]!==Te||e[73]!==_e||e[74]!==Me||e[75]!==me?(Ne=o.jsxs("div",{className:fe,children:[be,ce,Ae,ke,he,Te,_e,Me,me]}),e[66]=fe,e[67]=be,e[68]=ce,e[69]=Ae,e[70]=ke,e[71]=he,e[72]=Te,e[73]=_e,e[74]=Me,e[75]=me,e[76]=Ne):Ne=e[76],Ne}function ii(t){return t.approvalId}function ai(t){return t.toolCallId}function li(){document.querySelector("[data-chat-input]")?.focus()}function Vi(t){return t.type==="tool-user_ask"}$e.Error=function(e){return o.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};$e.Warning=function(e){return o.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};$e.UserAskQuestion=xs;function bs(t){const e=D.c(20),{taskId:s}=t,n=B(),r=Dn(s),i=Rn(r),a=Pn(),{stop:l,removeLocalMessage:c}=ze();if(i.length===0)return null;let d;e[0]!==n?(d=n("chat.queueTray.sendNow"),e[0]=n,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(Kt,{size:14}),e[4]=V):V=e[4];let p;e[5]!==d||e[6]!==u?(p=o.jsx(Je,{asChild:!0,children:o.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:V})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==n?(f=n("chat.queueTray.sendNow"),e[8]=n,e[9]=f):f=e[9];let h;e[10]!==f?(h=o.jsx(Ze,{side:"top",children:o.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=h):h=e[11];let m;e[12]!==p||e[13]!==h?(m=o.jsxs(Xe,{delayDuration:400,children:[p,h]}),e[12]=p,e[13]=h,e[14]=m):m=e[14];let g;return e[15]!==a||e[16]!==c||e[17]!==n||e[18]!==s?(g=(x,v)=>o.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[o.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}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:x.text}),o.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:o.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm",title:n("chat.queueTray.removeFromQueue"),"aria-label":n("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,x.messageId).then(b=>{b&&(En(s,x.messageId),c(x.messageId))})},children:o.jsx(Ot,{className:"size-3.5"})})})]},x.messageId),e[15]=a,e[16]=c,e[17]=n,e[18]=s,e[19]=g):g=e[19],o.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[o.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:[o.jsx("span",{children:n(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),m]}),i.map(g)]})}const ci={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function di(t,e){return ci[t]?.test(e)??!1}function ui(t){return Io(t)&&di(t.providerId,t.modelId)}function pi(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 fi={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function hi(t){const e=D.c(32),{tier:s,orgSlot:n,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:c,onClose:d}=t,u=B(),V=ns(),p=new Set(V.map(mi)),f=Un([r,n,i],p),h=f?.keyId??null,[m,g]=E.useState(h??V[0]?.id??null),x=V.some(F=>F.id===m)?m:h??V[0]?.id??null,v=x?V.find(F=>F.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",j=fi[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=o.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]!==c||e[6]!==u||e[7]!==r?(w=r&&o.jsx("button",{type:"button",onClick:c,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]=c,e[6]=u,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==k||e[10]!==w?(y=o.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=E.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(vo,{}),e[12]=I):I=e[12];const N=xo,M=!0,P=pi(h?f:null,v?.providerId??"deco");let R;e[13]!==x||e[14]!==l||e[15]!==g?(R=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]=R):R=e[16];let U;e[17]!==N||e[18]!==x||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==P||e[23]!==R?(U=o.jsx(N,{compact:M,filterModels:a,onClose:d,credentialId:x,onCredentialChange:g,selectedModel:P,onModelChange:R}),e[17]=N,e[18]=x,e[19]=a,e[20]=d,e[21]=g,e[22]=P,e[23]=R,e[24]=U):U=e[24];let _;e[25]!==S||e[26]!==U||e[27]!==I?(_=o.jsx("div",{className:C,children:o.jsx(S,{fallback:I,children:U})}),e[25]=S,e[26]=U,e[27]=I,e[28]=_):_=e[28];let L;return e[29]!==_||e[30]!==y?(L=o.jsxs("div",{className:b,children:[y,_]}),e[29]=_,e[30]=y,e[31]=L):L=e[31],L}function mi(t){return t.id}const gi=["fast","smart","thinking"];function As(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Mt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function xi(t){const e=D.c(28),{tier:s,pillIcon:n,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,[c,d]=E.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 V=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=O("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 h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=O("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]=h):h=e[4];const m=l[s];let g;e[5]!==m?(g=o.jsx("span",{className:h,children:m}),e[5]=m,e[6]=g):g=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Zt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=x):x=e[7];let v;e[8]!==n||e[9]!==p||e[10]!==g?(v=o.jsx(Je,{asChild:!0,children:o.jsx("span",{className:"inline-flex min-w-0 shrink",children:o.jsx(Xt,{asChild:!0,children:o.jsxs(Y,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[n,g,x]})})})}),e[8]=n,e[9]=p,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p?(b=o.jsx(Ze,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;e[14]!==v||e[15]!==b?(j=o.jsxs(Xe,{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=>o.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>o.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[o.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>V(S),className:O("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&&o.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&o.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&o.jsx("span",{title:i("chat.tierTrigger.selected"),children:o.jsx(at,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&o.jsx(bi,{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=o.jsx(es,{align:"end",className:"p-1 w-64",onOpenAutoFocus:vi,children:o.jsx("div",{role:"menu",className:"flex flex-col",children:A})}),e[22]=A,e[23]=k):k=e[23];let w;return e[24]!==c||e[25]!==j||e[26]!==k?(w=o.jsxs(ts,{open:c,onOpenChange:d,children:[j,k]}),e[24]=c,e[25]=j,e[26]=k,e[27]=w):w=e[27],w}function vi(t){return t.preventDefault()}function bi(t){const e=D.c(38),{label:s,render:n}=t,r=B(),i=ss(),[a,l]=E.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>l(!1),e[0]=c):c=e[0];const d=c;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 V=a&&"opacity-100";let p;e[4]!==V?(p=O("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",V),e[4]=V,e[5]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(qn,{size:14}),e[6]=f):f=e[6];let h;e[7]!==u||e[8]!==p?(h=o.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=h):h=e[9];const m=h;if(i){let j;e[10]!==m?(j=o.jsx(yo,{asChild:!0,children:m}),e[10]=m,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=o.jsx(jo,{className:"sr-only",children:A}),e[15]=A,e[16]=k):k=e[16];let w;e[17]!==a||e[18]!==n?(w=a&&n(d),e[17]=a,e[18]=n,e[19]=w):w=e[19];let y;e[20]!==w||e[21]!==k?(y=o.jsxs(ko,{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=o.jsxs(wo,{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]!==m?(g=o.jsx(Xt,{asChild:!0,children:m}),e[27]=m,e[28]=g):g=e[28];let x;e[29]!==a||e[30]!==n?(x=a&&n(d),e[29]=a,e[30]=n,e[31]=x):x=e[31];let v;e[32]!==x?(v=o.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=o.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 Dt(t){return t==="fast"?o.jsx(lt,{size:16}):t==="thinking"?o.jsx(Kn,{size:16}):o.jsx(So,{size:16})}function Ai(t){const e=D.c(13),s=zn();let n;e[0]!==t||e[1]!==s.tiers?(n=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]=n):n=e[2];const r=n;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 c;return e[9]!==i||e[10]!==a||e[11]!==l?(c={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=c):c=e[12],c}function yi(){const t=D.c(24),e=B(),{simpleModeTier:s,setSimpleModeTier:n}=Ge(),r=Co(),i=ns(),a=To(i),l=Ai(a),{data:c,error:d}=Ln();let u;t[0]!==c?(u=c===void 0?{tiers:{}}:c,t[0]=c,t[1]=u):u=t[1];const V=u,p=Fn(),f=We()?.lockedHarness==="claude-code",h=Oe("model_choice"),m=ao(),g=lo();if(!m||!h)return null;let x,v;if(t[2]!==a||t[3]!==g||t[4]!==f||t[5]!==r||t[6]!==n||t[7]!==e||t[8]!==s||t[9]!==l||t[10]!==p||t[11]!==V||t[12]!==d){const w=As(e);x="decopilot",v=gi.map(y=>{const C=l[y],S=V.tiers[y];return{key:`decopilot-${y}`,icon:Dt(y),title:w[y],subtitle:g?C??e(Mt[y]):e(Mt[y]),active:s===y,onSelect:()=>n(y),modelOverride:g?I=>o.jsxs(o.Fragment,{children:[d&&o.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),o.jsx(hi,{tier:y,orgSlot:r.tiers[y],userSlot:S,autoSlot:a.chat[y],filterModels:f?ui: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]=n,t[7]=e,t[8]=s,t[9]=l,t[10]=p,t[11]=V,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=Dt(s),t[18]=s,t[19]=A):A=t[19];let k;return t[20]!==j||t[21]!==A||t[22]!==s?(k=o.jsx(xi,{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=D.c(3),[s]=Se();let n;return e[0]!==s.enableSounds||e[1]!==t?(n=()=>{s.enableSounds&&Fo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=n):n=e[2],n}const ji={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"},ki=mn.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),wi=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Si(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center -space-x-1.5",children:wi.map(Ci)}),t[0]=e):e=t[0],e}function Ci(t){return o.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Ni({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:n,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,c]=E.useState(!1),d=ys(ji),{org:u}=Ce(),{editor:V}=zt(),p=E.useRef(null),f=ut(n),h=()=>{!f||r||(c(!1),p.current?.click())},m=async T=>{const Q=T.target.files;if(!Q||Q.length===0||!V)return;const Z=Array.from(Q);try{let H=V.state.selection.from;for(const oe of Z)await os(V,n??null,oe,H,i,a),H=V.state.selection.to}finally{p.current&&(p.current.value="")}},g=Po({connectionId:s,orgId:u.id,orgSlug:u.slug}),x=Os.virtualMcpPrompts(s,u.id),{data:v,isLoading:b}=$s({queryKey:x,queryFn:()=>Eo(g),staleTime:6e4,enabled:l&&!!g}),j=v?.prompts??[],[A,k]=E.useState(null),{chatMode:w,setChatMode:y}=Ge(),[C,S]=Se(),I=We()?.lockedHarness!=="claude-code",N=we.find(T=>T.value===C.toolApprovalLevel)??we[0],M=a(N.shortKey),P=T=>{const Q=we.find(Z=>Z.value===T);if(Q){if(Q.value===C.toolApprovalLevel){c(!1);return}d(),ee("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:Q.value,source:"tools_popover"}),S({...C,toolApprovalLevel:Q.value}),c(!1)}},R=w==="plan",U=()=>{d();const T=R?"default":"plan";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),c(!1)},_=()=>{e(),c(!1)},L=async(T,Q)=>{if(!V||!g)return;const Z=jt(T._meta),H={from:V.state.selection.from,to:V.state.selection.to};try{const oe=await Uo(g,T.name,Q);Vn(V,H,{id:T.name,name:ho(T.name,Z),metadata:oe.messages,char:"/",kind:"prompt",args:Q})}catch{Ee.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async T=>{c(!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 L(T)},q=async T=>{A&&(await L(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),c(!1)},z=()=>{d();const T=w==="web-search"?"default":"web-search";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),c(!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),c(!1)},X=w==="gen-image",te=w==="web-search",J=w==="deep-research",ae=o.jsx("input",{ref:p,type:"file",multiple:!0,accept:bo(n??null),className:"hidden",onChange:m,disabled:r});return o.jsxs(o.Fragment,{children:[ae,o.jsxs(Bs,{open:l,onOpenChange:T=>{T&&!l&&ee("chat_tools_popover_opened",{chat_mode:w}),c(T)},children:[o.jsx(Ks,{asChild:!0,children:o.jsxs(Y,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[o.jsx(Qn,{size:14}),o.jsx("span",{className:O("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")})]})}),o.jsxs(qs,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?o.jsxs(ye,{onClick:h,disabled:r,children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):o.jsxs(Xe,{children:[o.jsx(Je,{asChild:!0,children:o.jsxs(ye,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:T=>T.preventDefault(),children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),o.jsx(Ze,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),o.jsxs(ye,{onClick:U,className:O(R&&"text-special"),children:[o.jsx(qt,{size:16,className:O(R&&"text-special")}),o.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),o.jsx("span",{className:O("text-xs text-muted-foreground",R&&"text-special font-medium"),children:ki})]}),o.jsxs(ye,{onClick:$,className:O(X&&"text-special"),children:[o.jsx(Ht,{size:16,className:O(X&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),X&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:z,className:O(te&&"text-special"),children:[o.jsx(Yt,{size:16,className:O(te&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:W,className:O(J&&"text-special"),children:[o.jsx(Gt,{size:16,className:O(J&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),J&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),o.jsx(vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?o.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[o.jsx(Qs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):j.length===0?o.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):j.map(T=>o.jsxs(ye,{onClick:()=>F(T),className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"font-medium text-sm capitalize",children:T.title||fo(T.name,jt(T._meta))}),T.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:T.description})]},T.name))})]}),I&&o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx(He,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:M})]}),o.jsx(vt,{className:"w-48 p-1.5",children:o.jsx(Ws,{value:C.toolApprovalLevel,onValueChange:P,children:we.map(T=>o.jsx(Ys,{value:T.value,children:a(T.labelKey)},T.value))})})]}),o.jsxs(ye,{onClick:_,children:[o.jsx(Lo,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),o.jsx(E.Suspense,{children:o.jsx(Si,{})})]})]})]}),o.jsx(ln,{prompt:A,setPrompt:k,onSubmit:q})]})}const Ii=[{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 Ti(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center -space-x-1",children:Ii.map(_i)}),t[0]=e):e=t[0],e}function _i(t){return o.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Mi(t){const e=D.c(10),{onClick:s}=t,n=B();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=O("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]!==n?(i=n("chat.connectionsBanner.description"),e[1]=n,e[2]=i):i=e[2];let a;e[3]!==i?(a=o.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,c;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ti,{}),c=o.jsx(Gs,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=c):(l=e[5],c=e[6]);let d;return e[7]!==s||e[8]!==a?(d=o.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,c]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Pe=48;function Di(){const t=D.c(9),[e,s]=E.useState("idle"),[n,r]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(Ei),d=E.useRef(null),u=E.useRef(null),V=E.useRef(null),p=E.useRef(null),f=E.useRef(0),h=E.useRef(!1),m=E.useRef(""),g=E.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(Pi),p.current?.getTracks().forEach(Ri),V.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 P=M.createMediaStreamSource(N),R=M.createAnalyser();R.fftSize=128,R.smoothingTimeConstant=.8,P.connect(R),V.current=R;const U=new Uint8Array(R.frequencyBinCount),_=()=>{if(!V.current)return;V.current.getByteFrequencyData(U);const L=[];for(let F=0;F<Pe;F++){const q=Math.floor(F/Pe*U.length);L.push(Math.max(.04,(U[q]??0)/255))}c(L),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="",m.current="",h.current=!0,s("recording"),I(M);const P=new N;d.current=P,P.interimResults=!0,P.continuous=!0,P.lang=navigator.language||"en-US",P.onresult=R=>{if(d.current!==P)return;let U="",_="";for(let L=R.resultIndex;L<R.results.length;L++){const F=R.results[L],q=F?.[0]?.transcript??"";F?.isFinal?_=_+q:U=U+q}_&&(m.current=m.current+_,r(m.current)),g.current=U,a(U)},P.onerror=R=>{d.current===P&&R.error!=="no-speech"&&(h.current=!1,d.current=null,b(),s(R.error==="not-allowed"?"permission-denied":"idle"))},P.onend=()=>{if(d.current===P&&h.current)try{P.start()}catch{}};try{P.start()}catch{return h.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=()=>{h.current=!1,d.current?.stop(),b(),s("idle"),c(Array(Pe).fill(.05)),a("");const I=(m.current+(g.current?" "+g.current:"")).trim();return r(""),m.current="",g.current="",I},t[2]=k):k=t[2];const w=k;let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{h.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),c(Array(Pe).fill(.05)),m.current="",g.current=""},t[3]=y):y=t[3];const C=y;let S;return t[4]!==i||t[5]!==e||t[6]!==n||t[7]!==l?(S={status:e,transcript:n,interimTranscript:i,waveformData:l,isSupported:x,startRecording:A,stopRecording:w,cancelRecording:C},t[4]=i,t[5]=e,t[6]=n,t[7]=l,t[8]=S):S=t[8],S}function Ri(t){return t.stop()}function Pi(){}function Ei(){return Array(Pe).fill(.05)}function Ui(t){const e=D.c(4),{data:s}=t;let n;e[0]!==s?(n=s.map(Li),e[0]=s,e[1]=n):n=e[1];let r;return e[2]!==n?(r=o.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:n}),e[2]=n,e[3]=r):r=e[3],r}function Li(t,e){return o.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 Ue=12e3,Rt=re({token:ne(),expiresAt:Js()});Zs("provider",[re({provider:je("elevenlabs"),conversationToken:ne().min(1)}),re({provider:je("openai"),transport:je("webrtc")})]);const Fi=Hs([Rt.extend({provider:je("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Rt.extend({provider:je("openai"),transport:je("webrtc")})]);re({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Ue)});const js=re({request:ne().trim().min(1).max(Ue)}),ot=5e3;Ut(re({role:Fe(["user","agent"]),text:ne().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 il(t){const e=[];let s=ot;for(const n of t.slice(-60).reverse()){if(s<=0)break;const r=n.text.slice(-s);e.unshift({role:n.role,text:r}),s-=r.length}return e}re({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:Fe(["en","pt"]).default("en")}).strict();const zi=re({sdp:ne().min(1).max(1e5)});async function Oi(t,e,s,n,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:c}=await import("./openai-conversation-DMNH07wd.js");return{startOpenAIConversation:c}},__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]));return l(r,s,n)}const{Conversation:i}=await bt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);n.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const c=js.safeParse(l);return JSON.stringify(c.success?await s.onDelegate(c.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 n.aborted&&(await a.endSession(),n.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const c=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(c):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
10
10
|
${c}
|
|
11
11
|
Briefly report this update. Do not delegate it as new work.`)}}}const $i=re({background:je(!0),status:je("started"),jobId:ne().min(1)}),Bi=re({item:re({id:ne().min(1),title:ne(),status:ne()})}),Ki=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 n=[];for(const r of t.slice(s+1))if(!r.metadata?.subtaskJobId){if(r.role==="user")break;r.role==="assistant"&&n.push(r)}return n}function Pt(t,e){const s=[],n=[];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=$i.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(a==="tool-TASK_BOARD_ITEM_CREATE"){const l=Bi.safeParse(i.output);l.success&&n.push(l.data.item)}}return{backgroundJobs:s,tasks:n}}function Et(t,e){const s=ks(t,e);if(!s)return null;const n=s.at(-1);if(!n||n.parts.some(l=>"state"in l&&["approval-requested","input-streaming","input-available"].includes(String(l.state))))return null;const r=n.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<=Ue)return i;const a=i.slice(0,Ue-1);return`${a.slice(0,a.lastIndexOf(" "))}…`}class qi{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,n])=>this.state[s]===n)){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
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(n=>n.accepted&&n.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 n of this.jobs.values()){if(!n.accepted||n.result!==void 0)continue;if(n.background){this.collectBackground(n,s);continue}const r=e.messages.findIndex(l=>l.id===n.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=Et(e.messages,n.messageId);if(l===null)continue;a=l;const c=Pt(e.messages,n.messageId);if(this.track(c.tasks),c.backgroundJobs.length){n.background=c.backgroundJobs,this.collectBackground(n,s);continue}}this.finish(n,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(n=>n.accepted&&n.result===void 0)}),this.publishWorkStatus()}collectBackground(e,s){const n=this.bindings?.messages??[],r=[];for(const i of e.background??[]){const a=Ki(i),l=n.findIndex(u=>u.id===a);if(l<0)return;const c=n.slice(l+1).some(u=>u.role==="user");if(s&&!c)return;const d=Et(n,a);if(d===null)return;this.track(Pt(n,a).tasks),r.push(d)}this.finish(e,r.filter(Boolean).join(`
|