decocms 4.507.1 → 4.507.3
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-BpUYB5M6.js → ActiveShapeUtils-xnsSL3sx.js} +1 -1
- package/dist/client/assets/{AlertCircle-Bty2uhsk.js → AlertCircle-CEZZLz38.js} +1 -1
- package/dist/client/assets/{AreaChart-DSbx8Pux.js → AreaChart-HN0fRlrS.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CGwuLtbU.js → ArrowLeft-DYDkRAue.js} +1 -1
- package/dist/client/assets/{ArrowUp-BYzq623p.js → ArrowUp-BoSjhzDf.js} +1 -1
- package/dist/client/assets/{BarChart-ws0Z6t_Q.js → BarChart-48xiRldD.js} +1 -1
- package/dist/client/assets/{Building02-DC1B_tJa.js → Building02-gxUxeRsd.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Bhsngimh.js → CategoricalChart-DmP7gVQc.js} +1 -1
- package/dist/client/assets/{CheckCircle-DPGL3Hpc.js → CheckCircle-B20x4ndI.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BwRvUPUM.js → ChevronSelectorVertical-9PUa7L-N.js} +1 -1
- package/dist/client/assets/{ChevronUp-D5DP9qHs.js → ChevronUp-BvKleEa1.js} +1 -1
- package/dist/client/assets/{Copy01-51uCRbSg.js → Copy01-DsiTYYU6.js} +1 -1
- package/dist/client/assets/{CreditCard01-D8QKn2t6.js → CreditCard01-kVpDY_m5.js} +1 -1
- package/dist/client/assets/{DotsVertical-Bhq6_ex6.js → DotsVertical-C9QJiHpJ.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-C8nCqXCd.js → ErrorBarContext-2zxIz6ZK.js} +1 -1
- package/dist/client/assets/{Globe04-C6aR04Lg.js → Globe04-OCDS2DtM.js} +1 -1
- package/dist/client/assets/{Image01-8_YUB9dA.js → Image01-DQWVAHE7.js} +1 -1
- package/dist/client/assets/{Key01-BYJLiX2A.js → Key01-X1DrP0l3.js} +1 -1
- package/dist/client/assets/{Link01-BrX96Lzm.js → Link01-ByHkgEJr.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DvM0DBf8.js → LinkBroken01-C1K12OTL.js} +1 -1
- package/dist/client/assets/{Monitor01-D0i8fPos.js → Monitor01-DRY8tI7i.js} +1 -1
- package/dist/client/assets/{Play-BefGY3fA.js → Play-DgswSwWx.js} +1 -1
- package/dist/client/assets/{Plus-Bk_sjqOf.js → Plus-CBBIyP6s.js} +1 -1
- package/dist/client/assets/{SearchMd-Cey_qFlh.js → SearchMd-cZPkobS8.js} +1 -1
- package/dist/client/assets/{Sector-CtKVpBRQ.js → Sector-EzyKalFj.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DmYaqF6W.js → ShoppingBag01-Dne3aRqF.js} +1 -1
- package/dist/client/assets/{Sun-Vjoy_5bv.js → Sun-CHpluZV5.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Cpiuomvl.js → SwitchHorizontal01-BxVAqSEt.js} +1 -1
- package/dist/client/assets/{Tool01-BxfOk1kQ.js → Tool01-BpE6Ocu5.js} +1 -1
- package/dist/client/assets/{Trash01-CMp64biU.js → Trash01-CWyW8AJH.js} +1 -1
- package/dist/client/assets/{Upload01-Dgeov9JH.js → Upload01-Cx8wHc7w.js} +1 -1
- package/dist/client/assets/{User01-hKw9FGQs.js → User01-COA-WNQV.js} +1 -1
- package/dist/client/assets/{UserSquare-J-pPBDsM.js → UserSquare-CySOTy0y.js} +1 -1
- package/dist/client/assets/{Users01-D83kTTD4.js → Users01-Czgnm_XI.js} +1 -1
- package/dist/client/assets/{XAxis-DP4n5Mz1.js → XAxis-CGzEXMaM.js} +1 -1
- package/dist/client/assets/{XClose-BnQLG2SG.js → XClose-Qxrq0G_x.js} +1 -1
- package/dist/client/assets/{ZoomOut-DAA80mSj.js → ZoomOut-NpBIqZ1k.js} +1 -1
- package/dist/client/assets/{access-gate-BPTmRdwJ.js → access-gate-BKWaGhuR.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DJYTiZdc.js → add-connection-dialog-BNedSJ6Y.js} +1 -1
- package/dist/client/assets/{agent-analytics-CciBDuVD.js → agent-analytics-EgytGSYW.js} +1 -1
- package/dist/client/assets/agent-app-D9eg50A5.js +1 -0
- package/dist/client/assets/{agent-assets-BtIBrBU2.js → agent-assets-Boz0X5Ki.js} +1 -1
- package/dist/client/assets/{agent-automation-xojgkWpW.js → agent-automation-Cjz3FKC_.js} +1 -1
- package/dist/client/assets/{agent-automations-DI9zixMm.js → agent-automations-Dn0LzzG7.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-CTaUDT6P.js → agent-connect-sources-a_Oe6pMW.js} +1 -1
- package/dist/client/assets/agent-deck-1gupRcJZ.js +1 -0
- package/dist/client/assets/{agent-e2e-CMbdmVpE.js → agent-e2e-ge69NZq7.js} +1 -1
- package/dist/client/assets/{agent-experiments-BAiMCicr.js → agent-experiments-Cg0irecg.js} +1 -1
- package/dist/client/assets/{agent-file-IVz8YLfb.js → agent-file-DNlgdYja.js} +1 -1
- package/dist/client/assets/{agent-hosting--MjQUCqO.js → agent-hosting--5LLQHqh.js} +1 -1
- package/dist/client/assets/{agent-icon-CdvQWbsW.js → agent-icon-RCyVT7wo.js} +1 -1
- package/dist/client/assets/agent-library-CZsORtzd.js +1 -0
- package/dist/client/assets/agent-library-file-CqqayOGV.js +1 -0
- package/dist/client/assets/{agent-monitor-D3m53JTs.js → agent-monitor-x7nRbONI.js} +1 -1
- package/dist/client/assets/{agent-overview-CEg-2iVO.js → agent-overview-h2sT0vHf.js} +1 -1
- package/dist/client/assets/{agent-releases-DiaV8DC-.js → agent-releases-CCY6x1Zv.js} +1 -1
- package/dist/client/assets/agent-settings-XcvMA_9D.js +1 -0
- package/dist/client/assets/{agent-site-editor-C5QM4WzO.js → agent-site-editor-InBJeC6D.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Bh5sCFsy.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BtuYGgjS.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Cdx_zMGc.js +1 -0
- package/dist/client/assets/agent-view-UKvSEWLk.js +1 -0
- package/dist/client/assets/{agent-view-guard-BUPMHzY7.js → agent-view-guard-CQbpMBLl.js} +1 -1
- package/dist/client/assets/{agents-list-CK-X0XMD.js → agents-list-CWBXnTS3.js} +1 -1
- package/dist/client/assets/{ai-providers-BRhxQzWW.js → ai-providers-CqVdQTJJ.js} +1 -1
- package/dist/client/assets/{alert-CpswsOed.js → alert-DtmiRNCs.js} +1 -1
- package/dist/client/assets/{alert-dialog-C9FvnbJH.js → alert-dialog-eYX_HG6w.js} +1 -1
- package/dist/client/assets/{analytics-sections-CbcIa337.js → analytics-sections-D83BItUG.js} +1 -1
- package/dist/client/assets/{api-keys-DlsaE7fm.js → api-keys-CfeV-_9h.js} +1 -1
- package/dist/client/assets/api-keys-eHR4JGKj.js +1 -0
- package/dist/client/assets/{app-editor-BoavkVeY.js → app-editor-CLUKjiV1.js} +1 -1
- package/dist/client/assets/{asset-utils-D7MF6-R7.js → asset-utils-BfYqMmJj.js} +1 -1
- package/dist/client/assets/{auth-MJlmDrih.js → auth-CAugv3bc.js} +1 -1
- package/dist/client/assets/{auth-catchall-BHMd9Ph5.js → auth-catchall-BXWISMfs.js} +1 -1
- package/dist/client/assets/{auth-entry-DL7EFmi7.js → auth-entry-D3dpURJr.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DW5pckra.js → auth-split-layout-DLWrmJg2.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DjLIsCBn.js → authenticate-and-persist-oauth-B4sOdDrI.js} +1 -1
- package/dist/client/assets/{automation-list-row-BjiQRizI.js → automation-list-row-C3iwYbyI.js} +1 -1
- package/dist/client/assets/{automation-runs-80f4mOhg.js → automation-runs-BbzFBQok.js} +1 -1
- package/dist/client/assets/{automations-DvVYYa4T.js → automations-DPaT9sIN.js} +1 -1
- package/dist/client/assets/{autosend-BfqtXC9i.js → autosend-DSEyOhE7.js} +1 -1
- package/dist/client/assets/{avatar-V-6seD4f.js → avatar-Vuppyn0R.js} +1 -1
- package/dist/client/assets/{badge-xuppbiJQ.js → badge-DCJU38ab.js} +1 -1
- package/dist/client/assets/{block-document-Btuft_G8.js → block-document-DdDh5C7y.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BgDdSp2f.js → blocks-preview-workspace-context-Zw7X8ZvT.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-Db9AzGGz.js → blocks-tab-states-Z8p2MUXW.js} +3 -3
- package/dist/client/assets/{blog-schema-COmuQoqg.js → blog-schema-kNeCn8hc.js} +1 -1
- package/dist/client/assets/{board-analytics-DmUIfxqn.js → board-analytics-IgbW7H8y.js} +1 -1
- package/dist/client/assets/{buckets-BUVMZHRM.js → buckets-BJDs6pQ7.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-LycMDrLL.js → build-improve-prompt-doc-DuUSRBYw.js} +1 -1
- package/dist/client/assets/{calendar-BFQivyIG.js → calendar-BqBNvALs.js} +1 -1
- package/dist/client/assets/{capability-load-error-DT-E9Kqv.js → capability-load-error-Ct7gTlUl.js} +1 -1
- package/dist/client/assets/{category-editor-D7z_VQuj.js → category-editor-BcDXgxmT.js} +1 -1
- package/dist/client/assets/{chart-Bf8aJepc.js → chart-D7WURHEc.js} +1 -1
- package/dist/client/assets/{chat-context-CShbCUNX.js → chat-context-qaPvBrDR.js} +1 -1
- package/dist/client/assets/{chat-draft-D5xPO9J5.js → chat-draft-zaNEWXzo.js} +1 -1
- package/dist/client/assets/{checkbox-CsdxV5F4.js → checkbox-Cu7Sq496.js} +1 -1
- package/dist/client/assets/{choose-editor-Cob5iDz2.js → choose-editor-IaO1rmYe.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BGAGjJYR.js → cli-auth-success-Bat4qyJj.js} +1 -1
- package/dist/client/assets/{client-icons-C0O_MDmG.js → client-icons-BrKH2PNf.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CXWd5Zp3.js +1 -0
- package/dist/client/assets/{collapsible-pbpDRVGu.js → collapsible-7FtcEuA2.js} +1 -1
- package/dist/client/assets/{collection-detail-QEBGQhqZ.js → collection-detail-ALnK7pxW.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bo5uFmZI.js → collection-display-button-CCVpzOGT.js} +1 -1
- package/dist/client/assets/{collection-search-B8HvNhHx.js → collection-search-DvXfIbCw.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CME0ZXYS.js → collection-table-wrapper-B4V_gZlC.js} +1 -1
- package/dist/client/assets/{collection-tabs-P32YIIxy.js → collection-tabs-D3G56cwm.js} +1 -1
- package/dist/client/assets/{column-rules-DJkbTYf8.js → column-rules-CmG06P_7.js} +1 -1
- package/dist/client/assets/{combobox-95bHdh7B.js → combobox-DSlBd4Uo.js} +1 -1
- package/dist/client/assets/{command-CdQubtgL.js → command-DtJnVLn9.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DT-zqSA0.js → companion-mcps-section-CiG0ujv0.js} +1 -1
- package/dist/client/assets/{config-CC4U9lyT.js → config-BpRBB-kH.js} +1 -1
- package/dist/client/assets/{connect-D_OdkLzZ.js → connect-B-rLA-PL.js} +1 -1
- package/dist/client/assets/{connect-layout-DKUDTFmt.js → connect-layout-DnZ_SKor.js} +1 -1
- package/dist/client/assets/{connection-DS2m6_aA.js → connection-BiAy_e5E.js} +1 -1
- package/dist/client/assets/{connection-card-C1INmiO3.js → connection-card-BPU1-L2q.js} +1 -1
- package/dist/client/assets/{connection-detail-govoielY.js → connection-detail-re-PCDvu.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bdbv__5q.js → connection-form-helpers-BX34BrYY.js} +1 -1
- package/dist/client/assets/{connections-CS9HbJB3.js → connections-CpI1FEJb.js} +1 -1
- package/dist/client/assets/{content-tab-DWizMuHE.js → content-tab-DcKfctGm.js} +3 -3
- package/dist/client/assets/{context-TX95KwtD.js → context-9Kg2kcpD.js} +1 -1
- package/dist/client/assets/{context-menu-CV5Kwy0Y.js → context-menu-evHCp9FV.js} +1 -1
- package/dist/client/assets/{core.esm-DySokeDD.js → core.esm-1eSJsXtC.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BKXj66H0.js → create-organization-dialog-Cimilr21.js} +1 -1
- package/dist/client/assets/{daily-pulse-BnWqY20A.js → daily-pulse-CoLeZob0.js} +1 -1
- package/dist/client/assets/{discover-CwLdifKu.js → discover-C547kJMw.js} +1 -1
- package/dist/client/assets/{domain-settings-bBNFtUzG.js → domain-settings-P5qccMb4.js} +1 -1
- package/dist/client/assets/{drawer-CY01gtte.js → drawer-CRbqujkT.js} +1 -1
- package/dist/client/assets/{editor-BMsJkpc5.js → editor-RFaQaHms.js} +1 -1
- package/dist/client/assets/{editor-classes-hvMxYRPw.js → editor-classes-DzSdR8sO.js} +1 -1
- package/dist/client/assets/{empty-state-DbF1fVB1.js → empty-state-BkMrlKiw.js} +1 -1
- package/dist/client/assets/{empty-state-lMQw4wDb.js → empty-state-C4pckIIk.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CxPHH0g-.js → extract-connection-data-CC8UKBjD.js} +1 -1
- package/dist/client/assets/{feature-gate-yx1JPdIs.js → feature-gate-B-pMn93y.js} +1 -1
- package/dist/client/assets/{feature-paywall-BVtlmh2X.js → feature-paywall-DlBo4LL2.js} +1 -1
- package/dist/client/assets/{file-explorer-ibryp6QB.js → file-explorer-DKN9shzl.js} +1 -1
- package/dist/client/assets/{file-preview-C0xlzOg8.js → file-preview-BXp5QURM.js} +1 -1
- package/dist/client/assets/{file-share-button-DpvTad7o.js → file-share-button-02yJpkjE.js} +2 -2
- package/dist/client/assets/{file-type-icon-DuTvDFZv.js → file-type-icon-BEKg8VDa.js} +1 -1
- package/dist/client/assets/flat-project-COP0FJZl.js +1 -0
- package/dist/client/assets/{folder-icon-whk1wgCT.js → folder-icon-unq375RQ.js} +1 -1
- package/dist/client/assets/{form-C3-gqoE3.js → form-Cpn1fS0w.js} +1 -1
- package/dist/client/assets/{general-CWIFD_7I.js → general-BmnN3W6h.js} +1 -1
- package/dist/client/assets/{home-DT5-zQ3E.js → home-CcAf30Bi.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-D6Ffo0E3.js → hosted-publish-feedback-DkXb3WIe.js} +1 -1
- package/dist/client/assets/{icon-button-BS-JGKQE.js → icon-button-CFK3NQ6z.js} +1 -1
- package/dist/client/assets/{index-3zItT2RS.js → index-B5P6mJ_-.js} +3 -3
- package/dist/client/assets/{index-CdXcvK9e.js → index-BHRumIhC.js} +1 -1
- package/dist/client/assets/{index-D1WhOgDF.js → index-BMxoxuSr.js} +1 -1
- package/dist/client/assets/{index-Bw86rqRb.js → index-BXnPeal1.js} +1 -1
- package/dist/client/assets/{index-DbWYgc1J.js → index-BY_Bygen.js} +1 -1
- package/dist/client/assets/{index-ONAPJHIb.js → index-BstXDWDk.js} +1 -1
- package/dist/client/assets/{index-CylNQm53.js → index-BtcNxrFQ.js} +1 -1
- package/dist/client/assets/{index-2To0vSEr.js → index-C4JqPt-P.js} +1 -1
- package/dist/client/assets/{index-CTZFCFor.js → index-D05mvej1.js} +2 -2
- package/dist/client/assets/{index-DN6_-RzX.js → index-DNnzAgp6.js} +1 -1
- package/dist/client/assets/{index-D3Egkv0G.js → index-DdfVrq0H.js} +1 -1
- package/dist/client/assets/{index-JOoGKn03.js → index-DkiNTs6p.js} +1 -1
- package/dist/client/assets/{index-DQRAWCM4.js → index-DyNtXlZs.js} +1 -1
- package/dist/client/assets/{index-BfPVLbyp.js → index-Wv6TNaI1.js} +1 -1
- package/dist/client/assets/{index-CocrhzZC.js → index-gn-kXq4N.js} +1 -1
- package/dist/client/assets/{index-redirect-B7Nxq720.js → index-redirect-DWgCkH3j.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DjFxX3t4.js → infiniteQueryObserver-Dqqye4fA.js} +1 -1
- package/dist/client/assets/{infra-billing-C91ooPoC.js → infra-billing-C6VLY__1.js} +1 -1
- package/dist/client/assets/{input-CAuGdxaS.js → input-BvNGJpgE.js} +1 -1
- package/dist/client/assets/{input-zzyYgG2z.js → input-f3VIcDXD.js} +4 -4
- package/dist/client/assets/{integration-icon-DedJ1gFL.js → integration-icon-CHEBfkGE.js} +1 -1
- package/dist/client/assets/{jira-icon-BH-e3sV4.js → jira-icon-DN-RVD9t.js} +1 -1
- package/dist/client/assets/{label-BxQ_dsc6.js → label-Byc0yEyf.js} +1 -1
- package/dist/client/assets/{layout-C3yBCGKV.js → layout-B1lqiDjR.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CPUJGbk4.js → legacy-agents-deep-BtrtyYyj.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Cd5BSaGF.js → legacy-main-redirect-cEbXG2LF.js} +1 -1
- package/dist/client/assets/library-Dbl7_fbA.js +1 -0
- package/dist/client/assets/{library-tab-DAuCMhST.js → library-tab-BtmMRnLQ.js} +1 -1
- package/dist/client/assets/{login-DCgWtHlv.js → login-B3nYLEGw.js} +1 -1
- package/dist/client/assets/{markdown-B3gUf9fq.js → markdown-CzotQpcK.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-4oVWjJbt.js → mcp-app-renderer-D1par7Q1.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Dx8iOGEt.js → mcp-oauth-AbAsLX7c.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DnmbC1ZC.js → mcp-oauth-BvaFMPww.js} +1 -1
- package/dist/client/assets/{members-PWoNTeHj.js → members-0EWINC3M.js} +1 -1
- package/dist/client/assets/{memory-BEuf8l8C.js → memory-DeBKfL7w.js} +1 -1
- package/dist/client/assets/{mini-report-page-BQGdzpbF.js → mini-report-page-Dq7zNRd2.js} +1 -1
- package/dist/client/assets/{mock-board-CSuz4opM.js → mock-board-BZAoQJtk.js} +1 -1
- package/dist/client/assets/{monaco-editor-C1ThyHfg.js → monaco-editor-DGXE9Zzq.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BLfBHvDR.js → monitoring-stats-row-B43DV0_4.js} +1 -1
- package/dist/client/assets/{multi-select-BGUKy-ie.js → multi-select-CxesYEMo.js} +1 -1
- package/dist/client/assets/{mustache-BopKjK4y.js → mustache-DrDpouee.js} +1 -1
- package/dist/client/assets/{new-project-dialog--6a9GYsY.js → new-project-dialog-DSNw0Myy.js} +1 -1
- package/dist/client/assets/{oauth-callback-Dl9UbmC0.js → oauth-callback-BTWmNREt.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-MlWlWjGr.js → oauth-callback-ai-provider-CiVltBb1.js} +1 -1
- package/dist/client/assets/{onboarding-BvW7_lSm.js → onboarding-bZ8kU41t.js} +1 -1
- package/dist/client/assets/{openai-conversation-DV_TyXnN.js → openai-conversation-CuaaGonx.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-gZfWr2eJ.js → optimistic-project-sidebar-views-B1zKAGen.js} +1 -1
- package/dist/client/assets/{order-monitor-day-tqxzccsD.js → order-monitor-day-DezLRXC3.js} +1 -1
- package/dist/client/assets/{organization-choice-qkiDWPrl.js → organization-choice-Db-HDg5l.js} +1 -1
- package/dist/client/assets/{orgs-Bsdk5WNb.js → orgs-B-W3rGw3.js} +1 -1
- package/dist/client/assets/{page-seo-form-C26iJCis.js → page-seo-form-6DuLnecK.js} +1 -1
- package/dist/client/assets/{pair-BXKJ75t2.js → pair-BLRClNAO.js} +1 -1
- package/dist/client/assets/{plan-ladder-D42bnzq6.js → plan-ladder-YN2QGUeX.js} +1 -1
- package/dist/client/assets/{popover-DZg3XzK_.js → popover-BRP0dGOy.js} +1 -1
- package/dist/client/assets/{post-calendar-BtiCxjbq.js → post-calendar-DOJqkrJo.js} +1 -1
- package/dist/client/assets/{post-editor-CimCNunY.js → post-editor-Bh9kQF0s.js} +1 -1
- package/dist/client/assets/{preview-content-CxXRowEV.js → preview-content-Ca7hetMx.js} +1 -1
- package/dist/client/assets/{preview-dialog-W6xlve7R.js → preview-dialog-DAkeNZ-D.js} +1 -1
- package/dist/client/assets/{preview-panel-Cy7WRuva.js → preview-panel-CH-U1JQP.js} +1 -1
- package/dist/client/assets/{preview-tab-Bo_MmH8N.js → preview-tab-wUz9gFMu.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DRSW83x9.js → product-picker-dialog-BnlEUa12.js} +1 -1
- package/dist/client/assets/{profile-CtmE_8xo.js → profile--86fFY_-.js} +1 -1
- package/dist/client/assets/{project-app-view-8D3fxLxg.js → project-app-view-C4BR6Mmp.js} +1 -1
- package/dist/client/assets/{project-feed-B6d9Pblv.js → project-feed-UeMqowpl.js} +1 -1
- package/dist/client/assets/{project-icon-Cd3AxOfl.js → project-icon-CoMTGFyt.js} +1 -1
- package/dist/client/assets/project-reports-Bqaec69c.js +1 -0
- package/dist/client/assets/project-tasks-89FCuOFj.js +1 -0
- package/dist/client/assets/{projects-B8YVAgec.js → projects-DVDcAAbz.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BfkNTDjK.js → projects-empty-state-BPJ64wXe.js} +1 -1
- package/dist/client/assets/{prompts-2NxN_gnO.js → prompts-vZQv-E0a.js} +1 -1
- package/dist/client/assets/record-editor-BO4FTIEZ.js +1 -0
- package/dist/client/assets/{redirect-editor-S1rL9xd1.js → redirect-editor-CWOGGd9X.js} +1 -1
- package/dist/client/assets/{reports-BdiHuIUD.js → reports-Ber8U8S_.js} +1 -1
- package/dist/client/assets/reports-CZIAXvrm.js +1 -0
- package/dist/client/assets/{reports-onboarding-CzBiKyvA.js → reports-onboarding-DWd9qnNo.js} +1 -1
- package/dist/client/assets/{reports-tab-fWUABT_U.js → reports-tab-BjvOLVL2.js} +2 -2
- package/dist/client/assets/{repositories-1B0IcoSH.js → repositories-Cdtpc8vK.js} +1 -1
- package/dist/client/assets/{repository-binding-CbZ7gDPF.js → repository-binding-EXwhhepG.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CqejRBEV.js → repository-import-picker-BJHLuYxy.js} +1 -1
- package/dist/client/assets/{repository-picker-lc5PVuph.js → repository-picker-BVEKwcgd.js} +1 -1
- package/dist/client/assets/{require-capability-CLiKw7xi.js → require-capability-CxYZgREN.js} +1 -1
- package/dist/client/assets/{required-auth-layout-obZ6miVT.js → required-auth-layout-DZ3djgK0.js} +1 -1
- package/dist/client/assets/{reset-password-C9jR1Ymc.js → reset-password-7FkpzK0V.js} +1 -1
- package/dist/client/assets/{resizable-MOzKpsY9.js → resizable-DFRjhuA3.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DXtTUrAj.js → resolve-tab-icon-CIbcu6wD.js} +1 -1
- package/dist/client/assets/{review-settings-DrM5MUBI.js → review-settings-DHsLGNnN.js} +1 -1
- package/dist/client/assets/{roles-CHt9_vGR.js → roles-Ce-B_VAm.js} +1 -1
- package/dist/client/assets/{route-Cd4e3z96.js → route-BMO8eHq2.js} +1 -1
- package/dist/client/assets/{route-q27BnTUy.js → route-BSFeNlw2.js} +1 -1
- package/dist/client/assets/route-CFEus4jk.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-BlCv6a-P.js → sandbox-lifecycle-context-IFQ1Yk5o.js} +1 -1
- package/dist/client/assets/{schema-BpLx5lXs.js → schema-BfUoakNz.js} +1 -1
- package/dist/client/assets/{schema-B3PJAfvC.js → schema-CeF-A6L_.js} +1 -1
- package/dist/client/assets/{scroll-area-CioiKzlv.js → scroll-area-BuGk0_hc.js} +1 -1
- package/dist/client/assets/{search-input-OMtFZb1f.js → search-input-Cvascs0V.js} +1 -1
- package/dist/client/assets/{search-toggle-Rm9zqdhj.js → search-toggle-8XoSHYon.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-FPLrd6Sz.js → secret-ciphertext-CL3ZJB5S.js} +1 -1
- package/dist/client/assets/{secret-picker-fddEeqOm.js → secret-picker-Dytvhmin.js} +1 -1
- package/dist/client/assets/{secrets-loUpoyBS.js → secrets-2XF20fZX.js} +1 -1
- package/dist/client/assets/{sections-editor-E9Z18ZDi.js → sections-editor-BGbg0MVG.js} +1 -1
- package/dist/client/assets/{select-CMGxS2qh.js → select-BcxRUsT5.js} +1 -1
- package/dist/client/assets/{select-model-CxhDhd-9.js → select-model-Cf5wadBJ.js} +1 -1
- package/dist/client/assets/{seo-editor-D8MaiSNi.js → seo-editor-BAc3X0rC.js} +1 -1
- package/dist/client/assets/{separator-BXc0zPSY.js → separator-CDdukvQ8.js} +1 -1
- package/dist/client/assets/{settings-tab-Dou04qL_.js → settings-tab-CEr__nVA.js} +1 -1
- package/dist/client/assets/{sheet-BRHzkcNr.js → sheet-MLYvpvbU.js} +1 -1
- package/dist/client/assets/{shell-layout-Dhz9Exq4.js → shell-layout-724i__Wv.js} +1 -1
- package/dist/client/assets/site-editor-E4EuEJwx.js +1 -0
- package/dist/client/assets/{site-editor-toast-7y5QejdX.js → site-editor-toast-D5dcnvPF.js} +1 -1
- package/dist/client/assets/{skills-BYVm1yj9.js → skills-DjYBgyTk.js} +1 -1
- package/dist/client/assets/{slider-BA5URV4c.js → slider-DPrJ3-c2.js} +1 -1
- package/dist/client/assets/{sortable.esm-BOb8_093.js → sortable.esm-CB3TqmDh.js} +1 -1
- package/dist/client/assets/{sso-BobuOVA-.js → sso-CHTZTnHu.js} +1 -1
- package/dist/client/assets/{suggestion-D_2yEjf4.js → suggestion-wjyEiM3d.js} +1 -1
- package/dist/client/assets/{switch-DGEo5K4-.js → switch-Bml_T3Qz.js} +1 -1
- package/dist/client/assets/{symbol-CjppxhTH.js → symbol-BI8lYa6g.js} +1 -1
- package/dist/client/assets/{synced-repos-Dr5VcS9S.js → synced-repos-DPqC2Jws.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DJxM1HMX.js → tab-icon-glyph-0QOKkYa2.js} +1 -1
- package/dist/client/assets/{table-CM_armOG.js → table-gj14KciX.js} +1 -1
- package/dist/client/assets/{tabs-D7n9t3lM.js → tabs-BhOBQud_.js} +1 -1
- package/dist/client/assets/{task-board-Cfny2jqU.js → task-board-BVpRfyhG.js} +1 -1
- package/dist/client/assets/{task-route-C93dEljG.js → task-route-BG6GqN_V.js} +1 -1
- package/dist/client/assets/{task-status-Dc99s_5R.js → task-status-45w0gLpN.js} +1 -1
- package/dist/client/assets/taskboard-analytics-DjdlsG9e.js +1 -0
- package/dist/client/assets/tasks-5Sm7zKel.js +1 -0
- package/dist/client/assets/{tasks-Bz8Lz6cJ.js → tasks-CLwTmsJ6.js} +1 -1
- package/dist/client/assets/{textarea-D-r53Xtx.js → textarea-0AY2HDgW.js} +1 -1
- package/dist/client/assets/{thread-analytics-xhV1IkYL.js → thread-analytics-DJsGipjG.js} +1 -1
- package/dist/client/assets/{thread-intent-b5vpifzT.js → thread-intent-oqwOpeN9.js} +1 -1
- package/dist/client/assets/{thread-route-dlwv4_1A.js → thread-route-DHova7iz.js} +1 -1
- package/dist/client/assets/{thread-route-BJ_juaVR.js → thread-route-l3Qo5S-E.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BlfHDz0K.js → thread-sheet-body-BevXM8QK.js} +1 -1
- package/dist/client/assets/{time-range-picker-BbFeKJV8.js → time-range-picker-DGZ1k38N.js} +1 -1
- package/dist/client/assets/{toggle-group-DHp1u7am.js → toggle-group-Dq44TMds.js} +1 -1
- package/dist/client/assets/{tool-namespace-BEzs43Ur.js → tool-namespace-BrVPsXeX.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-iqvhc0aD.js → toolbar-icon-button-DL4Lx8lo.js} +1 -1
- package/dist/client/assets/{tooltip-OCAaNJPG.js → tooltip-bUQOQa7V.js} +1 -1
- package/dist/client/assets/{tooltipContext-Di2WNqkv.js → tooltipContext-qP0WSM-N.js} +1 -1
- package/dist/client/assets/{track-C14SKSTg.js → track-fGt0oqX1.js} +1 -1
- package/dist/client/assets/{types-DSl6aKYl.js → types-aDeKLUKc.js} +1 -1
- package/dist/client/assets/{url-slug-BDqmchWv.js → url-slug-BxPt7IKX.js} +1 -1
- package/dist/client/assets/{usage-stats-k4aXi0cR.js → usage-stats-DyepwXzI.js} +1 -1
- package/dist/client/assets/{use-ai-providers-r5JMl3Dn.js → use-ai-providers-BWS-kzjG.js} +1 -1
- package/dist/client/assets/{use-app-takeover-C41Zrny9.js → use-app-takeover-BeifZEUu.js} +1 -1
- package/dist/client/assets/{use-automations-CAQWvaBW.js → use-automations-CpqZoOF8.js} +1 -1
- package/dist/client/assets/{use-autosave-DVsGD-u4.js → use-autosave-Ch4IhRzV.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-B7jtkmO9.js → use-chat-navigation-BxUcSwDs.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CdAPP8z5.js → use-clock-tick-DBHdRcgc.js} +1 -1
- package/dist/client/assets/{use-connect-companion-XVE2U2A9.js → use-connect-companion-xpkpChp6.js} +1 -1
- package/dist/client/assets/{use-connection-Bc66r7WR.js → use-connection-BThCD02o.js} +1 -1
- package/dist/client/assets/{use-content-sync-Cur_tlcg.js → use-content-sync-1a74Mfy8.js} +1 -1
- package/dist/client/assets/{use-copy-DIsWFSvt.js → use-copy-CIKivmGg.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CC1Pm7Vq.js → use-create-virtual-mcp-BSg6bI1H.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BPUEmwqZ.js → use-date-fns-locale-CpOIvaKP.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CitZx5FB.js → use-debounced-autosave-iZ-ciKPa.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Cv1nzd8k.js → use-debounced-value-CBaPWhkT.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CbC5ZgVr.js → use-deco-credits-CeMi8OEE.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BGdkAbxA.js → use-decopilot-events-BRhYtpoz.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Cgcil9G0.js → use-delete-connection-Cjxx4sX7.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Bq3PTYyd.js → use-deployment-admin-B-HAzjo2.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-D4n7osah.js → use-ensure-project-folder-CaRRA2I7.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-C__pe5ue.js → use-fast-preview-draft-url-Dh7O6LMl.js} +1 -1
- package/dist/client/assets/{use-file-configs-Da0V_POi.js → use-file-configs-BQC6XyYZ.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-qQBI_BkS.js → use-infinite-scroll-BFH6ALbG.js} +1 -1
- package/dist/client/assets/{use-join-requests-dO2c6Tc2.js → use-join-requests-CP2xJ3Ri.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-eu6gNvfS.js → use-main-panel-tabs-CIP4ocar.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DciS_iyB.js → use-mcp-auth-status-CYey3yvS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-jKOlHdKM.js → use-mcp-client-BBXqVg_9.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-KLIBV_YA.js → use-mcp-prompts-Cj-ktde6.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CWDoMes8.js → use-mcp-tools-kJXySVJI.js} +1 -1
- package/dist/client/assets/{use-members-DKFjOBdl.js → use-members-CiZWIC0d.js} +1 -1
- package/dist/client/assets/{use-mobile-CmswU9_U.js → use-mobile-DJpnvK3z.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DvsN-N9f.js → use-navigate-to-agent-Bl8cogEE.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BGaG_eVz.js → use-open-billing-url-XnMbaK0a.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DyhHIXwn.js → use-org-auth-client-CTNehkS3.js} +1 -1
- package/dist/client/assets/{use-org-fs-5rCZZYw5.js → use-org-fs-Dq13jVHU.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-jpa15G0h.js → use-org-repo-syncs-CvLH4wbE.js} +1 -1
- package/dist/client/assets/{use-org-sso-meIc9b7s.js → use-org-sso-ChQNO61D.js} +1 -1
- package/dist/client/assets/{use-organization-roles-1dxZeG9R.js → use-organization-roles-RGMgKsJZ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-NMl9AK6V.js → use-organization-settings-BPwGtPPE.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BhXVoQPa.js → use-panel-navigate-qwoVIGbd.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DgH1oa2Q.js → use-project-native-view-presence-DjwhxozD.js} +1 -1
- package/dist/client/assets/{use-project-scope-B3s9YTAH.js → use-project-scope-BJnBJfVB.js} +1 -1
- package/dist/client/assets/{use-recent-apps-B3eA701g.js → use-recent-apps-B9OM3iYn.js} +1 -1
- package/dist/client/assets/{use-releases-B_Ivj-ji.js → use-releases-DLIUGm3k.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Dq1Yd1Vr.js → use-reports-diagnostic-CYeJxpI-.js} +1 -1
- package/dist/client/assets/{use-secrets-Dg67dBxN.js → use-secrets-9ixMQP9c.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CYSL7sBu.js → use-section-preview-base-Cmtd6ng9.js} +1 -1
- package/dist/client/assets/{use-tags-DRpey5ac.js → use-tags-B0ggclX3.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CxHs3cah.js → use-task-board-analytics-B6E6Fkfq.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CWFDTGYW.js → use-task-board-events-CiIHX-ua.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-D8bcpDjg.js → use-task-board-item-prs-Cb0mLe68.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BbRfksII.js → use-task-board-items-Ic-4hEeS.js} +1 -1
- package/dist/client/assets/{use-task-metadata-4c8a_mNH.js → use-task-metadata-BjhVnC7Q.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-CMJl8EEf.js → use-thread-analytics-CHKh8wgx.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BOAz3j7m.js → use-thread-outputs-V5U3Y6kh.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BzJxgycA.js +1 -0
- package/dist/client/assets/{useQueries-BiefmIu_.js → useQueries-Cfhj2y2h.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-dyLsyxo4.js +1 -0
- package/dist/client/assets/{users-eo_ZMVx2.js → users-DSABHHiq.js} +1 -1
- package/dist/client/assets/{utils-DqXf9fJY.js → utils-DX56o_OV.js} +1 -1
- package/dist/client/assets/{variant-calendar-1onPlYHl.js → variant-calendar-CYqJUjai.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-OJYw4Y1_.js → variant-draft-pointer-lxnOTSSh.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-ImzlJONT.js → view-mode-toggle-DgWgfxpg.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BX0PkQ6l.js → virtual-mcp-QJZm8dxv.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CEcxThGW.js → watch-sse-pool-CYJqfo52.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +371 -371
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DiZwp2A0.js +0 -1
- package/dist/client/assets/agent-deck-jNu9-E3W.js +0 -1
- package/dist/client/assets/agent-library-DuL0qEtT.js +0 -1
- package/dist/client/assets/agent-library-file-Yb6uRPKq.js +0 -1
- package/dist/client/assets/agent-settings-DdQ64SOh.js +0 -1
- package/dist/client/assets/agent-site-editor-code-TvR4NVzG.js +0 -2
- package/dist/client/assets/agent-site-editor-content-D9MSMJlS.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-1BlZLcsH.js +0 -1
- package/dist/client/assets/agent-view-CaYqv_5j.js +0 -1
- package/dist/client/assets/api-keys-C6QAXUnz.js +0 -1
- package/dist/client/assets/cms-settings-editor-CQKCJYGK.js +0 -1
- package/dist/client/assets/flat-project-ZH6vKlez.js +0 -1
- package/dist/client/assets/library-C1JuHwwk.js +0 -1
- package/dist/client/assets/project-reports-DhGxN0x2.js +0 -1
- package/dist/client/assets/project-tasks-DppEghsL.js +0 -1
- package/dist/client/assets/record-editor-DQiQEm3J.js +0 -1
- package/dist/client/assets/reports-c39OWGSZ.js +0 -1
- package/dist/client/assets/route-C2SFyXDw.js +0 -1
- package/dist/client/assets/site-editor-CN-mBnl3.js +0 -1
- package/dist/client/assets/taskboard-analytics-i6H3Rv1v.js +0 -1
- package/dist/client/assets/tasks-ByuTOhSz.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DOKZzanu.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-gQb4-5BD.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{b0 as Fe,c as R,b as K,r as P,l as O,j as o,aX as it,aF as ie,bW as Ut,aG as ne,bV as ze,B as G,aE as Ss,aD as Cs,cZ as Ns,bU as Is,F as Ne,b9 as Ts,dY as Ce,dZ as mt,a9 as _s,e as Ms,I as Ds,t as Ue,y as se,a2 as Ie,d as at,ah as lt,v as Rs,aM as Es,s as Ps,q as Us,D as Ls,dT as Fs,a3 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,aT as Ys,aS as Ws,au as Gs,cY as Hs,d1 as je,aY as Js,d3 as Zs,aZ as bt,b2 as Xs,a as en,at as tn,av as sn,aL as st,af as Lt,b_ as nn,aR as on}from"./index-CTZFCFor.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-k4aXi0cR.js";import{s as Ot}from"./XClose-BnQLG2SG.js";import{I as dn}from"./icon-button-BS-JGKQE.js";import{F as un}from"./file-type-icon-DuTvDFZv.js";import{u as pn}from"./use-chat-navigation-B7jtkmO9.js";import{b as fn}from"./location-BjlyegC2.js";import{d as hn,K as mn,b as gn}from"./shell-layout-Dhz9Exq4.js";import{a as $t}from"./repository-binding-CbZ7gDPF.js";import{w as xn,A as vn}from"./autosend-BfqtXC9i.js";import{s as bn,r as At,i as An,c as yn,w as jn,H as kn}from"./chat-draft-D5xPO9J5.js";import{r as wn,d as Sn,f as Cn,h as Nn,t as In,z as Tn,o as _n,c as Mn}from"./thread-intent-b5vpifzT.js";import{u as We,b as Oe,c as Ge,d as He,j as Dn,m as Rn,n as En,o as Pn,q as Un,v as Ln,x as Fn,y as zn,f as On,s as $n,e as Bn}from"./chat-context-CShbCUNX.js";import{i as Bt}from"./LinkBroken01-DvM0DBf8.js";import{i as Kt}from"./ArrowUp-BYzq623p.js";import{n as qt}from"./ShoppingBag01-DmYaqF6W.js";import{t as Je,aJ as Qt,a4 as Yt,aK as nt,f as Vt,ax as Kn,B as qn,aL as Qn,q as Wt,aM as Gt,Z as Yn,aN as Wn}from"./agent-icon-CdvQWbsW.js";import{a as Ht}from"./Image01-8_YUB9dA.js";import{h as Gn}from"./UserSquare-J-pPBDsM.js";import{i as Hn}from"./Upload01-Dgeov9JH.js";import{i as Jn}from"./AlertCircle-Bty2uhsk.js";import{a as Zn}from"./Copy01-51uCRbSg.js";import{a as ot,b as ct,d as dt,f as ut,F as Jt}from"./form-C3-gqoE3.js";import{c as Xn,S as eo,b as to,a as so,d as no}from"./select-CMGxS2qh.js";import{t as Zt}from"./ChevronUp-D5DP9qHs.js";import{T as Ze,a as Xe,c as et}from"./tooltip-OCAaNJPG.js";import{i as oo}from"./ArrowLeft-CGwuLtbU.js";import{c as ro,b as io}from"./tabs-D7n9t3lM.js";import{e as $e,f as ao,c as lo,g as Vo}from"./use-decopilot-events-BGdkAbxA.js";import{u as co}from"./use-deco-credits-CbC5ZgVr.js";import{T as yt,a as uo}from"./toggle-group-DHp1u7am.js";import{a as po,d as fo,g as jt,s as ho}from"./tool-namespace-BEzs43Ur.js";import{t as mo}from"./utils-CVEq3hMx.js";import{u as go}from"./use-open-billing-url-BGaG_eVz.js";import{M as xo,a as vo,m as pt,g as bo,b as Ao}from"./index-DN6_-RzX.js";import{a as Xt,b as es,P as ts}from"./popover-DZg3XzK_.js";import{c as yo,b as jo,a as ko,D as wo}from"./drawer-CY01gtte.js";import{u as ss}from"./use-mobile-CmswU9_U.js";import{t as So}from"./Tool01-BxfOk1kQ.js";import{d as Co,a as No}from"./use-organization-settings-NMl9AK6V.js";import{u as ns,c as Io,d as To}from"./use-ai-providers-r5JMl3Dn.js";import{p as os,u as _o,T as Mo,a as Do,U as Ro}from"./input-CAuGdxaS.js";import{a as Eo}from"./use-mcp-client-jKOlHdKM.js";import{l as Po,g as Uo}from"./use-mcp-prompts-KLIBV_YA.js";import{i as Lo}from"./Link01-BrX96Lzm.js";import{s as kt}from"./Plus-Bk_sjqOf.js";import"./suggestion-D_2yEjf4.js";import{p as Fo,q as zo}from"./question-004-sINsf4GQ.js";import{A as Oo}from"./avatar-V-6seD4f.js";import{u as $o}from"./use-members-DKFjOBdl.js";import{F as wt}from"./feature-paywall-BVtlmh2X.js";import{A as Bo}from"./add-connection-dialog-DJYTiZdc.js";import{u as Ko}from"./use-task-board-events-CWFDTGYW.js";import{h as qo}from"./use-project-native-view-presence-DgH1oa2Q.js";const Qo=Fe("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 Yo=Fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const Wo=Fe("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=Fe("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=Fe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function Jo(t){const e=R.c(14),s=$t(t),n=We(),r=s?.metadata,i=n?.activeTask,a=i?.metadata?.runtime;let l;e[0]!==a?(l=Nn(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=wn(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=Sn(r),e[5]=r,e[6]=f):f=e[6];let h;e[7]!==r?(h=Cn(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}const tt="cubic-bezier(0.645, 0.045, 0.355, 1)",ll=44,Zo={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"},Xo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},er={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.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=K(),[h,m]=P.useState(d),[g,v]=P.useState(!1);let x;e[0]!==V?(x=()=>{v(!0),V?.()},e[0]=V,e[1]=x):x=e[1];const b=x;if(g)return null;const A=Xo[p],j=Zo[p];let y;e[2]!==A||e[3]!==j?(y=O("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,j),e[2]=A,e[3]=j,e[4]=y):y=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>m(tr),e[5]=k):k=e[5];const w=h&&"rounded-b-none",S=!h&&"rounded-b-xl";let N;e[6]!==w||e[7]!==S?(N=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",w,S),e[6]=w,e[7]=S,e[8]=N):N=e[8];const I=er[p];let C;e[9]!==I?(C=O("shrink-0",I),e[9]=I,e[10]=C):C=e[10];let M;e[11]!==s||e[12]!==C?(M=o.jsx("span",{className:C,children:s}),e[11]=s,e[12]=C,e[13]=M):M=e[13];let D;e[14]!==n?(D=o.jsx("span",{className:"flex-1 min-w-0 truncate",children:n}),e[14]=n,e[15]=D):D=e[15];let E;e[16]!==r?(E=r?o.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=E):E=e[17];const U=h?"rotate(180deg)":"rotate(0deg)";let T;e[18]!==U?(T=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 ${tt}`}})}),e[18]=U,e[19]=T):T=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 W,$;e[24]!==b?(W=ce=>{ce.stopPropagation(),b()},$=ce=>{(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),ce.stopPropagation(),b())},e[24]=b,e[25]=W,e[26]=$):(W=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=o.jsx(it,{size:16}),e[27]=z):z=e[27];let Q;e[28]!==L||e[29]!==F||e[30]!==W||e[31]!==$?(Q=o.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,title:F,onClick:W,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]=W,e[31]=$,e[32]=Q):Q=e[32];let ee;e[33]!==h||e[34]!==M||e[35]!==D||e[36]!==E||e[37]!==T||e[38]!==Q||e[39]!==N?(ee=o.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:k,className:N,children:[M,D,E,T,Q]}),e[33]=h,e[34]=M,e[35]=D,e[36]=E,e[37]=T,e[38]=Q,e[39]=N,e[40]=ee):ee=e[40];const te=h?"1fr":"0fr";let H;e[41]!==te?(H={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${tt}`},e[41]=te,e[42]=H):H=e[42];let oe;e[43]===Symbol.for("react.memo_cache_sentinel")?(oe={overflow:"hidden",minHeight:0},e[43]=oe):oe=e[43];const _=h?1:0;let B;e[44]!==_?(B={opacity:_,transition:`opacity 120ms ${tt}`,maxHeight:"60vh"},e[44]=_,e[45]=B):B=e[45];let J;e[46]!==i?(J=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]=J):J=e[47];let Z;e[48]!==c||e[49]!==i?(Z=c?o.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:c}):null,e[48]=c,e[49]=i,e[50]=Z):Z=e[50];let X;e[51]!==J||e[52]!==Z?(X=o.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[J,Z]}),e[51]=J,e[52]=Z,e[53]=X):X=e[53];let ue;e[54]!==a||e[55]!==l?(ue=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]=ue):ue=e[56];let Y;e[57]!==B||e[58]!==X||e[59]!==ue?(Y=o.jsx("div",{style:oe,children:o.jsxs("div",{className:"flex flex-col",style:B,children:[X,ue]})}),e[57]=B,e[58]=X,e[59]=ue,e[60]=Y):Y=e[60];let le;e[61]!==H||e[62]!==Y?(le=o.jsx("div",{"data-testid":"collapsible-highlight-body",style:H,children:Y}),e[61]=H,e[62]=Y,e[63]=le):le=e[63];let Ve;return e[64]!==ee||e[65]!==le||e[66]!==y||e[67]!==p?(Ve=o.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:y,children:[ee,le]}),e[64]=ee,e[65]=le,e[66]=y,e[67]=p,e[68]=Ve):Ve=e[68],Ve}function tr(t){return!t}const sr=ie({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:ze(["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=ie({todos:Ut(sr)}),nr="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.";In({description:nr,inputSchema:Tn(rs),execute:async({todos:t})=>({ok:!0,count:t.length})});const or="tool-todo_write",rr=new Set(["input-available","output-available"]);function ir(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!==or||typeof i.state!="string"||!rr.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 ar(t){return t?t.message.startsWith("[CREDITS]"):!1}const lr={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Vr(t){const{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&ar(s))return{...lr,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],c=l,u=!!c.filter(y=>y.type==="tool-user_ask").filter(y=>y.state!=="output-available").length,V=c.some(Ft),p=ls(l),f=is(c),h=ir(e),m=r?null:bn(s),g=r?null:_n(s),v=!r&&!!s&&!m&&!g,x=f.length>0||r&&i,b=p.length>0,j=!r&&!!n&&n!=="stop"&&!(n==="tool-calls"&&(u||x||b||V))&&!v;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:m,hasTodos:h.length>0,showError:v,showWarning:j,hasApprovals:x,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:V,todos:h}}function Vs(){const t=R.c(6),{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=Oe(),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=Vr({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 Vl(){const t=Vs(),e=$e("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",cr=`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-CuaaGonx.js","assets/index-D05mvej1.js","assets/index-s7bCSMKE.css","assets/usage-stats-DyepwXzI.js","assets/tool-namespace-BrVPsXeX.js","assets/form-Cpn1fS0w.js","assets/label-Byc0yEyf.js","assets/utils-CVEq3hMx.js","assets/markdown-CzotQpcK.js","assets/use-copy-CIKivmGg.js","assets/Copy01-DsiTYYU6.js","assets/ZoomOut-NpBIqZ1k.js","assets/location-BjlyegC2.js","assets/use-mobile-DJpnvK3z.js","assets/use-panel-navigate-qwoVIGbd.js","assets/thread-route-DHova7iz.js","assets/use-project-scope-BJnBJfVB.js","assets/repository-binding-EXwhhepG.js","assets/use-mcp-client-BBXqVg_9.js","assets/auth-CAugv3bc.js","assets/tooltip-bUQOQa7V.js","assets/index-DyNtXlZs.js","assets/agent-icon-RCyVT7wo.js","assets/AlertCircle-CEZZLz38.js","assets/Tool01-BpE6Ocu5.js","assets/ArrowUp-BoSjhzDf.js","assets/ArrowLeft-DYDkRAue.js","assets/LinkBroken01-C1K12OTL.js","assets/ShoppingBag01-Dne3aRqF.js","assets/Building02-gxUxeRsd.js","assets/CheckCircle-B20x4ndI.js","assets/ChevronUp-BvKleEa1.js","assets/ChevronSelectorVertical-9PUa7L-N.js","assets/UserSquare-CySOTy0y.js","assets/CreditCard01-kVpDY_m5.js","assets/DotsVertical-C9QJiHpJ.js","assets/Image01-DQWVAHE7.js","assets/Globe04-OCDS2DtM.js","assets/SwitchHorizontal01-BxVAqSEt.js","assets/Key01-X1DrP0l3.js","assets/Link01-ByHkgEJr.js","assets/Monitor01-DRY8tI7i.js","assets/Sun-CHpluZV5.js","assets/Play-DgswSwWx.js","assets/Plus-CBBIyP6s.js","assets/SearchMd-cZPkobS8.js","assets/Trash01-CWyW8AJH.js","assets/Upload01-Cx8wHc7w.js","assets/User01-COA-WNQV.js","assets/Users01-Czgnm_XI.js","assets/XClose-Qxrq0G_x.js","assets/format-time-CAj8AQXM.js","assets/differenceInSeconds-C3x8sHUj.js","assets/use-decopilot-events-BRhYtpoz.js","assets/thread-intent-oqwOpeN9.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CYJqfo52.js","assets/task-board-BVpRfyhG.js","assets/schema-BfUoakNz.js","assets/slugify-CEUa2lfQ.js","assets/chat-context-qaPvBrDR.js","assets/autosend-DSEyOhE7.js","assets/use-ai-providers-BWS-kzjG.js","assets/use-chat-navigation-BxUcSwDs.js","assets/use-organization-settings-BPwGtPPE.js","assets/icon-button-CFK3NQ6z.js","assets/file-type-icon-BEKg8VDa.js","assets/shell-layout-724i__Wv.js","assets/avatar-Vuppyn0R.js","assets/use-clock-tick-DBHdRcgc.js","assets/command-DtJnVLn9.js","assets/index-DkiNTs6p.js","assets/integration-icon-CHEBfkGE.js","assets/project-icon-CoMTGFyt.js","assets/new-project-dialog-DSNw0Myy.js","assets/repository-import-picker-BJHLuYxy.js","assets/use-navigate-to-agent-Bl8cogEE.js","assets/repository-picker-BVEKwcgd.js","assets/useInfiniteQuery-BzJxgycA.js","assets/infiniteQueryObserver-Dqqye4fA.js","assets/collection-search-DvXfIbCw.js","assets/use-debounced-value-CBaPWhkT.js","assets/required-auth-layout-DZ3djgK0.js","assets/use-org-sso-ChQNO61D.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-zaNEWXzo.js","assets/select-BcxRUsT5.js","assets/index-BdQq_4o_.js","assets/tabs-BhOBQud_.js","assets/use-deco-credits-CeMi8OEE.js","assets/toggle-group-Dq44TMds.js","assets/use-open-billing-url-XnMbaK0a.js","assets/index-DNnzAgp6.js","assets/checkbox-Cu7Sq496.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-BRP0dGOy.js","assets/drawer-CRbqujkT.js","assets/input-BvNGJpgE.js","assets/suggestion-wjyEiM3d.js","assets/use-mcp-prompts-Cj-ktde6.js","assets/use-org-fs-Dq13jVHU.js","assets/question-004-sINsf4GQ.js","assets/use-members-CiZWIC0d.js","assets/use-org-auth-client-CTNehkS3.js","assets/feature-paywall-DlBo4LL2.js","assets/plan-ladder-YN2QGUeX.js","assets/add-connection-dialog-BNedSJ6Y.js","assets/extract-connection-data-CC8UKBjD.js","assets/metadata-D72DunRR.js","assets/connection-BiAy_e5E.js","assets/url-slug-BxPt7IKX.js","assets/connection-card-BPU1-L2q.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-0AY2HDgW.js","assets/use-connection-BThCD02o.js","assets/schema-CeF-A6L_.js","assets/connection-form-helpers-BX34BrYY.js","assets/authenticate-and-persist-oauth-B4sOdDrI.js","assets/mcp-oauth-AbAsLX7c.js","assets/mcp-oauth-BvaFMPww.js","assets/collection-tabs-D3G56cwm.js","assets/badge-DCJU38ab.js","assets/use-infinite-scroll-BFH6ALbG.js","assets/useSuspenseInfiniteQuery-dyLsyxo4.js","assets/use-task-board-events-CiIHX-ua.js","assets/use-project-native-view-presence-DjwhxozD.js","assets/use-file-configs-BQC6XyYZ.js","assets/site-slug-DebpOoQq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{b0 as Fe,c as R,b as K,r as E,l as $,j as o,aX as it,aF as ie,bW as Ut,aG as ne,bV as ze,B as G,aE as Ss,aD as Cs,cZ as Ns,bU as Is,F as Ne,b9 as Ts,dY as Ce,dZ as mt,a9 as _s,e as Ms,I as Ds,t as Ue,y as se,a2 as Ie,d as at,ah as lt,v as Rs,aM as Es,s as Ps,q as Us,D as Ls,dT as Fs,a3 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,aT as Ys,aS as Ws,au as Gs,cY as Hs,d1 as je,aY as Js,d3 as Zs,aZ as bt,b2 as Xs,a as en,at as tn,av as sn,aL as st,af as Lt,b_ as nn,aR as on}from"./index-D05mvej1.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-DyepwXzI.js";import{s as Ot}from"./XClose-Qxrq0G_x.js";import{I as dn}from"./icon-button-CFK3NQ6z.js";import{F as un}from"./file-type-icon-BEKg8VDa.js";import{u as pn}from"./use-chat-navigation-BxUcSwDs.js";import{b as fn}from"./location-BjlyegC2.js";import{d as hn,K as mn,b as gn}from"./shell-layout-724i__Wv.js";import{a as $t}from"./repository-binding-EXwhhepG.js";import{w as xn,A as vn}from"./autosend-DSEyOhE7.js";import{s as bn,r as At,i as An,c as yn,w as jn,H as kn}from"./chat-draft-zaNEWXzo.js";import{r as wn,d as Sn,f as Cn,h as Nn,t as In,z as Tn,o as _n,c as Mn}from"./thread-intent-oqwOpeN9.js";import{u as We,b as Oe,c as Ge,d as He,j as Dn,m as Rn,n as En,o as Pn,q as Un,v as Ln,x as Fn,y as zn,f as On,s as $n,e as Bn}from"./chat-context-qaPvBrDR.js";import{i as Bt}from"./LinkBroken01-C1K12OTL.js";import{i as Kt}from"./ArrowUp-BoSjhzDf.js";import{n as qt}from"./ShoppingBag01-Dne3aRqF.js";import{t as Je,aJ as Qt,a4 as Yt,aK as nt,f as Vt,ax as Kn,B as qn,aL as Qn,q as Wt,aM as Gt,Z as Yn,aN as Wn}from"./agent-icon-RCyVT7wo.js";import{a as Ht}from"./Image01-DQWVAHE7.js";import{h as Gn}from"./UserSquare-CySOTy0y.js";import{i as Hn}from"./Upload01-Cx8wHc7w.js";import{i as Jn}from"./AlertCircle-CEZZLz38.js";import{a as Zn}from"./Copy01-DsiTYYU6.js";import{a as ot,b as ct,d as dt,f as ut,F as Jt}from"./form-Cpn1fS0w.js";import{c as Xn,S as eo,b as to,a as so,d as no}from"./select-BcxRUsT5.js";import{t as Zt}from"./ChevronUp-BvKleEa1.js";import{T as Ze,a as Xe,c as et}from"./tooltip-bUQOQa7V.js";import{i as oo}from"./ArrowLeft-DYDkRAue.js";import{c as ro,b as io}from"./tabs-BhOBQud_.js";import{e as $e,f as ao,c as lo,g as Vo}from"./use-decopilot-events-BRhYtpoz.js";import{u as co}from"./use-deco-credits-CeMi8OEE.js";import{T as yt,a as uo}from"./toggle-group-Dq44TMds.js";import{a as po,d as fo,g as jt,s as ho}from"./tool-namespace-BrVPsXeX.js";import{t as mo}from"./utils-CVEq3hMx.js";import{u as go}from"./use-open-billing-url-XnMbaK0a.js";import{M as xo,a as vo,m as pt,g as bo,b as Ao}from"./index-DNnzAgp6.js";import{a as Xt,b as es,P as ts}from"./popover-BRP0dGOy.js";import{c as yo,b as jo,a as ko,D as wo}from"./drawer-CRbqujkT.js";import{u as ss}from"./use-mobile-DJpnvK3z.js";import{t as So}from"./Tool01-BpE6Ocu5.js";import{d as Co,a as No}from"./use-organization-settings-BPwGtPPE.js";import{u as ns,c as Io,d as To}from"./use-ai-providers-BWS-kzjG.js";import{p as os,u as _o,T as Mo,a as Do,U as Ro}from"./input-BvNGJpgE.js";import{a as Eo}from"./use-mcp-client-BBXqVg_9.js";import{l as Po,g as Uo}from"./use-mcp-prompts-Cj-ktde6.js";import{i as Lo}from"./Link01-ByHkgEJr.js";import{s as kt}from"./Plus-CBBIyP6s.js";import"./suggestion-wjyEiM3d.js";import{p as Fo,q as zo}from"./question-004-sINsf4GQ.js";import{A as Oo}from"./avatar-Vuppyn0R.js";import{u as $o}from"./use-members-CiZWIC0d.js";import{F as wt}from"./feature-paywall-DlBo4LL2.js";import{A as Bo}from"./add-connection-dialog-BNedSJ6Y.js";import{u as Ko}from"./use-task-board-events-CiIHX-ua.js";import{h as qo}from"./use-project-native-view-presence-DjwhxozD.js";const Qo=Fe("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 Yo=Fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const Wo=Fe("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=Fe("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=Fe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function Jo(t){const e=R.c(14),s=$t(t),n=We(),r=s?.metadata,i=n?.activeTask,a=i?.metadata?.runtime;let l;e[0]!==a?(l=Nn(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=wn(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=Sn(r),e[5]=r,e[6]=f):f=e[6];let h;e[7]!==r?(h=Cn(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}const tt="cubic-bezier(0.645, 0.045, 0.355, 1)",ll=44,Zo={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"},Xo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},er={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.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=K(),[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 y=Xo[p],A=Zo[p];let j;e[2]!==y||e[3]!==A?(j=$("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",y,A),e[2]=y,e[3]=A,e[4]=j):j=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>m(tr),e[5]=k):k=e[5];const S=h&&"rounded-b-none",w=!h&&"rounded-b-xl";let N;e[6]!==S||e[7]!==w?(N=$("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",S,w),e[6]=S,e[7]=w,e[8]=N):N=e[8];const I=er[p];let C;e[9]!==I?(C=$("shrink-0",I),e[9]=I,e[10]=C):C=e[10];let M;e[11]!==s||e[12]!==C?(M=o.jsx("span",{className:C,children:s}),e[11]=s,e[12]=C,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 U;e[16]!==r?(U=r?o.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=U):U=e[17];const D=h?"rotate(180deg)":"rotate(0deg)";let T;e[18]!==D?(T=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:D,transition:`transform 180ms ${tt}`}})}),e[18]=D,e[19]=T):T=e[19];let F;e[20]!==f?(F=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=F):F=e[21];let z;e[22]!==f?(z=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=z):z=e[23];let Q,O;e[24]!==b?(Q=ce=>{ce.stopPropagation(),b()},O=ce=>{(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),ce.stopPropagation(),b())},e[24]=b,e[25]=Q,e[26]=O):(Q=e[25],O=e[26]);let L;e[27]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(it,{size:16}),e[27]=L):L=e[27];let Y;e[28]!==F||e[29]!==z||e[30]!==Q||e[31]!==O?(Y=o.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:z,onClick:Q,onKeyDown:O,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:L}),e[28]=F,e[29]=z,e[30]=Q,e[31]=O,e[32]=Y):Y=e[32];let ee;e[33]!==h||e[34]!==M||e[35]!==P||e[36]!==U||e[37]!==T||e[38]!==Y||e[39]!==N?(ee=o.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:k,className:N,children:[M,P,U,T,Y]}),e[33]=h,e[34]=M,e[35]=P,e[36]=U,e[37]=T,e[38]=Y,e[39]=N,e[40]=ee):ee=e[40];const te=h?"1fr":"0fr";let H;e[41]!==te?(H={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${tt}`},e[41]=te,e[42]=H):H=e[42];let oe;e[43]===Symbol.for("react.memo_cache_sentinel")?(oe={overflow:"hidden",minHeight:0},e[43]=oe):oe=e[43];const _=h?1:0;let B;e[44]!==_?(B={opacity:_,transition:`opacity 120ms ${tt}`,maxHeight:"60vh"},e[44]=_,e[45]=B):B=e[45];let J;e[46]!==i?(J=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]=J):J=e[47];let Z;e[48]!==c||e[49]!==i?(Z=c?o.jsx("div",{className:$("pb-4",!i&&"pt-4"),children:c}):null,e[48]=c,e[49]=i,e[50]=Z):Z=e[50];let X;e[51]!==J||e[52]!==Z?(X=o.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[J,Z]}),e[51]=J,e[52]=Z,e[53]=X):X=e[53];let ue;e[54]!==a||e[55]!==l?(ue=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]=ue):ue=e[56];let W;e[57]!==B||e[58]!==X||e[59]!==ue?(W=o.jsx("div",{style:oe,children:o.jsxs("div",{className:"flex flex-col",style:B,children:[X,ue]})}),e[57]=B,e[58]=X,e[59]=ue,e[60]=W):W=e[60];let le;e[61]!==H||e[62]!==W?(le=o.jsx("div",{"data-testid":"collapsible-highlight-body",style:H,children:W}),e[61]=H,e[62]=W,e[63]=le):le=e[63];let Ve;return e[64]!==ee||e[65]!==le||e[66]!==j||e[67]!==p?(Ve=o.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:j,children:[ee,le]}),e[64]=ee,e[65]=le,e[66]=j,e[67]=p,e[68]=Ve):Ve=e[68],Ve}function tr(t){return!t}const sr=ie({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:ze(["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=ie({todos:Ut(sr)}),nr="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.";In({description:nr,inputSchema:Tn(rs),execute:async({todos:t})=>({ok:!0,count:t.length})});const or="tool-todo_write",rr=new Set(["input-available","output-available"]);function ir(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!==or||typeof i.state!="string"||!rr.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 ar(t){return t?t.message.startsWith("[CREDITS]"):!1}const lr={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Vr(t){const{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&ar(s))return{...lr,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],c=l,u=!!c.filter(j=>j.type==="tool-user_ask").filter(j=>j.state!=="output-available").length,V=c.some(Ft),p=ls(l),f=is(c),h=ir(e),m=r?null:bn(s),g=r?null:_n(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=R.c(6),{messages:e,error:s,finishReason:n,isStreaming:r,isWaitingForApprovals:i}=Oe(),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=Vr({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 Vl(){const t=Vs(),e=$e("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",cr=`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 dr(t){return{...t,content:[{type:"paragraph",content:[rn({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:cr}}]})]},...t.content??[]]}}function ur(){const t=R.c(24),e=K(),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 pr(t){const e=R.c(30),{current:s,total:n,onPrev:r,onNext:i}=t,a=K();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,v=s===n-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let x;e[16]!==v?(x=O("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=x):x=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(Bt,{size:14}),e[20]=A):A=e[20];let j;e[21]!==i||e[22]!==g||e[23]!==x||e[24]!==b?(j=o.jsx("button",{type:"button",onClick:i,disabled:g,className:x,"aria-label":b,children:A}),e[21]=i,e[22]=g,e[23]=x,e[24]=b,e[25]=j):j=e[25];let y;return e[26]!==j||e[27]!==p||e[28]!==m?(y=o.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,m,j]}),e[26]=j,e[27]=p,e[28]=m,e[29]=y):y=e[29],y}function cs(t){const e=R.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=R.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(G,{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 v=g;if(!p)return v;let x;e[10]!==v?(x=o.jsx(Ze,{asChild:!0,children:v}),e[10]=v,e[11]=x):x=e[11];let b;e[12]!==p?(b=o.jsx(Xe,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;return e[14]!==x||e[15]!==b?(A=o.jsxs(et,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16],A}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]=P.useState(c),[V,p]=P.useState(!1),f=Ss({resolver:Cs(n),defaultValues:r}),h=f.watch(),m=ds(e,s,d),g=m>=0?e[m]:void 0,v=a(h[d]),x=Ct(e,s,h,a),b=hr({isStreaming:i,allAnswered:x}),A=()=>{if(m>0){const I=e[m-1];I&&u(s(I))}},j=()=>{if(m>=0&&m<e.length-1){const I=e[m+1];I&&u(s(I))}},y=()=>{const I=f.getValues(),C=Nt(e,s,I,a,d);C&&u(C)},k=()=>{f.handleSubmit(I=>{const C=I;for(const M of e)l(M,C[s(M)])})()},w=P.useRef(k);w.current=k;const S=()=>{b&&(p(!1),w.current())},N=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),w.current()}else{const C=Nt(e,s,I,a,d);C&&u(C)}};return P.useEffect(()=>{if(V&&!i){if(!x){p(!1);return}p(!1),w.current()}},[V,i,x]),{form:f,activeKey:d,setActiveKey:u,currentIndex:m,currentPart:g,isCurrentAnswered:v,isAllAnswered:x,canSubmit:b,goPrev:A,goNext:j,advanceToNextUnanswered:y,submit:S,submitOrAdvance:N}}const ps="chat.approval.defaultDenyReason";function fs(t){const e=R.c(36),{onYolo:s}=t,n=K(),[r,i]=Ne();let a,l,c,d,u,V,p,f,h;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const A=Ce.find(k=>k.value===r.toolApprovalLevel)??Ce[0];let j;e[13]!==s||e[14]!==r||e[15]!==i?(j=k=>{const w=k,S=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:w}),w==="auto"&&s(S)},e[13]=s,e[14]=r,e[15]=i,e[16]=j):j=e[16];const y=j;c=eo,f=r.toolApprovalLevel,h=y,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(A.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 v;e[26]!==n?(v=Ce.map(A=>o.jsx(Xn,{value:A.value,children:n(A.labelKey)},A.value)),e[26]=n,e[27]=v):v=e[27];let x;e[28]!==v?(x=o.jsx(no,{children:v}),e[28]=v,e[29]=x):x=e[29];let b;return e[30]!==c||e[31]!==x||e[32]!==f||e[33]!==h||e[34]!==g?(b=o.jsxs(c,{value:f,onValueChange:h,children:[g,x]}),e[30]=c,e[31]=x,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=R.c(8),{input:s}=t,n=K();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=R.c(38),{approval:s,onRespond:n}=t,r=K(),[i]=Ne(),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=S=>n(s.approvalId,!0,void 0,S),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(G,{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 v;e[19]!==r?(v=r("chat.approval.acceptButton"),e[19]=r,e[20]=v):v=e[20];let x;e[21]!==u||e[22]!==v?(x=o.jsx(G,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:v}),e[21]=u,e[22]=v,e[23]=x):x=e[23];let b;e[24]!==g||e[25]!==x?(b=o.jsxs(o.Fragment,{children:[g,x]}),e[24]=g,e[25]=x,e[26]=b):b=e[26];const A=b;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Je,{size:14}),e[27]=j):j=e[27];let y;e[28]!==r?(y=r("chat.approval.needsApproval"),e[28]=r,e[29]=y):y=e[29];let k;e[30]!==s.input?(k=o.jsx(hs,{input:s.input}),e[30]=s.input,e[31]=k):k=e[31];let w;return e[32]!==s.friendlyName||e[33]!==h||e[34]!==A||e[35]!==y||e[36]!==k?(w=o.jsx(pe,{icon:j,label:y,title:s.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:A,children:k}),e[32]=s.friendlyName,e[33]=h,e[34]=A,e[35]=y,e[36]=k,e[37]=w):w=e[37],w}const xr=Ns(ne(),ie({approved:Is().optional(),levelOverride:ze(["auto","readonly"]).optional()}));function vr(t){const e=R.c(46),{approvals:s,isStreaming:n,onRespond:r}=t,i=K(),[a]=Ne(),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=(C,M)=>{const D=M;typeof D?.approved=="boolean"&&r(C.approvalId,D.approved,D.approved===!1?i(ps):void 0,D.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=C=>{p.form.reset(Object.fromEntries(s.map(M=>[M.approvalId,{approved:!0,levelOverride:C}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const h=f,m=p.currentPart,g=p.form;let v;e[14]!==p?(v=C=>{C.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Je,{size:14}),e[16]=x):x=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 A=m?.friendlyName??"";let j;e[20]!==h?(j=o.jsx(fs,{onYolo:h}),e[20]=h,e[21]=j):j=e[21];let y;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==j?(y=o.jsx(cs,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:j}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=j,e[27]=y):y=e[27];let k;e[28]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(k=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]=k):k=e[31];let w;e[32]!==m?(w=m?o.jsx(hs,{input:m.input}):null,e[32]=m,e[33]=w):w=e[33];let S;e[34]!==y||e[35]!==k||e[36]!==w||e[37]!==b||e[38]!==A?(S=o.jsx(pe,{icon:x,label:b,title:A,defaultExpanded:!0,footerLeft:y,footerRight:k,children:w}),e[34]=y,e[35]=k,e[36]=w,e[37]=b,e[38]=A,e[39]=S):S=e[39];let N;e[40]!==S||e[41]!==v?(N=o.jsx("form",{onSubmit:v,children:S}),e[40]=S,e[41]=v,e[42]=N):N=e[42];let I;return e[43]!==p.form||e[44]!==N?(I=o.jsx(ot,{...g,children:N}),e[43]=p.form,e[44]=N,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=R.c(7),{approvalId:s,control:n,onChange:r}=t,i=K(),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(G,{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(G,{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=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Je,{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=R.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=R.c(28),{plan:s,onApprove:n,onDismiss:r}=t,i=K();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(G,{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(G,{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 v;e[21]!==s.plan?(v=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]=v):v=e[22];let x;return e[23]!==f||e[24]!==v||e[25]!==m||e[26]!==g?(x=o.jsx(pe,{icon:h,label:m,title:g,defaultExpanded:!0,footerRight:f,children:v}),e[23]=f,e[24]=v,e[25]=m,e[26]=g,e[27]=x):x=e[27],x}function Cr(t){const e=R.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=ie({response:ne().min(1,"Response is required")}),Nr=ie({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ir=ie({response:ze(["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 ie(e)}function Mr(t){const e=R.c(7),{control:s,name:n,placeholder:r}=t,i=K();let a;e[0]!==r||e[1]!==i?(a=c=>{const{field:d}=c,u=d.value??"";return o.jsxs(ct,{children:[o.jsx(dt,{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(Yt,{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(ut,{})]})},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=R.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]),P.useEffect(n,r)}function Dr(t){const e=R.c(51),{control:s,name:n,options:r}=t,i=K(),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 T=r[U];T!=null&&c.onChange(T)},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 v;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=(T,L)=>{const F=p===T;return o.jsxs("button",{type:"button",onClick:()=>c.onChange(T),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:T}),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:T})]},`${L}-${T}`)},e[16]=c,e[17]=p,e[18]=i,e[19]=U):U=e[19],v=r.map(U),e[11]=c,e[12]=p,e[13]=r,e[14]=i,e[15]=v}else v=e[15];const x=m&&"bg-accent/50",b=!m&&"hover:bg-accent/30";let A;e[20]!==x||e[21]!==b?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",x,b),e[20]=x,e[21]=b,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:o.jsx(Yt,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const y=m?f:"";let k;e[24]!==V||e[25]!==c||e[26]!==p?(k=U=>{V.onChange(U.target.value),p!==null&&c.onChange(null)},e[24]=V,e[25]=c,e[26]=p,e[27]=k):k=e[27];let w;e[28]!==c||e[29]!==p?(w=()=>{p!==null&&c.onChange(null)},e[28]=c,e[29]=p,e[30]=w):w=e[30];let S;e[31]!==i?(S=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=S):S=e[32];let N;e[33]!==i?(N=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=N):N=e[34];let I;e[35]!==y||e[36]!==k||e[37]!==w||e[38]!==S||e[39]!==N?(I=o.jsx("input",{type:"text",value:y,onChange:k,onFocus:w,placeholder:S,"aria-label":N,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=y,e[36]=k,e[37]=w,e[38]=S,e[39]=N,e[40]=I):I=e[40];let C;e[41]!==A||e[42]!==I?(C=o.jsxs("label",{className:A,children:[j,I]}),e[41]=A,e[42]=I,e[43]=C):C=e[43];let M;e[44]!==C||e[45]!==g||e[46]!==v?(M=o.jsx(dt,{children:o.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[v,C]})}),e[44]=C,e[45]=g,e[46]=v,e[47]=M):M=e[47];let D;e[48]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(ut,{}),e[48]=D):D=e[48];let E;return e[49]!==M?(E=o.jsxs(ct,{children:[M,D]}),e[49]=M,e[50]=E):E=e[50],E}function Rr(t){const e=R.c(8),{control:s,name:n}=t,r=K();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.useRef(null);let 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(ct,{children:[o.jsx(dt,{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(ut,{})]})},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=R.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 Er(t){const e=R.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 Q=ms(z);Q&&r($,Q)},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:Pr,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=K();let h;e[12]!==p||e[13]!==V||e[14]!==f?(h=()=>{const $=p;if(!$)return;const z=f("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(V.form.setValue(`${Q}.option`,null),V.form.setValue(`${Q}.draft`,z)):V.form.setValue(`${Q}.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 v=g;let x;e[21]!==f?(x=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=x):x=e[22];let b;e[23]!==m||e[24]!==x?(b=o.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:x}),e[23]=m,e[24]=x,e[25]=b):b=e[25];let A;e[26]!==V.isAllAnswered||e[27]!==V.isCurrentAnswered||e[28]!==V.submitOrAdvance||e[29]!==n?(A=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]=A):A=e[30];let j;e[31]!==b||e[32]!==A?(j=o.jsxs(o.Fragment,{children:[b,A]}),e[31]=b,e[32]=A,e[33]=j):j=e[33];const y=j;if(s.length===1){const $=s[0];if(!$?.input)return null;const z=V.form;let Q;e[34]!==V?(Q=X=>{X.preventDefault(),V.submit()},e[34]=V,e[35]=Q):Q=e[35];let ee;e[36]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(nt,{size:14}),e[36]=ee):ee=e[36];let te;e[37]!==f?(te=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=te):te=e[38];let H;e[39]!==$.input?.prompt||e[40]!==f?(H=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=H):H=e[41];const oe=$.input;let _;e[42]!==V.form.control||e[43]!==$.toolCallId||e[44]!==oe?(_=o.jsx(Tt,{input:oe,control:V.form.control,toolCallId:$.toolCallId}),e[42]=V.form.control,e[43]=$.toolCallId,e[44]=oe,e[45]=_):_=e[45];let B;e[46]!==y||e[47]!==te||e[48]!==H||e[49]!==_?(B=o.jsx(pe,{icon:ee,label:te,title:H,defaultExpanded:!0,footerRight:y,children:_}),e[46]=y,e[47]=te,e[48]=H,e[49]=_,e[50]=B):B=e[50];let J;e[51]!==Q||e[52]!==B?(J=o.jsx("form",{onSubmit:Q,autoComplete:"off",children:B}),e[51]=Q,e[52]=B,e[53]=J):J=e[53];let Z;return e[54]!==V.form||e[55]!==J?(Z=o.jsx(ot,{...z,children:J}),e[54]=V.form,e[55]=J,e[56]=Z):Z=e[56],Z}const k=V.form;let w;e[57]!==V?(w=$=>{$.preventDefault(),V.submit()},e[57]=V,e[58]=w):w=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(nt,{size:14}),e[59]=S):S=e[59];let N;e[60]!==f?(N=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=N):N=e[61];const I=V.currentIndex+1;let C;e[62]!==s.length||e[63]!==f||e[64]!==I?(C=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=C):C=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 D=V.activeKey,E=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 T;e[74]!==V.activeKey||e[75]!==V.setActiveKey||e[76]!==U?(T=o.jsx(io,{value:D,onValueChange:E,children:U}),e[74]=V.activeKey,e[75]=V.setActiveKey,e[76]=U,e[77]=T):T=e[77];let L;e[78]!==v||e[79]!==y||e[80]!==N||e[81]!==C||e[82]!==M||e[83]!==T?(L=o.jsx(pe,{icon:S,label:N,count:C,title:M,defaultExpanded:!0,footerLeft:v,footerRight:y,children:T}),e[78]=v,e[79]=y,e[80]=N,e[81]=C,e[82]=M,e[83]=T,e[84]=L):L=e[84];let F;e[85]!==w||e[86]!==L?(F=o.jsx("form",{onSubmit:w,autoComplete:"off",children:L}),e[85]=w,e[86]=L,e[87]=F):F=e[87];let W;return e[88]!==V.form||e[89]!==F?(W=o.jsx(ot,{...k,children:F}),e[88]=V.form,e[89]=F,e[90]=W):W=e[90],W}function Pr(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=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(nt,{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=R.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(Er,{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=R.c(33),{parts:s,isStreaming:n,onRespond:r}=t,i=K();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(G,{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 v;e[19]!==n||e[20]!==m||e[21]!==g?(v=o.jsx(G,{type:"button",size:"sm",className:"h-7",disabled:n,onClick:m,children:g}),e[19]=n,e[20]=m,e[21]=g,e[22]=v):v=e[22];let x;e[23]!==v||e[24]!==h?(x=o.jsxs(o.Fragment,{children:[h,v]}),e[23]=v,e[24]=h,e[25]=x):x=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 A;return e[28]!==c.title||e[29]!==x||e[30]!==b||e[31]!==u?(A=o.jsx(pe,{icon:d,label:u,title:V,defaultExpanded:!0,footerRight:x,children:b}),e[28]=c.title,e[29]=x,e[30]=b,e[31]=u,e[32]=A):A=e[32],A}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=R.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(Wr,{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(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function qr(t,e){return o.jsx(Qr,{todo:t},e)}function Qr(t){const e=R.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(Yr,{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 Yr(t){const e=R.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 Wr(t){const e=R.c(13),{status:s}=t,n=K();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=R.c(46),{source:s,onDone:n}=t,r=K(),i=_s(),[a]=Ne(),[l,c]=P.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=P.useState(""),[V,p]=P.useState(!1),f=l==="brl"?"R$":"$";let h;e[0]!==l||e[1]!==i?(h=async T=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:T,currency:l});return L},e[0]=l,e[1]=i,e[2]=h):h=e[2];let m;e[3]!==n?(m=T=>{T&&window.open(T,"_blank","noopener,noreferrer"),n?.()},e[3]=n,e[4]=m):m=e[4];let g;e[5]!==r?(g=T=>{Ue.error(r("credits.topUp.failed",{message:T.message}))},e[5]=r,e[6]=g):g=e[6];let v;e[7]!==h||e[8]!==m||e[9]!==g?(v={mutationFn:h,onSuccess:m,onError:g},e[7]=h,e[8]=m,e[9]=g,e[10]=v):v=e[10];const{mutate:x,isPending:b}=Ms(v);let A;e[11]!==l||e[12]!==s||e[13]!==x?(A=(T,L)=>{se("credits_topup_clicked",{amount_cents:T,currency:l,tier_label:L,source:s}),x(T)},e[11]=l,e[12]=s,e[13]=x,e[14]=A):A=e[14];const j=A,y=parseFloat(d),k=!isNaN(y)&&y>=1;let w,S,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=T=>{T&&c(T)},S=o.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=o.jsx(yt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=w,e[16]=S,e[17]=N):(w=e[15],S=e[16],N=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:w,children:[S,N]})}),e[18]=l,e[19]=I):I=e[19];const C=Gr[l];let M;if(e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==C){let T;e[26]!==j||e[27]!==f||e[28]!==b||e[29]!==r?(T=L=>{const{dollars:F,labelKey:W}=L;return o.jsxs("button",{type:"button",disabled:b,onClick:()=>j(F*100,Hr[W]??"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(W)})]},F)},e[26]=j,e[27]=f,e[28]=b,e[29]=r,e[30]=T):T=e[30],M=C.map(T),e[20]=j,e[21]=f,e[22]=b,e[23]=r,e[24]=C,e[25]=M}else M=e[25];let D;e[31]!==M?(D=o.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:M}),e[31]=M,e[32]=D):D=e[32];let E;e[33]!==j||e[34]!==f||e[35]!==d||e[36]!==y||e[37]!==k||e[38]!==b||e[39]!==V||e[40]!==r?(E=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:T=>u(T.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),o.jsx(G,{className:"h-10",disabled:!k||b,onClick:()=>j(Math.round(y*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]=j,e[34]=f,e[35]=d,e[36]=y,e[37]=k,e[38]=b,e[39]=V,e[40]=r,e[41]=E):E=e[41];let U;return e[42]!==D||e[43]!==E||e[44]!==I?(U=o.jsxs("div",{children:[I,D,E]}),e[42]=D,e[43]=E,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=R.c(47),{onDismiss:s}=t,{org:n}=Ie(),r=at(),{decoKeyId:i}=co(),a=K(),l=$e("credits");let c,d;if(e[0]!==n.id?(c=()=>{se("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]),P.useEffect(c,d),!l)return null;let u;e[3]!==s?(u=C=>!C&&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 v;e[14]!==g?(v=o.jsx(Es,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=v):v=e[15];let x;e[16]!==v||e[17]!==m?(x=o.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,o.jsxs(Ps,{className:"relative gap-4",children:[f,o.jsxs("div",{children:[m,v]})]})]}),e[16]=v,e[17]=m,e[18]=x):x=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(C=>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(lt,{size:12,className:"text-success"})}),o.jsx("span",{className:"text-sm text-foreground/80",children:a(C)})]},C))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let A;e[23]!==a?(A=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=A):A=e[24];let j;e[25]!==s||e[26]!==A?(j=o.jsx(G,{variant:"ghost",size:"sm",onClick:s,children:A}),e[25]=s,e[26]=A,e[27]=j):j=e[27];let y;e[28]!==r||e[29]!==s||e[30]!==n.slug?(y=()=>{r({to:"/$org/settings/ai-providers",params:{org:n.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=n.slug,e[31]=y):y=e[31];let k;e[32]!==a?(k=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=o.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:y,children:k}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let S;e[37]!==j||e[38]!==w?(S=o.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,w]}),e[37]=j,e[38]=w,e[39]=S):S=e[39];let N;e[40]!==x||e[41]!==b||e[42]!==S?(N=o.jsxs(Us,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ei,children:[x,b,S]}),e[40]=x,e[41]=b,e[42]=S,e[43]=N):N=e[43];let I;return e[44]!==N||e[45]!==u?(I=o.jsx(Ls,{open:!0,onOpenChange:u,children:N}),e[44]=N,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=R.c(16),{kind:s,onDismiss:n,onSubscribe:r}=t,i=K(),{label:a,title:l}=ti[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Vt,{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(G,{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(pe,{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=R.c(21),{kind:s,onDismiss:n}=t,r=K(),i=at(),{org:a}=Ie(),{label:l,title:c}=ni[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Vt,{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(G,{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(pe,{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 Ye(t){const e=R.c(29),s=K(),{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 x=ri[t.finishReason];return x?s(x):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(G,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):o.jsx(G,{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(()=>Ue.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ue.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 v;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==h||e[25]!==m||e[26]!==g||e[27]!==n?(v=o.jsx(pe,{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]=v):v=e[28],v}function Be(t){const e=R.c(78);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=K(),{error:c,clearError:d,finishReason:u,clearFinishReason:V,messages:p,isStreaming:f,submit:h,sendMessage:m}=Oe(),[g,v]=Ne(),{virtualMcpId:x,createTaskWithMessage:b}=Ge(),{chatMode:A,setChatMode:j,simpleModeTier:y}=He(),k=$e("credits"),{mutate:w}=go("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let S;e[2]!==w?(S=()=>w(),e[2]=w,e[3]=S):S=e[3];const N=S;let I;e[4]!==A||e[5]!==y||e[6]!==x||e[7]!==a?(I=re=>({...a?{voiceMode:!0}:{},tier:y,mode:A,toolApprovalLevel:re,agent:x?{id:x}:void 0}),e[4]=A,e[5]=y,e[6]=x,e[7]=a,e[8]=I):I=e[8];const C=I;let M;e[9]!==g.toolApprovalLevel?(M=g.toolApprovalLevel??Fs(),e[9]=g.toolApprovalLevel,e[10]=M):M=e[10];const D=M,E=p.at(-1),U=E?.role==="assistant"?E.parts:[],T=U.filter(Vi),L=U.filter(Ft),F=ls(U),W=is(U);let $;e[11]!==c||e[12]!==m||e[13]!==l?($=()=>{if(c){const ae={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:c.message})}]}]};m(ae)}},e[11]=c,e[12]=m,e[13]=l,e[14]=$):$=e[14];const z=$;let Q;e[15]!==m||e[16]!==l?(Q=()=>{const re={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(re)},e[15]=m,e[16]=l,e[17]=Q):Q=e[17];const ee=Q;let te;e[18]!==C||e[19]!==D||e[20]!==h?(te=(re,ae)=>{h({kind:"toolOutput",toolCallId:re.toolCallId,output:{response:ae}},C(D))},e[18]=C,e[19]=D,e[20]=h,e[21]=te):te=e[21];const H=te;let oe;e[22]!==C||e[23]!==D||e[24]!==h?(oe=(re,ae)=>{h({kind:"toolOutput",toolCallId:re.toolCallId,output:{accepted:ae}},C(D))},e[22]=C,e[23]=D,e[24]=h,e[25]=oe):oe=e[25];const _=oe;let B;e[26]!==b||e[27]!==g||e[28]!==j||e[29]!==v||e[30]!==l||e[31]!==x?(B=re=>{j("default"),v({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:x,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:re})}]}})},e[26]=b,e[27]=g,e[28]=j,e[29]=v,e[30]=l,e[31]=x,e[32]=B):B=e[32];const J=B,Z=li;let X;e[33]!==C||e[34]!==h?(X=(re,ae,Me,Ae)=>{h({kind:"approval",approvalId:re,approved:ae,...Me?{reason:Me}:{}},C(Ae))},e[33]=C,e[34]=h,e[35]=X):X=e[35];const ue=X,Y=Vs();if(Y.isCreditExhausted){let re;return e[36]!==k||e[37]!==d||e[38]!==i?(re=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[36]=k,e[37]=d,e[38]=i,e[39]=re):re=e[39],re}const{showError:le,showWarning:Ve,hasApprovals:ce}=Y,ke=T.map(ai).join("|"),Ke=as(F)?.toolCallId??"",me=W.map(ii).join("|"),Te=!i&&"absolute bottom-full left-0 right-0";let ge;e[40]!==Te?(ge=O(Te),e[40]=Te,e[41]=ge):ge=e[41];let de;e[42]!==Y.todos?(de=o.jsx(Kr,{todos:Y.todos}),e[42]=Y.todos,e[43]=de):de=e[43];let xe;e[44]!==d||e[45]!==Y.subscriptionErrorKind||e[46]!==N?(xe=Y.subscriptionErrorKind&&o.jsx(si,{kind:Y.subscriptionErrorKind,onDismiss:d,onSubscribe:N}),e[44]=d,e[45]=Y.subscriptionErrorKind,e[46]=N,e[47]=xe):xe=e[47];let we;e[48]!==d||e[49]!==Y.planRefusal?(we=Y.planRefusal&&o.jsx(_t,{kind:Y.planRefusal,onDismiss:d}),e[48]=d,e[49]=Y.planRefusal,e[50]=we):we=e[50];let fe;e[51]!==d||e[52]!==c||e[53]!==z||e[54]!==le?(fe=le&&o.jsx(Ye,{variant:"error",error:c,onDismiss:d,onFixInChat:z}),e[51]=d,e[52]=c,e[53]=z,e[54]=le,e[55]=fe):fe=e[55];let ve;e[56]!==V||e[57]!==u||e[58]!==ee||e[59]!==Ve?(ve=Ve&&o.jsx(Ye,{variant:"warning",finishReason:u,onDismiss:V,onContinue:ee}),e[56]=V,e[57]=u,e[58]=ee,e[59]=Ve,e[60]=ve):ve=e[60];const De=ce&&o.jsx(wr,{approvals:W,isStreaming:f,onRespond:ue},me),Re=Y.hasPlans&&o.jsx(Cr,{plans:F,isStreaming:f,onApprove:J,onDismiss:Z},Ke),_e=Y.hasTaskSuggestion&&o.jsx($r,{parts:L,isStreaming:f,onRespond:_},L.at(-1)?.toolCallId??"");let be;e[61]!==Y.isWaitingForUserInput||e[62]!==H||e[63]!==f||e[64]!==ke||e[65]!==T?(be=Y.isWaitingForUserInput&&o.jsx(xs,{userAskParts:T,isStreaming:f,onSubmit:H},ke),e[61]=Y.isWaitingForUserInput,e[62]=H,e[63]=f,e[64]=ke,e[65]=T,e[66]=be):be=e[66];let Se;return e[67]!==ge||e[68]!==de||e[69]!==xe||e[70]!==we||e[71]!==fe||e[72]!==ve||e[73]!==De||e[74]!==Re||e[75]!==_e||e[76]!==be?(Se=o.jsxs("div",{className:ge,children:[de,xe,we,fe,ve,De,Re,_e,be]}),e[67]=ge,e[68]=de,e[69]=xe,e[70]=we,e[71]=fe,e[72]=ve,e[73]=De,e[74]=Re,e[75]=_e,e[76]=be,e[77]=Se):Se=e[77],Se}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"}Be.Error=function(e){return o.jsx(Ye,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Be.Warning=function(e){return o.jsx(Ye,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Be.UserAskQuestion=xs;function bs(t){const e=R.c(20),{taskId:s}=t,n=K(),r=Dn(s),i=Rn(r),a=En(),{stop:l,removeLocalMessage:c}=Oe();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(Ze,{asChild:!0,children:o.jsx(G,{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(Xe,{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(et,{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=(v,x)=>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:x+1}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.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(G,{type:"button",variant:"ghost",size:"icon-sm",title:n("chat.queueTray.removeFromQueue"),"aria-label":n("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,v.messageId).then(b=>{b&&(Pn(s,v.messageId),c(v.messageId))})},children:o.jsx(Ot,{className:"size-3.5"})})})]},v.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)]})}function ci(t){return["openai-compatible","openrouter","deco"].includes(t)}function di(t,e){return ci(t)&&ui(e)!==null}function ui(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const pi={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function fi(t,e){return pi[t]?.test(e)??!1}function hi(t){return Io(t)&&fi(t.providerId,t.modelId)}function mi(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 gi={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function xi(t){const e=R.c(32),{tier:s,orgSlot:n,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:c,onClose:d}=t,u=K(),V=ns(),p=new Set(V.map(vi)),f=Un([r,n,i],p),h=f?.keyId??null,[m,g]=P.useState(h??V[0]?.id??null),v=V.some(F=>F.id===m)?m:h??V[0]?.id??null,x=v?V.find(F=>F.id===v):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",A=gi[s];let j;e[0]!==u||e[1]!==A?(j=u(A),e[0]=u,e[1]=A,e[2]=j):j=e[2];let y;e[3]!==j?(y=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:j}),e[3]=j,e[4]=y):y=e[4];let k;e[5]!==c||e[6]!==u||e[7]!==r?(k=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]=k):k=e[8];let w;e[9]!==y||e[10]!==k?(w=o.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[y,k]}),e[9]=y,e[10]=k,e[11]=w):w=e[11];const S="flex-1 min-h-0",N=P.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(vo,{}),e[12]=I):I=e[12];const C=xo,M=!0,D=mi(h?f:null,x?.providerId??"deco");let E;e[13]!==v||e[14]!==l||e[15]!==g?(E=F=>{const W=F.keyId??v??"";g(W),l({keyId:W,modelId:F.modelId,title:F.title})},e[13]=v,e[14]=l,e[15]=g,e[16]=E):E=e[16];let U;e[17]!==C||e[18]!==v||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==D||e[23]!==E?(U=o.jsx(C,{compact:M,filterModels:a,onClose:d,credentialId:v,onCredentialChange:g,selectedModel:D,onModelChange:E}),e[17]=C,e[18]=v,e[19]=a,e[20]=d,e[21]=g,e[22]=D,e[23]=E,e[24]=U):U=e[24];let T;e[25]!==N||e[26]!==U||e[27]!==I?(T=o.jsx("div",{className:S,children:o.jsx(N,{fallback:I,children:U})}),e[25]=N,e[26]=U,e[27]=I,e[28]=T):T=e[28];let L;return e[29]!==T||e[30]!==w?(L=o.jsxs("div",{className:b,children:[w,T]}),e[29]=T,e[30]=w,e[31]=L):L=e[31],L}function vi(t){return t.id}const bi=["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 Ai(t){const e=R.c(28),{tier:s,pillIcon:n,groups:r}=t,i=K();let a;e[0]!==i?(a=As(i),e[0]=i,e[1]=a):a=e[1];const l=a,[c,d]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{w.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 v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Zt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=v):v=e[7];let x;e[8]!==n||e[9]!==p||e[10]!==g?(x=o.jsx(Ze,{asChild:!0,children:o.jsx("span",{className:"inline-flex min-w-0 shrink",children:o.jsx(Xt,{asChild:!0,children:o.jsxs(G,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[n,g,v]})})})}),e[8]=n,e[9]=p,e[10]=g,e[11]=x):x=e[11];let b;e[12]!==p?(b=o.jsx(Xe,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;e[14]!==x||e[15]!==b?(A=o.jsxs(et,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16];let j;if(e[17]!==r||e[18]!==i){let w;e[20]!==i?(w=S=>o.jsx("div",{className:"flex flex-col",children:S.rows.map(N=>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":N.title,onClick:()=>V(N),className:O("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",N.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[N.icon&&o.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:N.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm",children:N.title}),N.subtitle&&o.jsx("div",{className:"text-xs text-muted-foreground",children:N.subtitle})]}),N.active&&o.jsx("span",{title:i("chat.tierTrigger.selected"),children:o.jsx(lt,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&o.jsx(ji,{label:N.title,render:N.modelOverride})]},N.key))},S.key),e[20]=i,e[21]=w):w=e[21],j=r.map(w),e[17]=r,e[18]=i,e[19]=j}else j=e[19];let y;e[22]!==j?(y=o.jsx(es,{align:"end",className:"p-1 w-64",onOpenAutoFocus:yi,children:o.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=y):y=e[23];let k;return e[24]!==c||e[25]!==A||e[26]!==y?(k=o.jsxs(ts,{open:c,onOpenChange:d,children:[A,y]}),e[24]=c,e[25]=A,e[26]=y,e[27]=k):k=e[27],k}function yi(t){return t.preventDefault()}function ji(t){const e=R.c(38),{label:s,render:n}=t,r=K(),i=ss(),[a,l]=P.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 A;e[10]!==m?(A=o.jsx(yo,{asChild:!0,children:m}),e[10]=m,e[11]=A):A=e[11];let j;e[12]!==s||e[13]!==r?(j=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=j):j=e[14];let y;e[15]!==j?(y=o.jsx(jo,{className:"sr-only",children:j}),e[15]=j,e[16]=y):y=e[16];let k;e[17]!==a||e[18]!==n?(k=a&&n(d),e[17]=a,e[18]=n,e[19]=k):k=e[19];let w;e[20]!==k||e[21]!==y?(w=o.jsxs(ko,{className:"p-0 flex flex-col max-h-[95vh]",children:[y,k]}),e[20]=k,e[21]=y,e[22]=w):w=e[22];let S;return e[23]!==a||e[24]!==w||e[25]!==A?(S=o.jsxs(wo,{open:a,onOpenChange:l,children:[A,w]}),e[23]=a,e[24]=w,e[25]=A,e[26]=S):S=e[26],S}let g;e[27]!==m?(g=o.jsx(Xt,{asChild:!0,children:m}),e[27]=m,e[28]=g):g=e[28];let v;e[29]!==a||e[30]!==n?(v=a&&n(d),e[29]=a,e[30]=n,e[31]=v):v=e[31];let x;e[32]!==v?(x=o.jsx(es,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:v}),e[32]=v,e[33]=x):x=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==x?(b=o.jsxs(ts,{open:a,onOpenChange:l,children:[g,x]}),e[34]=a,e[35]=g,e[36]=x,e[37]=b):b=e[37],b}function Dt(t){return t==="fast"?o.jsx(Vt,{size:16}):t==="thinking"?o.jsx(Kn,{size:16}):o.jsx(So,{size:16})}function ki(t){const e=R.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 wi(){const t=R.c(25),e=K(),{simpleModeTier:s,setSimpleModeTier:n}=He(),r=Co(),i=ns(),a=To(i),l=ki(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,h=f==="claude-code",m=$e("model_choice"),g=ao(),v=lo();if(!g||!m)return null;let x,b;if(t[2]!==a||t[3]!==v||t[4]!==h||t[5]!==f||t[6]!==r||t[7]!==n||t[8]!==e||t[9]!==s||t[10]!==l||t[11]!==p||t[12]!==V||t[13]!==d){const w=As(e);x="decopilot",b=bi.map(S=>{const N=l[S],I=V.tiers[S];return{key:`decopilot-${S}`,icon:Dt(S),title:w[S],subtitle:v?N??e(Mt[S]):e(Mt[S]),active:s===S,onSelect:()=>n(S),modelOverride:v?C=>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(xi,{tier:S,orgSlot:r.tiers[S],userSlot:I,autoSlot:a.chat[S],filterModels:f==="codex"?Si:h?hi:void 0,onClose:C,onPick:M=>p.mutate({tier:S,slot:M}),onReset:()=>p.mutate({tier:S,slot:null})},`${S}:${I?.keyId??"org"}:${I?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=v,t[4]=h,t[5]=f,t[6]=r,t[7]=n,t[8]=e,t[9]=s,t[10]=l,t[11]=p,t[12]=V,t[13]=d,t[14]=x,t[15]=b}else x=t[14],b=t[15];let A;t[16]!==x||t[17]!==b?(A=[{key:x,rows:b}],t[16]=x,t[17]=b,t[18]=A):A=t[18];const j=A;let y;t[19]!==s?(y=Dt(s),t[19]=s,t[20]=y):y=t[20];let k;return t[21]!==j||t[22]!==y||t[23]!==s?(k=o.jsx(Ai,{tier:s,pillIcon:y,groups:j}),t[21]=j,t[22]=y,t[23]=s,t[24]=k):k=t[24],k}function Si(t){return di(t.providerId,t.modelId)}function ys(t){const e=R.c(3),[s]=Ne();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 Ci={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"},Ni=mn.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Ii=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Ti(){const t=R.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: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-1 ring-border object-cover bg-white"},t.name)}function Mi({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:n,isStreaming:r,onUnsupportedFile:i}){const a=K(),[l,c]=P.useState(!1),d=ys(Ci),{org:u}=Ie(),{editor:V}=zt(),p=P.useRef(null),f=pt(n),h=()=>{!f||r||(c(!1),p.current?.click())},m=async _=>{const B=_.target.files;if(!B||B.length===0||!V)return;const J=Array.from(B);try{let Z=V.state.selection.from;for(const X of J)await os(V,n??null,X,Z,i,a),Z=V.state.selection.to}finally{p.current&&(p.current.value="")}},g=Eo({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Os.virtualMcpPrompts(s,u.id),{data:x,isLoading:b}=$s({queryKey:v,queryFn:()=>Po(g),staleTime:6e4,enabled:l&&!!g}),A=x?.prompts??[],[j,y]=P.useState(null),{chatMode:k,setChatMode:w}=He(),[S,N]=Ne(),I=We()?.lockedHarness!=="claude-code",C=Ce.find(_=>_.value===S.toolApprovalLevel)??Ce[0],M=a(C.shortKey),D=_=>{const B=Ce.find(J=>J.value===_);if(B){if(B.value===S.toolApprovalLevel){c(!1);return}d(),se("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:B.value,source:"tools_popover"}),N({...S,toolApprovalLevel:B.value}),c(!1)}},E=k==="plan",U=()=>{d();const _=E?"default":"plan";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},T=()=>{e(),c(!1)},L=async(_,B)=>{if(!V||!g)return;const J=jt(_._meta),Z={from:V.state.selection.from,to:V.state.selection.to};try{const X=await Uo(g,_.name,B);Vn(V,Z,{id:_.name,name:ho(_.name,J),metadata:X.messages,char:"/",kind:"prompt",args:B})}catch{Ue.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async _=>{c(!1);const B=!!(_.arguments&&_.arguments.length>0);if(se("chat_prompt_inserted",{prompt_name:_.name,with_arguments:B}),B){y(_);return}await L(_)},W=async _=>{j&&(await L(j,_),y(null))},$=()=>{d();const _=k==="gen-image"?"default":"gen-image";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},z=()=>{d();const _=k==="web-search"?"default":"web-search";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},Q=()=>{d();const _=k==="deep-research"?"default":"deep-research";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),w(_),c(!1)},ee=k==="gen-image",te=k==="web-search",H=k==="deep-research",oe=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:[oe,o.jsxs(Bs,{open:l,onOpenChange:_=>{_&&!l&&se("chat_tools_popover_opened",{chat_mode:k}),c(_)},children:[o.jsx(Ks,{asChild:!0,children:o.jsxs(G,{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(et,{children:[o.jsx(Ze,{asChild:!0,children:o.jsxs(ye,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:_=>_.preventDefault(),children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),o.jsx(Xe,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),o.jsxs(ye,{onClick:U,className:O(E&&"text-special"),children:[o.jsx(qt,{size:16,className:O(E&&"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",E&&"text-special font-medium"),children:Ni})]}),o.jsxs(ye,{onClick:$,className:O(ee&&"text-special"),children:[o.jsx(Ht,{size:16,className:O(ee&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),ee&&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(Wt,{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:Q,className:O(H&&"text-special"),children:[o.jsx(Gt,{size:16,className:O(H&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),H&&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")]}):A.length===0?o.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):A.map(_=>o.jsxs(ye,{onClick:()=>F(_),className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"font-medium text-sm capitalize",children:_.title||fo(_.name,jt(_._meta))}),_.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:_.description})]},_.name))})]}),I&&o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx(Je,{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(Ys,{value:S.toolApprovalLevel,onValueChange:D,children:Ce.map(_=>o.jsx(Ws,{value:_.value,children:a(_.labelKey)},_.value))})})]}),o.jsxs(ye,{onClick:T,children:[o.jsx(Lo,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),o.jsx(P.Suspense,{children:o.jsx(Ti,{})})]})]})]}),o.jsx(ln,{prompt:j,setPrompt:y,onSubmit:W})]})}const Di=[{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 Ri(){const t=R.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:Di.map(Ei)}),t[0]=e):e=t[0],e}function Ei(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 Pi(t){const e=R.c(10),{onClick:s}=t,n=K();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(Ri,{}),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 Ui(){const t=R.c(9),[e,s]=P.useState("idle"),[n,r]=P.useState(""),[i,a]=P.useState(""),[l,c]=P.useState(zi),d=P.useRef(null),u=P.useRef(null),V=P.useRef(null),p=P.useRef(null),f=P.useRef(0),h=P.useRef(!1),m=P.useRef(""),g=P.useRef(""),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(Fi),p.current?.getTracks().forEach(Li),V.current=null,u.current=null,p.current=null},t[0]=x):x=t[0];const b=x;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=C=>{p.current=C;const M=new AudioContext;u.current=M;const D=M.createMediaStreamSource(C),E=M.createAnalyser();E.fftSize=128,E.smoothingTimeConstant=.8,D.connect(E),V.current=E;const U=new Uint8Array(E.frequencyBinCount),T=()=>{if(!V.current)return;V.current.getByteFrequencyData(U);const L=[];for(let F=0;F<Pe;F++){const W=Math.floor(F/Pe*U.length);L.push(Math.max(.04,(U[W]??0)/255))}c(L),f.current=requestAnimationFrame(T)};T()};A=async()=>{const C=window.SpeechRecognition||window.webkitSpeechRecognition;if(!C)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 D=new C;d.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=E=>{if(d.current!==D)return;let U="",T="";for(let L=E.resultIndex;L<E.results.length;L++){const F=E.results[L],W=F?.[0]?.transcript??"";F?.isFinal?T=T+W:U=U+W}T&&(m.current=m.current+T,r(m.current)),g.current=U,a(U)},D.onerror=E=>{d.current===D&&E.error!=="no-speech"&&(h.current=!1,d.current=null,b(),s(E.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(d.current===D&&h.current)try{D.start()}catch{}};try{D.start()}catch{return h.current=!1,d.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let y;t[2]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{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]=y):y=t[2];const k=y;let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),c(Array(Pe).fill(.05)),m.current="",g.current=""},t[3]=w):w=t[3];const S=w;let N;return t[4]!==i||t[5]!==e||t[6]!==n||t[7]!==l?(N={status:e,transcript:n,interimTranscript:i,waveformData:l,isSupported:v,startRecording:j,stopRecording:k,cancelRecording:S},t[4]=i,t[5]=e,t[6]=n,t[7]=l,t[8]=N):N=t[8],N}function Li(t){return t.stop()}function Fi(){}function zi(){return Array(Pe).fill(.05)}function Oi(t){const e=R.c(4),{data:s}=t;let n;e[0]!==s?(n=s.map($i),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 $i(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 Le=12e3,Rt=ie({token:ne(),expiresAt:Js()});Zs("provider",[ie({provider:je("elevenlabs"),conversationToken:ne().min(1)}),ie({provider:je("openai"),transport:je("webrtc")})]);const Bi=Hs([Rt.extend({provider:je("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Rt.extend({provider:je("openai"),transport:je("webrtc")})]);ie({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Le)});const js=ie({request:ne().trim().min(1).max(Le)}),rt=5e3;Ut(ie({role:ze(["user","agent"]),text:ne().min(1).max(rt)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=rt,{message:"Voice transcript is too long"});function cl(t){const e=[];let s=rt;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}ie({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:ze(["en","pt"]).default("en")}).strict();const Ki=ie({sdp:ne().min(1).max(1e5)});async function qi(t,e,s,n,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:c}=await import("./openai-conversation-DV_TyXnN.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,128]));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 dr(t){return{...t,content:[{type:"paragraph",content:[rn({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:cr}}]})]},...t.content??[]]}}function ur(){const t=R.c(24),e=K(),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 pr(t){const e=R.c(30),{current:s,total:n,onPrev:r,onNext:i}=t,a=K();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=$("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=$("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 y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(Bt,{size:14}),e[20]=y):y=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:y}),e[21]=i,e[22]=g,e[23]=v,e[24]=b,e[25]=A):A=e[25];let j;return e[26]!==A||e[27]!==p||e[28]!==m?(j=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]=j):j=e[29],j}function cs(t){const e=R.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=R.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=$("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(G,{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(Ze,{asChild:!0,children:x}),e[10]=x,e[11]=v):v=e[11];let b;e[12]!==p?(b=o.jsx(Xe,{children:p}),e[12]=p,e[13]=b):b=e[13];let y;return e[14]!==v||e[15]!==b?(y=o.jsxs(et,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=y):y=e[16],y}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}),y=()=>{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))}},j=()=>{const I=f.getValues(),C=Nt(e,s,I,a,d);C&&u(C)},k=()=>{f.handleSubmit(I=>{const C=I;for(const M of e)l(M,C[s(M)])})()},S=E.useRef(k);S.current=k;const w=()=>{b&&(p(!1),S.current())},N=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),S.current()}else{const C=Nt(e,s,I,a,d);C&&u(C)}};return E.useEffect(()=>{if(V&&!i){if(!v){p(!1);return}p(!1),S.current()}},[V,i,v]),{form:f,activeKey:d,setActiveKey:u,currentIndex:m,currentPart:g,isCurrentAnswered:x,isAllAnswered:v,canSubmit:b,goPrev:y,goNext:A,advanceToNextUnanswered:j,submit:w,submitOrAdvance:N}}const ps="chat.approval.defaultDenyReason";function fs(t){const e=R.c(36),{onYolo:s}=t,n=K(),[r,i]=Ne();let a,l,c,d,u,V,p,f,h;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const y=Ce.find(k=>k.value===r.toolApprovalLevel)??Ce[0];let A;e[13]!==s||e[14]!==r||e[15]!==i?(A=k=>{const S=k,w=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:S}),S==="auto"&&s(w)},e[13]=s,e[14]=r,e[15]=i,e[16]=A):A=e[16];const j=A;c=eo,f=r.toolApprovalLevel,h=j,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(y.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=Ce.map(y=>o.jsx(Xn,{value:y.value,children:n(y.labelKey)},y.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=R.c(8),{input:s}=t,n=K();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=R.c(38),{approval:s,onRespond:n}=t,r=K(),[i]=Ne(),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=w=>n(s.approvalId,!0,void 0,w),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(G,{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(G,{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 y=b;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(Je,{size:14}),e[27]=A):A=e[27];let j;e[28]!==r?(j=r("chat.approval.needsApproval"),e[28]=r,e[29]=j):j=e[29];let k;e[30]!==s.input?(k=o.jsx(hs,{input:s.input}),e[30]=s.input,e[31]=k):k=e[31];let S;return e[32]!==s.friendlyName||e[33]!==h||e[34]!==y||e[35]!==j||e[36]!==k?(S=o.jsx(pe,{icon:A,label:j,title:s.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:y,children:k}),e[32]=s.friendlyName,e[33]=h,e[34]=y,e[35]=j,e[36]=k,e[37]=S):S=e[37],S}const xr=Ns(ne(),ie({approved:Is().optional(),levelOverride:ze(["auto","readonly"]).optional()}));function vr(t){const e=R.c(46),{approvals:s,isStreaming:n,onRespond:r}=t,i=K(),[a]=Ne(),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=(C,M)=>{const P=M;typeof P?.approved=="boolean"&&r(C.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=C=>{p.form.reset(Object.fromEntries(s.map(M=>[M.approvalId,{approved:!0,levelOverride:C}]))),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=C=>{C.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(Je,{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 y=m?.friendlyName??"";let A;e[20]!==h?(A=o.jsx(fs,{onYolo:h}),e[20]=h,e[21]=A):A=e[21];let j;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==A?(j=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]=j):j=e[27];let k;e[28]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(k=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]=k):k=e[31];let S;e[32]!==m?(S=m?o.jsx(hs,{input:m.input}):null,e[32]=m,e[33]=S):S=e[33];let w;e[34]!==j||e[35]!==k||e[36]!==S||e[37]!==b||e[38]!==y?(w=o.jsx(pe,{icon:v,label:b,title:y,defaultExpanded:!0,footerLeft:j,footerRight:k,children:S}),e[34]=j,e[35]=k,e[36]=S,e[37]=b,e[38]=y,e[39]=w):w=e[39];let N;e[40]!==w||e[41]!==x?(N=o.jsx("form",{onSubmit:x,children:w}),e[40]=w,e[41]=x,e[42]=N):N=e[42];let I;return e[43]!==p.form||e[44]!==N?(I=o.jsx(ot,{...g,children:N}),e[43]=p.form,e[44]=N,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=R.c(7),{approvalId:s,control:n,onChange:r}=t,i=K(),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(G,{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(G,{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=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Je,{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=R.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=R.c(28),{plan:s,onApprove:n,onDismiss:r}=t,i=K();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(G,{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(G,{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(pe,{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=R.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=ie({response:ne().min(1,"Response is required")}),Nr=ie({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ir=ie({response:ze(["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 ie(e)}function Mr(t){const e=R.c(7),{control:s,name:n,placeholder:r}=t,i=K();let a;e[0]!==r||e[1]!==i?(a=c=>{const{field:d}=c,u=d.value??"";return o.jsxs(ct,{children:[o.jsx(dt,{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(Yt,{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(ut,{})]})},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=R.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=R.c(51),{control:s,name:n,options:r}=t,i=K(),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=D=>{const T=r[D];T!=null&&c.onChange(T)},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 D;e[16]!==c||e[17]!==p||e[18]!==i?(D=(T,F)=>{const z=p===T;return o.jsxs("button",{type:"button",onClick:()=>c.onChange(T),className:$("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",z&&"bg-accent/50",!z&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:T}),children:[o.jsx("span",{className:$("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",z?"bg-chart-1 text-white":"bg-muted text-foreground"),children:F+1}),o.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:T})]},`${F}-${T}`)},e[16]=c,e[17]=p,e[18]=i,e[19]=D):D=e[19],x=r.map(D),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 y;e[20]!==v||e[21]!==b?(y=$("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]=y):y=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(Yt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const j=m?f:"";let k;e[24]!==V||e[25]!==c||e[26]!==p?(k=D=>{V.onChange(D.target.value),p!==null&&c.onChange(null)},e[24]=V,e[25]=c,e[26]=p,e[27]=k):k=e[27];let S;e[28]!==c||e[29]!==p?(S=()=>{p!==null&&c.onChange(null)},e[28]=c,e[29]=p,e[30]=S):S=e[30];let w;e[31]!==i?(w=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=w):w=e[32];let N;e[33]!==i?(N=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=N):N=e[34];let I;e[35]!==j||e[36]!==k||e[37]!==S||e[38]!==w||e[39]!==N?(I=o.jsx("input",{type:"text",value:j,onChange:k,onFocus:S,placeholder:w,"aria-label":N,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=j,e[36]=k,e[37]=S,e[38]=w,e[39]=N,e[40]=I):I=e[40];let C;e[41]!==y||e[42]!==I?(C=o.jsxs("label",{className:y,children:[A,I]}),e[41]=y,e[42]=I,e[43]=C):C=e[43];let M;e[44]!==C||e[45]!==g||e[46]!==x?(M=o.jsx(dt,{children:o.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[x,C]})}),e[44]=C,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(ut,{}),e[48]=P):P=e[48];let U;return e[49]!==M?(U=o.jsxs(ct,{children:[M,P]}),e[49]=M,e[50]=U):U=e[50],U}function Rr(t){const e=R.c(8),{control:s,name:n}=t,r=K();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(ct,{children:[o.jsx(dt,{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:$("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:$("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(ut,{})]})},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=R.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 Er(t){const e=R.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=(O,L)=>{const Y=ms(L);Y&&r(O,Y)},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:Pr,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=K();let h;e[12]!==p||e[13]!==V||e[14]!==f?(h=()=>{const O=p;if(!O)return;const L=f("chat.userAskQuestion.skipMessage"),Y=O.toolCallId;O.input?.type==="choice"?(V.form.setValue(`${Y}.option`,null),V.form.setValue(`${Y}.draft`,L)):V.form.setValue(`${Y}.response`,L),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(G,{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 y;e[26]!==V.isAllAnswered||e[27]!==V.isCurrentAnswered||e[28]!==V.submitOrAdvance||e[29]!==n?(y=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]=y):y=e[30];let A;e[31]!==b||e[32]!==y?(A=o.jsxs(o.Fragment,{children:[b,y]}),e[31]=b,e[32]=y,e[33]=A):A=e[33];const j=A;if(s.length===1){const O=s[0];if(!O?.input)return null;const L=V.form;let Y;e[34]!==V?(Y=X=>{X.preventDefault(),V.submit()},e[34]=V,e[35]=Y):Y=e[35];let ee;e[36]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(nt,{size:14}),e[36]=ee):ee=e[36];let te;e[37]!==f?(te=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=te):te=e[38];let H;e[39]!==O.input?.prompt||e[40]!==f?(H=O.input?.prompt??f("chat.userAskQuestion.question"),e[39]=O.input?.prompt,e[40]=f,e[41]=H):H=e[41];const oe=O.input;let _;e[42]!==V.form.control||e[43]!==O.toolCallId||e[44]!==oe?(_=o.jsx(Tt,{input:oe,control:V.form.control,toolCallId:O.toolCallId}),e[42]=V.form.control,e[43]=O.toolCallId,e[44]=oe,e[45]=_):_=e[45];let B;e[46]!==j||e[47]!==te||e[48]!==H||e[49]!==_?(B=o.jsx(pe,{icon:ee,label:te,title:H,defaultExpanded:!0,footerRight:j,children:_}),e[46]=j,e[47]=te,e[48]=H,e[49]=_,e[50]=B):B=e[50];let J;e[51]!==Y||e[52]!==B?(J=o.jsx("form",{onSubmit:Y,autoComplete:"off",children:B}),e[51]=Y,e[52]=B,e[53]=J):J=e[53];let Z;return e[54]!==V.form||e[55]!==J?(Z=o.jsx(ot,{...L,children:J}),e[54]=V.form,e[55]=J,e[56]=Z):Z=e[56],Z}const k=V.form;let S;e[57]!==V?(S=O=>{O.preventDefault(),V.submit()},e[57]=V,e[58]=S):S=e[58];let w;e[59]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(nt,{size:14}),e[59]=w):w=e[59];let N;e[60]!==f?(N=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=N):N=e[61];const I=V.currentIndex+1;let C;e[62]!==s.length||e[63]!==f||e[64]!==I?(C=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=C):C=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,U=V.setActiveKey;let D;if(e[69]!==V.form||e[70]!==s){let O;e[72]!==V.form?(O=L=>o.jsx(ro,{value:L.toolCallId,className:"mt-0",children:o.jsx(Tt,{input:L.input,control:V.form.control,toolCallId:L.toolCallId})},L.toolCallId),e[72]=V.form,e[73]=O):O=e[73],D=s.map(O),e[69]=V.form,e[70]=s,e[71]=D}else D=e[71];let T;e[74]!==V.activeKey||e[75]!==V.setActiveKey||e[76]!==D?(T=o.jsx(io,{value:P,onValueChange:U,children:D}),e[74]=V.activeKey,e[75]=V.setActiveKey,e[76]=D,e[77]=T):T=e[77];let F;e[78]!==x||e[79]!==j||e[80]!==N||e[81]!==C||e[82]!==M||e[83]!==T?(F=o.jsx(pe,{icon:w,label:N,count:C,title:M,defaultExpanded:!0,footerLeft:x,footerRight:j,children:T}),e[78]=x,e[79]=j,e[80]=N,e[81]=C,e[82]=M,e[83]=T,e[84]=F):F=e[84];let z;e[85]!==S||e[86]!==F?(z=o.jsx("form",{onSubmit:S,autoComplete:"off",children:F}),e[85]=S,e[86]=F,e[87]=z):z=e[87];let Q;return e[88]!==V.form||e[89]!==z?(Q=o.jsx(ot,{...k,children:z}),e[88]=V.form,e[89]=z,e[90]=Q):Q=e[90],Q}function Pr(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=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(nt,{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=R.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(Er,{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=R.c(33),{parts:s,isStreaming:n,onRespond:r}=t,i=K();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(G,{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(G,{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 y;return e[28]!==c.title||e[29]!==v||e[30]!==b||e[31]!==u?(y=o.jsx(pe,{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]=y):y=e[32],y}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=R.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(Wr,{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(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function qr(t,e){return o.jsx(Qr,{todo:t},e)}function Qr(t){const e=R.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(Yr,{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=$("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 Yr(t){const e=R.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 Wr(t){const e=R.c(13),{status:s}=t,n=K();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=R.c(46),{source:s,onDone:n}=t,r=K(),i=_s(),[a]=Ne(),[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 T=>{const{url:F}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:T,currency:l});return F},e[0]=l,e[1]=i,e[2]=h):h=e[2];let m;e[3]!==n?(m=T=>{T&&window.open(T,"_blank","noopener,noreferrer"),n?.()},e[3]=n,e[4]=m):m=e[4];let g;e[5]!==r?(g=T=>{Ue.error(r("credits.topUp.failed",{message:T.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 y;e[11]!==l||e[12]!==s||e[13]!==v?(y=(T,F)=>{se("credits_topup_clicked",{amount_cents:T,currency:l,tier_label:F,source:s}),v(T)},e[11]=l,e[12]=s,e[13]=v,e[14]=y):y=e[14];const A=y,j=parseFloat(d),k=!isNaN(j)&&j>=1;let S,w,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(S=T=>{T&&c(T)},w=o.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=o.jsx(yt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=S,e[16]=w,e[17]=N):(S=e[15],w=e[16],N=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:S,children:[w,N]})}),e[18]=l,e[19]=I):I=e[19];const C=Gr[l];let M;if(e[20]!==A||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==C){let T;e[26]!==A||e[27]!==f||e[28]!==b||e[29]!==r?(T=F=>{const{dollars:z,labelKey:Q}=F;return o.jsxs("button",{type:"button",disabled:b,onClick:()=>A(z*100,Hr[Q]??"preset"),className:$("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,z]}),o.jsx("span",{className:"text-xs text-muted-foreground",children:r(Q)})]},z)},e[26]=A,e[27]=f,e[28]=b,e[29]=r,e[30]=T):T=e[30],M=C.map(T),e[20]=A,e[21]=f,e[22]=b,e[23]=r,e[24]=C,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 U;e[33]!==A||e[34]!==f||e[35]!==d||e[36]!==j||e[37]!==k||e[38]!==b||e[39]!==V||e[40]!==r?(U=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:T=>u(T.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),o.jsx(G,{className:"h-10",disabled:!k||b,onClick:()=>A(Math.round(j*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]=j,e[37]=k,e[38]=b,e[39]=V,e[40]=r,e[41]=U):U=e[41];let D;return e[42]!==P||e[43]!==U||e[44]!==I?(D=o.jsxs("div",{children:[I,P,U]}),e[42]=P,e[43]=U,e[44]=I,e[45]=D):D=e[45],D}const Zr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Xr(t){const e=R.c(47),{onDismiss:s}=t,{org:n}=Ie(),r=at(),{decoKeyId:i}=co(),a=K(),l=$e("credits");let c,d;if(e[0]!==n.id?(c=()=>{se("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=C=>!C&&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(Es,{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(Ps,{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(C=>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(lt,{size:12,className:"text-success"})}),o.jsx("span",{className:"text-sm text-foreground/80",children:a(C)})]},C))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let y;e[23]!==a?(y=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=y):y=e[24];let A;e[25]!==s||e[26]!==y?(A=o.jsx(G,{variant:"ghost",size:"sm",onClick:s,children:y}),e[25]=s,e[26]=y,e[27]=A):A=e[27];let j;e[28]!==r||e[29]!==s||e[30]!==n.slug?(j=()=>{r({to:"/$org/settings/ai-providers",params:{org:n.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=n.slug,e[31]=j):j=e[31];let k;e[32]!==a?(k=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=k):k=e[33];let S;e[34]!==j||e[35]!==k?(S=o.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:j,children:k}),e[34]=j,e[35]=k,e[36]=S):S=e[36];let w;e[37]!==A||e[38]!==S?(w=o.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[A,S]}),e[37]=A,e[38]=S,e[39]=w):w=e[39];let N;e[40]!==v||e[41]!==b||e[42]!==w?(N=o.jsxs(Us,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ei,children:[v,b,w]}),e[40]=v,e[41]=b,e[42]=w,e[43]=N):N=e[43];let I;return e[44]!==N||e[45]!==u?(I=o.jsx(Ls,{open:!0,onOpenChange:u,children:N}),e[44]=N,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=R.c(16),{kind:s,onDismiss:n,onSubscribe:r}=t,i=K(),{label:a,title:l}=ti[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Vt,{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(G,{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(pe,{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=R.c(21),{kind:s,onDismiss:n}=t,r=K(),i=at(),{org:a}=Ie(),{label:l,title:c}=ni[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Vt,{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(G,{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(pe,{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 Ye(t){const e=R.c(29),s=K(),{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(G,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):o.jsx(G,{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(()=>Ue.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ue.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(pe,{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 Be(t){const e=R.c(78);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=K(),{error:c,clearError:d,finishReason:u,clearFinishReason:V,messages:p,isStreaming:f,submit:h,sendMessage:m}=Oe(),[g,x]=Ne(),{virtualMcpId:v,createTaskWithMessage:b}=Ge(),{chatMode:y,setChatMode:A,simpleModeTier:j}=He(),k=$e("credits"),{mutate:S}=go("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let w;e[2]!==S?(w=()=>S(),e[2]=S,e[3]=w):w=e[3];const N=w;let I;e[4]!==y||e[5]!==j||e[6]!==v||e[7]!==a?(I=re=>({...a?{voiceMode:!0}:{},tier:j,mode:y,toolApprovalLevel:re,agent:v?{id:v}:void 0}),e[4]=y,e[5]=j,e[6]=v,e[7]=a,e[8]=I):I=e[8];const C=I;let M;e[9]!==g.toolApprovalLevel?(M=g.toolApprovalLevel??Fs(),e[9]=g.toolApprovalLevel,e[10]=M):M=e[10];const P=M,U=p.at(-1),D=U?.role==="assistant"?U.parts:[],T=D.filter(Vi),F=D.filter(Ft),z=ls(D),Q=is(D);let O;e[11]!==c||e[12]!==m||e[13]!==l?(O=()=>{if(c){const ae={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:c.message})}]}]};m(ae)}},e[11]=c,e[12]=m,e[13]=l,e[14]=O):O=e[14];const L=O;let Y;e[15]!==m||e[16]!==l?(Y=()=>{const re={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(re)},e[15]=m,e[16]=l,e[17]=Y):Y=e[17];const ee=Y;let te;e[18]!==C||e[19]!==P||e[20]!==h?(te=(re,ae)=>{h({kind:"toolOutput",toolCallId:re.toolCallId,output:{response:ae}},C(P))},e[18]=C,e[19]=P,e[20]=h,e[21]=te):te=e[21];const H=te;let oe;e[22]!==C||e[23]!==P||e[24]!==h?(oe=(re,ae)=>{h({kind:"toolOutput",toolCallId:re.toolCallId,output:{accepted:ae}},C(P))},e[22]=C,e[23]=P,e[24]=h,e[25]=oe):oe=e[25];const _=oe;let B;e[26]!==b||e[27]!==g||e[28]!==A||e[29]!==x||e[30]!==l||e[31]!==v?(B=re=>{A("default"),x({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:v,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:re})}]}})},e[26]=b,e[27]=g,e[28]=A,e[29]=x,e[30]=l,e[31]=v,e[32]=B):B=e[32];const J=B,Z=li;let X;e[33]!==C||e[34]!==h?(X=(re,ae,Me,Ae)=>{h({kind:"approval",approvalId:re,approved:ae,...Me?{reason:Me}:{}},C(Ae))},e[33]=C,e[34]=h,e[35]=X):X=e[35];const ue=X,W=Vs();if(W.isCreditExhausted){let re;return e[36]!==k||e[37]!==d||e[38]!==i?(re=k?o.jsx(Xr,{onDismiss:d}):o.jsx("div",{className:$(!i&&"absolute bottom-full left-0 right-0"),children:o.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:d})}),e[36]=k,e[37]=d,e[38]=i,e[39]=re):re=e[39],re}const{showError:le,showWarning:Ve,hasApprovals:ce}=W,ke=T.map(ai).join("|"),Ke=as(z)?.toolCallId??"",me=Q.map(ii).join("|"),Te=!i&&"absolute bottom-full left-0 right-0";let ge;e[40]!==Te?(ge=$(Te),e[40]=Te,e[41]=ge):ge=e[41];let de;e[42]!==W.todos?(de=o.jsx(Kr,{todos:W.todos}),e[42]=W.todos,e[43]=de):de=e[43];let xe;e[44]!==d||e[45]!==W.subscriptionErrorKind||e[46]!==N?(xe=W.subscriptionErrorKind&&o.jsx(si,{kind:W.subscriptionErrorKind,onDismiss:d,onSubscribe:N}),e[44]=d,e[45]=W.subscriptionErrorKind,e[46]=N,e[47]=xe):xe=e[47];let we;e[48]!==d||e[49]!==W.planRefusal?(we=W.planRefusal&&o.jsx(_t,{kind:W.planRefusal,onDismiss:d}),e[48]=d,e[49]=W.planRefusal,e[50]=we):we=e[50];let fe;e[51]!==d||e[52]!==c||e[53]!==L||e[54]!==le?(fe=le&&o.jsx(Ye,{variant:"error",error:c,onDismiss:d,onFixInChat:L}),e[51]=d,e[52]=c,e[53]=L,e[54]=le,e[55]=fe):fe=e[55];let ve;e[56]!==V||e[57]!==u||e[58]!==ee||e[59]!==Ve?(ve=Ve&&o.jsx(Ye,{variant:"warning",finishReason:u,onDismiss:V,onContinue:ee}),e[56]=V,e[57]=u,e[58]=ee,e[59]=Ve,e[60]=ve):ve=e[60];const De=ce&&o.jsx(wr,{approvals:Q,isStreaming:f,onRespond:ue},me),Re=W.hasPlans&&o.jsx(Cr,{plans:z,isStreaming:f,onApprove:J,onDismiss:Z},Ke),_e=W.hasTaskSuggestion&&o.jsx($r,{parts:F,isStreaming:f,onRespond:_},F.at(-1)?.toolCallId??"");let be;e[61]!==W.isWaitingForUserInput||e[62]!==H||e[63]!==f||e[64]!==ke||e[65]!==T?(be=W.isWaitingForUserInput&&o.jsx(xs,{userAskParts:T,isStreaming:f,onSubmit:H},ke),e[61]=W.isWaitingForUserInput,e[62]=H,e[63]=f,e[64]=ke,e[65]=T,e[66]=be):be=e[66];let Se;return e[67]!==ge||e[68]!==de||e[69]!==xe||e[70]!==we||e[71]!==fe||e[72]!==ve||e[73]!==De||e[74]!==Re||e[75]!==_e||e[76]!==be?(Se=o.jsxs("div",{className:ge,children:[de,xe,we,fe,ve,De,Re,_e,be]}),e[67]=ge,e[68]=de,e[69]=xe,e[70]=we,e[71]=fe,e[72]=ve,e[73]=De,e[74]=Re,e[75]=_e,e[76]=be,e[77]=Se):Se=e[77],Se}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"}Be.Error=function(e){return o.jsx(Ye,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Be.Warning=function(e){return o.jsx(Ye,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Be.UserAskQuestion=xs;function bs(t){const e=R.c(20),{taskId:s}=t,n=K(),r=Dn(s),i=Rn(r),a=En(),{stop:l,removeLocalMessage:c}=Oe();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(Ze,{asChild:!0,children:o.jsx(G,{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(Xe,{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(et,{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(G,{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&&(Pn(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)]})}function ci(t){return["openai-compatible","openrouter","deco"].includes(t)}function di(t,e){return ci(t)&&ui(e)!==null}function ui(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const pi={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function fi(t,e){return pi[t]?.test(e)??!1}function hi(t){return Io(t)&&fi(t.providerId,t.modelId)}function mi(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 gi={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function xi(t){const e=R.c(32),{tier:s,orgSlot:n,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:c,onClose:d}=t,u=K(),V=ns(),p=new Set(V.map(vi)),f=Un([r,n,i],p),h=f?.keyId??null,[m,g]=E.useState(h??V[0]?.id??null),x=V.some(z=>z.id===m)?m:h??V[0]?.id??null,v=x?V.find(z=>z.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",y=gi[s];let A;e[0]!==u||e[1]!==y?(A=u(y),e[0]=u,e[1]=y,e[2]=A):A=e[2];let j;e[3]!==A?(j=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=j):j=e[4];let k;e[5]!==c||e[6]!==u||e[7]!==r?(k=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]=k):k=e[8];let S;e[9]!==j||e[10]!==k?(S=o.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[j,k]}),e[9]=j,e[10]=k,e[11]=S):S=e[11];const w="flex-1 min-h-0",N=E.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(vo,{}),e[12]=I):I=e[12];const C=xo,M=!0,P=mi(h?f:null,v?.providerId??"deco");let U;e[13]!==x||e[14]!==l||e[15]!==g?(U=z=>{const Q=z.keyId??x??"";g(Q),l({keyId:Q,modelId:z.modelId,title:z.title})},e[13]=x,e[14]=l,e[15]=g,e[16]=U):U=e[16];let D;e[17]!==C||e[18]!==x||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==P||e[23]!==U?(D=o.jsx(C,{compact:M,filterModels:a,onClose:d,credentialId:x,onCredentialChange:g,selectedModel:P,onModelChange:U}),e[17]=C,e[18]=x,e[19]=a,e[20]=d,e[21]=g,e[22]=P,e[23]=U,e[24]=D):D=e[24];let T;e[25]!==N||e[26]!==D||e[27]!==I?(T=o.jsx("div",{className:w,children:o.jsx(N,{fallback:I,children:D})}),e[25]=N,e[26]=D,e[27]=I,e[28]=T):T=e[28];let F;return e[29]!==T||e[30]!==S?(F=o.jsxs("div",{className:b,children:[S,T]}),e[29]=T,e[30]=S,e[31]=F):F=e[31],F}function vi(t){return t.id}const bi=["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 Ai(t){const e=R.c(28),{tier:s,pillIcon:n,groups:r}=t,i=K();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=S=>{S.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=$("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=$("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(Ze,{asChild:!0,children:o.jsx("span",{className:"inline-flex min-w-0 shrink",children:o.jsx(Xt,{asChild:!0,children:o.jsxs(G,{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(Xe,{children:p}),e[12]=p,e[13]=b):b=e[13];let y;e[14]!==v||e[15]!==b?(y=o.jsxs(et,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=y):y=e[16];let A;if(e[17]!==r||e[18]!==i){let S;e[20]!==i?(S=w=>o.jsx("div",{className:"flex flex-col",children:w.rows.map(N=>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":N.title,onClick:()=>V(N),className:$("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",N.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[N.icon&&o.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:N.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm",children:N.title}),N.subtitle&&o.jsx("div",{className:"text-xs text-muted-foreground",children:N.subtitle})]}),N.active&&o.jsx("span",{title:i("chat.tierTrigger.selected"),children:o.jsx(lt,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&o.jsx(ji,{label:N.title,render:N.modelOverride})]},N.key))},w.key),e[20]=i,e[21]=S):S=e[21],A=r.map(S),e[17]=r,e[18]=i,e[19]=A}else A=e[19];let j;e[22]!==A?(j=o.jsx(es,{align:"end",className:"p-1 w-64",onOpenAutoFocus:yi,children:o.jsx("div",{role:"menu",className:"flex flex-col",children:A})}),e[22]=A,e[23]=j):j=e[23];let k;return e[24]!==c||e[25]!==y||e[26]!==j?(k=o.jsxs(ts,{open:c,onOpenChange:d,children:[y,j]}),e[24]=c,e[25]=y,e[26]=j,e[27]=k):k=e[27],k}function yi(t){return t.preventDefault()}function ji(t){const e=R.c(38),{label:s,render:n}=t,r=K(),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=$("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 y;e[10]!==m?(y=o.jsx(yo,{asChild:!0,children:m}),e[10]=m,e[11]=y):y=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 j;e[15]!==A?(j=o.jsx(jo,{className:"sr-only",children:A}),e[15]=A,e[16]=j):j=e[16];let k;e[17]!==a||e[18]!==n?(k=a&&n(d),e[17]=a,e[18]=n,e[19]=k):k=e[19];let S;e[20]!==k||e[21]!==j?(S=o.jsxs(ko,{className:"p-0 flex flex-col max-h-[95vh]",children:[j,k]}),e[20]=k,e[21]=j,e[22]=S):S=e[22];let w;return e[23]!==a||e[24]!==S||e[25]!==y?(w=o.jsxs(wo,{open:a,onOpenChange:l,children:[y,S]}),e[23]=a,e[24]=S,e[25]=y,e[26]=w):w=e[26],w}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(Vt,{size:16}):t==="thinking"?o.jsx(Kn,{size:16}):o.jsx(So,{size:16})}function ki(t){const e=R.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 wi(){const t=R.c(25),e=K(),{simpleModeTier:s,setSimpleModeTier:n}=He(),r=Co(),i=ns(),a=To(i),l=ki(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,h=f==="claude-code",m=$e("model_choice"),g=ao(),x=lo();if(!g||!m)return null;let v,b;if(t[2]!==a||t[3]!==x||t[4]!==h||t[5]!==f||t[6]!==r||t[7]!==n||t[8]!==e||t[9]!==s||t[10]!==l||t[11]!==p||t[12]!==V||t[13]!==d){const S=As(e);v="decopilot",b=bi.map(w=>{const N=l[w],I=V.tiers[w];return{key:`decopilot-${w}`,icon:Dt(w),title:S[w],subtitle:x?N??e(Mt[w]):e(Mt[w]),active:s===w,onSelect:()=>n(w),modelOverride:x?C=>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(xi,{tier:w,orgSlot:r.tiers[w],userSlot:I,autoSlot:a.chat[w],filterModels:f==="codex"?Si:h?hi:void 0,onClose:C,onPick:M=>p.mutate({tier:w,slot:M}),onReset:()=>p.mutate({tier:w,slot:null})},`${w}:${I?.keyId??"org"}:${I?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=x,t[4]=h,t[5]=f,t[6]=r,t[7]=n,t[8]=e,t[9]=s,t[10]=l,t[11]=p,t[12]=V,t[13]=d,t[14]=v,t[15]=b}else v=t[14],b=t[15];let y;t[16]!==v||t[17]!==b?(y=[{key:v,rows:b}],t[16]=v,t[17]=b,t[18]=y):y=t[18];const A=y;let j;t[19]!==s?(j=Dt(s),t[19]=s,t[20]=j):j=t[20];let k;return t[21]!==A||t[22]!==j||t[23]!==s?(k=o.jsx(Ai,{tier:s,pillIcon:j,groups:A}),t[21]=A,t[22]=j,t[23]=s,t[24]=k):k=t[24],k}function Si(t){return di(t.providerId,t.modelId)}function ys(t){const e=R.c(3),[s]=Ne();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 Ci={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"},Ni=mn.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Ii=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Ti(){const t=R.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: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-1 ring-border object-cover bg-white"},t.name)}function Mi({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:n,isStreaming:r,onUnsupportedFile:i}){const a=K(),[l,c]=E.useState(!1),d=ys(Ci),{org:u}=Ie(),{editor:V}=zt(),p=E.useRef(null),f=pt(n),h=()=>{!f||r||(c(!1),p.current?.click())},m=async _=>{const B=_.target.files;if(!B||B.length===0||!V)return;const J=Array.from(B);try{let Z=V.state.selection.from;for(const X of J)await os(V,n??null,X,Z,i,a),Z=V.state.selection.to}finally{p.current&&(p.current.value="")}},g=Eo({connectionId:s,orgId:u.id,orgSlug:u.slug}),x=Os.virtualMcpPrompts(s,u.id),{data:v,isLoading:b}=$s({queryKey:x,queryFn:()=>Po(g),staleTime:6e4,enabled:l&&!!g}),y=v?.prompts??[],[A,j]=E.useState(null),{chatMode:k,setChatMode:S}=He(),[w,N]=Ne(),I=We()?.lockedHarness!=="claude-code",C=Ce.find(_=>_.value===w.toolApprovalLevel)??Ce[0],M=a(C.shortKey),P=_=>{const B=Ce.find(J=>J.value===_);if(B){if(B.value===w.toolApprovalLevel){c(!1);return}d(),se("chat_approval_level_changed",{from_level:w.toolApprovalLevel,to_level:B.value,source:"tools_popover"}),N({...w,toolApprovalLevel:B.value}),c(!1)}},U=k==="plan",D=()=>{d();const _=U?"default":"plan";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),S(_),c(!1)},T=()=>{e(),c(!1)},F=async(_,B)=>{if(!V||!g)return;const J=jt(_._meta),Z={from:V.state.selection.from,to:V.state.selection.to};try{const X=await Uo(g,_.name,B);Vn(V,Z,{id:_.name,name:ho(_.name,J),metadata:X.messages,char:"/",kind:"prompt",args:B})}catch{Ue.error(a("chat.toolsPopover.failedLoadPrompt"))}},z=async _=>{c(!1);const B=!!(_.arguments&&_.arguments.length>0);if(se("chat_prompt_inserted",{prompt_name:_.name,with_arguments:B}),B){j(_);return}await F(_)},Q=async _=>{A&&(await F(A,_),j(null))},O=()=>{d();const _=k==="gen-image"?"default":"gen-image";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),S(_),c(!1)},L=()=>{d();const _=k==="web-search"?"default":"web-search";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),S(_),c(!1)},Y=()=>{d();const _=k==="deep-research"?"default":"deep-research";se("chat_mode_changed",{from_mode:k,to_mode:_,source:"tools_popover"}),S(_),c(!1)},ee=k==="gen-image",te=k==="web-search",H=k==="deep-research",oe=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:[oe,o.jsxs(Bs,{open:l,onOpenChange:_=>{_&&!l&&se("chat_tools_popover_opened",{chat_mode:k}),c(_)},children:[o.jsx(Ks,{asChild:!0,children:o.jsxs(G,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:$("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:$("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(et,{children:[o.jsx(Ze,{asChild:!0,children:o.jsxs(ye,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:_=>_.preventDefault(),children:[o.jsx(kt,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),o.jsx(Xe,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),o.jsxs(ye,{onClick:D,className:$(U&&"text-special"),children:[o.jsx(qt,{size:16,className:$(U&&"text-special")}),o.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),o.jsx("span",{className:$("text-xs text-muted-foreground",U&&"text-special font-medium"),children:Ni})]}),o.jsxs(ye,{onClick:O,className:$(ee&&"text-special"),children:[o.jsx(Ht,{size:16,className:$(ee&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),ee&&o.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),o.jsxs(ye,{onClick:L,className:$(te&&"text-special"),children:[o.jsx(Wt,{size:16,className:$(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:Y,className:$(H&&"text-special"),children:[o.jsx(Gt,{size:16,className:$(H&&"text-special")}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),H&&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")]}):y.length===0?o.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):y.map(_=>o.jsxs(ye,{onClick:()=>z(_),className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"font-medium text-sm capitalize",children:_.title||fo(_.name,jt(_._meta))}),_.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:_.description})]},_.name))})]}),I&&o.jsxs(gt,{children:[o.jsxs(xt,{className:"gap-2",children:[o.jsx(Je,{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(Ys,{value:w.toolApprovalLevel,onValueChange:P,children:Ce.map(_=>o.jsx(Ws,{value:_.value,children:a(_.labelKey)},_.value))})})]}),o.jsxs(ye,{onClick:T,children:[o.jsx(Lo,{size:16}),o.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),o.jsx(E.Suspense,{children:o.jsx(Ti,{})})]})]})]}),o.jsx(ln,{prompt:A,setPrompt:j,onSubmit:Q})]})}const Di=[{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 Ri(){const t=R.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:Di.map(Ei)}),t[0]=e):e=t[0],e}function Ei(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 Pi(t){const e=R.c(10),{onClick:s}=t,n=K();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=$("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(Ri,{}),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 Ui(){const t=R.c(12),[e,s]=E.useState("idle"),[n,r]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(zi),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=E.useRef(!1),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let b;t[0]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(Fi),p.current?.getTracks().forEach(Li),V.current=null,u.current=null,p.current=null},t[0]=b):b=t[0];const y=b;let A;t[1]===Symbol.for("react.memo_cache_sentinel")?(A=P=>{p.current=P;const U=new AudioContext;u.current=U;const D=U.createMediaStreamSource(P),T=U.createAnalyser();T.fftSize=128,T.smoothingTimeConstant=.8,D.connect(T),V.current=T;const F=new Uint8Array(T.frequencyBinCount),z=()=>{if(!V.current)return;V.current.getByteFrequencyData(F);const Q=[];for(let O=0;O<Pe;O++){const L=Math.floor(O/Pe*F.length);Q.push(Math.max(.04,(F[L]??0)/255))}c(Q),f.current=requestAnimationFrame(z)};z()},t[1]=A):A=t[1];const j=A;let k;t[2]!==e?(k=async()=>{if(x.current||h.current)return e;x.current=!0;const P=window.SpeechRecognition||window.webkitSpeechRecognition;if(!P)return x.current=!1,s("unsupported"),"unsupported";let U;try{U=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return x.current=!1,s("permission-denied"),"permission-denied"}x.current=!1,r(""),a(""),g.current="",m.current="",h.current=!0,s("recording"),j(U);const D=new P;d.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=T=>{if(d.current!==D)return;let F="",z="";for(let Q=T.resultIndex;Q<T.results.length;Q++){const O=T.results[Q],L=O?.[0]?.transcript??"";O?.isFinal?z=z+L:F=F+L}z&&(m.current=m.current+z,r(m.current)),g.current=F,a(F)},D.onerror=T=>{d.current===D&&T.error!=="no-speech"&&(h.current=!1,d.current=null,y(),s(T.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(d.current===D&&h.current)try{D.start()}catch{}};try{D.start()}catch{return h.current=!1,d.current=null,y(),s("idle"),"idle"}return"recording"},t[2]=e,t[3]=k):k=t[3];const S=k;let w;t[4]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,d.current?.stop(),y(),s("idle"),c(Array(Pe).fill(.05)),a("");const P=(m.current+(g.current?" "+g.current:"")).trim();return r(""),m.current="",g.current="",P},t[4]=w):w=t[4];const N=w;let I;t[5]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{h.current=!1,d.current?.abort(),y(),s("idle"),r(""),a(""),c(Array(Pe).fill(.05)),m.current="",g.current=""},t[5]=I):I=t[5];const C=I;let M;return t[6]!==i||t[7]!==S||t[8]!==e||t[9]!==n||t[10]!==l?(M={status:e,transcript:n,interimTranscript:i,waveformData:l,isSupported:v,startRecording:S,stopRecording:N,cancelRecording:C},t[6]=i,t[7]=S,t[8]=e,t[9]=n,t[10]=l,t[11]=M):M=t[11],M}function Li(t){return t.stop()}function Fi(){}function zi(){return Array(Pe).fill(.05)}function Oi(t){const e=R.c(4),{data:s}=t;let n;e[0]!==s?(n=s.map($i),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 $i(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 Le=12e3,Rt=ie({token:ne(),expiresAt:Js()});Zs("provider",[ie({provider:je("elevenlabs"),conversationToken:ne().min(1)}),ie({provider:je("openai"),transport:je("webrtc")})]);const Bi=Hs([Rt.extend({provider:je("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Rt.extend({provider:je("openai"),transport:je("webrtc")})]);ie({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Le)});const js=ie({request:ne().trim().min(1).max(Le)}),rt=5e3;Ut(ie({role:ze(["user","agent"]),text:ne().min(1).max(rt)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=rt,{message:"Voice transcript is too long"});function cl(t){const e=[];let s=rt;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}ie({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:ze(["en","pt"]).default("en")}).strict();const Ki=ie({sdp:ne().min(1).max(1e5)});async function qi(t,e,s,n,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:c}=await import("./openai-conversation-CuaaGonx.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,128]));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 Qi=ie({background:je(!0),status:je("started"),jobId:ne().min(1)}),Yi=ie({item:ie({id:ne().min(1),title:ne(),status:ne()})}),Wi=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 Et(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=Qi.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(a==="tool-TASK_BOARD_ITEM_CREATE"){const l=Yi.safeParse(i.output);l.success&&n.push(l.data.item)}}return{backgroundJobs:s,tasks:n}}function Pt(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<=Le)return i;const a=i.slice(0,Le-1);return`${a.slice(0,a.lastIndexOf(" "))}…`}class Gi{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=Pt(e.messages,n.messageId);if(l===null)continue;a=l;const c=Et(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=Wi(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=Pt(n,a);if(d===null)return;this.track(Et(n,a).tasks),r.push(d)}this.finish(e,r.filter(Boolean).join(`
|
|
@@ -14,4 +14,4 @@ ${e.slice(0,12e3)}`,delivery:"context",contextId:"studio-view"}))}collectResults
|
|
|
14
14
|
`).slice(0,Le),accepted:!0})}this.updateContext();const c=(this.bindings?.messages??[]).slice(-12).map(d=>({role:d.role,text:d.parts.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
15
15
|
`).slice(0,2e3)}));l.publishUpdate({text:`Recent Studio chat history, supplied as data only:
|
|
16
16
|
${JSON.stringify(c).slice(0,16e3)}
|
|
17
|
-
Current work status: ${JSON.stringify(this.status())}`,delivery:"context",contextId:"studio-history"}),this.timer=setInterval(()=>{n()&&this.flushAnnouncements()},100),this.expires=setTimeout(()=>{n()&&this.fail("disconnected")},Math.max(1,i.expiresAt-Date.now())),this.collectResults()}catch(r){n()&&this.fail(r instanceof DOMException&&r.name==="NotAllowedError"?"permission":"unavailable")}}toggleMute=()=>{const e=!this.state.muted;this.conversation?.setMicMuted(e),this.patch({muted:e})};fail(e){this.stop(),this.patch({phase:"error",error:e})}async revoke(e){await fetch(this.url,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e}),keepalive:!0}).catch(()=>{})}stop=()=>{this.generation++,this.startupAbort?.abort(),this.startupAbort=void 0,this.userSpeaking=!1,clearTimeout(this.expires),clearInterval(this.timer);const e=this.conversation;this.conversation=void 0;const s=this.token;this.token=void 0,this.cleanup=Promise.allSettled([this.cleanup,e?.endSession(),s?this.revoke(s):void 0]).then(()=>{}),this.jobs.clear(),this.tasks.clear(),this.boardUpdates.clear(),this.announcements=[],this.lastContext="",this.lastWorkStatus="",this.utterance=0,this.seenUserEvents.clear(),this.approvalReported=!1,this.dispatchQueue=Promise.resolve(),this.patch({phase:"idle",error:null,working:!1})}}let Ee;const ft=P.createContext(null);function dl(t){const e=R.c(7),{children:s,layout:n}=t,{org:r}=Ie(),{taskId:i}=Ge(),a=ss();let l;e[0]!==a||e[1]!==n?(l=a?qo({visibility:n,threadVisibilityExplicit:n.threadVisibilityExplicit})==="chat":n.threadOpen||!n.contentOpen,e[0]=a,e[1]=n,e[2]=l):l=e[2];const c=l,d=`${r.id}:${i??"new"}`;let u;return e[3]!==s||e[4]!==d||e[5]!==c?(u=o.jsx(Hi,{visible:c,children:s},d),e[3]=s,e[4]=d,e[5]=c,e[6]=u):u=e[6],u}function Hi(t){const e=R.c(35),{children:s,visible:n}=t,{org:r}=Ie(),{taskId:i,createTask:a,activeTask:l}=Ge(),d=No("voice_mode")&&!l?.metadata?.read_only;let u;e[0]!==r.slug||e[1]!==i?(u=()=>new Gi(`/api/${encodeURIComponent(r.slug)}/threads/${encodeURIComponent(i??"")}/voice/sessions`,Xs()==="pt-BR"?"pt":"en"),e[0]=r.slug,e[1]=i,e[2]=u):u=e[2];const[V]=P.useState(u);let p,f;e[3]!==d||e[4]!==V||e[5]!==n?(p=()=>{(!d||!n)&&V.stop()},f=[V,d,n],e[3]=d,e[4]=V,e[5]=n,e[6]=p,e[7]=f):(p=e[6],f=e[7]),P.useLayoutEffect(p,f);let h;e[8]!==V?(h=()=>V.getSnapshot().phase!=="idle",e[8]=V,e[9]=h):h=e[9];const m=P.useSyncExternalStore(V.subscribe,h);let g;e[10]!==m||e[11]!==r.slug||e[12]!==V.taskDeleted||e[13]!==V.taskUpdated?(g={orgSlug:r.slug,enabled:m,onUpdate:V.taskUpdated,onDelete:V.taskDeleted},e[10]=m,e[11]=r.slug,e[12]=V.taskDeleted,e[13]=V.taskUpdated,e[14]=g):g=e[14],Ko(g);let v;e[15]!==d||e[16]!==r.id||e[17]!==V||e[18]!==i?(v=()=>w=>{if(d&&i&&Ee?.orgId===r.id&&Ee.threadId===i){const N=Ee.expires>Date.now();Ee=void 0,N&&V.start()}const S=()=>V.stop();return window.addEventListener("pagehide",S),()=>{window.removeEventListener("pagehide",S),V.stop()}},e[15]=d,e[16]=r.id,e[17]=V,e[18]=i,e[19]=v):v=e[19];const[x]=P.useState(v);let b;e[20]!==a||e[21]!==d||e[22]!==r.id||e[23]!==V||e[24]!==i?(b=()=>{if(d){if(!i){const w=a();Ee={orgId:r.id,threadId:w,expires:Date.now()+3e4};return}V.start()}},e[20]=a,e[21]=d,e[22]=r.id,e[23]=V,e[24]=i,e[25]=b):b=e[25];const A=b;let j;e[26]!==d||e[27]!==V||e[28]!==A?(j={session:V,enabled:d,start:A},e[26]=d,e[27]=V,e[28]=A,e[29]=j):j=e[29];let y;e[30]!==s?(y=o.jsx("div",{className:"contents",ref:x,children:s}),e[30]=s,e[31]=y):y=e[31];let k;return e[32]!==j||e[33]!==y?(k=o.jsx(ft,{value:j,children:y}),e[32]=j,e[33]=y,e[34]=k):k=e[34],k}function ul(t){const e=R.c(4),{children:s}=t,n=P.useContext(ft),r=Oe();let i,a;return e[0]!==n||e[1]!==r?(i=()=>{n?.session.updateBindings(r,n.enabled)},a=[n,r],e[0]=n,e[1]=r,e[2]=i,e[3]=a):(i=e[2],a=e[3]),P.useLayoutEffect(i,a),s}function ws(){const t=R.c(4),e=P.useContext(ft),s=P.useSyncExternalStore(e?.session.subscribe??Ji,e?.session.getSnapshot??Zi),n=s?.phase!==void 0&&s.phase!=="idle";let r;return t[0]!==e||t[1]!==s||t[2]!==n?(r={active:n,context:e,snapshot:s},t[0]=e,t[1]=s,t[2]=n,t[3]=r):r=t[3],r}const Ji=()=>()=>{},Zi=()=>null;function Xi(){const t=R.c(9),e=K(),{context:s}=ws();if(!s?.enabled||!navigator.mediaDevices?.getUserMedia)return null;const n=s.start;let r;t[0]!==e?(r=e("chat.voice.start"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e?(i=e("chat.voice.start"),t[2]=e,t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Qo,{size:18}),t[4]=a):a=t[4];let l;return t[5]!==s.start||t[6]!==r||t[7]!==i?(l=o.jsx(G,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:n,"aria-label":r,title:i,children:a}),t[5]=s.start,t[6]=r,t[7]=i,t[8]=l):l=t[8],l}function ea({session:t,phase:e,muted:s}){const[n]=P.useState(()=>r=>{if(!r||matchMedia("(prefers-reduced-motion: reduce)").matches)return;let i=0,a=requestAnimationFrame(function l(){const c=Math.min(1,t.outputVolume());i+=(c-i)*(c>i?.55:.12),r.style.setProperty("--voice-level",i.toFixed(3)),a=requestAnimationFrame(l)});return()=>cancelAnimationFrame(a)});return o.jsx("div",{ref:n,className:"studio-voice-orb","data-phase":e,"data-muted":s,"aria-hidden":"true"})}function pl(){const t=R.c(65),e=K(),{taskId:s}=Ge(),n=Oe(),{context:r,snapshot:i,active:a}=ws();if(!a||!r||!i)return null;const{session:l}=r;let c;t[0]!==i.error||t[1]!==i.muted||t[2]!==i.phase||t[3]!==e?(c=i.error?e(`chat.voice.${i.error}`):i.muted?e("chat.voice.muted"):e(`chat.voice.${i.phase}`),t[0]=i.error,t[1]=i.muted,t[2]=i.phase,t[3]=e,t[4]=c):c=t[4];const d=c;let u;t[5]!==e?(u=e("chat.voice.title"),t[5]=e,t[6]=u):u=t[6];let V;t[7]!==l||t[8]!==i.muted||t[9]!==i.phase?(V=o.jsx(ea,{session:l,phase:i.phase,muted:i.muted}),t[7]=l,t[8]=i.muted,t[9]=i.phase,t[10]=V):V=t[10];let p;t[11]!==d?(p=o.jsx("p",{role:"status",className:"max-w-sm text-center text-sm text-muted-foreground",children:d}),t[11]=d,t[12]=p):p=t[12];let f;t[13]!==i.working||t[14]!==e?(f=i.working&&o.jsx("p",{className:"text-center text-xs text-muted-foreground",children:e("chat.voice.backgroundWork")}),t[13]=i.working,t[14]=e,t[15]=f):f=t[15];let h;t[16]!==r.start||t[17]!==i.phase||t[18]!==e?(h=i.phase==="error"&&o.jsx(G,{variant:"outline",onClick:r.start,children:e("chat.voice.retry")}),t[16]=r.start,t[17]=i.phase,t[18]=e,t[19]=h):h=t[19];let m;t[20]!==V||t[21]!==p||t[22]!==f||t[23]!==h?(m=o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-7 overflow-y-auto px-6 py-8",children:[V,p,f,h]}),t[20]=V,t[21]=p,t[22]=f,t[23]=h,t[24]=m):m=t[24];let g;t[25]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Be,{inline:!0,voiceMode:!0}),t[25]=g):g=t[25];let v;t[26]!==s?(v=s&&o.jsx(bs,{taskId:s}),t[26]=s,t[27]=v):v=t[27];let x;t[28]!==v?(x=o.jsxs("div",{className:"max-h-[55%] shrink-0 overflow-y-auto px-3",children:[g,v]}),t[28]=v,t[29]=x):x=t[29];const b=i.phase==="connecting"||i.phase==="error",A=i.muted?"chat.voice.unmute":"chat.voice.mute";let j;t[30]!==e||t[31]!==A?(j=e(A),t[30]=e,t[31]=A,t[32]=j):j=t[32];const y=i.muted?"chat.voice.unmute":"chat.voice.mute";let k;t[33]!==e||t[34]!==y?(k=e(y),t[33]=e,t[34]=y,t[35]=k):k=t[35];let w;t[36]!==i.muted?(w=i.muted?o.jsx(Wo,{size:18}):o.jsx(Go,{size:18}),t[36]=i.muted,t[37]=w):w=t[37];let S;t[38]!==l.toggleMute||t[39]!==i.muted||t[40]!==b||t[41]!==j||t[42]!==k||t[43]!==w?(S=o.jsx(G,{variant:"outline",size:"icon",disabled:b,"aria-label":j,title:k,"aria-pressed":i.muted,onClick:l.toggleMute,children:w}),t[38]=l.toggleMute,t[39]=i.muted,t[40]=b,t[41]=j,t[42]=k,t[43]=w,t[44]=S):S=t[44];const N=l.stop;let I;t[45]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(Yo,{size:16}),t[45]=I):I=t[45];let C;t[46]!==e?(C=e("chat.voice.backToChat"),t[46]=e,t[47]=C):C=t[47];let M;t[48]!==l.stop||t[49]!==C?(M=o.jsxs(G,{variant:"outline",onClick:N,children:[I,C]}),t[48]=l.stop,t[49]=C,t[50]=M):M=t[50];let D;t[51]!==n.isRunInProgress||t[52]!==n.isStreaming||t[53]!==n.stop||t[54]!==e?(D=(n.isStreaming||n.isRunInProgress)&&o.jsx(G,{variant:"outline",size:"icon","aria-label":e("chat.voice.stopWork"),title:e("chat.voice.stopWork"),onClick:n.stop,children:o.jsx(Ho,{size:16})}),t[51]=n.isRunInProgress,t[52]=n.isStreaming,t[53]=n.stop,t[54]=e,t[55]=D):D=t[55];let E;t[56]!==S||t[57]!==M||t[58]!==D?(E=o.jsxs("div",{className:"flex shrink-0 items-center justify-center gap-3 px-4 py-6",children:[S,M,D]}),t[56]=S,t[57]=M,t[58]=D,t[59]=E):E=t[59];let U;return t[60]!==u||t[61]!==E||t[62]!==m||t[63]!==x?(U=o.jsxs("section",{"aria-label":u,className:"absolute inset-0 flex min-h-0 flex-col bg-background",children:[m,x,E]}),t[60]=u,t[61]=E,t[62]=m,t[63]=x,t[64]=U):U=t[64],U}function ta(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function qe(t){const e=R.c(7),{message:s,icon:n}=t;let r;e[0]!==n?(r=n??o.jsx(Lt,{size:14,className:"shrink-0"}),e[0]=n,e[1]=r):r=e[1];const i=s??"";let a;e[2]!==i?(a=o.jsx("span",{className:"text-sm",children:i}),e[2]=i,e[3]=a):a=e[3];let l;return e[4]!==r||e[5]!==a?(l=o.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[r,a]}),e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function sa(t,e,s){const n=R.c(7),{editor:r}=zt(),i=K(),[a,l]=P.useState(!1),c=P.useRef(0);let d,u;return n[0]!==s||n[1]!==r||n[2]!==e||n[3]!==t||n[4]!==i?(d=()=>{const V=m=>{m.dataTransfer?.types.includes("Files")&&(m.preventDefault(),c.current=c.current+1,l(!0))},p=m=>{m.preventDefault(),c.current=Math.max(0,c.current-1),c.current===0&&l(!1)},f=na,h=m=>{if(c.current=0,l(!1),m.defaultPrevented||(m.preventDefault(),s||!r||!t||!pt(t)))return;const g=m.dataTransfer?.files;if(!g||g.length===0)return;const v=Array.from(g);(async()=>{let x=r.state.selection.from;for(const b of v)await os(r,t,b,x,e,i),x=r.state.selection.to})()};return window.addEventListener("dragenter",V),window.addEventListener("dragleave",p),window.addEventListener("dragover",f),window.addEventListener("drop",h),()=>{window.removeEventListener("dragenter",V),window.removeEventListener("dragleave",p),window.removeEventListener("dragover",f),window.removeEventListener("drop",h)}},u=[r,t,e,i,s],n[0]=s,n[1]=r,n[2]=e,n[3]=t,n[4]=i,n[5]=d,n[6]=u):(d=n[5],u=n[6]),P.useEffect(d,u),a}function na(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function oa(t){const e=R.c(14),{selectedModel:s}=t,n=K();let r,i,a;if(e[0]!==s||e[1]!==n){const{parts:d}=Ao(s);e[5]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Hn,{size:24}),e[5]=a):a=e[5],r="text-sm font-medium";let u;e[6]!==n?(u=V=>n(V),e[6]=n,e[7]=u):u=e[7],i=n("chat.input.dropFilesHere",{fileTypes:d.map(u).join(", ")}),e[0]=s,e[1]=n,e[2]=r,e[3]=i,e[4]=a}else r=e[2],i=e[3],a=e[4];let l;e[8]!==r||e[9]!==i?(l=o.jsx("span",{className:r,children:i}),e[8]=r,e[9]=i,e[10]=l):l=e[10];let c;return e[11]!==a||e[12]!==l?(c=o.jsxs(o.Fragment,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=c):c=e[13],c}function ra(){const t=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Lt,{size:24}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.jsxs(o.Fragment,{children:[s,o.jsx("span",{className:"text-sm font-medium",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function ia(t){const e=R.c(11),{selectedModel:s,onUnsupportedFile:n,disabled:r}=t,i=sa(s,n,r);let a;e[0]!==s?(a=pt(s),e[0]=s,e[1]=a):a=e[1];const l=a,c=i?"opacity-100":"opacity-0 pointer-events-none",d=l?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let u;e[2]!==c||e[3]!==d?(u=O("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",c,d),e[2]=c,e[3]=d,e[4]=u):u=e[4];let V;e[5]!==s||e[6]!==l?(V=l?o.jsx(oa,{selectedModel:s}):o.jsx(ra,{}),e[5]=s,e[6]=l,e[7]=V):V=e[7];let p;return e[8]!==u||e[9]!==V?(p=o.jsx("div",{className:u,children:V}),e[8]=u,e[9]=V,e[10]=p):p=e[10],p}function Qe(t){const e=R.c(14),{onClick:s,label:n,icon:r,colorClass:i,maxWidthClass:a}=t;let l;e[0]!==i?(l=O("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",i),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==a?(c=O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",a),e[2]=a,e[3]=c):c=e[3];let d;e[4]!==n||e[5]!==c?(d=o.jsx("span",{className:c,children:n}),e[4]=n,e[5]=c,e[6]=d):d=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(it,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=u):u=e[7];let V;return e[8]!==r||e[9]!==n||e[10]!==s||e[11]!==l||e[12]!==d?(V=o.jsxs("button",{type:"button",onClick:s,title:n,"aria-label":n,className:l,children:[r,d,u]}),e[8]=r,e[9]=n,e[10]=s,e[11]=l,e[12]=d,e[13]=V):V=e[13],V}function aa(){const t=R.c(6),e=at(),{org:s,locator:n}=Ie(),{create:r}=Mn();let i;return t[0]!==r||t[1]!==n||t[2]!==e||t[3]!==s.id||t[4]!==s.slug?(i=async a=>{const{tiptapDoc:l,virtualMcp:c,taskIntake:d}=a,u=d===void 0?!1:d,V=crypto.randomUUID(),p=c?.id??st(s.id).id;xn(sessionStorage,n,V,{tiptapDoc:u&&l?dr(l):l});try{await r({id:V,virtual_mcp_id:p})}catch{}const f={autosend:vn};u&&(f.sidepanel=!0,f.mainpanel=!1),nn(e,on({org:s.slug,agentId:p,superAgentId:st(s.id).id}),{search:()=>({...f,thread:V}),replace:!1})},t[0]=r,t[1]=n,t[2]=e,t[3]=s.id,t[4]=s.slug,t[5]=i):i=t[5],i}function fl({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:s=!1}){const n=K(),r=On(),i=We(),a=r?.messages??[],l=r?.isStreaming??!1,c=r?.isRunInProgress??!1,d=r?.stop??(()=>{}),u=i?.taskId??"",V=u||kn,p=aa(),{selectedModel:f,selectedVirtualMcp:h,isModelsLoading:m,tiptapDocRef:g,imageModel:v,webSearchModel:x,deepResearchModel:b,chatMode:A,setChatMode:j}=He(),{data:y}=en.useSession(),k=y?.user?.id,{org:w,locator:S}=Ie(),[N,I]=tn(sn.homeTaskMode(S),!0),C=s&&N,M=st(w.id).id,D=$t(h?.id),E=Jo(D?.id).runtime==="cms",U=ys(zo),[T,L]=P.useState(!1),{unsupportedFile:F,onUnsupportedFile:W,clearUnsupportedFile:$}=_o(),z=Ui(),Q=P.useRef(void 0),ee=async()=>{Q.current=Y;const q=await z.startRecording();se("chat_voice_started",{thread_id:u,outcome:q==="recording"?"started":q==="unsupported"?"unsupported":q==="permission-denied"?"permission_denied":"unknown"})},te=()=>{se("chat_voice_confirmed",{thread_id:u});const q=z.stopRecording();me.current?.syncVoiceText(Q.current,q),me.current?.focus()},H=()=>{se("chat_voice_cancelled",{thread_id:u}),z.cancelRecording(),me.current?.restoreContent(Q.current)};P.useEffect(()=>{if(z.status!=="recording")return;const q=(z.transcript+(z.interimTranscript?" "+z.interimTranscript:"")).trim();me.current?.syncVoiceText(Q.current,q)},[z.transcript,z.interimTranscript,z.status]);const oe=i?.activeTask??null,_=oe?.created_by,B=!!(k&&_&&_!==k),{data:J}=$o({enabled:B}),Z=(J?.data?.members??[]).find(q=>q.userId===_),X=Z?.user?.name??Z?.user?.email?.split("@")[0]??null,ue=$n(oe?.harness_id),[Y,le]=P.useState(()=>At(sessionStorage,S,V)??void 0),Ve=q=>{le(q),g.current=q,jn(sessionStorage,S,V,q,{onQuotaExceeded:({docSizeBytes:he})=>{se("chat_draft_quota_exceeded",{thread_id:u||null,doc_size_bytes:he}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},ce=P.useRef(u);if(ce.current!==u){ce.current=u;const q=At(sessionStorage,S,V)??void 0;le(q),g.current=q}const ke=[...a].reverse().find(q=>q.role==="assistant")?.metadata,Ke=ke?.modelLimits?.contextWindow??(!ke?.models?.thinking||ke.models.thinking.id===f?.modelId?f?.limits?.contextWindow:void 0),me=P.useRef(null),Te=P.useRef(!1),ge=A==="plan",de=q=>{U(),se("chat_mode_changed",{from_mode:q,to_mode:"default",source:"pill_dismiss"}),j("default")};P.useEffect(()=>{const q=he=>{gn(he)&&he.code==="KeyL"&&(he.preventDefault(),he.shiftKey&&j(A==="plan"?"default":"plan"),me.current?.focus())};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[A,j]);const xe=Bn(a),fe=[...a].reverse().find(q=>q.role==="assistant"&&q.metadata?.usage)?.metadata?.usage?.contextTokens??0,ve=$e("chat"),De=Vo(),[Re,_e]=P.useState(!1),[be,Se]=P.useState(!1),re=!m&&!An(Y),ae=ta({hasDraft:re,isStreaming:l,isRunInProgress:c}),Me=ae==="send",Ae=ae==="stop",ht=q=>{if(q?.preventDefault(),!ve){_e(!0);return}if(De){Se(!0);return}if(ae==="send"&&Y){if(se("chat_message_sent",{thread_id:u||null,mode:A,model_id:f?.modelId??null,model_provider:f?.providerId??null,virtual_mcp_id:h?.id??null,submission:q?"button_or_enter":"programmatic"}),r){if(r.isSendInFlight()){Ue.info(n("chat.input.stillSendingPreviousMessage"));return}r.sendMessage(Y)}else C&&se("task_report_submitted",{source:"home"}),p({tiptapDoc:Y,virtualMcp:C?null:h,taskIntake:C});yn(sessionStorage,S,V),Ve(void 0)}else ae==="stop"&&(se("chat_message_stopped",{thread_id:u}),d())};if(B)return o.jsx(qe,{message:X?n("chat.input.readOnlyOthersChatNamed",{name:X}):n("chat.input.readOnlyOthersChat"),icon:X?o.jsx(Oo,{shape:"circle",size:"2xs",url:Z?.user?.image??void 0,fallback:X.slice(0,2).toUpperCase()}):void 0});if(oe?.metadata?.read_only)return o.jsx(qe,{message:n("chat.input.readOnlyThread")});if(ue)return o.jsx(qe,{message:n("chat.input.codingAgentUnavailable")});if(E){if(!i)return o.jsx(qe,{message:n("chat.input.fastPreviewUnavailable")});const q=()=>{const he=i.createTask({runtime:"sandbox"});se("coding_session_started",{thread_id:he})};return o.jsxs("button",{type:"button",onClick:q,className:"group flex w-full items-center gap-3 rounded-2xl border border-border bg-background/60 px-4 py-3.5 text-left shadow-sm backdrop-blur-sm transition-colors hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[o.jsx(Yn,{size:18,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("chat.fastPreview.startCodingSession")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:n("chat.fastPreview.chatNeedsSession")})]}),o.jsx(Bt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return o.jsxs(o.Fragment,{children:[Re&&o.jsx(wt,{feature:"chat",onDismiss:()=>_e(!1)}),be&&o.jsx(wt,{feature:"chat",copy:{title:n("chat.input.allowanceExhaustedTitle")},onDismiss:()=>Se(!1)}),o.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:o.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&o.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),r&&i&&o.jsx(Be,{}),r&&i&&u?o.jsx(bs,{taskId:u}):null,o.jsx(Mo,{tiptapDoc:Y,setTiptapDoc:Ve,disabled:z.status==="recording",enterToSubmit:!0,placeholder:n(C?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:ht,suggestionOpenRef:Te,children:o.jsxs("form",{onSubmit:ht,className:O("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[o.jsx(ia,{selectedModel:f,onUnsupportedFile:W,disabled:z.status==="recording"}),o.jsx(ur,{}),o.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:o.jsx(Do,{ref:me,disabled:z.status==="recording",virtualMcpId:h?.id??M,showFileUploader:!0,selectedModel:f,onUnsupportedFile:W,suggestionOpenRef:Te})}),o.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:z.status==="recording"?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex-1"}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o.jsx(Oi,{data:z.waveformData.slice(0,28)}),o.jsx("button",{type:"button",onClick:H,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":n("chat.input.cancelRecording"),children:o.jsx(it,{size:16})}),o.jsx("button",{type:"button",onClick:te,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":n("chat.input.useTranscription"),children:o.jsx(lt,{size:16})})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s&&o.jsx(G,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>I(!N),className:"h-8",children:n("chat.input.taskMode")}),o.jsx(Mi,{disabled:!1,onOpenConnections:()=>{se("connections_dialog_opened",{source:"tools_popover",mode:"add"}),L(!0)},virtualMcpId:h?.id??M,selectedModel:f,isStreaming:l,onUnsupportedFile:W}),ge&&o.jsx(Qe,{onClick:()=>de("plan"),label:n("chat.input.planMode"),icon:o.jsx(qt,{size:14,className:"shrink-0"}),colorClass:"text-violet-600 dark:text-violet-400 hover:bg-violet-500/10",maxWidthClass:"@[320px]/chat-bottom:max-w-32"}),A==="gen-image"&&v&&o.jsx(Qe,{onClick:()=>de("gen-image"),label:n("chat.input.createImage"),icon:o.jsx(Ht,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),A==="web-search"&&x&&o.jsx(Qe,{onClick:()=>de("web-search"),label:n("chat.input.webSearch"),icon:o.jsx(Wt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),A==="deep-research"&&b&&o.jsx(Qe,{onClick:()=>de("deep-research"),label:n("chat.input.deepResearch"),icon:o.jsx(Gt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),Ke&&fe>0&&o.jsx(cn,{usage:xe,totalTokens:fe,contextWindow:Ke,onOpenContextPanel:t})]}),o.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[o.jsx(wi,{}),o.jsx(Xi,{}),z.isSupported&&o.jsx(G,{type:"button",onClick:ee,disabled:!1,variant:"ghost",size:"icon",className:O("size-8 transition-colors",z.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:z.status==="permission-denied"?n("chat.input.microphoneAccessDenied"):n("chat.input.voiceInput"),"aria-label":z.status==="permission-denied"?n("chat.input.microphoneAccessDenied"):n("chat.input.voiceInput"),children:o.jsx(Gn,{size:18})}),o.jsx(G,{type:Ae?"button":"submit",onClick:q=>{Ae&&(q.preventDefault(),q.stopPropagation(),d())},variant:Me||Ae?"default":"ghost",size:C?"sm":"icon",disabled:!Me&&!Ae,className:O(C?"h-8 px-3 transition-all":"size-8 transition-all",!Me&&!Ae&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:n(ae==="stop"?l?"chat.input.stopGenerating":"chat.input.cancelRun":C?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":n(ae==="stop"?l?"chat.input.stopGenerating":"chat.input.cancelRun":C?"chat.input.startTask":"chat.input.sendMessage"),children:Ae?o.jsx(Wn,{size:20}):o.jsxs(o.Fragment,{children:[C&&n("chat.input.startTask"),o.jsx(Kt,{size:20})]})})]})]})})]})},u),s&&C&&o.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:n("chat.input.taskHint")}),e&&o.jsx(Pi,{onClick:()=>{se("connections_banner_clicked",{source:"home_chat_input"}),se("connections_dialog_opened",{source:"home_banner",mode:"add"}),L(!0)}})]})}),o.jsx(Bo,{mode:"browse",open:T,onOpenChange:L,defaultTab:"all"}),o.jsx(Ro,{info:F,onClose:$})]})}export{ul as C,ll as H,Jr as T,pl as V,Jo as a,dl as b,fl as c,Xr as d,Vl as e,Le as f,cl as g,ci as s,ws as u};
|
|
17
|
+
Current work status: ${JSON.stringify(this.status())}`,delivery:"context",contextId:"studio-history"}),this.timer=setInterval(()=>{n()&&this.flushAnnouncements()},100),this.expires=setTimeout(()=>{n()&&this.fail("disconnected")},Math.max(1,i.expiresAt-Date.now())),this.collectResults()}catch(r){n()&&this.fail(r instanceof DOMException&&r.name==="NotAllowedError"?"permission":"unavailable")}}toggleMute=()=>{const e=!this.state.muted;this.conversation?.setMicMuted(e),this.patch({muted:e})};fail(e){this.stop(),this.patch({phase:"error",error:e})}async revoke(e){await fetch(this.url,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e}),keepalive:!0}).catch(()=>{})}stop=()=>{this.generation++,this.startupAbort?.abort(),this.startupAbort=void 0,this.userSpeaking=!1,clearTimeout(this.expires),clearInterval(this.timer);const e=this.conversation;this.conversation=void 0;const s=this.token;this.token=void 0,this.cleanup=Promise.allSettled([this.cleanup,e?.endSession(),s?this.revoke(s):void 0]).then(()=>{}),this.jobs.clear(),this.tasks.clear(),this.boardUpdates.clear(),this.announcements=[],this.lastContext="",this.lastWorkStatus="",this.utterance=0,this.seenUserEvents.clear(),this.approvalReported=!1,this.dispatchQueue=Promise.resolve(),this.patch({phase:"idle",error:null,working:!1})}}let Ee;const ft=E.createContext(null);function dl(t){const e=R.c(7),{children:s,layout:n}=t,{org:r}=Ie(),{taskId:i}=Ge(),a=ss();let l;e[0]!==a||e[1]!==n?(l=a?qo({visibility:n,threadVisibilityExplicit:n.threadVisibilityExplicit})==="chat":n.threadOpen||!n.contentOpen,e[0]=a,e[1]=n,e[2]=l):l=e[2];const c=l,d=`${r.id}:${i??"new"}`;let u;return e[3]!==s||e[4]!==d||e[5]!==c?(u=o.jsx(Hi,{visible:c,children:s},d),e[3]=s,e[4]=d,e[5]=c,e[6]=u):u=e[6],u}function Hi(t){const e=R.c(35),{children:s,visible:n}=t,{org:r}=Ie(),{taskId:i,createTask:a,activeTask:l}=Ge(),d=No("voice_mode")&&!l?.metadata?.read_only;let u;e[0]!==r.slug||e[1]!==i?(u=()=>new Gi(`/api/${encodeURIComponent(r.slug)}/threads/${encodeURIComponent(i??"")}/voice/sessions`,Xs()==="pt-BR"?"pt":"en"),e[0]=r.slug,e[1]=i,e[2]=u):u=e[2];const[V]=E.useState(u);let p,f;e[3]!==d||e[4]!==V||e[5]!==n?(p=()=>{(!d||!n)&&V.stop()},f=[V,d,n],e[3]=d,e[4]=V,e[5]=n,e[6]=p,e[7]=f):(p=e[6],f=e[7]),E.useLayoutEffect(p,f);let h;e[8]!==V?(h=()=>V.getSnapshot().phase!=="idle",e[8]=V,e[9]=h):h=e[9];const m=E.useSyncExternalStore(V.subscribe,h);let g;e[10]!==m||e[11]!==r.slug||e[12]!==V.taskDeleted||e[13]!==V.taskUpdated?(g={orgSlug:r.slug,enabled:m,onUpdate:V.taskUpdated,onDelete:V.taskDeleted},e[10]=m,e[11]=r.slug,e[12]=V.taskDeleted,e[13]=V.taskUpdated,e[14]=g):g=e[14],Ko(g);let x;e[15]!==d||e[16]!==r.id||e[17]!==V||e[18]!==i?(x=()=>S=>{if(d&&i&&Ee?.orgId===r.id&&Ee.threadId===i){const N=Ee.expires>Date.now();Ee=void 0,N&&V.start()}const w=()=>V.stop();return window.addEventListener("pagehide",w),()=>{window.removeEventListener("pagehide",w),V.stop()}},e[15]=d,e[16]=r.id,e[17]=V,e[18]=i,e[19]=x):x=e[19];const[v]=E.useState(x);let b;e[20]!==a||e[21]!==d||e[22]!==r.id||e[23]!==V||e[24]!==i?(b=()=>{if(d){if(!i){const S=a();Ee={orgId:r.id,threadId:S,expires:Date.now()+3e4};return}V.start()}},e[20]=a,e[21]=d,e[22]=r.id,e[23]=V,e[24]=i,e[25]=b):b=e[25];const y=b;let A;e[26]!==d||e[27]!==V||e[28]!==y?(A={session:V,enabled:d,start:y},e[26]=d,e[27]=V,e[28]=y,e[29]=A):A=e[29];let j;e[30]!==s?(j=o.jsx("div",{className:"contents",ref:v,children:s}),e[30]=s,e[31]=j):j=e[31];let k;return e[32]!==A||e[33]!==j?(k=o.jsx(ft,{value:A,children:j}),e[32]=A,e[33]=j,e[34]=k):k=e[34],k}function ul(t){const e=R.c(4),{children:s}=t,n=E.useContext(ft),r=Oe();let i,a;return e[0]!==n||e[1]!==r?(i=()=>{n?.session.updateBindings(r,n.enabled)},a=[n,r],e[0]=n,e[1]=r,e[2]=i,e[3]=a):(i=e[2],a=e[3]),E.useLayoutEffect(i,a),s}function ws(){const t=R.c(4),e=E.useContext(ft),s=E.useSyncExternalStore(e?.session.subscribe??Ji,e?.session.getSnapshot??Zi),n=s?.phase!==void 0&&s.phase!=="idle";let r;return t[0]!==e||t[1]!==s||t[2]!==n?(r={active:n,context:e,snapshot:s},t[0]=e,t[1]=s,t[2]=n,t[3]=r):r=t[3],r}const Ji=()=>()=>{},Zi=()=>null;function Xi(){const t=R.c(9),e=K(),{context:s}=ws();if(!s?.enabled||!navigator.mediaDevices?.getUserMedia)return null;const n=s.start;let r;t[0]!==e?(r=e("chat.voice.start"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e?(i=e("chat.voice.start"),t[2]=e,t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Qo,{size:18}),t[4]=a):a=t[4];let l;return t[5]!==s.start||t[6]!==r||t[7]!==i?(l=o.jsx(G,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:n,"aria-label":r,title:i,children:a}),t[5]=s.start,t[6]=r,t[7]=i,t[8]=l):l=t[8],l}function ea({session:t,phase:e,muted:s}){const[n]=E.useState(()=>r=>{if(!r||matchMedia("(prefers-reduced-motion: reduce)").matches)return;let i=0,a=requestAnimationFrame(function l(){const c=Math.min(1,t.outputVolume());i+=(c-i)*(c>i?.55:.12),r.style.setProperty("--voice-level",i.toFixed(3)),a=requestAnimationFrame(l)});return()=>cancelAnimationFrame(a)});return o.jsx("div",{ref:n,className:"studio-voice-orb","data-phase":e,"data-muted":s,"aria-hidden":"true"})}function pl(){const t=R.c(65),e=K(),{taskId:s}=Ge(),n=Oe(),{context:r,snapshot:i,active:a}=ws();if(!a||!r||!i)return null;const{session:l}=r;let c;t[0]!==i.error||t[1]!==i.muted||t[2]!==i.phase||t[3]!==e?(c=i.error?e(`chat.voice.${i.error}`):i.muted?e("chat.voice.muted"):e(`chat.voice.${i.phase}`),t[0]=i.error,t[1]=i.muted,t[2]=i.phase,t[3]=e,t[4]=c):c=t[4];const d=c;let u;t[5]!==e?(u=e("chat.voice.title"),t[5]=e,t[6]=u):u=t[6];let V;t[7]!==l||t[8]!==i.muted||t[9]!==i.phase?(V=o.jsx(ea,{session:l,phase:i.phase,muted:i.muted}),t[7]=l,t[8]=i.muted,t[9]=i.phase,t[10]=V):V=t[10];let p;t[11]!==d?(p=o.jsx("p",{role:"status",className:"max-w-sm text-center text-sm text-muted-foreground",children:d}),t[11]=d,t[12]=p):p=t[12];let f;t[13]!==i.working||t[14]!==e?(f=i.working&&o.jsx("p",{className:"text-center text-xs text-muted-foreground",children:e("chat.voice.backgroundWork")}),t[13]=i.working,t[14]=e,t[15]=f):f=t[15];let h;t[16]!==r.start||t[17]!==i.phase||t[18]!==e?(h=i.phase==="error"&&o.jsx(G,{variant:"outline",onClick:r.start,children:e("chat.voice.retry")}),t[16]=r.start,t[17]=i.phase,t[18]=e,t[19]=h):h=t[19];let m;t[20]!==V||t[21]!==p||t[22]!==f||t[23]!==h?(m=o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-7 overflow-y-auto px-6 py-8",children:[V,p,f,h]}),t[20]=V,t[21]=p,t[22]=f,t[23]=h,t[24]=m):m=t[24];let g;t[25]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Be,{inline:!0,voiceMode:!0}),t[25]=g):g=t[25];let x;t[26]!==s?(x=s&&o.jsx(bs,{taskId:s}),t[26]=s,t[27]=x):x=t[27];let v;t[28]!==x?(v=o.jsxs("div",{className:"max-h-[55%] shrink-0 overflow-y-auto px-3",children:[g,x]}),t[28]=x,t[29]=v):v=t[29];const b=i.phase==="connecting"||i.phase==="error",y=i.muted?"chat.voice.unmute":"chat.voice.mute";let A;t[30]!==e||t[31]!==y?(A=e(y),t[30]=e,t[31]=y,t[32]=A):A=t[32];const j=i.muted?"chat.voice.unmute":"chat.voice.mute";let k;t[33]!==e||t[34]!==j?(k=e(j),t[33]=e,t[34]=j,t[35]=k):k=t[35];let S;t[36]!==i.muted?(S=i.muted?o.jsx(Wo,{size:18}):o.jsx(Go,{size:18}),t[36]=i.muted,t[37]=S):S=t[37];let w;t[38]!==l.toggleMute||t[39]!==i.muted||t[40]!==b||t[41]!==A||t[42]!==k||t[43]!==S?(w=o.jsx(G,{variant:"outline",size:"icon",disabled:b,"aria-label":A,title:k,"aria-pressed":i.muted,onClick:l.toggleMute,children:S}),t[38]=l.toggleMute,t[39]=i.muted,t[40]=b,t[41]=A,t[42]=k,t[43]=S,t[44]=w):w=t[44];const N=l.stop;let I;t[45]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(Yo,{size:16}),t[45]=I):I=t[45];let C;t[46]!==e?(C=e("chat.voice.backToChat"),t[46]=e,t[47]=C):C=t[47];let M;t[48]!==l.stop||t[49]!==C?(M=o.jsxs(G,{variant:"outline",onClick:N,children:[I,C]}),t[48]=l.stop,t[49]=C,t[50]=M):M=t[50];let P;t[51]!==n.isRunInProgress||t[52]!==n.isStreaming||t[53]!==n.stop||t[54]!==e?(P=(n.isStreaming||n.isRunInProgress)&&o.jsx(G,{variant:"outline",size:"icon","aria-label":e("chat.voice.stopWork"),title:e("chat.voice.stopWork"),onClick:n.stop,children:o.jsx(Ho,{size:16})}),t[51]=n.isRunInProgress,t[52]=n.isStreaming,t[53]=n.stop,t[54]=e,t[55]=P):P=t[55];let U;t[56]!==w||t[57]!==M||t[58]!==P?(U=o.jsxs("div",{className:"flex shrink-0 items-center justify-center gap-3 px-4 py-6",children:[w,M,P]}),t[56]=w,t[57]=M,t[58]=P,t[59]=U):U=t[59];let D;return t[60]!==u||t[61]!==U||t[62]!==m||t[63]!==v?(D=o.jsxs("section",{"aria-label":u,className:"absolute inset-0 flex min-h-0 flex-col bg-background",children:[m,v,U]}),t[60]=u,t[61]=U,t[62]=m,t[63]=v,t[64]=D):D=t[64],D}function ta(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function qe(t){const e=R.c(7),{message:s,icon:n}=t;let r;e[0]!==n?(r=n??o.jsx(Lt,{size:14,className:"shrink-0"}),e[0]=n,e[1]=r):r=e[1];const i=s??"";let a;e[2]!==i?(a=o.jsx("span",{className:"text-sm",children:i}),e[2]=i,e[3]=a):a=e[3];let l;return e[4]!==r||e[5]!==a?(l=o.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[r,a]}),e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function sa(t,e,s){const n=R.c(7),{editor:r}=zt(),i=K(),[a,l]=E.useState(!1),c=E.useRef(0);let d,u;return n[0]!==s||n[1]!==r||n[2]!==e||n[3]!==t||n[4]!==i?(d=()=>{const V=m=>{m.dataTransfer?.types.includes("Files")&&(m.preventDefault(),c.current=c.current+1,l(!0))},p=m=>{m.preventDefault(),c.current=Math.max(0,c.current-1),c.current===0&&l(!1)},f=na,h=m=>{if(c.current=0,l(!1),m.defaultPrevented||(m.preventDefault(),s||!r||!t||!pt(t)))return;const g=m.dataTransfer?.files;if(!g||g.length===0)return;const x=Array.from(g);(async()=>{let v=r.state.selection.from;for(const b of x)await os(r,t,b,v,e,i),v=r.state.selection.to})()};return window.addEventListener("dragenter",V),window.addEventListener("dragleave",p),window.addEventListener("dragover",f),window.addEventListener("drop",h),()=>{window.removeEventListener("dragenter",V),window.removeEventListener("dragleave",p),window.removeEventListener("dragover",f),window.removeEventListener("drop",h)}},u=[r,t,e,i,s],n[0]=s,n[1]=r,n[2]=e,n[3]=t,n[4]=i,n[5]=d,n[6]=u):(d=n[5],u=n[6]),E.useEffect(d,u),a}function na(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function oa(t){const e=R.c(14),{selectedModel:s}=t,n=K();let r,i,a;if(e[0]!==s||e[1]!==n){const{parts:d}=Ao(s);e[5]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Hn,{size:24}),e[5]=a):a=e[5],r="text-sm font-medium";let u;e[6]!==n?(u=V=>n(V),e[6]=n,e[7]=u):u=e[7],i=n("chat.input.dropFilesHere",{fileTypes:d.map(u).join(", ")}),e[0]=s,e[1]=n,e[2]=r,e[3]=i,e[4]=a}else r=e[2],i=e[3],a=e[4];let l;e[8]!==r||e[9]!==i?(l=o.jsx("span",{className:r,children:i}),e[8]=r,e[9]=i,e[10]=l):l=e[10];let c;return e[11]!==a||e[12]!==l?(c=o.jsxs(o.Fragment,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=c):c=e[13],c}function ra(){const t=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Lt,{size:24}),t[0]=s):s=t[0];let n;t[1]!==e?(n=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=n):n=t[2];let r;return t[3]!==n?(r=o.jsxs(o.Fragment,{children:[s,o.jsx("span",{className:"text-sm font-medium",children:n})]}),t[3]=n,t[4]=r):r=t[4],r}function ia(t){const e=R.c(11),{selectedModel:s,onUnsupportedFile:n,disabled:r}=t,i=sa(s,n,r);let a;e[0]!==s?(a=pt(s),e[0]=s,e[1]=a):a=e[1];const l=a,c=i?"opacity-100":"opacity-0 pointer-events-none",d=l?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let u;e[2]!==c||e[3]!==d?(u=$("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",c,d),e[2]=c,e[3]=d,e[4]=u):u=e[4];let V;e[5]!==s||e[6]!==l?(V=l?o.jsx(oa,{selectedModel:s}):o.jsx(ra,{}),e[5]=s,e[6]=l,e[7]=V):V=e[7];let p;return e[8]!==u||e[9]!==V?(p=o.jsx("div",{className:u,children:V}),e[8]=u,e[9]=V,e[10]=p):p=e[10],p}function Qe(t){const e=R.c(14),{onClick:s,label:n,icon:r,colorClass:i,maxWidthClass:a}=t;let l;e[0]!==i?(l=$("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",i),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==a?(c=$("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",a),e[2]=a,e[3]=c):c=e[3];let d;e[4]!==n||e[5]!==c?(d=o.jsx("span",{className:c,children:n}),e[4]=n,e[5]=c,e[6]=d):d=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(it,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=u):u=e[7];let V;return e[8]!==r||e[9]!==n||e[10]!==s||e[11]!==l||e[12]!==d?(V=o.jsxs("button",{type:"button",onClick:s,title:n,"aria-label":n,className:l,children:[r,d,u]}),e[8]=r,e[9]=n,e[10]=s,e[11]=l,e[12]=d,e[13]=V):V=e[13],V}function aa(){const t=R.c(6),e=at(),{org:s,locator:n}=Ie(),{create:r}=Mn();let i;return t[0]!==r||t[1]!==n||t[2]!==e||t[3]!==s.id||t[4]!==s.slug?(i=async a=>{const{tiptapDoc:l,virtualMcp:c,taskIntake:d}=a,u=d===void 0?!1:d,V=crypto.randomUUID(),p=c?.id??st(s.id).id;xn(sessionStorage,n,V,{tiptapDoc:u&&l?dr(l):l});try{await r({id:V,virtual_mcp_id:p})}catch{}const f={autosend:vn};u&&(f.sidepanel=!0,f.mainpanel=!1),nn(e,on({org:s.slug,agentId:p,superAgentId:st(s.id).id}),{search:()=>({...f,thread:V}),replace:!1})},t[0]=r,t[1]=n,t[2]=e,t[3]=s.id,t[4]=s.slug,t[5]=i):i=t[5],i}function fl({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:s=!1}){const n=K(),r=On(),i=We(),a=r?.messages??[],l=r?.isStreaming??!1,c=r?.isRunInProgress??!1,d=r?.stop??(()=>{}),u=i?.taskId??"",V=u||kn,p=aa(),{selectedModel:f,selectedVirtualMcp:h,isModelsLoading:m,tiptapDocRef:g,imageModel:x,webSearchModel:v,deepResearchModel:b,chatMode:y,setChatMode:A}=He(),{data:j}=en.useSession(),k=j?.user?.id,{org:S,locator:w}=Ie(),[N,I]=tn(sn.homeTaskMode(w),!0),C=s&&N,M=st(S.id).id,P=$t(h?.id),U=Jo(P?.id).runtime==="cms",D=ys(zo),[T,F]=E.useState(!1),{unsupportedFile:z,onUnsupportedFile:Q,clearUnsupportedFile:O}=_o(),L=Ui(),Y=E.useRef(void 0),ee=async()=>{Y.current=W;const q=await L.startRecording();se("chat_voice_started",{thread_id:u,outcome:q==="recording"?"started":q==="unsupported"?"unsupported":q==="permission-denied"?"permission_denied":"unknown"})},te=()=>{se("chat_voice_confirmed",{thread_id:u});const q=L.stopRecording();me.current?.syncVoiceText(Y.current,q),me.current?.focus()},H=()=>{se("chat_voice_cancelled",{thread_id:u}),L.cancelRecording(),me.current?.restoreContent(Y.current)};E.useEffect(()=>{if(L.status!=="recording")return;const q=(L.transcript+(L.interimTranscript?" "+L.interimTranscript:"")).trim();me.current?.syncVoiceText(Y.current,q)},[L.transcript,L.interimTranscript,L.status]);const oe=i?.activeTask??null,_=oe?.created_by,B=!!(k&&_&&_!==k),{data:J}=$o({enabled:B}),Z=(J?.data?.members??[]).find(q=>q.userId===_),X=Z?.user?.name??Z?.user?.email?.split("@")[0]??null,ue=$n(oe?.harness_id),[W,le]=E.useState(()=>At(sessionStorage,w,V)??void 0),Ve=q=>{le(q),g.current=q,jn(sessionStorage,w,V,q,{onQuotaExceeded:({docSizeBytes:he})=>{se("chat_draft_quota_exceeded",{thread_id:u||null,doc_size_bytes:he}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},ce=E.useRef(u);if(ce.current!==u){ce.current=u;const q=At(sessionStorage,w,V)??void 0;le(q),g.current=q}const ke=[...a].reverse().find(q=>q.role==="assistant")?.metadata,Ke=ke?.modelLimits?.contextWindow??(!ke?.models?.thinking||ke.models.thinking.id===f?.modelId?f?.limits?.contextWindow:void 0),me=E.useRef(null),Te=E.useRef(!1),ge=y==="plan",de=q=>{D(),se("chat_mode_changed",{from_mode:q,to_mode:"default",source:"pill_dismiss"}),A("default")};E.useEffect(()=>{const q=he=>{gn(he)&&he.code==="KeyL"&&(he.preventDefault(),he.shiftKey&&A(y==="plan"?"default":"plan"),me.current?.focus())};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[y,A]);const xe=Bn(a),fe=[...a].reverse().find(q=>q.role==="assistant"&&q.metadata?.usage)?.metadata?.usage?.contextTokens??0,ve=$e("chat"),De=Vo(),[Re,_e]=E.useState(!1),[be,Se]=E.useState(!1),re=!m&&!An(W),ae=ta({hasDraft:re,isStreaming:l,isRunInProgress:c}),Me=ae==="send",Ae=ae==="stop",ht=q=>{if(q?.preventDefault(),!ve){_e(!0);return}if(De){Se(!0);return}if(ae==="send"&&W){if(se("chat_message_sent",{thread_id:u||null,mode:y,model_id:f?.modelId??null,model_provider:f?.providerId??null,virtual_mcp_id:h?.id??null,submission:q?"button_or_enter":"programmatic"}),r){if(r.isSendInFlight()){Ue.info(n("chat.input.stillSendingPreviousMessage"));return}r.sendMessage(W)}else C&&se("task_report_submitted",{source:"home"}),p({tiptapDoc:W,virtualMcp:C?null:h,taskIntake:C});yn(sessionStorage,w,V),Ve(void 0)}else ae==="stop"&&(se("chat_message_stopped",{thread_id:u}),d())};if(B)return o.jsx(qe,{message:X?n("chat.input.readOnlyOthersChatNamed",{name:X}):n("chat.input.readOnlyOthersChat"),icon:X?o.jsx(Oo,{shape:"circle",size:"2xs",url:Z?.user?.image??void 0,fallback:X.slice(0,2).toUpperCase()}):void 0});if(oe?.metadata?.read_only)return o.jsx(qe,{message:n("chat.input.readOnlyThread")});if(ue)return o.jsx(qe,{message:n("chat.input.codingAgentUnavailable")});if(U){if(!i)return o.jsx(qe,{message:n("chat.input.fastPreviewUnavailable")});const q=()=>{const he=i.createTask({runtime:"sandbox"});se("coding_session_started",{thread_id:he})};return o.jsxs("button",{type:"button",onClick:q,className:"group flex w-full items-center gap-3 rounded-2xl border border-border bg-background/60 px-4 py-3.5 text-left shadow-sm backdrop-blur-sm transition-colors hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[o.jsx(Yn,{size:18,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("chat.fastPreview.startCodingSession")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:n("chat.fastPreview.chatNeedsSession")})]}),o.jsx(Bt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return o.jsxs(o.Fragment,{children:[Re&&o.jsx(wt,{feature:"chat",onDismiss:()=>_e(!1)}),be&&o.jsx(wt,{feature:"chat",copy:{title:n("chat.input.allowanceExhaustedTitle")},onDismiss:()=>Se(!1)}),o.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:o.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&o.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),r&&i&&o.jsx(Be,{}),r&&i&&u?o.jsx(bs,{taskId:u}):null,o.jsx(Mo,{tiptapDoc:W,setTiptapDoc:Ve,disabled:L.status==="recording",enterToSubmit:!0,placeholder:n(C?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:ht,suggestionOpenRef:Te,children:o.jsxs("form",{onSubmit:ht,className:$("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[o.jsx(ia,{selectedModel:f,onUnsupportedFile:Q,disabled:L.status==="recording"}),o.jsx(ur,{}),o.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:o.jsx(Do,{ref:me,disabled:L.status==="recording",virtualMcpId:h?.id??M,showFileUploader:!0,selectedModel:f,onUnsupportedFile:Q,suggestionOpenRef:Te})}),o.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:L.status==="recording"?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex-1"}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o.jsx(Oi,{data:L.waveformData.slice(0,28)}),o.jsx("button",{type:"button",onClick:H,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":n("chat.input.cancelRecording"),children:o.jsx(it,{size:16})}),o.jsx("button",{type:"button",onClick:te,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":n("chat.input.useTranscription"),children:o.jsx(lt,{size:16})})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s&&o.jsx(G,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>I(!N),className:"h-8",children:n("chat.input.taskMode")}),o.jsx(Mi,{disabled:!1,onOpenConnections:()=>{se("connections_dialog_opened",{source:"tools_popover",mode:"add"}),F(!0)},virtualMcpId:h?.id??M,selectedModel:f,isStreaming:l,onUnsupportedFile:Q}),ge&&o.jsx(Qe,{onClick:()=>de("plan"),label:n("chat.input.planMode"),icon:o.jsx(qt,{size:14,className:"shrink-0"}),colorClass:"text-violet-600 dark:text-violet-400 hover:bg-violet-500/10",maxWidthClass:"@[320px]/chat-bottom:max-w-32"}),y==="gen-image"&&x&&o.jsx(Qe,{onClick:()=>de("gen-image"),label:n("chat.input.createImage"),icon:o.jsx(Ht,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),y==="web-search"&&v&&o.jsx(Qe,{onClick:()=>de("web-search"),label:n("chat.input.webSearch"),icon:o.jsx(Wt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),y==="deep-research"&&b&&o.jsx(Qe,{onClick:()=>de("deep-research"),label:n("chat.input.deepResearch"),icon:o.jsx(Gt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),Ke&&fe>0&&o.jsx(cn,{usage:xe,totalTokens:fe,contextWindow:Ke,onOpenContextPanel:t})]}),o.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[o.jsx(wi,{}),o.jsx(Xi,{}),L.isSupported&&o.jsx(G,{type:"button",onClick:ee,disabled:!1,variant:"ghost",size:"icon",className:$("size-8 transition-colors",L.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:L.status==="permission-denied"?n("chat.input.microphoneAccessDenied"):n("chat.input.voiceInput"),"aria-label":L.status==="permission-denied"?n("chat.input.microphoneAccessDenied"):n("chat.input.voiceInput"),children:o.jsx(Gn,{size:18})}),o.jsx(G,{type:Ae?"button":"submit",onClick:q=>{Ae&&(q.preventDefault(),q.stopPropagation(),d())},variant:Me||Ae?"default":"ghost",size:C?"sm":"icon",disabled:!Me&&!Ae,className:$(C?"h-8 px-3 transition-all":"size-8 transition-all",!Me&&!Ae&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:n(ae==="stop"?l?"chat.input.stopGenerating":"chat.input.cancelRun":C?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":n(ae==="stop"?l?"chat.input.stopGenerating":"chat.input.cancelRun":C?"chat.input.startTask":"chat.input.sendMessage"),children:Ae?o.jsx(Wn,{size:20}):o.jsxs(o.Fragment,{children:[C&&n("chat.input.startTask"),o.jsx(Kt,{size:20})]})})]})]})})]})},u),s&&C&&o.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:n("chat.input.taskHint")}),e&&o.jsx(Pi,{onClick:()=>{se("connections_banner_clicked",{source:"home_chat_input"}),se("connections_dialog_opened",{source:"home_banner",mode:"add"}),F(!0)}})]})}),o.jsx(Bo,{mode:"browse",open:T,onOpenChange:F,defaultTab:"all"}),o.jsx(Ro,{info:z,onClose:O})]})}export{ul as C,ll as H,Jr as T,pl as V,Jo as a,dl as b,fl as c,Xr as d,Vl as e,Le as f,cl as g,ci as s,ws as u};
|