decocms 4.450.0 → 4.451.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CfHvNlgZ.js → AlertCircle-DDHQi3fm.js} +1 -1
- package/dist/client/assets/{AreaChart-DgRgPjRl.js → AreaChart-xcCkJdeX.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Bj2Vh3jF.js → ArrowLeft-CIsJnvjF.js} +1 -1
- package/dist/client/assets/{ArrowUp-BDwJ6lSJ.js → ArrowUp-CtvQk6Vg.js} +1 -1
- package/dist/client/assets/{Building02-Bqa8ze-O.js → Building02-BVSXudo-.js} +1 -1
- package/dist/client/assets/{CartesianChart-C-1Ljn_q.js → CartesianChart-YXdY8HHd.js} +1 -1
- package/dist/client/assets/{Check-COzQ04E7.js → Check-Cf-cMW3t.js} +1 -1
- package/dist/client/assets/{CheckCircle-Vb-xyxhE.js → CheckCircle-BemNEpVg.js} +1 -1
- package/dist/client/assets/{ChevronUp-RdnkaZaK.js → ChevronUp-B79uJeZN.js} +1 -1
- package/dist/client/assets/{Copy01-DJrDIAgF.js → Copy01-DluK-JtU.js} +1 -1
- package/dist/client/assets/{CreditCard01-N4OPgVDg.js → CreditCard01-BzBUMTax.js} +1 -1
- package/dist/client/assets/{DotsVertical-D5rr2YQm.js → DotsVertical-COzw8ydu.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-BzHJmc6J.js → ErrorBarContext-CICGscAV.js} +1 -1
- package/dist/client/assets/{Image01-Ccx9C_Rg.js → Image01-DnRAAkhy.js} +1 -1
- package/dist/client/assets/{Key01-B1Y8yy7Z.js → Key01-DXvy1NNO.js} +1 -1
- package/dist/client/assets/{Line-CDHGyXU2.js → Line-DooN19Jn.js} +1 -1
- package/dist/client/assets/{Link01-Bh_PC3dO.js → Link01-iwXPIeVc.js} +1 -1
- package/dist/client/assets/{LinkBroken01-xKKRxXlY.js → LinkBroken01-ChSpe7Cq.js} +1 -1
- package/dist/client/assets/{LinkExternal01-mH0kFM32.js → LinkExternal01-BVDnNs6j.js} +1 -1
- package/dist/client/assets/{Monitor01-PBPlMgWr.js → Monitor01-BLZH5esy.js} +1 -1
- package/dist/client/assets/{Palette-KCM9-De7.js → Palette-CaKXG6S_.js} +1 -1
- package/dist/client/assets/{Plus-HBSdQYLn.js → Plus-DjsQQqpw.js} +1 -1
- package/dist/client/assets/{SearchMd-BBjcQIvr.js → SearchMd-oXON6Mge.js} +1 -1
- package/dist/client/assets/{Sector-BGpLXB4C.js → Sector-Df4GIa0t.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-CdLvneJ1.js → ShoppingBag01-DktiI11o.js} +1 -1
- package/dist/client/assets/{Sun-BpeW1MoX.js → Sun-BWosC3Su.js} +1 -1
- package/dist/client/assets/{Tool01-Dz-lp6mO.js → Tool01-BchdJG2X.js} +1 -1
- package/dist/client/assets/{Trash01-C7BGYPNB.js → Trash01-BfnCKCGB.js} +1 -1
- package/dist/client/assets/{Upload01-Crj-EmOO.js → Upload01-CNtxqXvb.js} +1 -1
- package/dist/client/assets/{User01-COdLotsN.js → User01-DXNh3TnB.js} +1 -1
- package/dist/client/assets/{UserSquare-BZc1G4LK.js → UserSquare-DZJwwd71.js} +1 -1
- package/dist/client/assets/{Users01-6Yj_4D_n.js → Users01-DAfCqIN7.js} +1 -1
- package/dist/client/assets/{X-BpUF7FNJ.js → X-C52mq3mn.js} +1 -1
- package/dist/client/assets/{XAxis-DHX42RQV.js → XAxis-DgLHWAdH.js} +1 -1
- package/dist/client/assets/{XClose-CYHY5GcG.js → XClose-BqRoe3QG.js} +1 -1
- package/dist/client/assets/{ZoomOut-BvLQLuGR.js → ZoomOut-BlDSjKri.js} +1 -1
- package/dist/client/assets/{access-gate-m2qtNNPd.js → access-gate-DbBQLMiF.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BKu4JrTL.js → add-connection-dialog-Bll7Vib1.js} +1 -1
- package/dist/client/assets/{agent-analytics-vEDyxY7n.js → agent-analytics-DRKGLO_x.js} +1 -1
- package/dist/client/assets/agent-app-DI84JCkP.js +1 -0
- package/dist/client/assets/{agent-assets-DPX4xJR-.js → agent-assets-D9BHI5EW.js} +1 -1
- package/dist/client/assets/{agent-automation-q5wiAOx3.js → agent-automation-ClR5yW20.js} +1 -1
- package/dist/client/assets/{agent-automations-CLGqAcAP.js → agent-automations-CCiWhcgf.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-D9DCAQIR.js → agent-connect-sources-DFTkcmVS.js} +1 -1
- package/dist/client/assets/agent-deck-CgsUwnay.js +1 -0
- package/dist/client/assets/{agent-e2e-DGk0x04T.js → agent-e2e-pbVC7Vx7.js} +1 -1
- package/dist/client/assets/{agent-experiments-D65zJ4jN.js → agent-experiments-_aODOZpq.js} +1 -1
- package/dist/client/assets/{agent-file-B9SJnbYJ.js → agent-file-DtN8kaxY.js} +1 -1
- package/dist/client/assets/{agent-git-CJxYwcoX.js → agent-git-BCddyL27.js} +1 -1
- package/dist/client/assets/{agent-hosting-UMq8FCPI.js → agent-hosting-CgLWSfX9.js} +1 -1
- package/dist/client/assets/agent-icon-DEoEcQYL.js +1 -0
- package/dist/client/assets/agent-library-BMVOMtwg.js +1 -0
- package/dist/client/assets/agent-library-file-Bs_Ov692.js +1 -0
- package/dist/client/assets/{agent-monitor-Dy_K0ub4.js → agent-monitor-YUBiIydT.js} +1 -1
- package/dist/client/assets/{agent-overview-DgMmZowY.js → agent-overview-HCAO8obL.js} +1 -1
- package/dist/client/assets/agent-settings-JOvgc7kq.js +1 -0
- package/dist/client/assets/{agent-site-editor-C76UAYYm.js → agent-site-editor-DH5igdCT.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-De-iSok_.js +2 -0
- package/dist/client/assets/agent-site-editor-content-Ch2WC4sl.js +9 -0
- package/dist/client/assets/{agent-site-editor-preview-uCP-Axlu.js → agent-site-editor-preview-BBSy8s7P.js} +3 -3
- package/dist/client/assets/agent-view-BtBtSuEv.js +1 -0
- package/dist/client/assets/{agent-view-guard-Dz25zh4B.js → agent-view-guard-BYimT8Jz.js} +1 -1
- package/dist/client/assets/{agents-list-C7koOCD-.js → agents-list-C434Mp2b.js} +1 -1
- package/dist/client/assets/{ai-providers-mt2APKAD.js → ai-providers-DINDBcoG.js} +1 -1
- package/dist/client/assets/{alert-DTtquKm0.js → alert-_Nu0OQ4m.js} +1 -1
- package/dist/client/assets/{alert-dialog-BZP1AD0I.js → alert-dialog-D9wz_Poi.js} +1 -1
- package/dist/client/assets/{analytics-sections-BCXDounI.js → analytics-sections-_zTIyETq.js} +1 -1
- package/dist/client/assets/api-keys-2hDzDTH9.js +1 -0
- package/dist/client/assets/{api-keys-gXBnRr4Q.js → api-keys-tqQH4z9A.js} +1 -1
- package/dist/client/assets/app-editor-BqD9kpqg.js +1 -0
- package/dist/client/assets/{asset-utils-BciMW5G_.js → asset-utils-WUpNFBXm.js} +1 -1
- package/dist/client/assets/{auth-C1mOz7Cp.js → auth-DDdLUET9.js} +1 -1
- package/dist/client/assets/{auth-catchall-D1QDLQSo.js → auth-catchall-mR81Birw.js} +1 -1
- package/dist/client/assets/{auth-entry-CD9pgR2t.js → auth-entry-DCUAgWIX.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DTpd8fsO.js → auth-split-layout-FX4F99rm.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-jKlCQsjO.js → authenticate-and-persist-oauth-Bb2l090x.js} +1 -1
- package/dist/client/assets/{automation-list-row-CbqCS8l-.js → automation-list-row-SxUdqZJz.js} +1 -1
- package/dist/client/assets/{automation-runs-Dl3yx598.js → automation-runs-Cw-2J5pa.js} +1 -1
- package/dist/client/assets/{automations-BZBJG0Qn.js → automations-DXUfchhU.js} +1 -1
- package/dist/client/assets/{autosend-BiJfUQUT.js → autosend-CeDtnxlk.js} +1 -1
- package/dist/client/assets/{avatar-BIv_2mLm.js → avatar-BeFEVdWT.js} +1 -1
- package/dist/client/assets/{badge-lEq6LpEb.js → badge-Dw0XHZAq.js} +1 -1
- package/dist/client/assets/block-document-HhERskFc.js +3 -0
- package/dist/client/assets/{blocks-preview-workspace-context-DANrcxW4.js → blocks-preview-workspace-context-BqdqlnAP.js} +1 -1
- package/dist/client/assets/{blog-schema-CyOQeZHl.js → blog-schema-Bzw5lTdw.js} +1 -1
- package/dist/client/assets/{buckets-BqkRKuz-.js → buckets-C_vclPuO.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CbZ5gHs3.js → build-improve-prompt-doc-DG46Mbz-.js} +1 -1
- package/dist/client/assets/{calendar-DV2ELhqc.js → calendar-BGvJ_APz.js} +1 -1
- package/dist/client/assets/{capability-load-error-khp8kp3N.js → capability-load-error-m8D5eiRW.js} +1 -1
- package/dist/client/assets/category-editor-BoAaFme1.js +1 -0
- package/dist/client/assets/{chart-DZlYelqd.js → chart-AQf5J0lZ.js} +1 -1
- package/dist/client/assets/{chat-context-CuWiXF8M.js → chat-context-DHGUafJ4.js} +1 -1
- package/dist/client/assets/{chat-draft-MjQajd4b.js → chat-draft-Du6X8nKJ.js} +1 -1
- package/dist/client/assets/{checkbox-69BFI5HM.js → checkbox-D-g_vU3W.js} +1 -1
- package/dist/client/assets/{choose-editor-DOkI-i_1.js → choose-editor-DJMezn9k.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-DW6T-00N.js → claim-phase-copy-BTrkr4bY.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Oels3F-J.js → cli-auth-success-M_9Lwmu5.js} +1 -1
- package/dist/client/assets/{client-icons-BhwVxJqX.js → client-icons-Do1roBGh.js} +1 -1
- package/dist/client/assets/{collapsible-BMQj5Dup.js → collapsible-DUefED3P.js} +1 -1
- package/dist/client/assets/{collection-detail--UMVDw_e.js → collection-detail-CuQUNXH_.js} +1 -1
- package/dist/client/assets/{collection-display-button-A4mEJyub.js → collection-display-button-CMHxbURQ.js} +1 -1
- package/dist/client/assets/{collection-search-DUZsfox8.js → collection-search-CKxipBbw.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CJyPG0PT.js → collection-table-wrapper-CN227TJm.js} +1 -1
- package/dist/client/assets/{collection-tabs-BYPXCgXS.js → collection-tabs-z-VIWVMA.js} +1 -1
- package/dist/client/assets/{column-rules-Cmy6j5D_.js → column-rules-BOkclOCh.js} +1 -1
- package/dist/client/assets/{combobox-BfrybbG7.js → combobox-D_pkyBdU.js} +1 -1
- package/dist/client/assets/{command-BzdiaYU5.js → command-B-LkMxT6.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BaryY-2L.js → companion-mcps-section-BPWHNlmG.js} +1 -1
- package/dist/client/assets/{config-U1gvv_50.js → config-F8FEDZHV.js} +1 -1
- package/dist/client/assets/{connect-CheBVLEk.js → connect-CSAnQalo.js} +1 -1
- package/dist/client/assets/{connect-layout-CGfoXglM.js → connect-layout-CSKeZ95g.js} +1 -1
- package/dist/client/assets/{connection-Byk90CG2.js → connection-Da57b2wi.js} +1 -1
- package/dist/client/assets/{connection-card-CdUGcyiA.js → connection-card-UvAhqwBj.js} +1 -1
- package/dist/client/assets/{connection-detail-DVhGbJ_P.js → connection-detail-C-Hcx_Z9.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CIUjUhAv.js → connection-form-helpers-DyaTkO-i.js} +1 -1
- package/dist/client/assets/{connections-D7nPZ_WD.js → connections-B2s4aP98.js} +1 -1
- package/dist/client/assets/context-BPEjFj2c.js +1 -0
- package/dist/client/assets/{context-menu-n5XAPSQR.js → context-menu-D65fsibc.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Bt3iiYSK.js → create-organization-dialog-rmBJe-TK.js} +1 -1
- package/dist/client/assets/{daily-pulse-DRfCbhaG.js → daily-pulse-39bOcAjW.js} +1 -1
- package/dist/client/assets/{decopilot-Djx80CTZ.js → decopilot-CDg-MCtI.js} +1 -1
- package/dist/client/assets/{device-hint-DIcIjg5e.js → device-hint-BckoyQwI.js} +1 -1
- package/dist/client/assets/{dialog-BK1Ueu93.js → dialog-C9YQM7Rb.js} +1 -1
- package/dist/client/assets/{discover-CjiCng93.js → discover-B4mPS-t0.js} +1 -1
- package/dist/client/assets/{domain-settings-BqejR8AT.js → domain-settings-C5SxoG2E.js} +1 -1
- package/dist/client/assets/{download-app-dialog-wOlBcsxc.js → download-app-dialog-D3HwAGf1.js} +1 -1
- package/dist/client/assets/{drawer-u-W4g_nO.js → drawer-BbtvDSmI.js} +1 -1
- package/dist/client/assets/{editor-DOIu8213.js → editor-DiFPb_7W.js} +1 -1
- package/dist/client/assets/{empty-state-CwuzKy1b.js → empty-state-ChIdoRAZ.js} +1 -1
- package/dist/client/assets/{empty-state-B5HnsrMX.js → empty-state-Jq3vDmCi.js} +1 -1
- package/dist/client/assets/{extract-connection-data-lBq634kY.js → extract-connection-data-0OXYM8zm.js} +1 -1
- package/dist/client/assets/{feature-gate-C451yaSo.js → feature-gate-DyX-49Cz.js} +1 -1
- package/dist/client/assets/{feature-paywall-Ly3_RQ_p.js → feature-paywall-CMm2o9Ho.js} +1 -1
- package/dist/client/assets/{file-explorer-BGyklvkh.js → file-explorer-BsD7GHt-.js} +1 -1
- package/dist/client/assets/{file-preview-B2Gly7zq.js → file-preview-DG7_swxk.js} +1 -1
- package/dist/client/assets/{file-share-button-CUSzS93g.js → file-share-button-d423tG-P.js} +2 -2
- package/dist/client/assets/{file-type-icon-Ib_JQuvQ.js → file-type-icon-Zo3jfkM-.js} +1 -1
- package/dist/client/assets/flat-project-DUdVe5OD.js +1 -0
- package/dist/client/assets/{folder-icon-tWiqYLYb.js → folder-icon-DrGtPSK9.js} +1 -1
- package/dist/client/assets/{form-nYJgRjCD.js → form-CYA-1Wz9.js} +1 -1
- package/dist/client/assets/{gateway-client-BpCG924q.js → gateway-client-DE4QITdV.js} +1 -1
- package/dist/client/assets/general-C_08074W.js +1 -0
- package/dist/client/assets/{home-CmbO8MKm.js → home-HCpI5IEw.js} +1 -1
- package/dist/client/assets/{icon-button-D4H5x94G.js → icon-button-Cag62vyF.js} +1 -1
- package/dist/client/assets/{index-hVDNPnIj.js → index-BGzd8qMa.js} +1 -1
- package/dist/client/assets/{index-Creb5Fal.js → index-BiuSAlzd.js} +6 -6
- package/dist/client/assets/{index-YPpUZW2G.js → index-BxwNVsQv.js} +1 -1
- package/dist/client/assets/{index-CzSdBX-p.js → index-C-HKqiI5.js} +1 -1
- package/dist/client/assets/{index-BEAvsXWJ.js → index-C9yvlucI.js} +1 -1
- package/dist/client/assets/{index-CYQqV4oD.js → index-CFxmc0DR.js} +1 -1
- package/dist/client/assets/{index-D3Sn56HF.js → index-D3bKcVsq.js} +1 -1
- package/dist/client/assets/{index-BAnyMtCQ.js → index-DBg3Da4o.js} +1 -1
- package/dist/client/assets/{index-CGgVIw_7.js → index-DX971x0F.js} +1 -1
- package/dist/client/assets/{index-DxddTk14.js → index-Dm3Ro6iT.js} +1 -1
- package/dist/client/assets/{index-BWmIYoGl.js → index-DzWyHXO2.js} +1 -1
- package/dist/client/assets/{index-DpRTJH-I.js → index-LffHYdj2.js} +1 -1
- package/dist/client/assets/{index-C2J0aGyP.js → index-UAWA_mBS.js} +1 -1
- package/dist/client/assets/{index-DrzDi7N3.js → index-cj3FPIlo.js} +1 -1
- package/dist/client/assets/{index-Do0LZXCE.js → index-qFmYqkwW.js} +3 -3
- package/dist/client/assets/{index-redirect-BhVNihb9.js → index-redirect-Cms0d9Rf.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D3SNQDlh.js → infiniteQueryObserver-B7-m24Hr.js} +1 -1
- package/dist/client/assets/{infra-billing-DwoAbG-N.js → infra-billing-BD4W3COQ.js} +1 -1
- package/dist/client/assets/{input-BKlAoViI.js → input-B5d33h6X.js} +1 -1
- package/dist/client/assets/{input-Bv8cV8cl.js → input-CYlwvkm5.js} +7 -7
- package/dist/client/assets/{input-B4_sU5tp.js → input-CpjWxr53.js} +1 -1
- package/dist/client/assets/{integration-icon-DhFk0v8h.js → integration-icon-BcFb9WXn.js} +1 -1
- package/dist/client/assets/{label-ycBnzzff.js → label-BmSaj4OS.js} +1 -1
- package/dist/client/assets/{layout-DmY5YpEN.js → layout-DKTnWTMe.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CIaqC-AF.js → legacy-agents-deep-CbFqRQlc.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Bgp7nu2i.js → legacy-main-redirect-1k1KX6mL.js} +1 -1
- package/dist/client/assets/library-D9RnFFGm.js +1 -0
- package/dist/client/assets/{library-tab-CBapuFEX.js → library-tab-rskkU2DA.js} +1 -1
- package/dist/client/assets/{login-BKGtEguK.js → login-BUVWJTBG.js} +1 -1
- package/dist/client/assets/{markdown-C0crjplB.js → markdown-D5RcIxaz.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-weTyRI6G.js → mcp-app-renderer-4bTrB0jF.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DvzBEl8t.js → mcp-oauth-C-EEuNZg.js} +1 -1
- package/dist/client/assets/{members-D6M8al4X.js → members-CWz-dF_G.js} +1 -1
- package/dist/client/assets/{memory-DUEsb2C1.js → memory-BfINHUTl.js} +1 -1
- package/dist/client/assets/{message-templates-80H103Z6.js → message-templates-Cq847r4U.js} +1 -1
- package/dist/client/assets/{mini-report-page-BmNfvJlO.js → mini-report-page-BxFxCQ_x.js} +1 -1
- package/dist/client/assets/{mock-board-CZK2Cvo3.js → mock-board-BFAIWkA7.js} +1 -1
- package/dist/client/assets/{monaco-editor-C-S-8OC6.js → monaco-editor-DrtzucP0.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-IwAbB8u9.js → monitoring-stats-row-DWbeH1RS.js} +1 -1
- package/dist/client/assets/{multi-select-y9FwQ-dm.js → multi-select-BidbKgY6.js} +1 -1
- package/dist/client/assets/{mustache-Ag809o1A.js → mustache-Dy9IxQRw.js} +1 -1
- package/dist/client/assets/{new-project-dialog-DrxiqG-Y.js → new-project-dialog-Dj5TFcCk.js} +1 -1
- package/dist/client/assets/{oauth-callback-DWtAAf7G.js → oauth-callback-Diqg-5tw.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-NQ8LdX-a.js → oauth-callback-ai-provider-DdjEQJSy.js} +1 -1
- package/dist/client/assets/{onboarding-BRFoKzMG.js → onboarding-BiJRVogp.js} +1 -1
- package/dist/client/assets/{openai-conversation-BHudNimx.js → openai-conversation-Cssz-znB.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DS6iax6c.js → optimistic-project-sidebar-views-Bl6nsH4A.js} +1 -1
- package/dist/client/assets/{org-file-open-context-BWYWVr6j.js → org-file-open-context-CTyFwctz.js} +1 -1
- package/dist/client/assets/{organization-choice-ColOG4Qs.js → organization-choice-BtNQMYzV.js} +1 -1
- package/dist/client/assets/{orgs-DN46iPbm.js → orgs-BYnZJx1z.js} +1 -1
- package/dist/client/assets/{page-seo-form-bx7wNVcF.js → page-seo-form-RJHH5jjR.js} +1 -1
- package/dist/client/assets/{pair-BbS6p0iS.js → pair-PmQIQCBI.js} +7 -7
- package/dist/client/assets/{plan-ladder-RwyJdG4c.js → plan-ladder-BbGn-NgZ.js} +1 -1
- package/dist/client/assets/{popover-Dvqj57GQ.js → popover-DwQhmYZx.js} +1 -1
- package/dist/client/assets/{post-calendar-BLOA3EdX.js → post-calendar-u9yIz1ap.js} +1 -1
- package/dist/client/assets/post-editor-zwUoRB_d.js +2 -0
- package/dist/client/assets/{preview-content-CT0ZeYI2.js → preview-content-YklxPrDD.js} +1 -1
- package/dist/client/assets/{preview-dialog-C06uRVP1.js → preview-dialog-B6-Ghng-.js} +1 -1
- package/dist/client/assets/{profile-C1YrKzza.js → profile-DZ3TYytY.js} +1 -1
- package/dist/client/assets/{project-app-view-CvhGuyEm.js → project-app-view-B13_tHdE.js} +1 -1
- package/dist/client/assets/{project-feed-Lrn2Vx6v.js → project-feed-CuWJElvp.js} +1 -1
- package/dist/client/assets/{project-icon-DYsLOXub.js → project-icon-C1TVO88N.js} +1 -1
- package/dist/client/assets/project-reports-hbeMiS7q.js +1 -0
- package/dist/client/assets/project-tasks-DcinQO1a.js +1 -0
- package/dist/client/assets/{projects-empty-state-lPWjupMn.js → projects-empty-state-BBcr5xLl.js} +1 -1
- package/dist/client/assets/{projects-9bg9EGUj.js → projects-qlg8VwGy.js} +1 -1
- package/dist/client/assets/{prompts-Ci7eVBQ_.js → prompts-IW4xrems.js} +1 -1
- package/dist/client/assets/record-editor-DZiiw2X4.js +1 -0
- package/dist/client/assets/{redirect-editor-dVA7hSbo.js → redirect-editor-Djr6TkEe.js} +1 -1
- package/dist/client/assets/{reports-DMyC7KyA.js → reports-DD_aD-uv.js} +1 -1
- package/dist/client/assets/reports-RkncIczX.js +1 -0
- package/dist/client/assets/{reports-onboarding-DPM59fnB.js → reports-onboarding-Btv0f8sO.js} +1 -1
- package/dist/client/assets/{reports-tab-8zKvNIEo.js → reports-tab-DoBMpRJD.js} +2 -2
- package/dist/client/assets/{repositories-DU6E4aSI.js → repositories-ZgvcUEvA.js} +1 -1
- package/dist/client/assets/{repository-binding-BDRDBDUT.js → repository-binding-CQsr_3Zk.js} +1 -1
- package/dist/client/assets/{repository-import-picker-COhtx-GU.js → repository-import-picker-D6vKdpbU.js} +1 -1
- package/dist/client/assets/{repository-picker-CsXpKrPD.js → repository-picker-DnfKLU2E.js} +1 -1
- package/dist/client/assets/{require-capability-r3Xn3m_O.js → require-capability-B1clucXi.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CPsT8IBO.js → required-auth-layout-5x9XYN7k.js} +1 -1
- package/dist/client/assets/{reset-password-BCbbqzqA.js → reset-password-JId6yrpe.js} +1 -1
- package/dist/client/assets/{resizable-xF5MDTwK.js → resizable-00FuDjCF.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-Bi-w5DjE.js +1 -0
- package/dist/client/assets/review-settings-IzuHTtkG.js +1 -0
- package/dist/client/assets/{rich-text-link-control-CY5lmcbW.js → rich-text-link-control-B3wmUrSm.js} +1 -1
- package/dist/client/assets/{roles-COXgTHD9.js → roles-6EAMaiCw.js} +1 -1
- package/dist/client/assets/{route-DsmAMRjH.js → route-Bp7poLJJ.js} +1 -1
- package/dist/client/assets/route-DLd5XMus.js +1 -0
- package/dist/client/assets/{route-DgJH5qOb.js → route-DcKDacvo.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-Bq48XkmP.js → runnable-block-editor-BPu9lbHb.js} +2 -2
- package/dist/client/assets/{sandbox-lifecycle-context-BDzjYF6X.js → sandbox-lifecycle-context-_l6ILxBR.js} +1 -1
- package/dist/client/assets/{schema-DsftfWql.js → schema-CepQKFSq.js} +1 -1
- package/dist/client/assets/{scroll-area-CuhYBrVG.js → scroll-area-BNMPUKzn.js} +1 -1
- package/dist/client/assets/{search-input-DO4RsgDo.js → search-input-DroJjkYC.js} +1 -1
- package/dist/client/assets/{search-toggle-BJ6mBMxB.js → search-toggle-Vpxqce5X.js} +1 -1
- package/dist/client/assets/{secret-picker-B9q4BUYJ.js → secret-picker-CIV9Pyxx.js} +1 -1
- package/dist/client/assets/{secrets-CePkYXXO.js → secrets-Ddw-OUj-.js} +1 -1
- package/dist/client/assets/{sections-editor-Df3gUxs6.js → sections-editor-B6DapFds.js} +1 -1
- package/dist/client/assets/{select-DUxatCDi.js → select-QknS4jya.js} +1 -1
- package/dist/client/assets/{select-model-hxt2hW5D.js → select-model-MWiJU5BO.js} +1 -1
- package/dist/client/assets/{seo-editor-Du7ojpzS.js → seo-editor-BmySIXEZ.js} +1 -1
- package/dist/client/assets/{separator-BzaLX8fd.js → separator-C5QeX-ze.js} +1 -1
- package/dist/client/assets/{settings-tab-DqEufUIw.js → settings-tab-pWdRgoZd.js} +1 -1
- package/dist/client/assets/{sheet-Dsh1DGgw.js → sheet-CuQcjl8J.js} +1 -1
- package/dist/client/assets/{shell-layout-DrF9YflL.js → shell-layout-DgCL-aOA.js} +1 -1
- package/dist/client/assets/{skills-oZ0qPKOl.js → skills-C9HRCrz7.js} +1 -1
- package/dist/client/assets/{sso-D9V8xm1h.js → sso-eRxfAwx6.js} +1 -1
- package/dist/client/assets/{suggestion-C-WgKXgU.js → suggestion-CUAhSpKi.js} +1 -1
- package/dist/client/assets/{switch-Dm6uUVFL.js → switch-WI6sluFx.js} +1 -1
- package/dist/client/assets/{synced-repos-CYW9TGNF.js → synced-repos-B7M4g-ab.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BqlyD9jL.js → tab-icon-glyph-BUy8eStz.js} +1 -1
- package/dist/client/assets/{table-BbevayqW.js → table-DahiKrUr.js} +1 -1
- package/dist/client/assets/{tabs-8CMAf1uG.js → tabs-mZ2AJpie.js} +1 -1
- package/dist/client/assets/{task-board-DXD3aKXi.js → task-board-Cg5OuTdd.js} +1 -1
- package/dist/client/assets/{task-route-doPf8uSw.js → task-route-CcdO9T8s.js} +1 -1
- package/dist/client/assets/{task-status-B0dcE5iY.js → task-status--I5ZFulR.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CE1JeLhH.js → taskboard-analytics-CwIKc_CA.js} +1 -1
- package/dist/client/assets/{tasks-BvFkBNHM.js → tasks-Cx199_rB.js} +1 -1
- package/dist/client/assets/tasks-DQZjFSh-.js +1 -0
- package/dist/client/assets/{textarea-Cnw96_Vw.js → textarea-IAy-ownU.js} +1 -1
- package/dist/client/assets/{thread-analytics-BnQ-KERJ.js → thread-analytics-DoucYhij.js} +1 -1
- package/dist/client/assets/{thread-button-BRy_z3r1.js → thread-button-BS5hFLVf.js} +1 -1
- package/dist/client/assets/{thread-intent-BOEFGlMm.js → thread-intent-ags1XWir.js} +1 -1
- package/dist/client/assets/{thread-route-D6_2qU5y.js → thread-route-Cbe9daAp.js} +1 -1
- package/dist/client/assets/{thread-route-BtUAL8zM.js → thread-route-SwwHxRrN.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-C_UWi3rA.js → thread-sheet-body-BzLo18UG.js} +1 -1
- package/dist/client/assets/{toggle-group-DMrc-VEn.js → toggle-group-C7J6hm1X.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B_si7l6J.js → toolbar-icon-button-MH5hFCTi.js} +1 -1
- package/dist/client/assets/{tooltip-D_rDETL5.js → tooltip-rVl8jzih.js} +1 -1
- package/dist/client/assets/{track-CmsoJ4xI.js → track-D9Kj7slb.js} +1 -1
- package/dist/client/assets/{types-DNrbJSW6.js → types-B77htmoi.js} +1 -1
- package/dist/client/assets/{usage-stats-DtxeZ0P6.js → usage-stats-B9NCjY7p.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BY6SYGnL.js → use-ai-providers-BBj3hH0A.js} +1 -1
- package/dist/client/assets/{use-automations-BTGg3lrV.js → use-automations-BMeSuYUl.js} +1 -1
- package/dist/client/assets/{use-autosave-C09SWhxz.js → use-autosave-DddhIIlH.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-DtSzju1r.js → use-chat-layout-state-CcLE4xPO.js} +1 -1
- package/dist/client/assets/{use-clock-tick-B6RjlwGP.js → use-clock-tick-WbPH8S5J.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Md7gJVdj.js → use-connect-companion-ooa0I2Ht.js} +1 -1
- package/dist/client/assets/{use-connection-BdXCXco4.js → use-connection-BJVimXqv.js} +1 -1
- package/dist/client/assets/{use-copy-CGFZVF1O.js → use-copy-XLZP4Fnf.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BDx5KjcP.js → use-create-virtual-mcp-P_mw-sB2.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-xsNp9_jV.js → use-date-fns-locale-D1z6vY0T.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Bm10g-8R.js → use-debounced-autosave-DM7h6lLt.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BXmvwHes.js → use-debounced-value-PqnB6cMC.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BLsA0-D1.js → use-deco-credits-CWMvx_aN.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-xg-lzK_6.js → use-decopilot-events-B_Wj2FDs.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BE4Nj7DL.js → use-delete-connection-Ct_NbrFe.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CdfYikgx.js → use-deployment-admin-BrRZ5JXH.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-D5snqAgF.js → use-fast-preview-draft-url-Ckawo-Vn.js} +1 -1
- package/dist/client/assets/{use-file-configs-CeiMSMu5.js → use-file-configs-BCUJhrSS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CnGnDOhg.js → use-infinite-scroll-DOZLICG8.js} +1 -1
- package/dist/client/assets/{use-join-requests-BldvGxVz.js → use-join-requests-LL4W5sq2.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-C83ZnyG5.js → use-main-panel-tabs-CUdUAhvy.js} +1 -1
- package/dist/client/assets/use-mcp-auth-status-D_jLHFPt.js +1 -0
- package/dist/client/assets/{use-mcp-client-DrDmZDA7.js → use-mcp-client-5sJCC1_2.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-ORmr-8fB.js → use-mcp-prompts-5OccjpiV.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-YCPND0WQ.js → use-mcp-tools-cj_8qKci.js} +1 -1
- package/dist/client/assets/{use-members-DEXWsj1d.js → use-members-C5RWM84Q.js} +1 -1
- package/dist/client/assets/{use-mobile-CfSbfoft.js → use-mobile-D06E6E9A.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CPmL7r2a.js → use-navigate-to-agent-2D1RSJEE.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-DxwEKp1u.js +1 -0
- package/dist/client/assets/{use-open-billing-url-kzMhA6w7.js → use-open-billing-url-CrzuSkfk.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CkktJ4ju.js → use-org-auth-client-CXExidw4.js} +1 -1
- package/dist/client/assets/{use-org-fs-aJhRDDIA.js → use-org-fs-BI2aRf-g.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-hamxf4uc.js → use-org-repo-syncs-DhxRO-sX.js} +1 -1
- package/dist/client/assets/{use-org-sso-D5wnNfkO.js → use-org-sso-C8LeExfy.js} +1 -1
- package/dist/client/assets/{use-organization-roles-OHxv6X-a.js → use-organization-roles-Z4A7wlo_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B56H80YG.js → use-organization-settings-0Ql08vCb.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C7k_IWwP.js → use-panel-navigate-DvFfVppm.js} +1 -1
- package/dist/client/assets/{use-project-scope-D3SRaEYd.js → use-project-scope-DJC0Rmd2.js} +1 -1
- package/dist/client/assets/{use-releases-CpYl3ey_.js → use-releases-UqMY8RcZ.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CkrVtdqs.js → use-reports-diagnostic-zVwryKCp.js} +1 -1
- package/dist/client/assets/{use-secrets-Dcc9pXbR.js → use-secrets-DGDpC9hp.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Z24TKN0B.js → use-section-preview-base-DryOEAAN.js} +1 -1
- package/dist/client/assets/{use-session-runtime-DStZ5XGd.js → use-session-runtime-Cosw4CCW.js} +1 -1
- package/dist/client/assets/{use-tags-BaTcNvTV.js → use-tags-BCCzUzPa.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-B1pwJZX7.js → use-task-board-analytics-CCFQvvsk.js} +1 -1
- package/dist/client/assets/{use-task-board-events-oQbUK5D4.js → use-task-board-events-B2orELe0.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Dq3w9o1-.js → use-task-metadata-8O-Ga8Wr.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-Bit06zCt.js → use-thread-analytics-BYmN2LQm.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DMYaNXtN.js → use-thread-outputs-DqnIgfuG.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BAMBgsXo.js +1 -0
- package/dist/client/assets/{useQueries-Bm3vQaFd.js → useQueries-Cdt1TSyJ.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B_8hQc1u.js +1 -0
- package/dist/client/assets/{users-BHYuTTwT.js → users-BLEnjq5F.js} +1 -1
- package/dist/client/assets/{utils-Fw1u9QDx.js → utils-BiBoFq--.js} +1 -1
- package/dist/client/assets/{variant-calendar-DRKQ2B6v.js → variant-calendar-Csv8MReF.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-wHTtLSfq.js → variant-matcher-override-CdOGya1b.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BQZodl_Y.js → view-mode-toggle-D3nXTaNQ.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C2bpy2G-.js → virtual-mcp-DUyYKScq.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +14 -14
- package/dist/server/server.js +14 -14
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DnEVoEjI.js +0 -1
- package/dist/client/assets/agent-deck-BczWleOc.js +0 -1
- package/dist/client/assets/agent-icon-Cs5o_QD_.js +0 -1
- package/dist/client/assets/agent-library-D54-cgPN.js +0 -1
- package/dist/client/assets/agent-library-file-DeLY3SxR.js +0 -1
- package/dist/client/assets/agent-settings-BrnBZqdX.js +0 -1
- package/dist/client/assets/agent-site-editor-code-ClZXgoqS.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CPY5DcAt.js +0 -9
- package/dist/client/assets/agent-view-CB7GVVHY.js +0 -1
- package/dist/client/assets/api-keys-B0lfuxgV.js +0 -1
- package/dist/client/assets/app-editor-BeOyqqqi.js +0 -1
- package/dist/client/assets/block-document-9tqq3gtP.js +0 -3
- package/dist/client/assets/category-editor-BXpyvMT8.js +0 -1
- package/dist/client/assets/context-CrR6BY7f.js +0 -1
- package/dist/client/assets/flat-project-ehtY7lK6.js +0 -1
- package/dist/client/assets/general-CEwHM3rV.js +0 -1
- package/dist/client/assets/library-CN3vmNYC.js +0 -1
- package/dist/client/assets/post-editor-0k2icWwR.js +0 -2
- package/dist/client/assets/project-reports-Cxp5cndN.js +0 -1
- package/dist/client/assets/project-tasks-mGerfQed.js +0 -1
- package/dist/client/assets/record-editor-1_isDy55.js +0 -1
- package/dist/client/assets/reports-BhvXDkS0.js +0 -1
- package/dist/client/assets/resolve-tab-icon-BpT7YYoz.js +0 -1
- package/dist/client/assets/review-settings-bSzJA51j.js +0 -1
- package/dist/client/assets/route-CXaJOXis.js +0 -1
- package/dist/client/assets/tasks-xR3ybzsh.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-Du_TKL-p.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-Cc8wtKHo.js +0 -1
- package/dist/client/assets/useInfiniteQuery-S6GnLytU.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CrkH2XOR.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{r as R,c as E,b as U,j as a,ak as tt,l as K,X as ge,o as es,a2 as ts,e as ss,K as he,t as ze,m as dt,ab as ns,E as ls,h as as,B as He,aJ as ft,aa as os,ea as mt,s as rs,p as qe,d as We,d0 as is,d$ as cs,eb as us}from"./index-Creb5Fal.js";import{aQ as ds,aR as fs,aB as ms,R as ps,a as st,as as gs,h as xs,a2 as hs,aS as bs,aT as pt,aU as ys,q as De,aM as js,aL as vs,aV as gt,aW as xt,A as ht,aX as fe,X as Ns,b as Ss,F as ks,f as _s}from"./agent-icon-Cs5o_QD_.js";import{t as Ie,f as ws,c as Cs}from"./Tool01-Dz-lp6mO.js";import{i as bt}from"./LinkBroken01-xKKRxXlY.js";import{i as yt}from"./Check-COzQ04E7.js";import{a as Ts}from"./Copy01-DJrDIAgF.js";import{b as je,c as Ge,d as nt}from"./format-time-CjIPQhCN.js";import{b as Is,C as $s,a as As}from"./collapsible-BMQj5Dup.js";import{u as Ms}from"./use-copy-CGFZVF1O.js";import{a as jt,M as $e,b as Es}from"./usage-stats-DtxeZ0P6.js";import{v as Ls,u as Ps,x as Rs,y as zs}from"./thread-intent-BOEFGlMm.js";import{f as ve,r as Ds,u as Ne,v as Fs,a as Bs,w as Os,x as Us}from"./chat-context-CuWiXF8M.js";import{u as Ke}from"./use-clock-tick-B6RjlwGP.js";import{c as Hs}from"./content-blocks-o63cs2vh.js";import{M as qs}from"./mcp-app-renderer-weTyRI6G.js";import{g as vt}from"./types-DNrbJSW6.js";import{o as Ws}from"./omit-sandbox-map-jj4lCB2U.js";import{T as Nt,a as St,b as kt}from"./tooltip-D_rDETL5.js";import{c as Gs,u as _t}from"./use-mcp-client-DrDmZDA7.js";import{g as wt,s as Ct}from"./gateway-client-BpCG924q.js";import{s as Tt}from"./tool-namespace-DmnQIdtF.js";import{t as Ks,g as pe,u as be}from"./utils-CVEq3hMx.js";import{i as It}from"./AlertCircle-CfHvNlgZ.js";import{s as Vs,a as _e,n as Xs}from"./Image01-Ccx9C_Rg.js";import{s as Js}from"./XClose-CYHY5GcG.js";import{n as Fe}from"./ShoppingBag01-CdLvneJ1.js";import{i as Qs}from"./SearchMd-BBjcQIvr.js";import{a as Ys,d as Zs}from"./shell-layout-DrF9YflL.js";import{a as Ve}from"./use-panel-navigate-C7k_IWwP.js";import{c as $t}from"./use-decopilot-events-xg-lzK_6.js";import{I as en,M as At}from"./markdown-C0crjplB.js";import{n as Mt}from"./LinkExternal01-mH0kFM32.js";import{c as tn,S as sn,a as nn,b as ln}from"./sheet-Dsh1DGgw.js";import{I as Se}from"./integration-icon-DhFk0v8h.js";import{a as Et}from"./use-connection-BdXCXco4.js";import{a as me}from"./Palette-KCM9-De7.js";import{u as Lt}from"./use-navigate-to-agent-CPmL7r2a.js";import{i as we}from"./Link01-Bh_PC3dO.js";import{g as an}from"./use-mcp-prompts-ORmr-8fB.js";import{c as on,P as rn,u as cn,e as un,F as dn,s as fn,b as mn}from"./index-CGgVIw_7.js";import{i as pn}from"./Monitor01-PBPlMgWr.js";import{a as gn}from"./use-thread-outputs-DMYaNXtN.js";import{F as xn}from"./file-type-icon-Ib_JQuvQ.js";import{t as hn}from"./ChevronUp-RdnkaZaK.js";const bn={damping:.7,stiffness:.05,mass:1.25},yn=70,jn=1e3/60,vn=350;let Ae=!1;globalThis.document?.addEventListener("mousedown",()=>{Ae=!0});globalThis.document?.addEventListener("mouseup",()=>{Ae=!1});globalThis.document?.addEventListener("click",()=>{Ae=!1});const Nn=(s={})=>{const[e,t]=R.useState(!1),[l,n]=R.useState(s.initial!==!1),[c,u]=R.useState(!1),i=R.useRef(null);i.current=s;const r=R.useCallback(()=>{if(!Ae)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const k=b.getRangeAt(0);return k.commonAncestorContainer.contains(x.current)||x.current?.contains(k.commonAncestorContainer)},[]),o=R.useCallback(b=>{d.isAtBottom=b,n(b)},[]),m=R.useCallback(b=>{d.escapedFromLock=b,t(b)},[]),d=R.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:l,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return x.current?.scrollTop??0},set scrollTop(k){if(x.current){const{scrollBehavior:j}=getComputedStyle(x.current);j!=="auto"&&(x.current.style.scrollBehavior="auto"),x.current.scrollTop=k,d.ignoreScrollToTop=x.current.scrollTop,j!=="auto"&&(x.current.style.scrollBehavior=j)}},get targetScrollTop(){return!x.current||!v.current?0:x.current.scrollHeight-1-x.current.clientHeight},get calculatedTargetScrollTop(){if(!x.current||!v.current)return 0;const{targetScrollTop:k}=this;if(!s.targetScrollTop)return k;if(b?.targetScrollTop===k)return b.calculatedScrollTop;const j=Math.max(Math.min(s.targetScrollTop(k,{scrollElement:x.current,contentElement:v.current}),k),0);return b={targetScrollTop:k,calculatedScrollTop:j},requestAnimationFrame(()=>{b=void 0}),j},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=yn}}},[]),f=R.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||o(!0);const k=Date.now()+(Number(b.wait)||0),j=Le(i.current,b.animation),{ignoreEscapes:_=!1}=b;let y,S=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{y=Date.now()}):y=k+(b.duration??0);const N=async()=>{const w=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:C}=d,M=performance.now(),A=(M-(d.lastTick??M))/jn;if(d.animation||(d.animation={behavior:j,promise:w,ignoreEscapes:_}),d.animation.behavior===j&&(d.lastTick=M),r()||k>Date.now())return N();if(C<Math.min(S,d.calculatedTargetScrollTop)){if(d.animation?.behavior===j){if(j==="instant")return d.scrollTop=d.calculatedTargetScrollTop,N();d.velocity=(j.damping*d.velocity+j.stiffness*d.scrollDifference)/j.mass,d.accumulated+=d.velocity*A,d.scrollTop+=d.accumulated,d.scrollTop!==C&&(d.accumulated=0)}return N()}return y>Date.now()?(S=d.calculatedTargetScrollTop,N()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Le(i.current,i.current.resize),ignoreEscapes:_,duration:Math.max(0,y-Date.now())||void 0}):d.isAtBottom)});return w.then(C=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),C))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===j?d.animation.promise:N()},[o,r,d]),p=R.useCallback(()=>{m(!0),o(!1)},[m,o]),g=R.useCallback(({target:b})=>{if(b!==x.current)return;const{scrollTop:k,ignoreScrollToTop:j}=d;let{lastScrollTop:_=k}=d;d.lastScrollTop=k,d.ignoreScrollToTop=void 0,j&&j>k&&(_=j),u(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||k===j)return;if(r()){m(!0),o(!1);return}const y=k>_,S=k<_;if(d.animation?.ignoreEscapes){d.scrollTop=_;return}S&&(m(!0),o(!1)),y&&m(!1),!d.escapedFromLock&&d.isNearBottom&&o(!0)},1)},[m,o,r,d]),h=R.useCallback(({target:b,deltaY:k})=>{let j=b;for(;!["scroll","auto"].includes(getComputedStyle(j).overflow);){if(!j.parentElement)return;j=j.parentElement}j===x.current&&k<0&&x.current.scrollHeight>x.current.clientHeight&&!d.animation?.ignoreEscapes&&(m(!0),o(!1))},[m,o,d]),x=lt(b=>{x.current?.removeEventListener("scroll",g),x.current?.removeEventListener("wheel",h),b?.addEventListener("scroll",g,{passive:!0}),b?.addEventListener("wheel",h,{passive:!0})},[]),v=lt(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let k;d.resizeObserver=new ResizeObserver(([j])=>{const{height:_}=j.contentRect,y=_-(k??_);if(d.resizeDifference=y,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),u(d.isNearBottom),y>=0){const S=Le(i.current,k?i.current.resize:i.current.initial);f({animation:S,wait:!0,preserveScrollPosition:!0,duration:S==="instant"?void 0:vn})}else d.isNearBottom&&(m(!1),o(!0));k=_,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===y&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:v,scrollRef:x,scrollToBottom:f,stopScroll:p,isAtBottom:l||c,isNearBottom:c,escapedFromLock:e,state:d}};function lt(s,e){const t=R.useCallback(l=>(t.current=l,s(l)),e);return t}const Ee=new Map;function Le(...s){const e={...bn};let t=!1;for(const n of s){if(n==="instant"){t=!0;continue}typeof n=="object"&&(t=!1,e.damping=n.damping??e.damping,e.stiffness=n.stiffness??e.stiffness,e.mass=n.mass??e.mass)}const l=JSON.stringify(e);return Ee.has(l)||Ee.set(l,Object.freeze(e)),t?"instant":Ee.get(l)}function H({icon:s,title:e,usage:t,summary:l,state:n,detail:c,detailVariant:u="code",forceOpen:i,variant:r="default",trailing:o,iconDestructive:m,alwaysChevron:d,defaultOpen:f,children:p}){const g=U(),[h,x]=R.useState(f??!1),{handleCopy:v,copied:b}=Ms(),k=n==="loading",j=n==="error",y=!!(c&&c.trim())||!!p,S=r==="subtask",N=(i??!1)||h,w=Nn({initial:k?"instant":!1}),C=a.jsxs(Is,{open:N,onOpenChange:i?void 0:x,className:"min-w-0",children:[a.jsxs($s,{disabled:!y,className:K("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",y&&"[@media(hover:hover)]:hover:bg-accent/30",!y&&"cursor-default",k&&"shimmer"),"aria-disabled":!y,children:[a.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?a.jsx(tt,{className:K("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",N&&"rotate-90")}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:K("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",m?"[&>svg]:text-destructive/70":j?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",y&&(N?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:s}),y&&a.jsx("div",{className:K("absolute inset-0 flex items-center justify-center transition-opacity duration-150",N?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:a.jsx(tt,{className:K("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",N&&"rotate-90")})})]})}),a.jsx("span",{className:K("shrink-0 text-[14px] font-normal",j?"text-warning/80":"text-foreground"),children:e}),l?a.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:l})}):a.jsx("div",{className:"flex-1"}),o&&a.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:o}),a.jsx(jt,{usage:t})]}),y&&a.jsx(As,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:p||(u==="prose"?a.jsx("div",{className:"mt-1 mb-1",children:a.jsx("div",{ref:w.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:a.jsx("p",{ref:w.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:c})})}):a.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:a.jsx("div",{ref:w.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:a.jsxs("div",{ref:w.contentRef,className:"flex items-start justify-between gap-2",children:[a.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:a.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:c})}),a.jsx("button",{type:"button",onClick:()=>v(c),className:"shrink-0 p-1.5 rounded-lg text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":g("common.copy"),children:b?a.jsx(yt,{className:"size-3.5"}):a.jsx(Ts,{className:"size-3.5"})})]})})}))})]});return S?a.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:C}):C}function ne(s){const e=E.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=je(t),e[0]=t,e[1]=l):l=e[1];let n;return e[2]!==l?(n=a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=n):n=e[3],n}const Pt=4;function Rt(s){const e=E.c(8),{count:t,noun:l,onClick:n}=s,c=U();let u;e[0]!==t||e[1]!==l||e[2]!==c?(u=c("common.seeAll",{count:t,noun:l}),e[0]=t,e[1]=l,e[2]=c,e[3]=u):u=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(bt,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==u?(r=a.jsxs("button",{type:"button",onClick:n,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[u,i]}),e[5]=n,e[6]=u,e[7]=r):r=e[7],r}function zt(s){const e=E.c(12),{message:t,className:l}=s,n=t.created_at??t.metadata?.created_at??null;let c,u,i,r;if(e[0]!==l||e[1]!==n){r=Symbol.for("react.early_return_sentinel");e:{const m=Ge(n);if(m===null){r=null;break e}const d=new Date(m);c=d.toLocaleString(),e[6]!==l?(u=K("text-[11px] text-muted-foreground/60 select-none",l),e[6]=l,e[7]=u):u=e[7],i=d.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=l,e[1]=n,e[2]=c,e[3]=u,e[4]=i,e[5]=r}else c=e[2],u=e[3],i=e[4],r=e[5];if(r!==Symbol.for("react.early_return_sentinel"))return r;let o;return e[8]!==c||e[9]!==u||e[10]!==i?(o=a.jsx("span",{title:c,className:u,children:i}),e[8]=c,e[9]=u,e[10]=i,e[11]=o):o=e[11],o}function Be(s){const e=E.c(9),{since:t}=s;let l;e[0]!==t?(l=()=>nt(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[n,c]=R.useState(l);let u,i;e[2]!==t?(u=()=>{const d=setInterval(()=>c(nt(t,Date.now())),100);return()=>clearInterval(d)},i=[t],e[2]=t,e[3]=u,e[4]=i):(u=e[3],i=e[4]),R.useEffect(u,i);const r=n/1e3;let o;e[5]!==r?(o=je(r),e[5]=r,e[6]=o):o=e[6];let m;return e[7]!==o?(m=a.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:o}),e[7]=o,e[8]=m):m=e[8],m}const Dt=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Sn(){const s=E.c(5),[e]=R.useState(kn);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},s[0]=t):t=s[0];let l;s[1]!==e?(l=Dt.map((c,u)=>{const{delay:i}=c;return a.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[u],animation:"grid-ripple 1s ease infinite",animationDelay:`${i}ms`}},u)}),s[1]=e,s[2]=l):l=s[2];let n;return s[3]!==l?(n=a.jsx("div",{className:"grid",style:t,children:l}),s[3]=l,s[4]=n):n=s[4],n}function kn(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Dt.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}function _n(s){return{planning:{icon:a.jsx(fs,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.planningLabel"),detail:s("chat.thinkingIndicator.planningDetail")},thinking:{icon:a.jsx(Ie,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.thinkingLabel"),detail:s("chat.thinkingIndicator.thinkingDetail")}}}const wn=1200;function Oe(s){const e=E.c(8),{icon:t,title:l,summary:n,detail:c,state:u,detailVariant:i,trailing:r}=s,o=i===void 0?"prose":i;let m;return e[0]!==c||e[1]!==o||e[2]!==t||e[3]!==u||e[4]!==n||e[5]!==l||e[6]!==r?(m=a.jsx(H,{icon:t,title:l,summary:n,detail:c,state:u,detailVariant:o,trailing:r}),e[0]=c,e[1]=o,e[2]=t,e[3]=u,e[4]=n,e[5]=l,e[6]=r,e[7]=m):m=e[7],m}function Cn(s){const e=E.c(22),{startedAt:t}=s,l=U(),n=ve()?.runStatusStage??null,[c,u]=R.useState("planning");let i,r;if(e[0]!==n?(i=()=>{if(n!==null)return;const h=setTimeout(()=>{u("thinking")},wn);return()=>{clearTimeout(h)}},r=[n],e[0]=n,e[1]=i,e[2]=r):(i=e[1],r=e[2]),R.useEffect(i,r),n!==null){let h;e[3]!==n||e[4]!==l?(h=Ls(l,n),e[3]=n,e[4]=l,e[5]=h):h=e[5];const x=h;let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Ie,{className:"size-4"}),e[6]=v):v=e[6];const b=`${x.label}...`;let k;e[7]!==t?(k=t!==null&&a.jsx(Be,{since:t}),e[7]=t,e[8]=k):k=e[8];let j;return e[9]!==x.detail||e[10]!==b||e[11]!==k?(j=a.jsx(Oe,{icon:v,title:b,summary:x.detail,state:"loading",trailing:k}),e[9]=x.detail,e[10]=b,e[11]=k,e[12]=j):j=e[12],j}let o;e[13]!==l?(o=_n(l),e[13]=l,e[14]=o):o=e[14];const d=o[c],f=`${d.label}...`;let p;e[15]!==t?(p=t!==null&&a.jsx(Be,{since:t}),e[15]=t,e[16]=p):p=e[16];let g;return e[17]!==d.detail||e[18]!==d.icon||e[19]!==f||e[20]!==p?(g=a.jsx(Oe,{icon:d.icon,title:f,summary:d.detail,state:"loading",trailing:p}),e[17]=d.detail,e[18]=d.icon,e[19]=f,e[20]=p,e[21]=g):g=e[21],g}function Tn(s){const e=E.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(Sn,{}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=a.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[l,a.jsx(Be,{since:t})]}),e[1]=t,e[2]=n):n=e[2],n}const In=2e4;function $n(s){const e=E.c(9),{startedAt:t}=s,l=U(),n=Ke(1e3),c=ve(),i=(t!==null?n-t:0)>=In;let r;e[0]!==t?(r=a.jsx(Cn,{startedAt:t}),e[0]=t,e[1]=r):r=e[1];let o;e[2]!==i||e[3]!==c||e[4]!==l?(o=i&&c?.stop&&a.jsxs("div",{className:"flex items-center gap-2 pb-1 text-[13px] text-muted-foreground/60",children:[a.jsx("span",{children:l("chat.thinkingIndicator.takingLonger")}),a.jsx("button",{type:"button",onClick:()=>c.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:l("chat.thinkingIndicator.cancel")})]}),e[2]=i,e[3]=c,e[4]=l,e[5]=o):o=e[5];let m;return e[6]!==r||e[7]!==o?(m=a.jsxs("div",{className:"flex flex-col gap-0.5",children:[r,o]}),e[6]=r,e[7]=o,e[8]=m):m=e[8],m}function An(s){const e=E.c(24),{duration:t,parts:l,isStreaming:n}=s,c=U();let u;e[0]!==l?(u=l.every(Ln),e[0]=l,e[1]=u):u=e[1];const i=u;let r;e[2]!==t||e[3]!==c?(r=t&&t/1e3>1?c("chat.thinkingIndicator.thoughtFor",{duration:je(t/1e3)}):c("chat.thinkingIndicator.thought"),e[2]=t,e[3]=c,e[4]=r):r=e[4];const o=r;let m;if(e[5]!==i||e[6]!==n||e[7]!==l){const k=l.map(En).join(`
|
|
1
|
+
import{r as R,c as E,b as U,j as a,ak as tt,l as G,X as ge,o as es,a2 as ts,e as ss,K as he,t as ze,m as dt,ab as ns,E as ls,h as as,B as He,aJ as ft,aa as os,ea as mt,s as rs,p as qe,d as We,d0 as is,d$ as cs,eb as us}from"./index-BiuSAlzd.js";import{aP as ds,aQ as fs,aA as ms,R as ps,a as st,ar as gs,h as xs,a2 as hs,aR as bs,aS as pt,aT as ys,q as De,aL as js,aK as vs,aU as gt,aV as xt,A as ht,aW as fe,X as Ns,b as Ss,F as ks,f as _s}from"./agent-icon-DEoEcQYL.js";import{t as Ie,f as ws,c as Cs}from"./Tool01-BchdJG2X.js";import{i as bt}from"./LinkBroken01-ChSpe7Cq.js";import{i as yt}from"./Check-Cf-cMW3t.js";import{a as Ts}from"./Copy01-DluK-JtU.js";import{b as je,c as Ke,d as nt}from"./format-time-CjIPQhCN.js";import{b as Is,C as $s,a as As}from"./collapsible-DUefED3P.js";import{u as Ms}from"./use-copy-XLZP4Fnf.js";import{a as jt,M as $e,b as Es}from"./usage-stats-B9NCjY7p.js";import{v as Ls,u as Ps,x as Rs,y as zs}from"./thread-intent-ags1XWir.js";import{f as ve,r as Ds,u as Ne,v as Fs,a as Bs,w as Os,x as Us}from"./chat-context-DHGUafJ4.js";import{u as Ge}from"./use-clock-tick-WbPH8S5J.js";import{c as Hs}from"./content-blocks-o63cs2vh.js";import{M as qs}from"./mcp-app-renderer-4bTrB0jF.js";import{g as vt}from"./types-B77htmoi.js";import{o as Ws}from"./omit-sandbox-map-jj4lCB2U.js";import{T as Nt,a as St,b as kt}from"./tooltip-rVl8jzih.js";import{c as Ks,u as _t}from"./use-mcp-client-5sJCC1_2.js";import{g as wt,s as Ct}from"./gateway-client-DE4QITdV.js";import{s as Tt}from"./tool-namespace-DmnQIdtF.js";import{t as Gs,g as pe,u as be}from"./utils-CVEq3hMx.js";import{i as It}from"./AlertCircle-DDHQi3fm.js";import{s as Vs,a as _e,n as Js}from"./Image01-DnRAAkhy.js";import{s as Xs}from"./XClose-BqRoe3QG.js";import{n as Fe}from"./ShoppingBag01-DktiI11o.js";import{i as Qs}from"./SearchMd-oXON6Mge.js";import{a as Ys,d as Zs}from"./shell-layout-DgCL-aOA.js";import{a as Ve}from"./use-panel-navigate-DvFfVppm.js";import{c as $t}from"./use-decopilot-events-B_Wj2FDs.js";import{I as en,M as At}from"./markdown-D5RcIxaz.js";import{n as Mt}from"./LinkExternal01-BVDnNs6j.js";import{c as tn,S as sn,a as nn,b as ln}from"./sheet-CuQcjl8J.js";import{I as Se}from"./integration-icon-BcFb9WXn.js";import{a as Et}from"./use-connection-BJVimXqv.js";import{a as me}from"./Palette-CaKXG6S_.js";import{u as Lt}from"./use-navigate-to-agent-2D1RSJEE.js";import{i as we}from"./Link01-iwXPIeVc.js";import{g as an}from"./use-mcp-prompts-5OccjpiV.js";import{c as on,P as rn,u as cn,e as un,F as dn,s as fn,b as mn}from"./index-DX971x0F.js";import{i as pn}from"./Monitor01-BLZH5esy.js";import{a as gn}from"./use-thread-outputs-DqnIgfuG.js";import{F as xn}from"./file-type-icon-Zo3jfkM-.js";import{t as hn}from"./ChevronUp-B79uJeZN.js";const bn={damping:.7,stiffness:.05,mass:1.25},yn=70,jn=1e3/60,vn=350;let Ae=!1;globalThis.document?.addEventListener("mousedown",()=>{Ae=!0});globalThis.document?.addEventListener("mouseup",()=>{Ae=!1});globalThis.document?.addEventListener("click",()=>{Ae=!1});const Nn=(s={})=>{const[e,t]=R.useState(!1),[l,n]=R.useState(s.initial!==!1),[c,u]=R.useState(!1),i=R.useRef(null);i.current=s;const r=R.useCallback(()=>{if(!Ae)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const k=b.getRangeAt(0);return k.commonAncestorContainer.contains(x.current)||x.current?.contains(k.commonAncestorContainer)},[]),o=R.useCallback(b=>{d.isAtBottom=b,n(b)},[]),m=R.useCallback(b=>{d.escapedFromLock=b,t(b)},[]),d=R.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:l,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return x.current?.scrollTop??0},set scrollTop(k){if(x.current){const{scrollBehavior:j}=getComputedStyle(x.current);j!=="auto"&&(x.current.style.scrollBehavior="auto"),x.current.scrollTop=k,d.ignoreScrollToTop=x.current.scrollTop,j!=="auto"&&(x.current.style.scrollBehavior=j)}},get targetScrollTop(){return!x.current||!v.current?0:x.current.scrollHeight-1-x.current.clientHeight},get calculatedTargetScrollTop(){if(!x.current||!v.current)return 0;const{targetScrollTop:k}=this;if(!s.targetScrollTop)return k;if(b?.targetScrollTop===k)return b.calculatedScrollTop;const j=Math.max(Math.min(s.targetScrollTop(k,{scrollElement:x.current,contentElement:v.current}),k),0);return b={targetScrollTop:k,calculatedScrollTop:j},requestAnimationFrame(()=>{b=void 0}),j},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=yn}}},[]),f=R.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||o(!0);const k=Date.now()+(Number(b.wait)||0),j=Le(i.current,b.animation),{ignoreEscapes:_=!1}=b;let y,S=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{y=Date.now()}):y=k+(b.duration??0);const N=async()=>{const w=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:C}=d,M=performance.now(),A=(M-(d.lastTick??M))/jn;if(d.animation||(d.animation={behavior:j,promise:w,ignoreEscapes:_}),d.animation.behavior===j&&(d.lastTick=M),r()||k>Date.now())return N();if(C<Math.min(S,d.calculatedTargetScrollTop)){if(d.animation?.behavior===j){if(j==="instant")return d.scrollTop=d.calculatedTargetScrollTop,N();d.velocity=(j.damping*d.velocity+j.stiffness*d.scrollDifference)/j.mass,d.accumulated+=d.velocity*A,d.scrollTop+=d.accumulated,d.scrollTop!==C&&(d.accumulated=0)}return N()}return y>Date.now()?(S=d.calculatedTargetScrollTop,N()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Le(i.current,i.current.resize),ignoreEscapes:_,duration:Math.max(0,y-Date.now())||void 0}):d.isAtBottom)});return w.then(C=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),C))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===j?d.animation.promise:N()},[o,r,d]),p=R.useCallback(()=>{m(!0),o(!1)},[m,o]),g=R.useCallback(({target:b})=>{if(b!==x.current)return;const{scrollTop:k,ignoreScrollToTop:j}=d;let{lastScrollTop:_=k}=d;d.lastScrollTop=k,d.ignoreScrollToTop=void 0,j&&j>k&&(_=j),u(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||k===j)return;if(r()){m(!0),o(!1);return}const y=k>_,S=k<_;if(d.animation?.ignoreEscapes){d.scrollTop=_;return}S&&(m(!0),o(!1)),y&&m(!1),!d.escapedFromLock&&d.isNearBottom&&o(!0)},1)},[m,o,r,d]),h=R.useCallback(({target:b,deltaY:k})=>{let j=b;for(;!["scroll","auto"].includes(getComputedStyle(j).overflow);){if(!j.parentElement)return;j=j.parentElement}j===x.current&&k<0&&x.current.scrollHeight>x.current.clientHeight&&!d.animation?.ignoreEscapes&&(m(!0),o(!1))},[m,o,d]),x=lt(b=>{x.current?.removeEventListener("scroll",g),x.current?.removeEventListener("wheel",h),b?.addEventListener("scroll",g,{passive:!0}),b?.addEventListener("wheel",h,{passive:!0})},[]),v=lt(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let k;d.resizeObserver=new ResizeObserver(([j])=>{const{height:_}=j.contentRect,y=_-(k??_);if(d.resizeDifference=y,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),u(d.isNearBottom),y>=0){const S=Le(i.current,k?i.current.resize:i.current.initial);f({animation:S,wait:!0,preserveScrollPosition:!0,duration:S==="instant"?void 0:vn})}else d.isNearBottom&&(m(!1),o(!0));k=_,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===y&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:v,scrollRef:x,scrollToBottom:f,stopScroll:p,isAtBottom:l||c,isNearBottom:c,escapedFromLock:e,state:d}};function lt(s,e){const t=R.useCallback(l=>(t.current=l,s(l)),e);return t}const Ee=new Map;function Le(...s){const e={...bn};let t=!1;for(const n of s){if(n==="instant"){t=!0;continue}typeof n=="object"&&(t=!1,e.damping=n.damping??e.damping,e.stiffness=n.stiffness??e.stiffness,e.mass=n.mass??e.mass)}const l=JSON.stringify(e);return Ee.has(l)||Ee.set(l,Object.freeze(e)),t?"instant":Ee.get(l)}function H({icon:s,title:e,usage:t,summary:l,state:n,detail:c,detailVariant:u="code",forceOpen:i,variant:r="default",trailing:o,iconDestructive:m,alwaysChevron:d,defaultOpen:f,children:p}){const g=U(),[h,x]=R.useState(f??!1),{handleCopy:v,copied:b}=Ms(),k=n==="loading",j=n==="error",y=!!(c&&c.trim())||!!p,S=r==="subtask",N=(i??!1)||h,w=Nn({initial:k?"instant":!1}),C=a.jsxs(Is,{open:N,onOpenChange:i?void 0:x,className:"min-w-0",children:[a.jsxs($s,{disabled:!y,className:G("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",y&&"[@media(hover:hover)]:hover:bg-accent/30",!y&&"cursor-default",k&&"shimmer"),"aria-disabled":!y,children:[a.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?a.jsx(tt,{className:G("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",N&&"rotate-90")}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:G("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",m?"[&>svg]:text-destructive/70":j?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",y&&(N?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:s}),y&&a.jsx("div",{className:G("absolute inset-0 flex items-center justify-center transition-opacity duration-150",N?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:a.jsx(tt,{className:G("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",N&&"rotate-90")})})]})}),a.jsx("span",{className:G("shrink-0 text-[14px] font-normal",j?"text-warning/80":"text-foreground"),children:e}),l?a.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:l})}):a.jsx("div",{className:"flex-1"}),o&&a.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:o}),a.jsx(jt,{usage:t})]}),y&&a.jsx(As,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:p||(u==="prose"?a.jsx("div",{className:"mt-1 mb-1",children:a.jsx("div",{ref:w.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:a.jsx("p",{ref:w.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:c})})}):a.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:a.jsx("div",{ref:w.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:a.jsxs("div",{ref:w.contentRef,className:"flex items-start justify-between gap-2",children:[a.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:a.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:c})}),a.jsx("button",{type:"button",onClick:()=>v(c),className:"shrink-0 p-1.5 rounded-lg text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":g("common.copy"),children:b?a.jsx(yt,{className:"size-3.5"}):a.jsx(Ts,{className:"size-3.5"})})]})})}))})]});return S?a.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:C}):C}function ne(s){const e=E.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=je(t),e[0]=t,e[1]=l):l=e[1];let n;return e[2]!==l?(n=a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=n):n=e[3],n}const Pt=4;function Rt(s){const e=E.c(8),{count:t,noun:l,onClick:n}=s,c=U();let u;e[0]!==t||e[1]!==l||e[2]!==c?(u=c("common.seeAll",{count:t,noun:l}),e[0]=t,e[1]=l,e[2]=c,e[3]=u):u=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(bt,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==u?(r=a.jsxs("button",{type:"button",onClick:n,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[u,i]}),e[5]=n,e[6]=u,e[7]=r):r=e[7],r}function zt(s){const e=E.c(12),{message:t,className:l}=s,n=t.created_at??t.metadata?.created_at??null;let c,u,i,r;if(e[0]!==l||e[1]!==n){r=Symbol.for("react.early_return_sentinel");e:{const m=Ke(n);if(m===null){r=null;break e}const d=new Date(m);c=d.toLocaleString(),e[6]!==l?(u=G("text-[11px] text-muted-foreground/60 select-none",l),e[6]=l,e[7]=u):u=e[7],i=d.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=l,e[1]=n,e[2]=c,e[3]=u,e[4]=i,e[5]=r}else c=e[2],u=e[3],i=e[4],r=e[5];if(r!==Symbol.for("react.early_return_sentinel"))return r;let o;return e[8]!==c||e[9]!==u||e[10]!==i?(o=a.jsx("span",{title:c,className:u,children:i}),e[8]=c,e[9]=u,e[10]=i,e[11]=o):o=e[11],o}function Be(s){const e=E.c(9),{since:t}=s;let l;e[0]!==t?(l=()=>nt(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[n,c]=R.useState(l);let u,i;e[2]!==t?(u=()=>{const d=setInterval(()=>c(nt(t,Date.now())),100);return()=>clearInterval(d)},i=[t],e[2]=t,e[3]=u,e[4]=i):(u=e[3],i=e[4]),R.useEffect(u,i);const r=n/1e3;let o;e[5]!==r?(o=je(r),e[5]=r,e[6]=o):o=e[6];let m;return e[7]!==o?(m=a.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:o}),e[7]=o,e[8]=m):m=e[8],m}const Dt=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Sn(){const s=E.c(5),[e]=R.useState(kn);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},s[0]=t):t=s[0];let l;s[1]!==e?(l=Dt.map((c,u)=>{const{delay:i}=c;return a.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[u],animation:"grid-ripple 1s ease infinite",animationDelay:`${i}ms`}},u)}),s[1]=e,s[2]=l):l=s[2];let n;return s[3]!==l?(n=a.jsx("div",{className:"grid",style:t,children:l}),s[3]=l,s[4]=n):n=s[4],n}function kn(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Dt.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}function _n(s){return{planning:{icon:a.jsx(fs,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.planningLabel"),detail:s("chat.thinkingIndicator.planningDetail")},thinking:{icon:a.jsx(Ie,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.thinkingLabel"),detail:s("chat.thinkingIndicator.thinkingDetail")}}}const wn=1200;function Oe(s){const e=E.c(8),{icon:t,title:l,summary:n,detail:c,state:u,detailVariant:i,trailing:r}=s,o=i===void 0?"prose":i;let m;return e[0]!==c||e[1]!==o||e[2]!==t||e[3]!==u||e[4]!==n||e[5]!==l||e[6]!==r?(m=a.jsx(H,{icon:t,title:l,summary:n,detail:c,state:u,detailVariant:o,trailing:r}),e[0]=c,e[1]=o,e[2]=t,e[3]=u,e[4]=n,e[5]=l,e[6]=r,e[7]=m):m=e[7],m}function Cn(s){const e=E.c(22),{startedAt:t}=s,l=U(),n=ve()?.runStatusStage??null,[c,u]=R.useState("planning");let i,r;if(e[0]!==n?(i=()=>{if(n!==null)return;const h=setTimeout(()=>{u("thinking")},wn);return()=>{clearTimeout(h)}},r=[n],e[0]=n,e[1]=i,e[2]=r):(i=e[1],r=e[2]),R.useEffect(i,r),n!==null){let h;e[3]!==n||e[4]!==l?(h=Ls(l,n),e[3]=n,e[4]=l,e[5]=h):h=e[5];const x=h;let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Ie,{className:"size-4"}),e[6]=v):v=e[6];const b=`${x.label}...`;let k;e[7]!==t?(k=t!==null&&a.jsx(Be,{since:t}),e[7]=t,e[8]=k):k=e[8];let j;return e[9]!==x.detail||e[10]!==b||e[11]!==k?(j=a.jsx(Oe,{icon:v,title:b,summary:x.detail,state:"loading",trailing:k}),e[9]=x.detail,e[10]=b,e[11]=k,e[12]=j):j=e[12],j}let o;e[13]!==l?(o=_n(l),e[13]=l,e[14]=o):o=e[14];const d=o[c],f=`${d.label}...`;let p;e[15]!==t?(p=t!==null&&a.jsx(Be,{since:t}),e[15]=t,e[16]=p):p=e[16];let g;return e[17]!==d.detail||e[18]!==d.icon||e[19]!==f||e[20]!==p?(g=a.jsx(Oe,{icon:d.icon,title:f,summary:d.detail,state:"loading",trailing:p}),e[17]=d.detail,e[18]=d.icon,e[19]=f,e[20]=p,e[21]=g):g=e[21],g}function Tn(s){const e=E.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(Sn,{}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=a.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[l,a.jsx(Be,{since:t})]}),e[1]=t,e[2]=n):n=e[2],n}const In=2e4;function $n(s){const e=E.c(9),{startedAt:t}=s,l=U(),n=Ge(1e3),c=ve(),i=(t!==null?n-t:0)>=In;let r;e[0]!==t?(r=a.jsx(Cn,{startedAt:t}),e[0]=t,e[1]=r):r=e[1];let o;e[2]!==i||e[3]!==c||e[4]!==l?(o=i&&c?.stop&&a.jsxs("div",{className:"flex items-center gap-2 pb-1 text-[13px] text-muted-foreground/60",children:[a.jsx("span",{children:l("chat.thinkingIndicator.takingLonger")}),a.jsx("button",{type:"button",onClick:()=>c.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:l("chat.thinkingIndicator.cancel")})]}),e[2]=i,e[3]=c,e[4]=l,e[5]=o):o=e[5];let m;return e[6]!==r||e[7]!==o?(m=a.jsxs("div",{className:"flex flex-col gap-0.5",children:[r,o]}),e[6]=r,e[7]=o,e[8]=m):m=e[8],m}function An(s){const e=E.c(24),{duration:t,parts:l,isStreaming:n}=s,c=U();let u;e[0]!==l?(u=l.every(Ln),e[0]=l,e[1]=u):u=e[1];const i=u;let r;e[2]!==t||e[3]!==c?(r=t&&t/1e3>1?c("chat.thinkingIndicator.thoughtFor",{duration:je(t/1e3)}):c("chat.thinkingIndicator.thought"),e[2]=t,e[3]=c,e[4]=r):r=e[4];const o=r;let m;if(e[5]!==i||e[6]!==n||e[7]!==l){const k=l.map(En).join(`
|
|
2
2
|
`).trim().split(`
|
|
3
3
|
`).filter(Boolean),j=n?k[k.length-1]??"":k[0]??"";m=!i&&j?j.length>100?j.slice(0,100)+"…":j:void 0,e[5]=i,e[6]=n,e[7]=l,e[8]=m}else m=e[8];const d=m;let f;if(e[9]!==i||e[10]!==l){const b=l.map(Mn).join(`
|
|
4
4
|
|
|
5
|
-
`);f=!i&&b.trim()?b:null,e[9]=i,e[10]=l,e[11]=f}else f=e[11];const p=f;let g;e[12]!==n?(g=n?a.jsx(Ie,{className:"size-4"}):a.jsx(ds,{className:"size-4"}),e[12]=n,e[13]=g):g=e[13];let h;e[14]!==n||e[15]!==c||e[16]!==o?(h=n?c("chat.thinkingIndicator.thinking"):o,e[14]=n,e[15]=c,e[16]=o,e[17]=h):h=e[17];const x=n?"loading":"idle";let v;return e[18]!==p||e[19]!==d||e[20]!==g||e[21]!==h||e[22]!==x?(v=a.jsx(Oe,{icon:g,title:h,summary:d,detail:p,state:x,detailVariant:"prose"}),e[18]=p,e[19]=d,e[20]=g,e[21]=h,e[22]=x,e[23]=v):v=e[23],v}function Mn(s){return s.text??""}function En(s){return s.text??""}function Ln(s){return s.text?.includes("REDACTED")}function Pn(s){const e=E.c(24),{org:t}=ge(),l=es(),n=Ps(),c=ts();let u;e[0]!==c||e[1]!==s?(u=async h=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const v=(await c.call("COLLECTION_THREADS_GET",{id:s})).item?.metadata??{},k=(v.expanded_tools??[]).filter(_=>_.toolName!==h.toolName);k.push({...h,expandedAt:new Date().toISOString()});const j={...Ws(v),expanded_tools:k};return await c.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:j}}),k},e[0]=c,e[1]=s,e[2]=u):u=e[2];let i,r,o;e[3]!==t||e[4]!==l||e[5]!==s?(i=async h=>{const x=he.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:x});const v=l.getQueryData(x),k=(v?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==h.toolName);return k.push({...h,expandedAt:new Date().toISOString()}),l.setQueryData(x,j=>j&&{...j,metadata:{...j.metadata??{},expanded_tools:k}}),{previous:v}},r=()=>{l.invalidateQueries({queryKey:he.ensureTask(t.id,s??"")})},o=(h,x,v)=>{const b=he.ensureTask(t.id,s??"");v?.previous===void 0?l.removeQueries({queryKey:b,exact:!0}):l.setQueryData(b,v.previous),ze.error(h instanceof Error?h.message:"Failed to expand tool")},e[3]=t,e[4]=l,e[5]=s,e[6]=i,e[7]=r,e[8]=o):(i=e[6],r=e[7],o=e[8]);let m;e[9]!==u||e[10]!==i||e[11]!==r||e[12]!==o?(m={mutationFn:u,onMutate:i,onSuccess:r,onError:o},e[9]=u,e[10]=i,e[11]=r,e[12]=o,e[13]=m):m=e[13];const d=ss(m);let f;e[14]!==n||e[15]!==d||e[16]!==t||e[17]!==l||e[18]!==s?(f=h=>{if(!s||!n)return;const x=he.ensureTask(t.id,s),v=l.getQueryData(x),k=(v?.metadata?.expanded_tools??[]).filter(_=>_.toolName!==h.toolName);k.push({...h,expandedAt:new Date().toISOString()});const j={...v?.metadata??{},expanded_tools:k};l.setQueryData(x,_=>_&&{..._,metadata:j}),n.patchThread({id:s,metadata:j}),d.mutate(h)},e[14]=n,e[15]=d,e[16]=t,e[17]=l,e[18]=s,e[19]=f):f=e[19];const p=f;let g;return e[20]!==p||e[21]!==d.isPending||e[22]!==d.mutate?(g={addOrReplace:d.mutate,addOrReplaceEager:p,isPending:d.isPending},e[20]=p,e[21]=d.isPending,e[22]=d.mutate,e[23]=g):g=e[23],g}function Rn(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function zn(s,e,t,l){const{data:n,isLoading:c}=dt({queryKey:he.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const u=await
|
|
5
|
+
`);f=!i&&b.trim()?b:null,e[9]=i,e[10]=l,e[11]=f}else f=e[11];const p=f;let g;e[12]!==n?(g=n?a.jsx(Ie,{className:"size-4"}):a.jsx(ds,{className:"size-4"}),e[12]=n,e[13]=g):g=e[13];let h;e[14]!==n||e[15]!==c||e[16]!==o?(h=n?c("chat.thinkingIndicator.thinking"):o,e[14]=n,e[15]=c,e[16]=o,e[17]=h):h=e[17];const x=n?"loading":"idle";let v;return e[18]!==p||e[19]!==d||e[20]!==g||e[21]!==h||e[22]!==x?(v=a.jsx(Oe,{icon:g,title:h,summary:d,detail:p,state:x,detailVariant:"prose"}),e[18]=p,e[19]=d,e[20]=g,e[21]=h,e[22]=x,e[23]=v):v=e[23],v}function Mn(s){return s.text??""}function En(s){return s.text??""}function Ln(s){return s.text?.includes("REDACTED")}function Pn(s){const e=E.c(24),{org:t}=ge(),l=es(),n=Ps(),c=ts();let u;e[0]!==c||e[1]!==s?(u=async h=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const v=(await c.call("COLLECTION_THREADS_GET",{id:s})).item?.metadata??{},k=(v.expanded_tools??[]).filter(_=>_.toolName!==h.toolName);k.push({...h,expandedAt:new Date().toISOString()});const j={...Ws(v),expanded_tools:k};return await c.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:j}}),k},e[0]=c,e[1]=s,e[2]=u):u=e[2];let i,r,o;e[3]!==t||e[4]!==l||e[5]!==s?(i=async h=>{const x=he.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:x});const v=l.getQueryData(x),k=(v?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==h.toolName);return k.push({...h,expandedAt:new Date().toISOString()}),l.setQueryData(x,j=>j&&{...j,metadata:{...j.metadata??{},expanded_tools:k}}),{previous:v}},r=()=>{l.invalidateQueries({queryKey:he.ensureTask(t.id,s??"")})},o=(h,x,v)=>{const b=he.ensureTask(t.id,s??"");v?.previous===void 0?l.removeQueries({queryKey:b,exact:!0}):l.setQueryData(b,v.previous),ze.error(h instanceof Error?h.message:"Failed to expand tool")},e[3]=t,e[4]=l,e[5]=s,e[6]=i,e[7]=r,e[8]=o):(i=e[6],r=e[7],o=e[8]);let m;e[9]!==u||e[10]!==i||e[11]!==r||e[12]!==o?(m={mutationFn:u,onMutate:i,onSuccess:r,onError:o},e[9]=u,e[10]=i,e[11]=r,e[12]=o,e[13]=m):m=e[13];const d=ss(m);let f;e[14]!==n||e[15]!==d||e[16]!==t||e[17]!==l||e[18]!==s?(f=h=>{if(!s||!n)return;const x=he.ensureTask(t.id,s),v=l.getQueryData(x),k=(v?.metadata?.expanded_tools??[]).filter(_=>_.toolName!==h.toolName);k.push({...h,expandedAt:new Date().toISOString()});const j={...v?.metadata??{},expanded_tools:k};l.setQueryData(x,_=>_&&{..._,metadata:j}),n.patchThread({id:s,metadata:j}),d.mutate(h)},e[14]=n,e[15]=d,e[16]=t,e[17]=l,e[18]=s,e[19]=f):f=e[19];const p=f;let g;return e[20]!==p||e[21]!==d.isPending||e[22]!==d.mutate?(g={addOrReplace:d.mutate,addOrReplaceEager:p,isPending:d.isPending},e[20]=p,e[21]=d.isPending,e[22]=d.mutate,e[23]=g):g=e[23],g}function Rn(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function zn(s,e,t,l){const{data:n,isLoading:c}=dt({queryKey:he.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const u=await Ks({connectionId:e,orgId:t,orgSlug:l});try{const{tools:i}=await u.listTools(),r=Tt(s);return i.find(o=>o.name===r)??null}finally{await u.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:n??void 0,isLoading:c}}const Dn={read:{icon:st,labelKey:"chat.generic.tool.read"},write:{icon:Cs,labelKey:"chat.generic.tool.write"},edit:{icon:hs,labelKey:"chat.generic.tool.edit"},grep:{icon:Qs,labelKey:"chat.generic.tool.grep"},glob:{icon:xs,labelKey:"chat.generic.tool.glob"},bash:{icon:gs,labelKey:"chat.generic.tool.bash"},read_tool_output:{icon:st,labelKey:"chat.generic.tool.readToolOutput"},read_resource:{icon:ps,labelKey:"chat.generic.tool.readResource"},read_prompt:{icon:Fe,labelKey:"chat.generic.tool.readPrompt"},skill:{icon:Fe,labelKey:"chat.generic.tool.skill"},enable_tool:{icon:ws,labelKey:"chat.generic.tool.enableTool"},open_in_agent:{icon:ns,labelKey:"chat.generic.tool.openInAgent"},sandbox:{icon:ms,labelKey:"chat.generic.tool.sandbox"}},Ft="studio:bash-sleep-start:v1",Fn=200;function Bn(s,e,t,l=Fn){const n=s.filter(([c])=>c!==e);for(n.push([e,t]);n.length>l;)n.shift();return n}function On(){try{const s=sessionStorage.getItem(Ft);if(!s)return[];const e=JSON.parse(s);return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&Number.isFinite(t[1])):[]}catch{return[]}}function Un(s){try{const e=On(),t=e.find(([n])=>n===s);if(t)return t[1];const l=Date.now();return sessionStorage.setItem(Ft,JSON.stringify(Bn(e,s,l))),l}catch{return Date.now()}}function Bt(s,e){const t=E.c(2);let l;t[0]!==s?(l=()=>Un(s),t[0]=s,t[1]=l):l=t[1];const n=R.useState(l)[0];return e??n}function Ot(s){const e=Math.ceil(s/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),l=e%60;return l?`${t}m ${l}s`:`${t}m`}function Hn(s){const e=E.c(5),{toolCallId:t,durationMs:l,anchorMs:n}=s,c=U(),u=Ge(1e3),r=Bt(t,n)+l-u;let o;e[0]!==r||e[1]!==c?(o=r>0?c("chat.generic.waitingFor",{duration:Ot(r)}):c("chat.generic.wrappingUp"),e[0]=r,e[1]=c,e[2]=o):o=e[2];let m;return e[3]!==o?(m=a.jsx("span",{className:"tabular-nums",children:o}),e[3]=o,e[4]=m):m=e[4],m}const qn=1e4;function Wn(s){const e=E.c(7),{toolCallId:t,anchorMs:l}=s,n=U(),c=Ge(1e3),u=Bt(t,l),i=c-u;if(i<qn){let m;return e[0]!==n?(m=n("chat.generic.preparing"),e[0]=n,e[1]=m):m=e[1],m}let r;e[2]!==i||e[3]!==n?(r=n("chat.generic.runningFor",{elapsed:Ot(i)}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==r?(o=a.jsx("span",{className:"tabular-nums",children:r}),e[5]=r,e[6]=o):o=e[6],o}const Kn={s:1e3,m:6e4,h:36e5,d:864e5};function Gn(s){const e=/(?:^|[\s;&|(])sleep((?:\s+[\d.]+[smhd]?)+)/g;let t=0,l=!1;for(const n of s.matchAll(e))for(const c of n[1].trim().split(/\s+/)){const u=/^([\d.]+)([smhd]?)$/.exec(c);if(!u)continue;const i=Number.parseFloat(u[1]);Number.isFinite(i)&&(t+=i*(Kn[u[2]||"s"]??1e3),l=!0)}return l?t:null}function Me(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function xe(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}function Te(s){const e=xe(s);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Vn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function Jn(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
|
|
6
6
|
${l.text}`);else if(l.type==="source-url")t.push(`## Source URL
|
|
7
7
|
${l.url}`);else if(l.type==="source-document")t.push(`## Source Document
|
|
8
8
|
${l.title}`);else if(l.type==="file")t.push(`## File
|
|
@@ -23,25 +23,25 @@ Error: Tool responded with an error`)}else if(l.state==="output-denied"){const c
|
|
|
23
23
|
Input: ${c||"[No input]"}...
|
|
24
24
|
Output: Tool execution was denied`)}}}return t.length>0?t.join(`
|
|
25
25
|
|
|
26
|
-
`):null}function at(s){const e=s&&typeof s=="object"&&"created_at"in s?s.created_at:void 0;return typeof e=="string"||e instanceof Date?
|
|
26
|
+
`):null}function at(s){const e=s&&typeof s=="object"&&"created_at"in s?s.created_at:void 0;return typeof e=="string"||e instanceof Date?Ke(e):null}function Xn(s){const e=s&&typeof s=="object"&&"timeout"in s?s.timeout:void 0;return Math.min(typeof e=="number"?e:3e4,12e4)}function Ce(s){const e=E.c(7),{icon:t,label:l}=s;let n;e[0]!==t?(n=a.jsx(Nt,{asChild:!0,children:a.jsx("span",{className:"flex items-center",children:t})}),e[0]=t,e[1]=n):n=e[1];let c;e[2]!==l?(c=a.jsx(St,{side:"top",children:l}),e[2]=l,e[3]=c):c=e[3];let u;return e[4]!==n||e[5]!==c?(u=a.jsxs(kt,{children:[n,c]}),e[4]=n,e[5]=c,e[6]=u):u=e[6],u}function Qn(s){const e=E.c(19),{annotations:t,toolMeta:l}=s,n=U();let c;e[0]!==l?(c=vt(l),e[0]=l,e[1]=c):c=e[1];const u=!!c;if(!t&&!u)return null;let i;e[2]!==u||e[3]!==n?(i=u&&a.jsx(Ce,{icon:a.jsx(pt,{}),label:n("chat.generic.annotation.interactive")}),e[2]=u,e[3]=n,e[4]=i):i=e[4];let r;e[5]!==t?.readOnlyHint||e[6]!==n?(r=t?.readOnlyHint&&a.jsx(Ce,{icon:a.jsx(Vs,{}),label:n("chat.generic.annotation.readOnly")}),e[5]=t?.readOnlyHint,e[6]=n,e[7]=r):r=e[7];let o;e[8]!==t?.destructiveHint||e[9]!==n?(o=t?.destructiveHint&&a.jsx(Ce,{icon:a.jsx(It,{}),label:n("chat.generic.annotation.destructive")}),e[8]=t?.destructiveHint,e[9]=n,e[10]=o):o=e[10];let m;e[11]!==t?.openWorldHint||e[12]!==n?(m=t?.openWorldHint&&a.jsx(Ce,{icon:a.jsx(De,{}),label:n("chat.generic.annotation.openWorld")}),e[11]=t?.openWorldHint,e[12]=n,e[13]=m):m=e[13];let d;return e[14]!==i||e[15]!==r||e[16]!==o||e[17]!==m?(d=a.jsxs(a.Fragment,{children:[i,r,o,m]}),e[14]=i,e[15]=r,e[16]=o,e[17]=m,e[18]=d):d=e[18],d}function Yn(s){return s<1?`${Math.round(s*1e3)}ms`:s<10?`${s.toFixed(1)}s`:`${Math.round(s)}s`}function Zn(s){const e=E.c(13),{latency:t,outputBytes:l}=s,n=typeof t=="number"&&t>0,c=typeof l=="number"&&l>=0;if(!n&&!c)return null;let u;e[0]!==n||e[1]!==t?(u=n&&a.jsx("span",{children:Yn(t)}),e[0]=n,e[1]=t,e[2]=u):u=e[2];let i;e[3]!==c||e[4]!==n?(i=n&&c&&a.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[3]=c,e[4]=n,e[5]=i):i=e[5];let r;e[6]!==c||e[7]!==l?(r=c&&a.jsx("span",{children:Rn(l)}),e[6]=c,e[7]=l,e[8]=r):r=e[8];let o;return e[9]!==u||e[10]!==i||e[11]!==r?(o=a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-mono tabular-nums text-muted-foreground/60 px-1 leading-none",children:[u,i,r]}),e[9]=u,e[10]=i,e[11]=r,e[12]=o):o=e[12],o}function el(s,e,t,l){switch(s){case"input-streaming":case"input-available":return l?l("chat.generic.preparing"):"Preparing...";case"approval-requested":return l?l("chat.generic.waitingForApproval"):"Waiting for your approval";case"output-denied":return l?l("chat.generic.cancelled"):"Cancelled";case"output-error":return t??(l?l("chat.generic.failed"):"Failed");case"output-available":{if(e==null)return l?l("chat.generic.done"):"Done";if(typeof e=="string"){const n=e.trim();return n.length>100?n.slice(0,100)+"…":n}if(typeof e=="object"){for(const n of Object.keys(e)){const c=e[n];if(typeof c=="string"&&c.trim()){const u=c.trim();return u.length>100?u.slice(0,100)+"…":u}}return""}return String(e).slice(0,100)}default:return""}}function ot(s){const e=E.c(76),{part:t,annotations:l,latency:n,outputBytes:c,isLastMessage:u,toolMeta:i}=s,r=U(),o="toolName"in t&&typeof t.toolName=="string"?t.toolName:t.type==="dynamic-tool"?r("chat.generic.dynamicTool"):t.type.replace("tool-","")||"Tool",m=Tt(o),d=ve(),f=Ds(),{org:p}=ge(),{openSidePanel:g}=Ys(),h=Ne()?.taskId??null,{addOrReplaceEager:x}=Pn(h),{openPanel:v}=Ve(),b=i&&typeof i=="object"&&i!==null&&"connectionId"in i&&i.connectionId!=null&&i.connectionId!==""?String(i.connectionId):f?.selectedVirtualMcp?.id??null,{toolDef:k}=zn(b?o:null,b,p.id,p.slug),j=k?._meta??i,_=wt(j),y=Ct(m,_),S=Dn[y],N=k?.title??(S?.labelKey?r(S.labelKey):void 0)??Gs(y);let w;e[0]!==j?(w=vt(j),e[0]=j,e[1]=w):w=e[1];const C=w,M=!!C&&t.state==="output-available",A=b?`${b}:${o}`:null,L=!!l?.destructiveHint,I=M&&!!b&&!L&&!!h;let T;e[2]!==x||e[3]!==b||e[4]!==v||e[5]!==t||e[6]!==o?(T=()=>{if(!b)return;const V="input"in t&&t.input&&typeof t.input=="object"?t.input:{};x({toolName:o,appId:b,args:V}),v(os(b,o))},e[2]=x,e[3]=b,e[4]=v,e[5]=t,e[6]=o,e[7]=T):T=e[7];const $=T;let P;e[8]!==I||e[9]!==$?(P=V=>V==="fullscreen"&&I?($(),"fullscreen"):"inline",e[8]=I,e[9]=$,e[10]=P):P=e[10];const q=P;let B;e[11]!==d||e[12]!==g?(B=V=>{const Z=Hs(V.content);Z.content.length>0&&(g(),d?.sendMessage(Z))},e[11]=d,e[12]=g,e[13]=B):B=e[13];const D=B,F=t.state==="approval-requested"&&u===!1,W=t.state==="output-denied"||F,J=t.state==="output-available"&&typeof t.output=="object"&&t.output!=null&&"isError"in t.output&&t.output.isError===!0;let X;e[14]!==t.state?(X=pe(t.state),e[14]=t.state,e[15]=X):X=e[15];const te=X,Q=F||te==="approval"?"idle":J?"error":te;let se,re;if(e[16]!==Q||e[17]!==J||e[18]!==F||e[19]!==t||e[20]!==r||e[21]!==y){se=t.state==="output-error"?Me(t):void 0;const V=y==="bash"&&Q==="loading"&&t.input&&typeof t.input=="object"&&typeof t.input.command=="string"?t.input.command:null;let Z;e[24]!==V?(Z=V!==null?Gn(V):null,e[24]=V,e[25]=Z):Z=e[25];const ee=Z;let ke;e[26]!==t.input||e[27]!==ee?(ke=ee!==null?Math.min(ee,Xn(t.input)):null,e[26]=t.input,e[27]=ee,e[28]=ke):ke=e[28];const Ze=ke,et="toolCallId"in t?t.toolCallId:"";re=Ze!==null?a.jsx(Hn,{toolCallId:et,durationMs:Ze,anchorMs:at(t)}):Q==="loading"?a.jsx(Wn,{toolCallId:et,anchorMs:at(t)}):F?r("chat.generic.cancelled"):J?r("chat.generic.failed"):el(t.state,t.output,se,r),e[16]=Q,e[17]=J,e[18]=F,e[19]=t,e[20]=r,e[21]=y,e[22]=se,e[23]=re}else se=e[22],re=e[23];const ue=re;let Y="";t.input!==void 0&&(Y=`# Input
|
|
27
27
|
`+Te(t.input)),t.state==="output-error"?(Y&&(Y=Y+`
|
|
28
28
|
|
|
29
29
|
`),Y=Y+(`# Error
|
|
30
30
|
`+(se??""))):t.output!==void 0&&!M&&(Y&&(Y=Y+`
|
|
31
31
|
|
|
32
32
|
`),Y=Y+(`# Output
|
|
33
|
-
`+Te(t.output)));let oe;e:{if(W){let ee;e[29]===Symbol.for("react.memo_cache_sentinel")?(ee=a.jsx(
|
|
33
|
+
`+Te(t.output)));let oe;e:{if(W){let ee;e[29]===Symbol.for("react.memo_cache_sentinel")?(ee=a.jsx(Xs,{}),e[29]=ee):ee=e[29],oe=ee;break e}if(M){let ee;e[30]===Symbol.for("react.memo_cache_sentinel")?(ee=a.jsx(pt,{className:"size-4 text-muted-foreground"}),e[30]=ee):ee=e[30],oe=ee;break e}const V=S?.icon;if(V){let ee;e[31]!==V?(ee=a.jsx(V,{className:"size-4 text-muted-foreground"}),e[31]=V,e[32]=ee):ee=e[32],oe=ee;break e}let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=a.jsx(ys,{className:"size-4 text-muted-foreground"}),e[33]=Z):Z=e[33],oe=Z}let z;e[34]!==l||e[35]!==i?(z=a.jsx(Qn,{annotations:l,toolMeta:i}),e[34]=l,e[35]=i,e[36]=z):z=e[36];let O;e[37]!==n||e[38]!==c?(O=a.jsx(Zn,{latency:n,outputBytes:c}),e[37]=n,e[38]=c,e[39]=O):O=e[39];let K;e[40]!==z||e[41]!==O?(K=a.jsxs(a.Fragment,{children:[z,O]}),e[40]=z,e[41]=O,e[42]=K):K=e[42];const le=Y||null;let ae;e[43]!==Q||e[44]!==N||e[45]!==W||e[46]!==ue||e[47]!==K||e[48]!==le||e[49]!==oe?(ae=a.jsx(H,{icon:oe,iconDestructive:W,trailing:K,title:N,summary:ue,state:Q,detail:le}),e[43]=Q,e[44]=N,e[45]=W,e[46]=ue,e[47]=K,e[48]=le,e[49]=oe,e[50]=ae):ae=e[50];let de;e[51]!==I||e[52]!==$||e[53]!==r?(de=I&&a.jsx("div",{className:"flex justify-end mt-1.5 mb-1",children:a.jsxs("button",{type:"button",onClick:$,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground rounded-lg [@media(hover:hover)]:hover:bg-accent/50 [@media(hover:hover)]:hover:text-foreground transition-colors",children:[a.jsx(bs,{className:"size-3.5"}),r("chat.generic.openInPanel")]})}),e[51]=I,e[52]=$,e[53]=r,e[54]=de):de=e[54];let ie;e[55]!==I||e[56]!==f||e[57]!==b||e[58]!==N||e[59]!==D||e[60]!==q||e[61]!==M||e[62]!==j||e[63]!==p.id||e[64]!==p.slug||e[65]!==t.input||e[66]!==t.output||e[67]!==A||e[68]!==r||e[69]!==y||e[70]!==C?(ie=M&&C&&b&&p?.id&&a.jsx(a.Fragment,{children:a.jsx(ls,{fallback:V=>{const{resetError:Z}=V;return a.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-2.5 border border-dashed border-destructive/30 bg-destructive/5 rounded-lg",children:[a.jsx(It,{size:16,className:"shrink-0 text-destructive"}),a.jsx("span",{className:"flex-1 text-xs text-destructive font-medium",children:r("chat.generic.failedToLoad",{toolName:N})}),a.jsxs(He,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5 shrink-0",onClick:Z,children:[a.jsx(ft,{className:"size-3.5"}),r("chat.generic.retry")]})]})},children:a.jsx(R.Suspense,{fallback:a.jsx("div",{className:"mt-2 flex items-center justify-center h-12 border border-border/75 rounded-lg overflow-hidden p-3",children:a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(as,{className:"size-4"}),a.jsx("span",{className:"text-sm",children:r("chat.generic.loadingApp")})]})}),children:a.jsx(nl,{uiResourceUri:C,connectionId:b,orgId:p.id,orgSlug:p.slug,toolName:y,toolInput:t.input,toolResult:t.output,toolMeta:j,onMessage:D,onUpdateModelContext:A&&f?V=>f.setAppContext(A,V):void 0,onTeardown:A&&f?()=>f.clearAppContext(A):void 0,onRequestDisplayMode:I?q:void 0})})})}),e[55]=I,e[56]=f,e[57]=b,e[58]=N,e[59]=D,e[60]=q,e[61]=M,e[62]=j,e[63]=p.id,e[64]=p.slug,e[65]=t.input,e[66]=t.output,e[67]=A,e[68]=r,e[69]=y,e[70]=C,e[71]=ie):ie=e[71];let ce;return e[72]!==ae||e[73]!==de||e[74]!==ie?(ce=a.jsxs("div",{children:[ae,de,ie]}),e[72]=ae,e[73]=de,e[74]=ie,e[75]=ce):ce=e[75],ce}function Ut(s){return typeof s=="object"&&s!=null&&"type"in s&&s.type==="mcpToolCall"}function tl(s){if(s!=null)return Ut(s)?s.arguments??void 0:s}function sl(s){if(s==null)return;if(Ut(s)&&s.result!=null)return s.result;if(typeof s=="object"&&"content"in s&&Array.isArray(s.content)){const t=s.content;if(t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"type"in t[0])return s}const e=typeof s=="string"?s:JSON.stringify(s);return{structuredContent:typeof s=="object"&&!Array.isArray(s)?s:void 0,content:[{type:"text",text:e}]}}function nl(s){const e=E.c(27),{uiResourceUri:t,connectionId:l,orgId:n,orgSlug:c,toolName:u,toolInput:i,toolResult:r,toolMeta:o,onMessage:m,onUpdateModelContext:d,onTeardown:f,onRequestDisplayMode:p}=s;let g;e[0]!==l||e[1]!==n||e[2]!==c?(g={connectionId:l,orgId:n,orgSlug:c},e[0]=l,e[1]=n,e[2]=c,e[3]=g):g=e[3];const h=_t(g);let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x={type:"object"},e[4]=x):x=e[4];let v;e[5]!==o?(v=o!=null&&{_meta:o},e[5]=o,e[6]=v):v=e[6];let b;e[7]!==v||e[8]!==u?(b={name:u,inputSchema:x,...v},e[7]=v,e[8]=u,e[9]=b):b=e[9];const k=b;let j;e[10]!==k?(j={tool:k},e[10]=k,e[11]=j):j=e[11];let _;e[12]!==i?(_=tl(i),e[12]=i,e[13]=_):_=e[13];let y;e[14]!==r?(y=sl(r),e[14]=r,e[15]=y):y=e[15];let S;return e[16]!==h||e[17]!==m||e[18]!==p||e[19]!==f||e[20]!==d||e[21]!==n||e[22]!==j||e[23]!==_||e[24]!==y||e[25]!==t?(S=a.jsx("div",{className:"mt-2 border border-border/75 rounded-lg overflow-hidden p-3",children:a.jsx(qs,{resourceURI:t,orgId:n,toolInfo:j,toolInput:_,toolResult:y,client:h,onMessage:m,onUpdateModelContext:d,onTeardown:f,onRequestDisplayMode:p})}),e[16]=h,e[17]=m,e[18]=p,e[19]=f,e[20]=d,e[21]=n,e[22]=j,e[23]=_,e[24]=y,e[25]=t,e[26]=S):S=e[26],S}const rt="studio-storage://",it="mesh-storage://";function Je(s){return s.startsWith(rt)?s.slice(rt.length):s.startsWith(it)?s.slice(it.length):null}function Ht(s,e){const t=Je(s);return t!==null?`/api/${e}/files/${t}`:s}function ll(s){return Array.isArray(s?.images)?s.images:void 0}function al(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;return l?{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:0,cacheReadTokens:0,cacheWriteTokens:0}:null}function ol(s){const e=E.c(14),{uri:t,orgSlug:l}=s,n=U();let c;e[0]!==l||e[1]!==t?(c=Ht(t,l),e[0]=l,e[1]=t,e[2]=c):c=e[2];const u=c;let i;e[3]!==n||e[4]!==t?(i=Je(t)!==null?t.slice(t.lastIndexOf("/")+1):n("chat.generateImage.reference"),e[3]=n,e[4]=t,e[5]=i):i=e[5];const r=i;let o;e[6]!==r?(o=a.jsx(Nt,{asChild:!0,children:a.jsx("span",{className:"inline-flex items-center gap-1 px-1 py-0.5 rounded bg-muted text-muted-foreground text-xs cursor-default select-none",children:r})}),e[6]=r,e[7]=o):o=e[7];let m;e[8]!==r||e[9]!==u?(m=a.jsx(St,{side:"top",className:"max-w-sm p-1.5",children:a.jsx("img",{src:u,alt:r,className:"max-w-full max-h-64 object-contain rounded"})}),e[8]=r,e[9]=u,e[10]=m):m=e[10];let d;return e[11]!==o||e[12]!==m?(d=a.jsxs(kt,{children:[o,m]}),e[11]=o,e[12]=m,e[13]=d):d=e[13],d}function rl(s){const e=E.c(61),{part:t,latency:l}=s,n=U(),c=mt();let u;e[0]!==t.state?(u=pe(t.state),e[0]=t.state,e[1]=u):u=e[1];const i=u,r=t.input,o=t.output,m=ll(o);let d;e[2]!==o?(d=al(o),e[2]=o,e[3]=d):d=e[3];const f=d,g=$t()?o?.model:void 0,h=Array.isArray(r?.referenceImages)?r.referenceImages.filter(il):void 0;let x;e[4]!==l?(x=l!=null&&l>0?a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:je(l)}):null,e[4]=l,e[5]=x):x=e[5];const v=x;if(i==="loading"){let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=a.jsx(_e,{size:14}),e[6]=I):I=e[6];let T;e[7]!==n?(T=n("chat.generateImage.generatingImage"),e[7]=n,e[8]=T):T=e[8];let $;e[9]!==r?($=r?.prompt?`"${r.prompt.slice(0,80)}…"`:void 0,e[9]=r,e[10]=$):$=e[10];let P;return e[11]!==T||e[12]!==$?(P=a.jsx(H,{icon:I,title:T,summary:$,state:"loading"}),e[11]=T,e[12]=$,e[13]=P):P=e[13],P}if(o?.background){let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=a.jsx(_e,{size:14}),e[14]=I):I=e[14];let T;e[15]!==n?(T=n("chat.generateImage.imageQueuedGeneratingInBackground"),e[15]=n,e[16]=T):T=e[16];let $;e[17]!==r?($=r?.prompt?`"${r.prompt.slice(0,80)}…"`:void 0,e[17]=r,e[18]=$):$=e[18];let P;return e[19]!==T||e[20]!==$?(P=a.jsx(H,{icon:I,title:T,summary:$,state:"idle"}),e[19]=T,e[20]=$,e[21]=P):P=e[21],P}if(i==="error"||!m||m.length===0){let I;e[22]!==t||e[23]!==i?(I=i==="error"?Me(t):void 0,e[22]=t,e[23]=i,e[24]=I):I=e[24];const T=I;let $="";r!==void 0&&($=`# Input
|
|
34
34
|
`+Te(r)),T?($&&($=$+`
|
|
35
35
|
|
|
36
36
|
`),$=$+(`# Error
|
|
37
37
|
`+T)):o!==void 0&&($&&($=$+`
|
|
38
38
|
|
|
39
39
|
`),$=$+(`# Output
|
|
40
|
-
`+Te(o)));let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(_e,{size:14}),e[25]=P):P=e[25];let q;e[26]!==n?(q=n("chat.generateImage.imageGeneration"),e[26]=n,e[27]=q):q=e[27];let B;e[28]!==i||e[29]!==n?(B=n(i==="error"?"chat.generateImage.failed":"chat.generateImage.noImagesGenerated"),e[28]=i,e[29]=n,e[30]=B):B=e[30];const D=i==="error"?"error":"idle",F=$||null;let W;return e[31]!==v||e[32]!==q||e[33]!==B||e[34]!==D||e[35]!==F||e[36]!==f?(W=a.jsx(H,{icon:P,title:q,summary:B,state:D,usage:f,trailing:v,detail:F}),e[31]=v,e[32]=q,e[33]=B,e[34]=D,e[35]=F,e[36]=f,e[37]=W):W=e[37],W}const b="flex flex-col gap-2";let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(_e,{size:14,className:"text-special"}),e[38]=k):k=e[38];let j;e[39]!==n?(j=n("chat.generateImage.generatedImage"),e[39]=n,e[40]=j):j=e[40];let _;e[41]!==r?(_=r?.prompt&&a.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:r.prompt}),e[41]=r,e[42]=_):_=e[42];const y=h&&h.length>0&&a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"text-[11px] text-muted-foreground/50",children:n("chat.generateImage.references")}),h.map((I,T)=>{const $=I.uri??I.url;return a.jsx(ol,{uri:$,orgSlug:c.slug},T)})]});let S;e[43]!==_||e[44]!==y?(S=a.jsxs("div",{className:"flex flex-col gap-1 pb-2 pl-6",children:[_,y]}),e[43]=_,e[44]=y,e[45]=S):S=e[45];let N;e[46]!==v||e[47]!==g||e[48]!==j||e[49]!==S||e[50]!==f?(N=a.jsx(H,{icon:k,title:j,summary:g,state:"idle",usage:f,trailing:v,children:S}),e[46]=v,e[47]=g,e[48]=j,e[49]=S,e[50]=f,e[51]=N):N=e[51];const w="flex flex-wrap gap-2";let C;e[52]!==r?.prompt||e[53]!==c||e[54]!==n?(C=(I,T)=>{const $=I.uri??I.url;if(!$)return null;const P=Ht($,c.slug);return a.jsx(en,{src:P,alt:r?.prompt??n("chat.generateImage.generatedImageAlt"),children:a.jsx("img",{src:P,alt:r?.prompt??n("chat.generateImage.generatedImageAlt"),className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"})},T)},e[52]=r?.prompt,e[53]=c,e[54]=n,e[55]=C):C=e[55];const M=m.map(C);let A;e[56]!==M?(A=a.jsx("div",{className:w,children:M}),e[56]=M,e[57]=A):A=e[57];let L;return e[58]!==N||e[59]!==A?(L=a.jsxs("div",{className:b,children:[N,A]}),e[58]=N,e[59]=A,e[60]=L):L=e[60],L}function il(s){return s.uri??s.url}function cl(s,e){const t=Xe(s);return t!==null?`/api/${e}/files/${t}`:s}function ul(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;if(!l)return null;const n={providerMetadata:s.usage.providerMetadata};return{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:Fs(n),cacheReadTokens:0,cacheWriteTokens:0}}function dl(s){try{return new URL(s).hostname.replace(/^www\./,"")}catch{return s}}function fl(s){try{return`${new URL(s).origin}/favicon.ico`}catch{return""}}function ml(s){const e=E.c(16),{citation:t,index:l}=s;let n;e[0]!==t.url?(n=dl(t.url),e[0]=t.url,e[1]=n):n=e[1];const c=n;let u;e[2]!==t.url?(u=fl(t.url),e[2]=t.url,e[3]=u):u=e[3];const i=u,r=t.title||c;let o;e[4]!==i?(o=a.jsx("img",{src:i,alt:"",className:"size-3.5 rounded-sm shrink-0",onError:pl}),e[4]=i,e[5]=o):o=e[5];let m;e[6]!==r?(m=a.jsx("span",{className:"truncate max-w-[180px]",children:r}),e[6]=r,e[7]=m):m=e[7];const d=l+1;let f;e[8]!==d?(f=a.jsxs("span",{className:"text-[10px] text-muted-foreground/50 tabular-nums shrink-0",children:["[",d,"]"]}),e[8]=d,e[9]=f):f=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(Mt,{size:10,className:"shrink-0 opacity-0 group-hover/src:opacity-100 transition-opacity"}),e[10]=p):p=e[10];let g;return e[11]!==t.url||e[12]!==o||e[13]!==m||e[14]!==f?(g=a.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group/src inline-flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:[o,m,f,p]}),e[11]=t.url,e[12]=o,e[13]=m,e[14]=f,e[15]=g):g=e[15],g}function pl(s){s.target.style.display="none"}function gl(s,e){return s.replace(/\[(\d+)\]/g,(t,l)=>{const n=parseInt(l,10)-1,c=e[n];return c?`[\\[${l}\\]](${c.url})`:t})}const Pe=5;function xl(s){const e=E.c(13),{citations:t}=s,l=U(),[n,c]=R.useState(!1),u=t.length>Pe;let i;e[0]!==t||e[1]!==n?(i=n?t:t.slice(0,Pe),e[0]=t,e[1]=n,e[2]=i):i=e[2];const r=i;let o;e[3]!==r?(o=r.map(bl),e[3]=r,e[4]=o):o=e[4];let m;e[5]!==t.length||e[6]!==n||e[7]!==u||e[8]!==l?(m=u&&a.jsx("button",{type:"button",onClick:()=>c(hl),className:"inline-flex items-center rounded-lg border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:n?l("chat.webSearch.showLess"):l("chat.webSearch.showMore",{count:t.length-Pe})}),e[5]=t.length,e[6]=n,e[7]=u,e[8]=l,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[o,m]}),e[10]=o,e[11]=m,e[12]=d):d=e[12],d}function hl(s){return!s}function bl(s,e){return a.jsx(ml,{citation:s,index:e},s.url)}function yl(s){const e=E.c(61),{part:t,latency:l,streamingText:n}=s,c=U(),u=mt();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const r=i,o=t.input,m=t.output;let d,f,p;e[2]!==u||e[3]!==m?(d=m?.uri?cl(m.uri,u.slug):void 0,p=dt,f=he.webSearchBlob(d??""),e[2]=u,e[3]=m,e[4]=d,e[5]=f,e[6]=p):(d=e[4],f=e[5],p=e[6]);let g;e[7]!==d?(g=async()=>{const J=await fetch(d);if(!J.ok)throw new Error(`Failed to fetch: ${J.status}`);return J.text()},e[7]=d,e[8]=g):g=e[8];const h=!!d;let x;e[9]!==f||e[10]!==g||e[11]!==h?(x={queryKey:f,queryFn:g,enabled:h,staleTime:1/0},e[9]=f,e[10]=g,e[11]=h,e[12]=x):x=e[12];const{data:v}=p(x),b=r==="loading",k=r!=="loading"&&r!=="error",j=$t(),_=m?.citations;let y;e[13]!==m?(y=ul(m),e[13]=m,e[14]=y):y=e[14];const S=y,N=m?.content??v??n;let w;e[15]!==_||e[16]!==N?(w=N&&_?.length?gl(N,_):N,e[15]=_,e[16]=N,e[17]=w):w=e[17];const C=w;let M;e[18]!==l?(M=l!=null&&l>0?a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:je(l)}):null,e[18]=l,e[19]=M):M=e[19];const A=M;if(r==="error"){let J;e[20]===Symbol.for("react.memo_cache_sentinel")?(J=a.jsx(De,{size:14}),e[20]=J):J=e[20];let te;e[21]!==c?(te=c("chat.webSearch.title"),e[21]=c,e[22]=te):te=e[22];let Q;e[23]!==c?(Q=c("chat.webSearch.failed"),e[23]=c,e[24]=Q):Q=e[24];let se;return e[25]!==A||e[26]!==te||e[27]!==Q||e[28]!==S?(se=a.jsx(H,{icon:J,title:te,summary:Q,state:"error",usage:S,trailing:A}),e[25]=A,e[26]=te,e[27]=Q,e[28]=S,e[29]=se):se=e[29],se}const L=b?"animate-pulse":"text-blue-500";let I;e[30]!==L?(I=K(L),e[30]=L,e[31]=I):I=e[31];let T;e[32]!==I?(T=a.jsx(De,{size:14,className:I}),e[32]=I,e[33]=T):T=e[33];let $;e[34]!==b||e[35]!==c?($=c(b?"chat.webSearch.researching":"chat.webSearch.title"),e[34]=b,e[35]=c,e[36]=$):$=e[36];let P;e[37]!==o||e[38]!==k||e[39]!==m?.model||e[40]!==j?(P=k?(j?m?.model:void 0)??o?.query?.slice(0,60):o?.query?`"${o.query.slice(0,80)}"`:void 0,e[37]=o,e[38]=k,e[39]=m?.model,e[40]=j,e[41]=P):P=e[41];const q=b?"loading":"idle";let B;e[42]!==o?(B=o?.query&&a.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:o.query}),e[42]=o,e[43]=B):B=e[43];let D;e[44]!==C||e[45]!==t.toolCallId?(D=C?a.jsx("div",{className:"max-h-96 overflow-y-auto overflow-x-hidden rounded-lg border border-border/40 bg-muted/20 px-4 py-3 min-w-0",children:a.jsx("div",{className:"prose prose-sm prose-neutral dark:prose-invert max-w-none text-[13px] leading-relaxed break-words",children:a.jsx(At,{id:t.toolCallId,text:C})})}):a.jsx("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-4 py-3",children:a.jsxs("div",{className:"space-y-2 animate-pulse",children:[a.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-3/4"}),a.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-1/2"})]})}),e[44]=C,e[45]=t.toolCallId,e[46]=D):D=e[46];let F;e[47]!==_?(F=_&&_.length>0&&a.jsx(xl,{citations:_}),e[47]=_,e[48]=F):F=e[48];let W;e[49]!==B||e[50]!==D||e[51]!==F?(W=a.jsxs("div",{className:"pl-6 pb-3 flex flex-col gap-1 min-w-0",children:[B,D,F]}),e[49]=B,e[50]=D,e[51]=F,e[52]=W):W=e[52];let X;return e[53]!==A||e[54]!==T||e[55]!==$||e[56]!==P||e[57]!==q||e[58]!==W||e[59]!==S?(X=a.jsx(H,{icon:T,title:$,summary:P,state:q,usage:S,trailing:A,defaultOpen:!0,children:W}),e[53]=A,e[54]=T,e[55]=$,e[56]=P,e[57]=q,e[58]=W,e[59]=S,e[60]=X):X=e[60],X}function jl(s){const e=E.c(16),{part:t}=s,l=U();if(!t.state.startsWith("output-"))return null;let n;e[0]!==t.input?.prompt||e[1]!==l?(n=t.input?.prompt?.trim()||l("chat.userAskQuestion.question"),e[0]=t.input?.prompt,e[1]=l,e[2]=n):n=e[2];const c=n,u=t.state==="output-error"||t.state==="output-denied",i=t.state==="output-denied";let r;e[3]!==i||e[4]!==t||e[5]!==l?(r=i?l("chat.userAskQuestion.skippedAnswer"):t.state==="output-error"?Me(t)??l("chat.subtask.errorLabel"):t.output?.response??"",e[3]=i,e[4]=t,e[5]=l,e[6]=r):r=e[6];const o=r;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(js,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[7]=m):m=e[7];let d;e[8]!==c?(d=a.jsxs("div",{className:"flex items-start gap-2",children:[m,a.jsx("span",{className:"text-[14px] text-muted-foreground leading-snug",children:c})]}),e[8]=c,e[9]=d):d=e[9];let f;e[10]!==o||e[11]!==u?(f=o&&a.jsx("div",{className:"ml-6 pl-2 border-l border-border/50",children:a.jsx("span",{className:K("text-[14px] leading-snug",u?"text-muted-foreground/50 italic":"text-foreground/70"),children:o})}),e[10]=o,e[11]=u,e[12]=f):f=e[12];let p;return e[13]!==d||e[14]!==f?(p=a.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[d,f]}),e[13]=d,e[14]=f,e[15]=p):p=e[15],p}function vl(s){const e=E.c(14),{part:t}=s,l=U();if(!t.state.startsWith("output-"))return null;const n=t.output?.accepted===!0;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(vs,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[0]=c):c=e[0];const u=t.input?.title;let i;e[1]!==u?(i=a.jsx("span",{className:"text-[14px] leading-snug text-muted-foreground",children:u}),e[1]=u,e[2]=i):i=e[2];const r=n?"text-foreground/70":"text-muted-foreground/50 italic";let o;e[3]!==r?(o=K("text-[14px] leading-snug shrink-0",r),e[3]=r,e[4]=o):o=e[4];let m;e[5]!==n||e[6]!==l?(m=l(n?"chat.suggestTask.accepted":"chat.suggestTask.declined"),e[5]=n,e[6]=l,e[7]=m):m=e[7];let d;e[8]!==o||e[9]!==m?(d=a.jsx("span",{className:o,children:m}),e[8]=o,e[9]=m,e[10]=d):d=e[10];let f;return e[11]!==i||e[12]!==d?(f=a.jsxs("div",{className:"my-1.5 flex items-start gap-2",children:[c,i,d]}),e[11]=i,e[12]=d,e[13]=f):f=e[13],f}const qt=R.createContext(new Map);function _o(s){const e=E.c(5),{messages:t,children:l}=s;let n;if(e[0]!==t){n=new Map;for(const u of t){const i=u.metadata?.subtaskJobId;if(!i)continue;const r=n.get(i);r?r.push(u):n.set(i,[u])}e[0]=t,e[1]=n}else n=e[1];let c;return e[2]!==n||e[3]!==l?(c=a.jsx(qt.Provider,{value:n,children:l}),e[2]=n,e[3]=l,e[4]=c):c=e[4],c}function Nl(s){const e=E.c(3),t=R.useContext(qt);let l;return e[0]!==s||e[1]!==t?(l=s?t.get(s)??[]:[],e[0]=s,e[1]=t,e[2]=l):l=e[2],l}function Sl(s){return new ReadableStream({async start(e){const t=s.getReader(),l=new TextDecoder;let n="";try{for(;;){const{done:c,value:u}=await t.read();if(c)break;n+=l.decode(u,{stream:!0});let i;for(;(i=n.indexOf(`
|
|
40
|
+
`+Te(o)));let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(_e,{size:14}),e[25]=P):P=e[25];let q;e[26]!==n?(q=n("chat.generateImage.imageGeneration"),e[26]=n,e[27]=q):q=e[27];let B;e[28]!==i||e[29]!==n?(B=n(i==="error"?"chat.generateImage.failed":"chat.generateImage.noImagesGenerated"),e[28]=i,e[29]=n,e[30]=B):B=e[30];const D=i==="error"?"error":"idle",F=$||null;let W;return e[31]!==v||e[32]!==q||e[33]!==B||e[34]!==D||e[35]!==F||e[36]!==f?(W=a.jsx(H,{icon:P,title:q,summary:B,state:D,usage:f,trailing:v,detail:F}),e[31]=v,e[32]=q,e[33]=B,e[34]=D,e[35]=F,e[36]=f,e[37]=W):W=e[37],W}const b="flex flex-col gap-2";let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(_e,{size:14,className:"text-special"}),e[38]=k):k=e[38];let j;e[39]!==n?(j=n("chat.generateImage.generatedImage"),e[39]=n,e[40]=j):j=e[40];let _;e[41]!==r?(_=r?.prompt&&a.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:r.prompt}),e[41]=r,e[42]=_):_=e[42];const y=h&&h.length>0&&a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"text-[11px] text-muted-foreground/50",children:n("chat.generateImage.references")}),h.map((I,T)=>{const $=I.uri??I.url;return a.jsx(ol,{uri:$,orgSlug:c.slug},T)})]});let S;e[43]!==_||e[44]!==y?(S=a.jsxs("div",{className:"flex flex-col gap-1 pb-2 pl-6",children:[_,y]}),e[43]=_,e[44]=y,e[45]=S):S=e[45];let N;e[46]!==v||e[47]!==g||e[48]!==j||e[49]!==S||e[50]!==f?(N=a.jsx(H,{icon:k,title:j,summary:g,state:"idle",usage:f,trailing:v,children:S}),e[46]=v,e[47]=g,e[48]=j,e[49]=S,e[50]=f,e[51]=N):N=e[51];const w="flex flex-wrap gap-2";let C;e[52]!==r?.prompt||e[53]!==c||e[54]!==n?(C=(I,T)=>{const $=I.uri??I.url;if(!$)return null;const P=Ht($,c.slug);return a.jsx(en,{src:P,alt:r?.prompt??n("chat.generateImage.generatedImageAlt"),children:a.jsx("img",{src:P,alt:r?.prompt??n("chat.generateImage.generatedImageAlt"),className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"})},T)},e[52]=r?.prompt,e[53]=c,e[54]=n,e[55]=C):C=e[55];const M=m.map(C);let A;e[56]!==M?(A=a.jsx("div",{className:w,children:M}),e[56]=M,e[57]=A):A=e[57];let L;return e[58]!==N||e[59]!==A?(L=a.jsxs("div",{className:b,children:[N,A]}),e[58]=N,e[59]=A,e[60]=L):L=e[60],L}function il(s){return s.uri??s.url}function cl(s,e){const t=Je(s);return t!==null?`/api/${e}/files/${t}`:s}function ul(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;if(!l)return null;const n={providerMetadata:s.usage.providerMetadata};return{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:Fs(n),cacheReadTokens:0,cacheWriteTokens:0}}function dl(s){try{return new URL(s).hostname.replace(/^www\./,"")}catch{return s}}function fl(s){try{return`${new URL(s).origin}/favicon.ico`}catch{return""}}function ml(s){const e=E.c(16),{citation:t,index:l}=s;let n;e[0]!==t.url?(n=dl(t.url),e[0]=t.url,e[1]=n):n=e[1];const c=n;let u;e[2]!==t.url?(u=fl(t.url),e[2]=t.url,e[3]=u):u=e[3];const i=u,r=t.title||c;let o;e[4]!==i?(o=a.jsx("img",{src:i,alt:"",className:"size-3.5 rounded-sm shrink-0",onError:pl}),e[4]=i,e[5]=o):o=e[5];let m;e[6]!==r?(m=a.jsx("span",{className:"truncate max-w-[180px]",children:r}),e[6]=r,e[7]=m):m=e[7];const d=l+1;let f;e[8]!==d?(f=a.jsxs("span",{className:"text-[10px] text-muted-foreground/50 tabular-nums shrink-0",children:["[",d,"]"]}),e[8]=d,e[9]=f):f=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(Mt,{size:10,className:"shrink-0 opacity-0 group-hover/src:opacity-100 transition-opacity"}),e[10]=p):p=e[10];let g;return e[11]!==t.url||e[12]!==o||e[13]!==m||e[14]!==f?(g=a.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group/src inline-flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:[o,m,f,p]}),e[11]=t.url,e[12]=o,e[13]=m,e[14]=f,e[15]=g):g=e[15],g}function pl(s){s.target.style.display="none"}function gl(s,e){return s.replace(/\[(\d+)\]/g,(t,l)=>{const n=parseInt(l,10)-1,c=e[n];return c?`[\\[${l}\\]](${c.url})`:t})}const Pe=5;function xl(s){const e=E.c(13),{citations:t}=s,l=U(),[n,c]=R.useState(!1),u=t.length>Pe;let i;e[0]!==t||e[1]!==n?(i=n?t:t.slice(0,Pe),e[0]=t,e[1]=n,e[2]=i):i=e[2];const r=i;let o;e[3]!==r?(o=r.map(bl),e[3]=r,e[4]=o):o=e[4];let m;e[5]!==t.length||e[6]!==n||e[7]!==u||e[8]!==l?(m=u&&a.jsx("button",{type:"button",onClick:()=>c(hl),className:"inline-flex items-center rounded-lg border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:n?l("chat.webSearch.showLess"):l("chat.webSearch.showMore",{count:t.length-Pe})}),e[5]=t.length,e[6]=n,e[7]=u,e[8]=l,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[o,m]}),e[10]=o,e[11]=m,e[12]=d):d=e[12],d}function hl(s){return!s}function bl(s,e){return a.jsx(ml,{citation:s,index:e},s.url)}function yl(s){const e=E.c(61),{part:t,latency:l,streamingText:n}=s,c=U(),u=mt();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const r=i,o=t.input,m=t.output;let d,f,p;e[2]!==u||e[3]!==m?(d=m?.uri?cl(m.uri,u.slug):void 0,p=dt,f=he.webSearchBlob(d??""),e[2]=u,e[3]=m,e[4]=d,e[5]=f,e[6]=p):(d=e[4],f=e[5],p=e[6]);let g;e[7]!==d?(g=async()=>{const X=await fetch(d);if(!X.ok)throw new Error(`Failed to fetch: ${X.status}`);return X.text()},e[7]=d,e[8]=g):g=e[8];const h=!!d;let x;e[9]!==f||e[10]!==g||e[11]!==h?(x={queryKey:f,queryFn:g,enabled:h,staleTime:1/0},e[9]=f,e[10]=g,e[11]=h,e[12]=x):x=e[12];const{data:v}=p(x),b=r==="loading",k=r!=="loading"&&r!=="error",j=$t(),_=m?.citations;let y;e[13]!==m?(y=ul(m),e[13]=m,e[14]=y):y=e[14];const S=y,N=m?.content??v??n;let w;e[15]!==_||e[16]!==N?(w=N&&_?.length?gl(N,_):N,e[15]=_,e[16]=N,e[17]=w):w=e[17];const C=w;let M;e[18]!==l?(M=l!=null&&l>0?a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:je(l)}):null,e[18]=l,e[19]=M):M=e[19];const A=M;if(r==="error"){let X;e[20]===Symbol.for("react.memo_cache_sentinel")?(X=a.jsx(De,{size:14}),e[20]=X):X=e[20];let te;e[21]!==c?(te=c("chat.webSearch.title"),e[21]=c,e[22]=te):te=e[22];let Q;e[23]!==c?(Q=c("chat.webSearch.failed"),e[23]=c,e[24]=Q):Q=e[24];let se;return e[25]!==A||e[26]!==te||e[27]!==Q||e[28]!==S?(se=a.jsx(H,{icon:X,title:te,summary:Q,state:"error",usage:S,trailing:A}),e[25]=A,e[26]=te,e[27]=Q,e[28]=S,e[29]=se):se=e[29],se}const L=b?"animate-pulse":"text-blue-500";let I;e[30]!==L?(I=G(L),e[30]=L,e[31]=I):I=e[31];let T;e[32]!==I?(T=a.jsx(De,{size:14,className:I}),e[32]=I,e[33]=T):T=e[33];let $;e[34]!==b||e[35]!==c?($=c(b?"chat.webSearch.researching":"chat.webSearch.title"),e[34]=b,e[35]=c,e[36]=$):$=e[36];let P;e[37]!==o||e[38]!==k||e[39]!==m?.model||e[40]!==j?(P=k?(j?m?.model:void 0)??o?.query?.slice(0,60):o?.query?`"${o.query.slice(0,80)}"`:void 0,e[37]=o,e[38]=k,e[39]=m?.model,e[40]=j,e[41]=P):P=e[41];const q=b?"loading":"idle";let B;e[42]!==o?(B=o?.query&&a.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:o.query}),e[42]=o,e[43]=B):B=e[43];let D;e[44]!==C||e[45]!==t.toolCallId?(D=C?a.jsx("div",{className:"max-h-96 overflow-y-auto overflow-x-hidden rounded-lg border border-border/40 bg-muted/20 px-4 py-3 min-w-0",children:a.jsx("div",{className:"prose prose-sm prose-neutral dark:prose-invert max-w-none text-[13px] leading-relaxed break-words",children:a.jsx(At,{id:t.toolCallId,text:C})})}):a.jsx("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-4 py-3",children:a.jsxs("div",{className:"space-y-2 animate-pulse",children:[a.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-3/4"}),a.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-1/2"})]})}),e[44]=C,e[45]=t.toolCallId,e[46]=D):D=e[46];let F;e[47]!==_?(F=_&&_.length>0&&a.jsx(xl,{citations:_}),e[47]=_,e[48]=F):F=e[48];let W;e[49]!==B||e[50]!==D||e[51]!==F?(W=a.jsxs("div",{className:"pl-6 pb-3 flex flex-col gap-1 min-w-0",children:[B,D,F]}),e[49]=B,e[50]=D,e[51]=F,e[52]=W):W=e[52];let J;return e[53]!==A||e[54]!==T||e[55]!==$||e[56]!==P||e[57]!==q||e[58]!==W||e[59]!==S?(J=a.jsx(H,{icon:T,title:$,summary:P,state:q,usage:S,trailing:A,defaultOpen:!0,children:W}),e[53]=A,e[54]=T,e[55]=$,e[56]=P,e[57]=q,e[58]=W,e[59]=S,e[60]=J):J=e[60],J}function jl(s){const e=E.c(16),{part:t}=s,l=U();if(!t.state.startsWith("output-"))return null;let n;e[0]!==t.input?.prompt||e[1]!==l?(n=t.input?.prompt?.trim()||l("chat.userAskQuestion.question"),e[0]=t.input?.prompt,e[1]=l,e[2]=n):n=e[2];const c=n,u=t.state==="output-error"||t.state==="output-denied",i=t.state==="output-denied";let r;e[3]!==i||e[4]!==t||e[5]!==l?(r=i?l("chat.userAskQuestion.skippedAnswer"):t.state==="output-error"?Me(t)??l("chat.subtask.errorLabel"):t.output?.response??"",e[3]=i,e[4]=t,e[5]=l,e[6]=r):r=e[6];const o=r;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(js,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[7]=m):m=e[7];let d;e[8]!==c?(d=a.jsxs("div",{className:"flex items-start gap-2",children:[m,a.jsx("span",{className:"text-[14px] text-muted-foreground leading-snug",children:c})]}),e[8]=c,e[9]=d):d=e[9];let f;e[10]!==o||e[11]!==u?(f=o&&a.jsx("div",{className:"ml-6 pl-2 border-l border-border/50",children:a.jsx("span",{className:G("text-[14px] leading-snug",u?"text-muted-foreground/50 italic":"text-foreground/70"),children:o})}),e[10]=o,e[11]=u,e[12]=f):f=e[12];let p;return e[13]!==d||e[14]!==f?(p=a.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[d,f]}),e[13]=d,e[14]=f,e[15]=p):p=e[15],p}function vl(s){const e=E.c(14),{part:t}=s,l=U();if(!t.state.startsWith("output-"))return null;const n=t.output?.accepted===!0;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(vs,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[0]=c):c=e[0];const u=t.input?.title;let i;e[1]!==u?(i=a.jsx("span",{className:"text-[14px] leading-snug text-muted-foreground",children:u}),e[1]=u,e[2]=i):i=e[2];const r=n?"text-foreground/70":"text-muted-foreground/50 italic";let o;e[3]!==r?(o=G("text-[14px] leading-snug shrink-0",r),e[3]=r,e[4]=o):o=e[4];let m;e[5]!==n||e[6]!==l?(m=l(n?"chat.suggestTask.accepted":"chat.suggestTask.declined"),e[5]=n,e[6]=l,e[7]=m):m=e[7];let d;e[8]!==o||e[9]!==m?(d=a.jsx("span",{className:o,children:m}),e[8]=o,e[9]=m,e[10]=d):d=e[10];let f;return e[11]!==i||e[12]!==d?(f=a.jsxs("div",{className:"my-1.5 flex items-start gap-2",children:[c,i,d]}),e[11]=i,e[12]=d,e[13]=f):f=e[13],f}const qt=R.createContext(new Map);function _o(s){const e=E.c(5),{messages:t,children:l}=s;let n;if(e[0]!==t){n=new Map;for(const u of t){const i=u.metadata?.subtaskJobId;if(!i)continue;const r=n.get(i);r?r.push(u):n.set(i,[u])}e[0]=t,e[1]=n}else n=e[1];let c;return e[2]!==n||e[3]!==l?(c=a.jsx(qt.Provider,{value:n,children:l}),e[2]=n,e[3]=l,e[4]=c):c=e[4],c}function Nl(s){const e=E.c(3),t=R.useContext(qt);let l;return e[0]!==s||e[1]!==t?(l=s?t.get(s)??[]:[],e[0]=s,e[1]=t,e[2]=l):l=e[2],l}function Sl(s){return new ReadableStream({async start(e){const t=s.getReader(),l=new TextDecoder;let n="";try{for(;;){const{done:c,value:u}=await t.read();if(c)break;n+=l.decode(u,{stream:!0});let i;for(;(i=n.indexOf(`
|
|
41
41
|
|
|
42
42
|
`))!==-1;){const r=n.slice(0,i);n=n.slice(i+2);const o=r.split(`
|
|
43
43
|
`).filter(m=>m.startsWith("data:")).map(m=>m.slice(5).trim()).join(`
|
|
44
44
|
`);if(o)try{e.enqueue(JSON.parse(o))}catch{}}}}finally{t.releaseLock(),e.close()}}})}function kl(s){const{orgSlug:e,threadId:t,jobId:l,enabled:n}=s,[c,u]=R.useState([]),[i,r]=R.useState(!1);return R.useEffect(()=>{if(!n||!l||!t)return;const o=new AbortController;return u([]),r(!0),(async()=>{try{const m=await fetch(`/api/${encodeURIComponent(e)}/decopilot/threads/${encodeURIComponent(t)}/jobs/${encodeURIComponent(l)}/stream`,{headers:{accept:"text/event-stream"},credentials:"include",signal:o.signal});if(!m.ok||!m.body)return;for await(const d of Rs({stream:zs(Sl(m.body),void 0)})){if(o.signal.aborted)return;u([d])}}catch{}finally{o.signal.aborted||r(!1)}})(),()=>o.abort()},[n,l,t,e]),{messages:c,streaming:i}}function _l(s,e){if(s&&typeof s=="object"&&!Array.isArray(s)){const t=s;if(typeof t.text=="string"||typeof t.error=="string"||typeof t.finishReason=="string"){if(typeof t.error=="string"&&t.error.length>0)return e("chat.subtask.failedWithError",{error:t.error});const n=typeof t.text=="string"?t.text.trim():"",c=t.finishReason==="length";return n?(c?`${e("chat.subtask.stepLimitPartial")}
|
|
45
45
|
|
|
46
|
-
`:"")+n:e(c?"chat.subtask.stepLimitNoOutput":"chat.subtask.completedNoOutput")}}return
|
|
47
|
-
… (${f.length-Re} more characters)`:f,e[5]=t.input,e[6]=r}else r=e[6];const o=r;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(gt,{}),e[7]=m):m=e[7];let d;return e[8]!==o||e[9]!==c||e[10]!==i?(d=a.jsx(H,{icon:m,title:c,summary:i,state:"idle",detail:o,detailVariant:"code"}),e[8]=o,e[9]=c,e[10]=i,e[11]=d):d=e[11],d}function Tl(s){const e=E.c(19),{jobId:t,prompt:l,items:n,streaming:c}=s,u=U();let i;e[0]!==u?(i=u("chat.subtask.taskLabel"),e[0]=u,e[1]=i):i=e[1];let r;e[2]!==i?(r=a.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:i}),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l?(o=a.jsx("p",{className:"text-[13px] text-foreground/90 whitespace-pre-wrap wrap-break-word",children:l}),e[4]=l,e[5]=o):o=e[5];let m;e[6]!==r||e[7]!==o?(m=a.jsxs("section",{children:[r,o]}),e[6]=r,e[7]=o,e[8]=m):m=e[8];let d;e[9]!==n||e[10]!==t||e[11]!==c||e[12]!==u?(d=n.length===0?a.jsx("p",{className:"text-[13px] text-muted-foreground/60 italic py-1",children:u("chat.subtask.runningInBackground")}):n.map((g,h)=>{const x=g,v=x.type??"";return v==="text"?x.text?.trim()?a.jsx($e,{id:`${t}-sub-${h}`,part:g,animate:c},`${t}-sub-${h}`):null:v==="dynamic-tool"||v.startsWith("tool-")&&v!=="tool-todo_write"&&v!=="tool-update_interests"?a.jsx(Cl,{part:x},`${t}-sub-${h}`):null}),e[9]=n,e[10]=t,e[11]=c,e[12]=u,e[13]=d):d=e[13];let f;e[14]!==d?(f=a.jsx("section",{className:"flex flex-col gap-3 sm:gap-2",children:d}),e[14]=d,e[15]=f):f=e[15];let p;return e[16]!==m||e[17]!==f?(p=a.jsxs("div",{className:"flex flex-col gap-4",children:[m,f]}),e[16]=m,e[17]=f,e[18]=p):p=e[18],p}function Jt(s){const e=E.c(32),{part:t}=s,l=U(),n=t.output?.jobId,c=Ne()?.taskId??null,{org:u}=ge(),[i,r]=R.useState(!1),o=Nl(n),m=c??"",d=i&&!!c;let f;e[0]!==n||e[1]!==u.slug||e[2]!==m||e[3]!==d?(f={orgSlug:u.slug,threadId:m,jobId:n,enabled:d},e[0]=n,e[1]=u.slug,e[2]=m,e[3]=d,e[4]=f):f=e[4];const p=kl(f);let g;e[5]!==p.messages?(g=p.messages.flatMap($l),e[5]=p.messages,e[6]=g):g=e[6];const h=g;let x;e[7]!==o?(x=o.flatMap(Il),e[7]=o,e[8]=x):x=e[8];const v=x,b=h.length>0?h:v;let k;e[9]!==t.input?.prompt||e[10]!==l?(k=t.input?.prompt??l("chat.subtask.noPromptProvided"),e[9]=t.input?.prompt,e[10]=l,e[11]=k):k=e[11];const j=k;let _;e[12]!==j?(_=j.length>120?`${j.slice(0,120)}…`:j,e[12]=j,e[13]=_):_=e[13];const y=_,S=o.length===0;let N;e[14]!==l?(N=l("chat.subtask.subtaskNoun"),e[14]=l,e[15]=N):N=e[15];let w;e[16]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(qe,{}),e[16]=w):w=e[16];let C;e[17]!==N?(C=a.jsx(Se,{icon:void 0,name:N,size:"2xs",className:"rounded-xs",fallbackIcon:w}),e[17]=N,e[18]=C):C=e[18];let M;e[19]!==l?(M=l("chat.subtask.subtaskNoun"),e[19]=l,e[20]=M):M=e[20];const A=S?"loading":"idle",L=p.streaming||S;let I;e[21]!==b||e[22]!==n||e[23]!==j||e[24]!==L?(I=a.jsx(Tl,{jobId:n,prompt:j,items:b,streaming:L}),e[21]=b,e[22]=n,e[23]=j,e[24]=L,e[25]=I):I=e[25];let T;return e[26]!==y||e[27]!==C||e[28]!==M||e[29]!==A||e[30]!==I?(T=a.jsx(Je,{icon:C,title:M,summary:y,state:A,onOpenChange:r,children:I}),e[26]=y,e[27]=C,e[28]=M,e[29]=A,e[30]=I,e[31]=T):T=e[31],T}function Il(s){return s.parts??[]}function $l(s){return s.parts??[]}function Al(s){const e=E.c(24),t=U(),l=Vt(s.part.toolCallId);if(Wt(s.part.output)){let h;return e[0]!==s?(h=a.jsx(Jt,{...s}),e[0]=s,e[1]=h):h=e[1],h}let n;e[2]!==s||e[3]!==t?(n=Gt(s,t),e[2]=s,e[3]=t,e[4]=n):n=e[4];const{fallbackTitle:c,summary:u,usage:i,state:r}=n;let o;e[5]!==t?(o=t("chat.subtask.subtaskNoun"),e[5]=t,e[6]=o):o=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(qe,{}),e[7]=m):m=e[7];let d;e[8]!==o?(d=a.jsx(Se,{icon:void 0,name:o,size:"2xs",className:"rounded-xs",fallbackIcon:m}),e[8]=o,e[9]=d):d=e[9];let f;e[10]!==l||e[11]!==s.part?(f=l&&Kt(s.part)?l:void 0,e[10]=l,e[11]=s.part,e[12]=f):f=e[12];let p;e[13]!==s.part?(p=a.jsx(Xt,{part:s.part}),e[13]=s.part,e[14]=p):p=e[14];let g;return e[15]!==c||e[16]!==s.latency||e[17]!==r||e[18]!==u||e[19]!==d||e[20]!==f||e[21]!==p||e[22]!==i?(g=a.jsx(Je,{icon:d,title:c,summary:u,state:r,usage:i,latency:s.latency,onFlip:f,children:p}),e[15]=c,e[16]=s.latency,e[17]=r,e[18]=u,e[19]=d,e[20]=f,e[21]=p,e[22]=i,e[23]=g):g=e[23],g}function Ml(s){const e=E.c(26),t=U(),l=Et(s.part.input?.agent_id),n=Vt(s.part.toolCallId);if(Wt(s.part.output)){let b;return e[0]!==s?(b=a.jsx(Jt,{...s}),e[0]=s,e[1]=b):b=e[1],b}let c;e[2]!==s||e[3]!==t?(c=Gt(s,t),e[2]=s,e[3]=t,e[4]=c):c=e[4];const{fallbackTitle:u,summary:i,usage:r,state:o}=c,m=l?.icon;let d;e[5]!==t||e[6]!==l?.title?(d=l?.title??t("chat.subtask.subtaskNoun"),e[5]=t,e[6]=l?.title,e[7]=d):d=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(qe,{}),e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==d?(p=a.jsx(Se,{icon:m,name:d,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[9]=m,e[10]=d,e[11]=p):p=e[11];const g=l?.title??u;let h;e[12]!==n||e[13]!==s.part?(h=n&&Kt(s.part)?n:void 0,e[12]=n,e[13]=s.part,e[14]=h):h=e[14];let x;e[15]!==s.part?(x=a.jsx(Xt,{part:s.part}),e[15]=s.part,e[16]=x):x=e[16];let v;return e[17]!==s.latency||e[18]!==o||e[19]!==i||e[20]!==p||e[21]!==g||e[22]!==h||e[23]!==x||e[24]!==r?(v=a.jsx(Je,{icon:p,title:g,summary:i,state:o,usage:r,latency:s.latency,onFlip:h,children:x}),e[17]=s.latency,e[18]=o,e[19]=i,e[20]=p,e[21]=g,e[22]=h,e[23]=x,e[24]=r,e[25]=v):v=e[25],v}function El(s){const e=E.c(28),{part:t}=s,l=U();if(!t.state.startsWith("output-"))return null;const n=t.input?.plan??"",u=t.output?.approved===!0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Fe,{className:"size-4 text-special shrink-0"}),e[0]=i):i=e[0];let r;e[1]!==l?(r=l("chat.proposePlan.implementationPlan"),e[1]=l,e[2]=r):r=e[2];let o;e[3]!==r?(o=a.jsx("span",{className:"text-[14px] font-medium text-foreground/80",children:r}),e[3]=r,e[4]=o):o=e[4];let m;e[5]!==u||e[6]!==l?(m=u&&a.jsxs("span",{className:"flex items-center gap-1 text-xs text-success bg-success/10 px-1.5 py-0.5 rounded-md",children:[a.jsx(yt,{size:12}),l("chat.proposePlan.approved")]}),e[5]=u,e[6]=l,e[7]=m):m=e[7];let d;e[8]!==u||e[9]!==t.state||e[10]!==l?(d=!u&&t.state==="output-available"&&a.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:l("chat.proposePlan.rejected")}),e[8]=u,e[9]=t.state,e[10]=l,e[11]=d):d=e[11];let f;e[12]!==o||e[13]!==m||e[14]!==d?(f=a.jsxs("div",{className:"flex items-center gap-2",children:[i,o,m,d]}),e[12]=o,e[13]=m,e[14]=d,e[15]=f):f=e[15];let p;e[16]!==l?(p=l("chat.proposePlan.viewPlan"),e[16]=l,e[17]=p):p=e[17];let g;e[18]!==p?(g=a.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:p}),e[18]=p,e[19]=g):g=e[19];let h;e[20]!==n?(h=a.jsx("div",{className:"mt-1 pl-2 border-l-2 border-special/30 prose prose-sm max-w-none text-sm",children:a.jsx($e,{id:"plan-content",part:{type:"text",text:n}})}),e[20]=n,e[21]=h):h=e[21];let x;e[22]!==g||e[23]!==h?(x=a.jsxs("details",{className:"ml-6",children:[g,h]}),e[22]=g,e[23]=h,e[24]=x):x=e[24];let v;return e[25]!==x||e[26]!==f?(v=a.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[f,x]}),e[25]=x,e[26]=f,e[27]=v):v=e[27],v}function Qe(s){return{primary:s("chat.brandContext.colorPrimary"),secondary:s("chat.brandContext.colorSecondary"),accent:s("chat.brandContext.colorAccent"),background:s("chat.brandContext.colorBackground"),foreground:s("chat.brandContext.colorForeground")}}function Ll(s){try{const e=new URL(s.startsWith("http")?s:`https://${s}`);return e.protocol!=="http:"&&e.protocol!=="https:"?"about:blank":e.href}catch{return"about:blank"}}function Ye(s){return s?Object.entries(s).filter(([,e])=>typeof e=="string"&&e.trim().length>0):[]}function Pl(s){return s?Object.entries(s).filter(([,e])=>typeof e=="string"&&e.trim().length>0):[]}function ct(s){const e=E.c(2),{children:t}=s;let l;return e[0]!==t?(l=a.jsx("span",{className:"text-sm font-medium text-foreground",children:t}),e[0]=t,e[1]=l):l=e[1],l}function Rl(s){const e=E.c(12),{name:t,value:l}=s;let n;e[0]!==l?(n=a.jsx("span",{className:"size-7 shrink-0 rounded-md border border-border",style:{backgroundColor:l},"aria-hidden":!0}),e[0]=l,e[1]=n):n=e[1];let c;e[2]!==t?(c=a.jsx("span",{className:"text-sm text-foreground",children:t}),e[2]=t,e[3]=c):c=e[3];let u;e[4]!==l?(u=a.jsx("span",{className:"text-xs font-mono tabular-nums text-muted-foreground",children:l}),e[4]=l,e[5]=u):u=e[5];let i;e[6]!==c||e[7]!==u?(i=a.jsxs("div",{className:"flex flex-col leading-tight min-w-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=i):i=e[8];let r;return e[9]!==n||e[10]!==i?(r=a.jsxs("div",{className:"flex items-center gap-2.5",children:[n,i]}),e[9]=n,e[10]=i,e[11]=r):r=e[11],r}function zl(s){const e=E.c(15),{role:t,family:l}=s;let n;e[0]!==l?(n=a.jsx("span",{className:"text-2xl font-medium leading-none text-foreground shrink-0",style:{fontFamily:l},"aria-hidden":!0,children:"Aa"}),e[0]=l,e[1]=n):n=e[1];let c;e[2]!==t?(c=a.jsx("span",{className:"text-xs text-muted-foreground",children:t}),e[2]=t,e[3]=c):c=e[3];let u;e[4]!==l?(u={fontFamily:l},e[4]=l,e[5]=u):u=e[5];let i;e[6]!==l||e[7]!==u?(i=a.jsx("span",{className:"text-sm text-foreground",style:u,children:l}),e[6]=l,e[7]=u,e[8]=i):i=e[8];let r;e[9]!==c||e[10]!==i?(r=a.jsxs("div",{className:"flex flex-col leading-tight",children:[c,i]}),e[9]=c,e[10]=i,e[11]=r):r=e[11];let o;return e[12]!==n||e[13]!==r?(o=a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted px-4 py-3",children:[n,r]}),e[12]=n,e[13]=r,e[14]=o):o=e[14],o}function Dl(s){const e=E.c(3),{logo:t,favicon:l,name:n}=s,c=t??l;if(!c)return null;const u=n?`${n} logo`:"";let i;return e[0]!==c||e[1]!==u?(i=a.jsx("img",{src:c,alt:u,className:"size-16 shrink-0 rounded-lg border border-border bg-background object-contain p-2",onError:Fl}),e[0]=c,e[1]=u,e[2]=i):i=e[2],i}function Fl(s){s.target.style.display="none"}function Qt(s){const e=E.c(12),{colors:t}=s,l=U();let n;e[0]!==l?(n=Qe(l),e[0]=l,e[1]=n):n=e[1];const c=n;let u,i,r;if(e[2]!==c||e[3]!==t){r=Symbol.for("react.early_return_sentinel");e:{const m=Ye(t);if(m.length===0){r=null;break e}u="flex h-1.5";let d;e[7]!==c?(d=f=>{const[p,g]=f;return a.jsx("span",{className:"flex-1",style:{backgroundColor:g},title:`${c[p]}: ${g}`,"aria-hidden":!0},p)},e[7]=c,e[8]=d):d=e[8],i=m.map(d)}e[2]=c,e[3]=t,e[4]=u,e[5]=i,e[6]=r}else u=e[4],i=e[5],r=e[6];if(r!==Symbol.for("react.early_return_sentinel"))return r;let o;return e[9]!==u||e[10]!==i?(o=a.jsx("div",{className:u,children:i}),e[9]=u,e[10]=i,e[11]=o):o=e[11],o}function Yt(s){const e=E.c(51),{logo:t,favicon:l,name:n,domain:c,overview:u,colors:i,fonts:r,showDefaultBadge:o,isDefault:m}=s,d=U();let f;e[0]!==d?(f=Qe(d),e[0]=d,e[1]=f):f=e[1];const p=f;let g,h,x,v,b,k,j;if(e[2]!==p||e[3]!==i||e[4]!==c||e[5]!==l||e[6]!==r||e[7]!==m||e[8]!==t||e[9]!==n||e[10]!==u||e[11]!==o||e[12]!==d){const S=Ye(i),N=Pl(r);k="mt-2 rounded-lg overflow-hidden border border-border",e[20]!==i?(j=i&&a.jsx(Qt,{colors:i}),e[20]=i,e[21]=j):j=e[21],g="p-5 flex flex-col gap-6";let w;e[22]!==l||e[23]!==t||e[24]!==n?(w=a.jsx(Dl,{logo:t,favicon:l,name:n}),e[22]=l,e[23]=t,e[24]=n,e[25]=w):w=e[25];let C;e[26]!==m||e[27]!==n||e[28]!==o||e[29]!==d?(C=n&&a.jsxs("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-foreground truncate",children:[n,o&&m&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[a.jsx(xt,{className:"size-3 text-warning"}),d("chat.brandContext.defaultBadge")]})]}),e[26]=m,e[27]=n,e[28]=o,e[29]=d,e[30]=C):C=e[30];let M;e[31]!==c?(M=c&&a.jsxs("a",{href:Ll(c),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c,a.jsx(Mt,{className:"size-3 shrink-0"})]}),e[31]=c,e[32]=M):M=e[32];let A;e[33]!==C||e[34]!==M?(A=a.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[C,M]}),e[33]=C,e[34]=M,e[35]=A):A=e[35],e[36]!==A||e[37]!==w?(h=a.jsxs("div",{className:"flex items-center gap-4",children:[w,A]}),e[36]=A,e[37]=w,e[38]=h):h=e[38],e[39]!==u?(x=u&&a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:u}),e[39]=u,e[40]=x):x=e[40],v=S.length>0&&a.jsxs("div",{className:"flex flex-col gap-3",children:[a.jsx(ct,{children:d("chat.brandContext.colorsSection")}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3",children:S.map(L=>{const[I,T]=L;return a.jsx(Rl,{name:p[I],value:T},I)})})]}),b=N.length>0&&a.jsxs("div",{className:"flex flex-col gap-3",children:[a.jsx(ct,{children:d("chat.brandContext.typographySection")}),a.jsx("div",{className:"flex flex-wrap gap-2.5",children:N.map(Bl)})]}),e[2]=p,e[3]=i,e[4]=c,e[5]=l,e[6]=r,e[7]=m,e[8]=t,e[9]=n,e[10]=u,e[11]=o,e[12]=d,e[13]=g,e[14]=h,e[15]=x,e[16]=v,e[17]=b,e[18]=k,e[19]=j}else g=e[13],h=e[14],x=e[15],v=e[16],b=e[17],k=e[18],j=e[19];let _;e[41]!==g||e[42]!==h||e[43]!==x||e[44]!==v||e[45]!==b?(_=a.jsxs("div",{className:g,children:[h,x,v,b]}),e[41]=g,e[42]=h,e[43]=x,e[44]=v,e[45]=b,e[46]=_):_=e[46];let y;return e[47]!==k||e[48]!==j||e[49]!==_?(y=a.jsxs("div",{className:k,children:[j,_]}),e[47]=k,e[48]=j,e[49]=_,e[50]=y):y=e[50],y}function Bl(s){const[e,t]=s;return a.jsx(zl,{role:e,family:t},e)}function Ol(s){const e=E.c(46),{part:t,latency:l}=s,n=U();let c;e[0]!==t.state?(c=pe(t.state),e[0]=t.state,e[1]=c):c=e[1];const u=c;let i,r,o,m,d;if(e[2]!==l||e[3]!==t.input||e[4]!==t.output||e[5]!==u||e[6]!==n){d=Symbol.for("react.early_return_sentinel");e:{r=be(t.output);const N=u==="loading",w=u==="error"||r&&r.success===!1;if(N){const C=t.input;let M;e[12]===Symbol.for("react.memo_cache_sentinel")?(M=a.jsx(me,{className:"animate-pulse"}),e[12]=M):M=e[12];let A;e[13]!==n?(A=n("chat.brandContext.extractingBrand"),e[13]=n,e[14]=A):A=e[14];let L;e[15]!==C||e[16]!==n?(L=C?.domain?n("chat.brandContext.fromDomain",{domain:C.domain}):void 0,e[15]=C,e[16]=n,e[17]=L):L=e[17];let I;e[18]!==A||e[19]!==L?(I=a.jsx(H,{icon:M,title:A,summary:L,state:"loading",defaultOpen:!0}),e[18]=A,e[19]=L,e[20]=I):I=e[20],d=I;break e}if(w){let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx(me,{}),e[21]=C):C=e[21];let M;e[22]!==n?(M=n("chat.brandContext.extractionFailed"),e[22]=n,e[23]=M):M=e[23];let A;e[24]!==l?(A=a.jsx(ne,{latency:l}),e[24]=l,e[25]=A):A=e[25],d=a.jsx(H,{icon:C,title:M,summary:r?.error??n("chat.brandContext.unknownError"),state:"error",trailing:A});break e}i=H,e[26]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(me,{className:"text-special"}),e[26]=o):o=e[26],m=r?.name?n("chat.brandContext.brandSet",{name:r.name}):n("chat.brandContext.brandContextSet")}e[2]=l,e[3]=t.input,e[4]=t.output,e[5]=u,e[6]=n,e[7]=i,e[8]=r,e[9]=o,e[10]=m,e[11]=d}else i=e[7],r=e[8],o=e[9],m=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;const f=r?.domain;let p;e[27]!==l?(p=a.jsx(ne,{latency:l}),e[27]=l,e[28]=p):p=e[28];let g;e[29]!==i||e[30]!==o||e[31]!==m||e[32]!==f||e[33]!==p?(g=a.jsx(i,{icon:o,title:m,summary:f,state:"idle",trailing:p}),e[29]=i,e[30]=o,e[31]=m,e[32]=f,e[33]=p,e[34]=g):g=e[34];const h=r?.logo,x=r?.favicon,v=r?.name,b=r?.domain,k=r?.overview,j=r?.colors,_=r?.fonts;let y;e[35]!==v||e[36]!==b||e[37]!==k||e[38]!==j||e[39]!==_||e[40]!==h||e[41]!==x?(y=a.jsx(Yt,{logo:h,favicon:x,name:v,domain:b,overview:k,colors:j,fonts:_}),e[35]=v,e[36]=b,e[37]=k,e[38]=j,e[39]=_,e[40]=h,e[41]=x,e[42]=y):y=e[42];let S;return e[43]!==y||e[44]!==g?(S=a.jsxs(a.Fragment,{children:[g,y]}),e[43]=y,e[44]=g,e[45]=S):S=e[45],S}function Ul(s){const e=E.c(45),{part:t,latency:l}=s,n=U();let c;e[0]!==t.state?(c=pe(t.state),e[0]=t.state,e[1]=c):c=e[1];const u=c;let i,r,o,m,d;if(e[2]!==l||e[3]!==t.output||e[4]!==u||e[5]!==n){d=Symbol.for("react.early_return_sentinel");e:{r=be(t.output);const x=u==="loading",v=u==="error"||r&&r.success===!1;if(x){let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(me,{className:"animate-pulse"}),e[11]=b):b=e[11];let k;e[12]!==n?(k=n("chat.brandContext.loadingBrand"),e[12]=n,e[13]=k):k=e[13];let j;e[14]!==k?(j=a.jsx(H,{icon:b,title:k,state:"loading"}),e[14]=k,e[15]=j):j=e[15],d=j;break e}if(v||!r){let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(me,{}),e[16]=b):b=e[16];let k;e[17]!==n?(k=n("chat.brandContext.couldNotLoadBrand"),e[17]=n,e[18]=k):k=e[18];let j;e[19]!==l?(j=a.jsx(ne,{latency:l}),e[19]=l,e[20]=j):j=e[20];let _;e[21]!==k||e[22]!==j?(_=a.jsx(H,{icon:b,title:k,state:"error",trailing:j}),e[21]=k,e[22]=j,e[23]=_):_=e[23],d=_;break e}i=H,e[24]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(me,{className:"text-special"}),e[24]=o):o=e[24],m=r.name?n("chat.brandContext.brandWithName",{name:r.name}):n("chat.brandContext.brand")}e[2]=l,e[3]=t.output,e[4]=u,e[5]=n,e[6]=i,e[7]=r,e[8]=o,e[9]=m,e[10]=d}else i=e[6],r=e[7],o=e[8],m=e[9],d=e[10];if(d!==Symbol.for("react.early_return_sentinel"))return d;let f;e[25]!==l?(f=a.jsx(ne,{latency:l}),e[25]=l,e[26]=f):f=e[26];let p;e[27]!==i||e[28]!==r.domain||e[29]!==o||e[30]!==m||e[31]!==f?(p=a.jsx(i,{icon:o,title:m,summary:r.domain,state:"idle",trailing:f}),e[27]=i,e[28]=r.domain,e[29]=o,e[30]=m,e[31]=f,e[32]=p):p=e[32];let g;e[33]!==r.colors||e[34]!==r.domain||e[35]!==r.favicon||e[36]!==r.fonts||e[37]!==r.isDefault||e[38]!==r.logo||e[39]!==r.name||e[40]!==r.overview?(g=a.jsx(Yt,{logo:r.logo,favicon:r.favicon,name:r.name,domain:r.domain,overview:r.overview,colors:r.colors,fonts:r.fonts,showDefaultBadge:!0,isDefault:r.isDefault}),e[33]=r.colors,e[34]=r.domain,e[35]=r.favicon,e[36]=r.fonts,e[37]=r.isDefault,e[38]=r.logo,e[39]=r.name,e[40]=r.overview,e[41]=g):g=e[41];let h;return e[42]!==p||e[43]!==g?(h=a.jsxs(a.Fragment,{children:[p,g]}),e[42]=p,e[43]=g,e[44]=h):h=e[44],h}function Hl(s){const e=E.c(49),{part:t,latency:l}=s,n=U();let c;e[0]!==n?(c=Qe(n),e[0]=n,e[1]=c):c=e[1];const u=c;let i;e[2]!==t.state?(i=pe(t.state),e[2]=t.state,e[3]=i):i=e[3];const r=i;let o,m,d,f;if(e[4]!==u||e[5]!==l||e[6]!==t.output||e[7]!==r||e[8]!==n){f=Symbol.for("react.early_return_sentinel");e:{const h=be(t.output),x=Array.isArray(h?.items)?h.items:[],v=r==="loading",b=r==="error";if(v){let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(me,{className:"animate-pulse"}),e[13]=y):y=e[13];let S;e[14]!==n?(S=n("chat.brandContext.loadingBrands"),e[14]=n,e[15]=S):S=e[15];let N;e[16]!==S?(N=a.jsx(H,{icon:y,title:S,state:"loading"}),e[16]=S,e[17]=N):N=e[17],f=N;break e}if(b){let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(me,{}),e[18]=y):y=e[18];let S;e[19]!==n?(S=n("chat.brandContext.couldNotLoadBrands"),e[19]=n,e[20]=S):S=e[20];let N;e[21]!==l?(N=a.jsx(ne,{latency:l}),e[21]=l,e[22]=N):N=e[22];let w;e[23]!==S||e[24]!==N?(w=a.jsx(H,{icon:y,title:S,state:"error",trailing:N}),e[23]=S,e[24]=N,e[25]=w):w=e[25],f=w;break e}if(x.length===0){let y;e[26]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(me,{}),e[26]=y):y=e[26];let S;e[27]!==n?(S=n("chat.brandContext.noBrandsYet"),e[27]=n,e[28]=S):S=e[28];let N;e[29]!==n?(N=n("chat.brandContext.noBrandsContext"),e[29]=n,e[30]=N):N=e[30];let w;e[31]!==l?(w=a.jsx(ne,{latency:l}),e[31]=l,e[32]=w):w=e[32];let C;e[33]!==w||e[34]!==S||e[35]!==N?(C=a.jsx(H,{icon:y,title:S,summary:N,state:"idle",trailing:w}),e[33]=w,e[34]=S,e[35]=N,e[36]=C):C=e[36],f=C;break e}let k;e[37]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(me,{className:"text-special"}),e[37]=k):k=e[37];let j;e[38]!==l?(j=a.jsx(ne,{latency:l}),e[38]=l,e[39]=j):j=e[39],d=a.jsx(H,{icon:k,title:x.length===1?n("chat.brandContext.oneBrand"):n("chat.brandContext.multipleBrands",{count:x.length}),state:"idle",trailing:j}),o="mt-2 flex flex-col gap-1.5";let _;e[40]!==u||e[41]!==n?(_=(y,S)=>{const N=Ye(y.colors);return a.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[y.colors&&a.jsx(Qt,{colors:y.colors}),a.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[(y.logo||y.favicon)&&a.jsx("img",{src:y.logo??y.favicon??void 0,alt:"",className:"size-8 shrink-0 rounded-md border border-border bg-background object-contain p-0.5",onError:ql}),a.jsxs("div",{className:"flex flex-col leading-tight min-w-0 flex-1",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground truncate",children:[y.name??n("chat.brandContext.untitled"),y.isDefault&&a.jsx(xt,{className:"size-3 text-warning shrink-0"})]}),y.domain&&a.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:y.domain})]}),N.length>0&&a.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:N.slice(0,5).map(w=>{const[C,M]=w;return a.jsx("span",{className:"size-3 rounded-full border border-border",style:{backgroundColor:M},title:`${u[C]}: ${M}`,"aria-hidden":!0},C)})})]})]},y.id??`${y.name}-${y.domain}-${S}`)},e[40]=u,e[41]=n,e[42]=_):_=e[42],m=x.map(_)}e[4]=u,e[5]=l,e[6]=t.output,e[7]=r,e[8]=n,e[9]=o,e[10]=m,e[11]=d,e[12]=f}else o=e[9],m=e[10],d=e[11],f=e[12];if(f!==Symbol.for("react.early_return_sentinel"))return f;let p;e[43]!==o||e[44]!==m?(p=a.jsx("div",{className:o,children:m}),e[43]=o,e[44]=m,e[45]=p):p=e[45];let g;return e[46]!==d||e[47]!==p?(g=a.jsxs(a.Fragment,{children:[d,p]}),e[46]=d,e[47]=p,e[48]=g):g=e[48],g}function ql(s){s.target.style.display="none"}function Ue(s){const e=E.c(4),{connection_id:t,iconSize:l}=s,n=l===void 0?"xs":l,c=Et(t);if(!c)return null;let u;return e[0]!==c.icon||e[1]!==c.title||e[2]!==n?(u=a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx(Se,{icon:c.icon,name:c.title,size:n})}),e[0]=c.icon,e[1]=c.title,e[2]=n,e[3]=u):u=e[3],u}Ue.Fallback=function({iconSize:e="xs"}){const t=e==="sm"?"size-6":"size-5";return a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx("div",{className:K(t,"rounded bg-muted animate-pulse")})})};function ye(s){const e=E.c(18),{connectionIds:t,maxVisibleIcons:l,iconSize:n,className:c}=s,u=l===void 0?2:l,i=n===void 0?"xs":n;if(t.length===0)return null;let r,o,m;if(e[0]!==c||e[1]!==t||e[2]!==i||e[3]!==u){const p=t.slice(0,u);r=t.length-u,e[7]!==c?(o=K("flex items-center justify-end -space-x-2",c),e[7]=c,e[8]=o):o=e[8];let g;e[9]!==i?(g=h=>a.jsx(R.Suspense,{fallback:a.jsx(Ue.Fallback,{iconSize:i}),children:a.jsx(Ue,{connection_id:h,iconSize:i})},h),e[9]=i,e[10]=g):g=e[10],m=p.map(g),e[0]=c,e[1]=t,e[2]=i,e[3]=u,e[4]=r,e[5]=o,e[6]=m}else r=e[4],o=e[5],m=e[6];let d;e[11]!==i||e[12]!==r?(d=r>0&&a.jsx("div",{className:K("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",i==="sm"?"size-8":"size-6"),children:a.jsxs("span",{className:K(i==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${r} more`,children:["+",r]})}),e[11]=i,e[12]=r,e[13]=d):d=e[13];let f;return e[14]!==o||e[15]!==m||e[16]!==d?(f=a.jsxs("div",{className:o,children:[m,d]}),e[14]=o,e[15]=m,e[16]=d,e[17]=f):f=e[17],f}ye.Fallback=function({maxVisibleIcons:e=2,totalCount:t,iconSize:l="xs"}){const n=l==="sm"?"size-6":"size-5",c=l==="sm"?"size-8":"size-6",u=t!==void 0&&t>e;return a.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((i,r)=>a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx("div",{className:K(n,"rounded bg-muted animate-pulse")})},r)),u&&a.jsx("div",{className:K("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",c),children:a.jsx("div",{className:K(l==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const Wl="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",ut=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function Gl(s){const e=E.c(105),{part:t,latency:l}=s,n=U(),c=Lt(),u=pe(t.state),i=R.useRef(null),r=R.useRef(null),o=R.useRef(null),m=R.useRef(null),d=R.useRef(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{ut?.matches||(d.current=i.current?.getBoundingClientRect()??null,i.current&&(i.current.style.willChange="transform"))},e[0]=f):f=e[0];const p=f;let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=z=>{if(ut?.matches)return;const O=d.current,G=i.current;if(!O||!G)return;const le=(z.clientX-O.left)/O.width*100,ae=(z.clientY-O.top)/O.height*100;G.style.transform=`perspective(800px) rotateY(${(le-50)*.05}deg) rotateX(${(ae-50)*-.05}deg)`,r.current&&(r.current.style.opacity="1",r.current.style.transform=`translate(${(le-50)*.15}px, ${(ae-50)*.15}px)`),o.current&&(o.current.style.opacity="0.45"),m.current&&(m.current.style.opacity="0.45")},e[1]=g):g=e[1];const h=g;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{const z=i.current;z&&(z.style.transform="none",z.style.willChange="auto"),r.current&&(r.current.style.opacity="0.4",r.current.style.transform="translate(0, 0)"),o.current&&(o.current.style.opacity="0.3"),m.current&&(m.current.style.opacity="0.3"),d.current=null},e[2]=x):x=e[2];const v=x;if(u==="loading"){let z;e[3]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(fe,{className:"animate-pulse"}),e[3]=z):z=e[3];let O;e[4]!==n?(O=n("chat.agentCreate.creating"),e[4]=n,e[5]=O):O=e[5];let G;return e[6]!==O?(G=a.jsx(H,{icon:z,title:O,state:"loading",defaultOpen:!0}),e[6]=O,e[7]=G):G=e[7],G}if(u==="approval"){let z;e[8]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(fe,{}),e[8]=z):z=e[8];let O;e[9]!==n?(O=n("chat.agentCreate.createAgent"),e[9]=n,e[10]=O):O=e[10];let G;return e[11]!==O?(G=a.jsx(H,{icon:z,title:O,state:"idle"}),e[11]=O,e[12]=G):G=e[12],G}if(u==="error"){let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(fe,{}),e[13]=z):z=e[13];let O;e[14]!==t.state||e[15]!==n?(O=t.state==="output-denied"?n("chat.agentCreate.cancelled"):n("chat.agentCreate.couldntCreate"),e[14]=t.state,e[15]=n,e[16]=O):O=e[16];let G;e[17]!==l?(G=a.jsx(ne,{latency:l}),e[17]=l,e[18]=G):G=e[18];let le;return e[19]!==O||e[20]!==G?(le=a.jsx(H,{icon:z,title:O,state:"error",trailing:G}),e[19]=O,e[20]=G,e[21]=le):le=e[21],le}let b,k,j,_,y,S,N,w,C,M,A,L,I,T,$,P,q,B,D,F,W,X,J;if(e[22]!==l||e[23]!==c||e[24]!==t.output||e[25]!==n){q=Symbol.for("react.early_return_sentinel");e:{const z=be(t.output)?.item;if(!z?.id||!z?.title){let ie;e[49]===Symbol.for("react.memo_cache_sentinel")?(ie=a.jsx(fe,{}),e[49]=ie):ie=e[49];let ce;e[50]!==n?(ce=n("chat.agentCreate.created"),e[50]=n,e[51]=ce):ce=e[51];let V;e[52]!==l?(V=a.jsx(ne,{latency:l}),e[52]=l,e[53]=V):V=e[53];let Z;e[54]!==ce||e[55]!==V?(Z=a.jsx(H,{icon:ie,title:ce,state:"idle",trailing:V}),e[54]=ce,e[55]=V,e[56]=Z):Z=e[56],q=Z;break e}const O=(z.connections??[]).map(Kl);let G;e[57]===Symbol.for("react.memo_cache_sentinel")?(G=a.jsx(fe,{className:"text-success"}),e[57]=G):G=e[57];let le;e[58]!==l?(le=a.jsx(ne,{latency:l}),e[58]=l,e[59]=le):le=e[59],P=a.jsx(H,{icon:G,title:n("chat.agentCreate.agentCreated",{name:z.title}),state:"idle",trailing:le}),$="mt-2 overflow-hidden rounded-xl border-[0.5px] border-border bg-card p-2.5",j=i,_="relative overflow-hidden rounded-lg bg-accent/25 p-2",e[60]===Symbol.for("react.memo_cache_sentinel")?(y={transition:"transform 0.3s ease-out"},e[60]=y):y=e[60],S=p,N=h,w=v,e[61]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx("div",{ref:r,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[61]=C):C=e[61];let ae;e[62]===Symbol.for("react.memo_cache_sentinel")?(ae={textAlign:"justify",wordBreak:"break-all"},e[62]=ae):ae=e[62],e[63]===Symbol.for("react.memo_cache_sentinel")?(M=a.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:ae,"aria-hidden":"true",children:Wl.repeat(6)}),A=a.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[63]=M,e[64]=A):(M=e[63],A=e[64]),e[65]===Symbol.for("react.memo_cache_sentinel")?(L=a.jsx("img",{ref:o,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[65]=L):L=e[65],e[66]===Symbol.for("react.memo_cache_sentinel")?(I=a.jsx("img",{ref:m,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[66]=I):I=e[66],T=a.jsxs("div",{className:"relative",children:[a.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[a.jsx(ht,{icon:z.icon,name:z.title,size:"md"}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:z.title})})]}),z.description&&a.jsx("div",{className:"px-2 pt-1 pr-16",children:a.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:z.description})})]}),J="relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1";const de=O.length>0&&a.jsx(R.Suspense,{fallback:a.jsx(ye.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:O.length}),children:a.jsx(ye,{connectionIds:O,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})});e[67]!==de?(k=a.jsx("div",{className:"flex-1 min-w-0",children:de}),e[67]=de,e[68]=k):k=e[68],X="flex items-center gap-2 shrink-0",b=He,B="sm",D="h-7",F=()=>c(z.id),W=n("chat.agentCreate.seeAgentLabel",{name:z.title})}e[22]=l,e[23]=c,e[24]=t.output,e[25]=n,e[26]=b,e[27]=k,e[28]=j,e[29]=_,e[30]=y,e[31]=S,e[32]=N,e[33]=w,e[34]=C,e[35]=M,e[36]=A,e[37]=L,e[38]=I,e[39]=T,e[40]=$,e[41]=P,e[42]=q,e[43]=B,e[44]=D,e[45]=F,e[46]=W,e[47]=X,e[48]=J}else b=e[26],k=e[27],j=e[28],_=e[29],y=e[30],S=e[31],N=e[32],w=e[33],C=e[34],M=e[35],A=e[36],L=e[37],I=e[38],T=e[39],$=e[40],P=e[41],q=e[42],B=e[43],D=e[44],F=e[45],W=e[46],X=e[47],J=e[48];if(q!==Symbol.for("react.early_return_sentinel"))return q;let te;e[69]!==n?(te=n("chat.agentCreate.seeAgent"),e[69]=n,e[70]=te):te=e[70];let Q;e[71]!==b||e[72]!==te||e[73]!==B||e[74]!==D||e[75]!==F||e[76]!==W?(Q=a.jsx(b,{size:B,className:D,onClick:F,"aria-label":W,children:te}),e[71]=b,e[72]=te,e[73]=B,e[74]=D,e[75]=F,e[76]=W,e[77]=Q):Q=e[77];let se;e[78]!==Q||e[79]!==X?(se=a.jsx("div",{className:X,children:Q}),e[78]=Q,e[79]=X,e[80]=se):se=e[80];let re;e[81]!==k||e[82]!==se||e[83]!==J?(re=a.jsxs("div",{className:J,children:[k,se]}),e[81]=k,e[82]=se,e[83]=J,e[84]=re):re=e[84];let ue;e[85]!==j||e[86]!==_||e[87]!==y||e[88]!==S||e[89]!==N||e[90]!==w||e[91]!==C||e[92]!==M||e[93]!==A||e[94]!==L||e[95]!==I||e[96]!==T||e[97]!==re?(ue=a.jsxs("div",{ref:j,className:_,style:y,onMouseEnter:S,onMouseMove:N,onMouseLeave:w,children:[C,M,A,L,I,T,re]}),e[85]=j,e[86]=_,e[87]=y,e[88]=S,e[89]=N,e[90]=w,e[91]=C,e[92]=M,e[93]=A,e[94]=L,e[95]=I,e[96]=T,e[97]=re,e[98]=ue):ue=e[98];let Y;e[99]!==$||e[100]!==ue?(Y=a.jsx("div",{className:$,children:ue}),e[99]=$,e[100]=ue,e[101]=Y):Y=e[101];let oe;return e[102]!==P||e[103]!==Y?(oe=a.jsxs(a.Fragment,{children:[P,Y]}),e[102]=P,e[103]=Y,e[104]=oe):oe=e[104],oe}function Kl(s){return s.connection_id}function Vl(s){const e=E.c(24),{agent:t}=s,l=Lt();if(!t.id)return null;let n;e[0]!==t.connections?(n=t.connections??[],e[0]=t.connections,e[1]=n):n=e[1];let c;e[2]!==n?(c=n.map(Xl),e[2]=n,e[3]=c):c=e[3];const u=c;let i;e[4]!==t.id||e[5]!==l?(i=()=>l(t.id),e[4]=t.id,e[5]=l,e[6]=i):i=e[6];let r;e[7]!==t.icon||e[8]!==t.title?(r=a.jsx(ht,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=r):r=e[9];let o;e[10]!==t.title?(o=a.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=o):o=e[11];let m;e[12]!==t.description?(m=t.description&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[12]=t.description,e[13]=m):m=e[13];let d;e[14]!==o||e[15]!==m?(d=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[o,m]}),e[14]=o,e[15]=m,e[16]=d):d=e[16];let f;e[17]!==u?(f=u.length>0&&a.jsx(R.Suspense,{fallback:a.jsx(ye.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:u.length}),children:a.jsx(ye,{connectionIds:u,iconSize:"xs",maxVisibleIcons:3})}),e[17]=u,e[18]=f):f=e[18];let p;return e[19]!==i||e[20]!==r||e[21]!==d||e[22]!==f?(p=a.jsxs("button",{type:"button",onClick:i,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[r,d,f]}),e[19]=i,e[20]=r,e[21]=d,e[22]=f,e[23]=p):p=e[23],p}function Xl(s){return s.connection_id}function Jl(s){const e=E.c(59),{part:t,latency:l}=s,n=U(),c=We(),{org:u}=ge();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const r=i;let o,m,d,f,p,g;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==r||e[6]!==n){g=Symbol.for("react.early_return_sentinel");e:{const b=be(t.output);if(m=Array.isArray(b?.items)?b.items:[],r==="loading"){let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(fe,{className:"animate-pulse"}),e[13]=y):y=e[13];let S;e[14]!==n?(S=n("chat.agentList.loading"),e[14]=n,e[15]=S):S=e[15];let N;e[16]!==S?(N=a.jsx(H,{icon:y,title:S,state:"loading"}),e[16]=S,e[17]=N):N=e[17],g=N;break e}if(r==="approval"){let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(fe,{}),e[18]=y):y=e[18];let S;e[19]!==n?(S=n("chat.agentList.listAgents"),e[19]=n,e[20]=S):S=e[20];let N;e[21]!==S?(N=a.jsx(H,{icon:y,title:S,state:"idle"}),e[21]=S,e[22]=N):N=e[22],g=N;break e}if(r==="error"){let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(fe,{}),e[23]=y):y=e[23];let S;e[24]!==t.state||e[25]!==n?(S=t.state==="output-denied"?n("chat.agentList.unavailable"):n("chat.agentList.couldntLoad"),e[24]=t.state,e[25]=n,e[26]=S):S=e[26];let N;e[27]!==l?(N=a.jsx(ne,{latency:l}),e[27]=l,e[28]=N):N=e[28];let w;e[29]!==S||e[30]!==N?(w=a.jsx(H,{icon:y,title:S,state:"error",trailing:N}),e[29]=S,e[30]=N,e[31]=w):w=e[31],g=w;break e}if(m.length===0){let y;e[32]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(fe,{}),e[32]=y):y=e[32];let S;e[33]!==n?(S=n("chat.agentList.noAgents"),e[33]=n,e[34]=S):S=e[34];let N;e[35]!==n?(N=n("chat.agentList.noAgentsDesc"),e[35]=n,e[36]=N):N=e[36];let w;e[37]!==l?(w=a.jsx(ne,{latency:l}),e[37]=l,e[38]=w):w=e[38];let C;e[39]!==S||e[40]!==N||e[41]!==w?(C=a.jsx(H,{icon:y,title:S,summary:N,state:"idle",trailing:w}),e[39]=S,e[40]=N,e[41]=w,e[42]=C):C=e[42],g=C;break e}const k=m.slice(0,Pt);o=m.length-k.length;let j;e[43]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(fe,{className:"text-success"}),e[43]=j):j=e[43];let _;e[44]!==l?(_=a.jsx(ne,{latency:l}),e[44]=l,e[45]=_):_=e[45],p=a.jsx(H,{icon:j,title:m.length===1?n("chat.agentList.oneAgent"):n("chat.agentList.multiAgents",{count:m.length}),state:"idle",trailing:_}),d="mt-2 flex flex-col gap-1.5",f=k.map(Ql)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=r,e[6]=n,e[7]=o,e[8]=m,e[9]=d,e[10]=f,e[11]=p,e[12]=g}else o=e[7],m=e[8],d=e[9],f=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let h;e[46]!==o||e[47]!==m||e[48]!==c||e[49]!==u||e[50]!==n?(h=o>0&&a.jsx(Rt,{count:m.length,noun:n("chat.agentList.agentsNoun"),onClick:()=>c({to:"/$org/settings/projects",params:{org:u.slug}})}),e[46]=o,e[47]=m,e[48]=c,e[49]=u,e[50]=n,e[51]=h):h=e[51];let x;e[52]!==d||e[53]!==f||e[54]!==h?(x=a.jsxs("div",{className:d,children:[f,h]}),e[52]=d,e[53]=f,e[54]=h,e[55]=x):x=e[55];let v;return e[56]!==p||e[57]!==x?(v=a.jsxs(a.Fragment,{children:[p,x]}),e[56]=p,e[57]=x,e[58]=v):v=e[58],v}function Ql(s){return a.jsx(Vl,{agent:s},s.id)}const Yl={active:"bg-success",inactive:"bg-muted-foreground",error:"bg-destructive"};function Zl(s){const e=E.c(27),{connection:t}=s,l=We(),{org:n}=ge(),c=t.slug,u=t.description||t.app_name,i=!c||void 0;let r;e[0]!==l||e[1]!==n||e[2]!==c?(r=()=>c&&l({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:c}}),e[0]=l,e[1]=n,e[2]=c,e[3]=r):r=e[3];let o;e[4]!==t.icon||e[5]!==t.title?(o=a.jsx(Se,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=o):o=e[6];let m;e[7]!==t.title?(m=a.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[7]=t.title,e[8]=m):m=e[8];let d;e[9]!==u?(d=u&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:u}),e[9]=u,e[10]=d):d=e[10];let f;e[11]!==m||e[12]!==d?(f=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[m,d]}),e[11]=m,e[12]=d,e[13]=f):f=e[13];const p=Yl[t.status]??"bg-muted-foreground";let g;e[14]!==p?(g=K("size-2 shrink-0 rounded-full",p),e[14]=p,e[15]=g):g=e[15];let h;e[16]!==g?(h=a.jsx("span",{className:g,"aria-hidden":"true"}),e[16]=g,e[17]=h):h=e[17];let x;e[18]!==t.status?(x=a.jsx("span",{className:"sr-only",children:t.status}),e[18]=t.status,e[19]=x):x=e[19];let v;return e[20]!==i||e[21]!==x||e[22]!==r||e[23]!==o||e[24]!==f||e[25]!==h?(v=a.jsxs("button",{type:"button","aria-disabled":i,onClick:r,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[o,f,h,x]}),e[20]=i,e[21]=x,e[22]=r,e[23]=o,e[24]=f,e[25]=h,e[26]=v):v=e[26],v}function ea(s){const e=E.c(54),{part:t,latency:l}=s,n=U(),c=We(),{org:u}=ge();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const r=i;let o,m,d,f,p,g;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==r||e[6]!==n){g=Symbol.for("react.early_return_sentinel");e:{const b=be(t.output);if(m=(Array.isArray(b?.items)?b.items:[]).filter(sa),r==="loading"||r==="approval"){let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(we,{className:"animate-pulse"}),e[13]=y):y=e[13];let S;e[14]!==n?(S=n("chat.connectionList.loadingTitle"),e[14]=n,e[15]=S):S=e[15];let N;e[16]!==S?(N=a.jsx(H,{icon:y,title:S,state:"loading"}),e[16]=S,e[17]=N):N=e[17],g=N;break e}if(r==="error"){let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(we,{}),e[18]=y):y=e[18];let S;e[19]!==t.state||e[20]!==n?(S=t.state==="output-denied"?n("chat.connectionList.unavailableTitle"):n("chat.connectionList.errorTitle"),e[19]=t.state,e[20]=n,e[21]=S):S=e[21];let N;e[22]!==l?(N=a.jsx(ne,{latency:l}),e[22]=l,e[23]=N):N=e[23];let w;e[24]!==S||e[25]!==N?(w=a.jsx(H,{icon:y,title:S,state:"error",trailing:N}),e[24]=S,e[25]=N,e[26]=w):w=e[26],g=w;break e}if(m.length===0){let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(we,{}),e[27]=y):y=e[27];let S;e[28]!==n?(S=n("chat.connectionList.emptyTitle"),e[28]=n,e[29]=S):S=e[29];let N;e[30]!==n?(N=n("chat.connectionList.emptySummary"),e[30]=n,e[31]=N):N=e[31];let w;e[32]!==l?(w=a.jsx(ne,{latency:l}),e[32]=l,e[33]=w):w=e[33];let C;e[34]!==S||e[35]!==N||e[36]!==w?(C=a.jsx(H,{icon:y,title:S,summary:N,state:"idle",trailing:w}),e[34]=S,e[35]=N,e[36]=w,e[37]=C):C=e[37],g=C;break e}const k=m.slice(0,Pt);o=m.length-k.length;let j;e[38]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(we,{className:"text-success"}),e[38]=j):j=e[38];let _;e[39]!==l?(_=a.jsx(ne,{latency:l}),e[39]=l,e[40]=_):_=e[40],p=a.jsx(H,{icon:j,title:m.length===1?n("chat.connectionList.singleConnection"):n("chat.connectionList.multipleConnections",{count:m.length}),state:"idle",trailing:_}),d="mt-2 flex flex-col gap-1.5",f=k.map(ta)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=r,e[6]=n,e[7]=o,e[8]=m,e[9]=d,e[10]=f,e[11]=p,e[12]=g}else o=e[7],m=e[8],d=e[9],f=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let h;e[41]!==o||e[42]!==m||e[43]!==c||e[44]!==u||e[45]!==n?(h=o>0&&a.jsx(Rt,{count:m.length,noun:n("chat.connectionList.connectionNoun"),onClick:()=>c({to:"/$org/settings/connections",params:{org:u.slug}})}),e[41]=o,e[42]=m,e[43]=c,e[44]=u,e[45]=n,e[46]=h):h=e[46];let x;e[47]!==d||e[48]!==f||e[49]!==h?(x=a.jsxs("div",{className:d,children:[f,h]}),e[47]=d,e[48]=f,e[49]=h,e[50]=x):x=e[50];let v;return e[51]!==p||e[52]!==x?(v=a.jsxs(a.Fragment,{children:[p,x]}),e[51]=p,e[52]=x,e[53]=v):v=e[53],v}function ta(s){return a.jsx(Zl,{connection:s},s.id)}function sa(s){return s.connection_type!=="VIRTUAL"}function na(){const s=E.c(42),e=U(),t=Ne(),{sendMessage:l,isStreaming:n,messages:c}=Bs(),{org:u}=ge(),i=t?.virtualMcpId,{prompts:r}=Zs(u.slug),o=i??null;let m;s[0]!==u.id||s[1]!==u.slug||s[2]!==o?(m={connectionId:o,orgId:u.id,orgSlug:u.slug},s[0]=u.id,s[1]=u.slug,s[2]=o,s[3]=m):m=s[3];const d=_t(m),[f,p]=R.useState(null);if(!i||n||!is(i)||!c.some(la))return null;let h;if(s[4]!==r||s[5]!==i){let T;s[7]!==i?(T=$=>$.agentId===i&&$.promptName,s[7]=i,s[8]=T):T=s[8],h=r.find(T),s[4]=r,s[5]=i,s[6]=h}else h=s[6];const x=h;if(!x)return null;let v;s[9]!==d||s[10]!==l||s[11]!==e?(v=async(T,$)=>{if(!d){ze.error(e("chat.nextActionChip.mcpClientNotAvailable"));return}try{const P=await an(d,T.name,$);await l({type:"doc",content:[{type:"paragraph",content:[on({id:T.name,name:Ct(T.name,wt(T._meta)),metadata:P.messages,char:"/",kind:"prompt",args:$}),{type:"text",text:" "}]}]})}catch(P){console.error("[next-action-chip] failed",P),ze.error(e("chat.nextActionChip.failedLoadPrompt"))}},s[9]=d,s[10]=l,s[11]=e,s[12]=v):v=s[12];const b=v;let k;s[13]!==x._meta||s[14]!==x.arguments||s[15]!==x.description||s[16]!==x.promptName||s[17]!==x.title||s[18]!==b?(k=()=>{const T={name:x.promptName,title:x.title,description:x.description,arguments:x.arguments,_meta:x._meta};if(T.arguments&&T.arguments.length>0){p(T);return}b(T)},s[13]=x._meta,s[14]=x.arguments,s[15]=x.description,s[16]=x.promptName,s[17]=x.title,s[18]=b,s[19]=k):k=s[19];const j=k;let _;s[20]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(Ns,{size:12,className:"shrink-0 text-special"}),s[20]=_):_=s[20];let y;s[21]!==e?(y=e("chat.nextActionChip.next"),s[21]=e,s[22]=y):y=s[22];let S;s[23]!==y?(S=a.jsx("span",{className:"font-medium text-foreground/80",children:y}),s[23]=y,s[24]=S):S=s[24];let N;s[25]!==x.title?(N=a.jsx("span",{className:"truncate",children:x.title}),s[25]=x.title,s[26]=N):N=s[26];let w;s[27]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(bt,{size:12,className:"shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),s[27]=w):w=s[27];let C;s[28]!==j||s[29]!==S||s[30]!==N?(C=a.jsxs("button",{type:"button",onClick:j,className:"group mt-3 flex items-center gap-2 self-start rounded-lg border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:border-border hover:bg-accent/40 hover:text-foreground",children:[_,S,N,w]}),s[28]=j,s[29]=S,s[30]=N,s[31]=C):C=s[31];let M;s[32]===Symbol.for("react.memo_cache_sentinel")?(M=T=>p(T),s[32]=M):M=s[32];let A;s[33]!==f||s[34]!==b?(A=async T=>{const $=f;p(null),$&&await b($,T)},s[33]=f,s[34]=b,s[35]=A):A=s[35];let L;s[36]!==f||s[37]!==A?(L=a.jsx(rn,{prompt:f,setPrompt:M,onSubmit:A}),s[36]=f,s[37]=A,s[38]=L):L=s[38];let I;return s[39]!==C||s[40]!==L?(I=a.jsxs(a.Fragment,{children:[C,L]}),s[39]=C,s[40]=L,s[41]=I):I=s[41],I}function la(s){return s.role==="user"||s.parts.some(aa)}function aa(s){return s.type==="tool-user_ask"&&s.state==="output-available"}function oa(s){const e=new Map;for(let t=s.length-1;t>=0;t--){const l=s[t]?.parts;if(l)for(const n of l){const c=n;if(c.type!=="data-deck-updated")continue;const u=c.data;if(!u?.path)continue;const i=`deck:${u.path}`;e.has(i)||e.set(i,{tabId:cs(u.path),label:u.name||u.path,kind:u.kind==="page"?"page":"deck"})}}return Array.from(e.values())}function ra(){const s=E.c(9),e=U(),{openPanel:t}=Ve(),l=ve()?.messages??[],n=oa(l);if(n.length===0)return null;const c=n.some(ca),u=n.some(ia),i=e(c?u?"chat.threadHtmlPreviews.slidesAndPages":"chat.threadHtmlPreviews.slides":"chat.threadHtmlPreviews.pages"),r="flex flex-col gap-1.5 py-2";let o;s[0]!==i?(o=a.jsx("div",{className:"text-[12px] text-muted-foreground/70 uppercase tracking-wide",children:i}),s[0]=i,s[1]=o):o=s[1];const m="flex flex-wrap gap-2";let d;s[2]!==t?(d=h=>a.jsxs("button",{type:"button",onClick:()=>t(h.tabId),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-muted/30 hover:bg-muted/60 text-[13px] transition-colors",children:[h.kind==="deck"?a.jsx(pn,{className:"size-3.5 shrink-0 text-muted-foreground"}):a.jsx(Ss,{className:"size-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:h.label})]},h.tabId),s[2]=t,s[3]=d):d=s[3];const f=n.map(d);let p;s[4]!==f?(p=a.jsx("div",{className:m,children:f}),s[4]=f,s[5]=p):p=s[5];let g;return s[6]!==o||s[7]!==p?(g=a.jsxs("div",{className:r,children:[o,p]}),s[6]=o,s[7]=p,s[8]=g):g=s[8],g}function ia(s){return s.kind==="page"}function ca(s){return s.kind==="deck"}function ua(s){const e=E.c(29),{file:t}=s,l=U(),{openPanel:n}=Ve();let c;e[0]!==t.key||e[1]!==n?(c=()=>n(us(t.key)),e[0]=t.key,e[1]=n,e[2]=c):c=e[2];const u=c;let i;e[3]!==t.filename?(i=a.jsx(xn,{filename:t.filename,className:"h-5 w-4 shrink-0"}),e[3]=t.filename,e[4]=i):i=e[4];let r;e[5]!==t.filename||e[6]!==u?(r=a.jsx("button",{type:"button",onClick:u,className:"min-w-0 flex-1 truncate text-left text-[13px] font-medium text-foreground hover:underline",title:t.filename,children:t.filename}),e[5]=t.filename,e[6]=u,e[7]=r):r=e[7];const o=t.downloadUrl,m=t.filename;let d;e[8]!==l?(d=l("chat.outputFileRow.download"),e[8]=l,e[9]=d):d=e[9];let f;e[10]!==t.filename||e[11]!==l?(f=l("chat.outputFileRow.downloadFile",{filename:t.filename}),e[10]=t.filename,e[11]=l,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(Xs,{className:"size-3.5"}),e[13]=p):p=e[13];let g;e[14]!==t.downloadUrl||e[15]!==t.filename||e[16]!==d||e[17]!==f?(g=a.jsx("a",{href:o,download:m,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block group-focus-within:block",title:d,"aria-label":f,children:p}),e[14]=t.downloadUrl,e[15]=t.filename,e[16]=d,e[17]=f,e[18]=g):g=e[18];let h;e[19]!==l?(h=l("chat.outputFileRow.open"),e[19]=l,e[20]=h):h=e[20];let x;e[21]!==u||e[22]!==h?(x=a.jsx(He,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:u,children:h}),e[21]=u,e[22]=h,e[23]=x):x=e[23];let v;return e[24]!==x||e[25]!==i||e[26]!==r||e[27]!==g?(v=a.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[i,r,g,x]}),e[24]=x,e[25]=i,e[26]=r,e[27]=g,e[28]=v):v=e[28],v}function da(s){return s.split("/").pop()??s}const fa=/(^|\/)output\//;function ma(s){const e=new Set;for(const t of s.parts??[]){const l=t;if(l.state==="output-available"&&l.type==="tool-write"){const n=l.input?.path;n&&fa.test(n)&&e.add(da(n))}}return e}function pa(s){const e=E.c(4),{threadId:t,message:l}=s,n=ma(l),c=n.size>0;let u;e[0]!==c?(u={enabled:c},e[0]=c,e[1]=u):u=e[1];const{data:i}=gn(t,u);if(n.size===0)return null;const r=(i??[]).filter(f=>n.has(f.filename));if(r.length===0)return null;const o="flex flex-col gap-1.5 py-2",m=r.map(ga);let d;return e[2]!==m?(d=a.jsx("div",{className:o,children:m}),e[2]=m,e[3]=d):d=e[3],d}function ga(s){return a.jsx(ua,{file:s},s.key)}function xa(s){return s.type==="reasoning"}function ha(s){const e=[],t=new Set,l=new Map,n=new Map,c=new Map;if(s){let i=null;for(let r=0;r<s.parts.length;r++){const o=s.parts[r];if(xa(o)){i||(i={parts:[],startIndex:r},e.push(i)),i.parts.push(o),t.add(r);continue}if(i=null,o.type==="data-tool-metadata"&&"id"in o&&"data"in o){const m=o.data,d={};m.annotations&&(d.annotations=m.annotations),typeof m.latencyMs=="number"&&Number.isFinite(m.latencyMs)&&(d.latencySeconds=m.latencyMs/1e3),typeof m.outputBytes=="number"&&Number.isFinite(m.outputBytes)&&m.outputBytes>=0&&(d.outputBytes=m.outputBytes),m._meta&&typeof m._meta=="object"&&(d._meta=m._meta),l.set(o.id,d);continue}if(o.type==="data-tool-subtask-metadata"&&"id"in o){n.set(o.id,o.data);continue}if(o.type==="data-web-search"&&"id"in o&&"data"in o){const m=o.id,d=o.data;c.set(m,d.text??"");continue}}}const u=[];if(s)for(let i=0;i<s.parts.length;i++){const r=s.parts[i];if(r.type!=="step-start"){if(t.has(i)){const o=e.find(m=>m.startIndex===i);o&&u.push({kind:"reasoning-group",group:o});continue}r.type.startsWith("data-")||u.push({kind:"part",index:i})}}return{reasoningGroups:e,renderOrder:u,dataParts:{toolMetadata:l,toolSubtaskMetadata:n,webSearchStreaming:c}}}const ba=3;function ya(s,e){let t=-1;for(let l=s.length-1;l>=0;l--){const n=s[l];if(n.kind==="part"&&e[n.index]?.type==="text"){t=l;break}}return t===-1?{collapsed:[],tail:s}:{collapsed:s.slice(0,t),tail:s.slice(t)}}function ja(s,e){let t=0,l=0;for(const n of s)if(n.kind==="reasoning-group")l++;else{const c=e[n.index]?.type;c==="text"?l++:(c==="dynamic-tool"||c?.startsWith("tool-"))&&c!=="tool-todo_write"&&c!=="tool-update_interests"&&t++}return{toolCalls:t,messages:l}}function va(s){const e=E.c(10),{toolCalls:t,messages:l}=s,n=U();let c;e[0]!==l||e[1]!==n||e[2]!==t?(c=t>0&&a.jsxs(a.Fragment,{children:[a.jsx(gt,{className:"size-3.5 shrink-0"}),a.jsxs("span",{children:[n("chat.assistant.toolCallPlural",{count:t}),l>0?",":""]})]}),e[0]=l,e[1]=n,e[2]=t,e[3]=c):c=e[3];let u;e[4]!==l||e[5]!==n?(u=l>0&&a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"size-3.5 shrink-0"}),a.jsx("span",{children:n("chat.assistant.messagePlural",{count:l})})]}),e[4]=l,e[5]=n,e[6]=u):u=e[6];let i;return e[7]!==c||e[8]!==u?(i=a.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[c,u]}),e[7]=c,e[8]=u,e[9]=i):i=e[9],i}function Na(s){const e=E.c(28),{items:t,message:l,reasoningGroups:n,isReasoningActive:c,totalDuration:u,dataParts:i,isLoading:r,isLast:o}=s;let m;e[0]!==t||e[1]!==l.parts?(m=ja(t,l.parts),e[0]=t,e[1]=l.parts,e[2]=m):m=e[2];const{toolCalls:d,messages:f}=m;if(d===0&&f===0)return null;let p;e[3]!==f||e[4]!==d?(p=a.jsx(va,{toolCalls:d,messages:f}),e[3]=f,e[4]=d,e[5]=p):p=e[5];let g;if(e[6]!==i||e[7]!==o||e[8]!==r||e[9]!==c||e[10]!==t||e[11]!==l||e[12]!==n||e[13]!==u){let v;e[15]!==i||e[16]!==o||e[17]!==r||e[18]!==c||e[19]!==l||e[20]!==n||e[21]!==u?(v=(b,k)=>Zt({item:b,renderIndex:k,message:l,reasoningGroups:n,isReasoningActive:c,totalDuration:u,dataParts:i,isLoading:r,isLast:o,isLastVisiblePart:!1}),e[15]=i,e[16]=o,e[17]=r,e[18]=c,e[19]=l,e[20]=n,e[21]=u,e[22]=v):v=e[22],g=t.map(v),e[6]=i,e[7]=o,e[8]=r,e[9]=c,e[10]=t,e[11]=l,e[12]=n,e[13]=u,e[14]=g}else g=e[14];let h;e[23]!==g?(h=a.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:g}),e[23]=g,e[24]=h):h=e[24];let x;return e[25]!==p||e[26]!==h?(x=a.jsx(H,{icon:null,alwaysChevron:!0,title:p,state:"idle",children:h}),e[25]=p,e[26]=h,e[27]=x):x=e[27],x}function Zt({item:s,renderIndex:e,message:t,reasoningGroups:l,isReasoningActive:n,totalDuration:c,dataParts:u,isLoading:i,isLast:r,isLastVisiblePart:o,renderOrder:m}){if(s.kind==="reasoning-group"){const{group:g}=s,h=g===l[l.length-1],x=n&&h;if(!g.parts.some(k=>k.text?.trim())&&!x)return null;const b=l.length===1?c:null;return a.jsx(An,{duration:b,parts:g.parts,isStreaming:x},`${t.id}-reasoning-${g.startIndex}`)}const d=t.parts[s.index],f=o||(m?m.findLastIndex(g=>g.kind==="part")===e:!1),p=f?Os(Us(),t.metadata?.usage):null;return a.jsx(Sa,{part:d,id:t.id,usageStats:f&&a.jsx(Es,{usage:p,duration:c}),dataParts:u,isLoading:i,isLastMessage:r},`${t.id}-${s.index}`)}function Sa(s){const e=E.c(117),{part:t,id:l,usageStats:n,dataParts:c,isLoading:u,isLastMessage:i}=s;let r;e[0]!==c.toolMetadata?(r=f=>c.toolMetadata.get(f),e[0]=c.toolMetadata,e[1]=r):r=e[1];const o=r;let m;e[2]!==c.toolSubtaskMetadata?(m=f=>c.toolSubtaskMetadata.get(f),e[2]=c.toolSubtaskMetadata,e[3]=m):m=e[3];const d=m;switch(t.type){case"dynamic-tool":{let f;e[4]!==o||e[5]!==t.toolCallId?(f=o(t.toolCallId)?.annotations,e[4]=o,e[5]=t.toolCallId,e[6]=f):f=e[6];let p;e[7]!==o||e[8]!==t.toolCallId?(p=o(t.toolCallId)?.latencySeconds,e[7]=o,e[8]=t.toolCallId,e[9]=p):p=e[9];let g;e[10]!==o||e[11]!==t.toolCallId?(g=o(t.toolCallId)?.outputBytes,e[10]=o,e[11]=t.toolCallId,e[12]=g):g=e[12];let h;e[13]!==o||e[14]!==t.toolCallId?(h=o(t.toolCallId)?._meta,e[13]=o,e[14]=t.toolCallId,e[15]=h):h=e[15];let x;return e[16]!==i||e[17]!==t||e[18]!==f||e[19]!==p||e[20]!==g||e[21]!==h?(x=a.jsx(ot,{part:t,annotations:f,latency:p,outputBytes:g,isLastMessage:i,toolMeta:h}),e[16]=i,e[17]=t,e[18]=f,e[19]=p,e[20]=g,e[21]=h,e[22]=x):x=e[22],x}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let f;e[23]!==o||e[24]!==t.toolCallId?(f=o(t.toolCallId)?.latencySeconds,e[23]=o,e[24]=t.toolCallId,e[25]=f):f=e[25];let p;return e[26]!==t||e[27]!==f?(p=a.jsx(jl,{part:t,latency:f}),e[26]=t,e[27]=f,e[28]=p):p=e[28],p}case"tool-suggest_task":{let f;return e[29]!==t?(f=a.jsx(vl,{part:t}),e[29]=t,e[30]=f):f=e[30],f}case"tool-propose_plan":{let f;return e[31]!==t?(f=a.jsx(El,{part:t}),e[31]=t,e[32]=f):f=e[32],f}case"tool-generate_image":{let f;e[33]!==o||e[34]!==t.toolCallId?(f=o(t.toolCallId)?.latencySeconds,e[33]=o,e[34]=t.toolCallId,e[35]=f):f=e[35];let p;return e[36]!==t||e[37]!==f?(p=a.jsx(rl,{part:t,latency:f}),e[36]=t,e[37]=f,e[38]=p):p=e[38],p}case"tool-web_search":case"tool-deep_research":{let f;e[39]!==o||e[40]!==t.toolCallId?(f=o(t.toolCallId)?.latencySeconds,e[39]=o,e[40]=t.toolCallId,e[41]=f):f=e[41];let p;e[42]!==c.webSearchStreaming||e[43]!==t.toolCallId?(p=c.webSearchStreaming.get(t.toolCallId),e[42]=c.webSearchStreaming,e[43]=t.toolCallId,e[44]=p):p=e[44];let g;return e[45]!==t||e[46]!==f||e[47]!==p?(g=a.jsx(yl,{part:t,latency:f,streamingText:p}),e[45]=t,e[46]=f,e[47]=p,e[48]=g):g=e[48],g}case"tool-subtask":{let f;e[49]!==d||e[50]!==t.toolCallId?(f=d(t.toolCallId),e[49]=d,e[50]=t.toolCallId,e[51]=f):f=e[51];let p;e[52]!==o||e[53]!==t.toolCallId?(p=o(t.toolCallId)?.annotations,e[52]=o,e[53]=t.toolCallId,e[54]=p):p=e[54];let g;e[55]!==o||e[56]!==t.toolCallId?(g=o(t.toolCallId)?.latencySeconds,e[55]=o,e[56]=t.toolCallId,e[57]=g):g=e[57];let h;e[58]!==t||e[59]!==f||e[60]!==p||e[61]!==g?(h={part:t,subtaskMeta:f,annotations:p,latency:g},e[58]=t,e[59]=f,e[60]=p,e[61]=g,e[62]=h):h=e[62];const x=h;let v;return e[63]!==x?(v=a.jsx(R.Suspense,{fallback:a.jsx(Al,{...x}),children:a.jsx(Ml,{...x})}),e[63]=x,e[64]=v):v=e[64],v}case"text":{const f=!!n&&!u,p=u&&i;let g;return e[65]!==l||e[66]!==t||e[67]!==f||e[68]!==p||e[69]!==n?(g=a.jsx($e,{id:l,part:t,extraActions:n,copyable:!0,alwaysShowActions:f,animate:p}),e[65]=l,e[66]=t,e[67]=f,e[68]=p,e[69]=n,e[70]=g):g=e[70],g}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const f=t;if(f.type==="tool-brand_context_setup"||f.type==="tool-BRAND_CONTEXT_EXTRACT"){let p;e[71]!==f.toolCallId||e[72]!==o?(p=o(f.toolCallId)?.latencySeconds,e[71]=f.toolCallId,e[72]=o,e[73]=p):p=e[73];let g;return e[74]!==f||e[75]!==p?(g=a.jsx(Ol,{part:f,latency:p}),e[74]=f,e[75]=p,e[76]=g):g=e[76],g}if(f.type==="tool-BRAND_CONTEXT_GET"){let p;e[77]!==f.toolCallId||e[78]!==o?(p=o(f.toolCallId)?.latencySeconds,e[77]=f.toolCallId,e[78]=o,e[79]=p):p=e[79];let g;return e[80]!==f||e[81]!==p?(g=a.jsx(Ul,{part:f,latency:p}),e[80]=f,e[81]=p,e[82]=g):g=e[82],g}if(f.type==="tool-BRAND_CONTEXT_LIST"){let p;e[83]!==f.toolCallId||e[84]!==o?(p=o(f.toolCallId)?.latencySeconds,e[83]=f.toolCallId,e[84]=o,e[85]=p):p=e[85];let g;return e[86]!==f||e[87]!==p?(g=a.jsx(Hl,{part:f,latency:p}),e[86]=f,e[87]=p,e[88]=g):g=e[88],g}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let p;e[89]!==f.toolCallId||e[90]!==o?(p=o(f.toolCallId)?.latencySeconds,e[89]=f.toolCallId,e[90]=o,e[91]=p):p=e[91];let g;return e[92]!==f||e[93]!==p?(g=a.jsx(Gl,{part:f,latency:p}),e[92]=f,e[93]=p,e[94]=g):g=e[94],g}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let p;e[95]!==f.toolCallId||e[96]!==o?(p=o(f.toolCallId)?.latencySeconds,e[95]=f.toolCallId,e[96]=o,e[97]=p):p=e[97];let g;return e[98]!==f||e[99]!==p?(g=a.jsx(Jl,{part:f,latency:p}),e[98]=f,e[99]=p,e[100]=g):g=e[100],g}if(f.type==="tool-COLLECTION_CONNECTIONS_LIST"){let p;e[101]!==f.toolCallId||e[102]!==o?(p=o(f.toolCallId)?.latencySeconds,e[101]=f.toolCallId,e[102]=o,e[103]=p):p=e[103];let g;return e[104]!==f||e[105]!==p?(g=a.jsx(ea,{part:f,latency:p}),e[104]=f,e[105]=p,e[106]=g):g=e[106],g}if(f.type.startsWith("tool-")){const p=f.toolCallId;let g;e[107]!==c.toolMetadata||e[108]!==p?(g=c.toolMetadata.get(p),e[107]=c.toolMetadata,e[108]=p,e[109]=g):g=e[109];const h=g,x=h?.annotations,v=h?.latencySeconds,b=h?.outputBytes,k=h?._meta;let j;return e[110]!==f||e[111]!==i||e[112]!==x||e[113]!==v||e[114]!==b||e[115]!==k?(j=a.jsx(ot,{part:f,annotations:x,latency:v,outputBytes:b,isLastMessage:i,toolMeta:k}),e[110]=f,e[111]=i,e[112]=x,e[113]=v,e[114]=b,e[115]=k,e[116]=j):j=e[116],j}if(f.type.startsWith("data-"))return null;throw new Error(`Unknown part type: ${f.type}`)}}}function ka(s){const e=E.c(9),{isRunInProgress:t}=s,l=U();if(t){let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(Ie,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),e[0]=u):u=e[0];let i;e[1]!==l?(i=l("chat.assistant.resumingTask"),e[1]=l,e[2]=i):i=e[2];let r;return e[3]!==i?(r=a.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[u,a.jsx("span",{className:"text-[14px] text-muted-foreground shimmer",children:i})]})}),e[3]=i,e[4]=r):r=e[4],r}let n;e[5]!==l?(n=l("chat.assistant.noResponseGenerated"),e[5]=l,e[6]=n):n=e[6];let c;return e[7]!==n?(c=a.jsx("div",{className:"text-[14px] text-muted-foreground/60 py-2",children:n}),e[7]=n,e[8]=c):c=e[8],c}function _a(s){const e=E.c(7),{className:t,children:l}=s;let n;e[0]!==t?(n=K("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=n):n=e[1];let c;e[2]!==l?(c=a.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:a.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[14px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:l})}),e[2]=l,e[3]=c):c=e[3];let u;return e[4]!==n||e[5]!==c?(u=a.jsx("div",{className:n,children:c}),e[4]=n,e[5]=c,e[6]=u):u=e[6],u}function wa(s){const e=E.c(32),{message:t,turnStartedAt:l,status:n,className:c,isLast:u}=s,i=u===void 0?!1:u,r=U(),{isRunInProgress:o}=ve()??{},m=o===void 0?!1:o,d=Ne()?.taskId??null,f=n==="streaming",g=f||n==="submitted";let h;e[0]!==l?(h=Ge(l),e[0]=l,e[1]=h):h=e[1];const x=h;let v;e[2]!==g?(v=()=>g?Date.now():null,e[2]=g,e[3]=v):v=e[3];const[b,k]=R.useState(v),[j,_]=R.useState(g);j!==g&&(_(g),k(()=>g?Date.now():null));const y=x??b,{reasoningGroups:S,renderOrder:N,dataParts:w}=ha(t),C=t!==null&&N.length>0,M=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,A=f&&M?.type==="reasoning";let L;if(e[4]!==t){const D=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,F=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;L=D!==null?F.getTime()-D.getTime():null,e[4]=t,e[5]=L}else L=e[5];const I=L;let T;e[6]!==i||e[7]!==t?(T=!i||!t||!t.parts.some(Ta),e[6]=i,e[7]=t,e[8]=T):T=e[8];const $=T;let P;e[9]!==C||e[10]!==g||e[11]!==$||e[12]!==t||e[13]!==N?(P=!g&&C&&$&&(()=>{let D=0;for(const F of N)if(F.kind==="part"){const W=t.parts[F.index]?.type;(W==="dynamic-tool"||W?.startsWith("tool-"))&&D++}return D>=ba})(),e[9]=C,e[10]=g,e[11]=$,e[12]=t,e[13]=N,e[14]=P):P=e[14];const q=P;let B;if(e[15]!==c||e[16]!==w||e[17]!==C||e[18]!==i||e[19]!==g||e[20]!==A||e[21]!==m||e[22]!==$||e[23]!==t||e[24]!==S||e[25]!==N||e[26]!==q||e[27]!==y||e[28]!==r||e[29]!==d||e[30]!==I){const{collapsed:D,tail:F}=q?ya(N,t.parts):{collapsed:[],tail:N};B=a.jsx(_a,{className:c,children:C?a.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[t.metadata?.resumedFromBackground&&a.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground/60 select-none",children:[a.jsx(ft,{className:"size-3 shrink-0"}),a.jsx("span",{children:r("chat.assistant.resumedBackgroundTask")})]}),D.length>0&&a.jsx(Na,{items:D,message:t,reasoningGroups:S,isReasoningActive:A,totalDuration:I,dataParts:w,isLoading:g,isLast:i}),F.map((W,X)=>{const J=D.length+X,te=F.findLastIndex(Ca)===X;return Zt({item:W,renderIndex:J,message:t,reasoningGroups:S,isReasoningActive:A,totalDuration:I,dataParts:w,isLoading:g,isLast:i,isLastVisiblePart:te,renderOrder:N})}),d&&a.jsx(pa,{threadId:d,message:t}),i&&g&&y!==null&&a.jsx(Tn,{startedAt:y}),i&&!g&&d&&a.jsxs(a.Fragment,{children:[a.jsx(ra,{}),$&&a.jsx(na,{})]}),!g&&a.jsx(zt,{message:t})]}):g?a.jsx($n,{startedAt:y}):a.jsx(ka,{isRunInProgress:i&&m})}),e[15]=c,e[16]=w,e[17]=C,e[18]=i,e[19]=g,e[20]=A,e[21]=m,e[22]=$,e[23]=t,e[24]=S,e[25]=N,e[26]=q,e[27]=y,e[28]=r,e[29]=d,e[30]=I,e[31]=B}else B=e[31];return B}function Ca(s){return s.kind==="part"}function Ta(s){const e=s.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=s.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function Ia(s){const e=E.c(25),{event:t}=s,l=U(),[n,c]=R.useState(!1);let u;e[0]!==t.data?(u=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=u):u=e[1];const i=u;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>c($a),e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(_s,{className:"size-4 shrink-0 text-muted-foreground"}),e[3]=o):o=e[3];let m;e[4]!==l?(m=l("chat.triggerEventPart.triggeredByEvent"),e[4]=l,e[5]=m):m=e[5];let d;e[6]!==m?(d=a.jsx("span",{className:"font-medium",children:m}),e[6]=m,e[7]=d):d=e[7];let f;e[8]!==t.type?(f=a.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[8]=t.type,e[9]=f):f=e[9];const p=n&&"rotate-180";let g;e[10]!==p?(g=K("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",p),e[10]=p,e[11]=g):g=e[11];let h;e[12]!==g?(h=a.jsx(hn,{className:g}),e[12]=g,e[13]=h):h=e[13];let x;e[14]!==d||e[15]!==f||e[16]!==h?(x=a.jsxs("button",{type:"button",onClick:r,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[o,d,f,h]}),e[14]=d,e[15]=f,e[16]=h,e[17]=x):x=e[17];let v;e[18]!==t.source||e[19]!==n||e[20]!==i?(v=n&&a.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[a.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),a.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:i})]}),e[18]=t.source,e[19]=n,e[20]=i,e[21]=v):v=e[21];let b;return e[22]!==x||e[23]!==v?(b=a.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[x,v]}),e[22]=x,e[23]=v,e[24]=b):b=e[24],b}function $a(s){return!s}const Aa=[fn.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),un,dn];function Ma(s){const e=E.c(5),{tiptapDoc:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=l):l=e[0];let n;e[1]!==t?(n={extensions:Aa,content:t,editable:!1,editorProps:l},e[1]=t,e[2]=n):n=e[2];const c=cn(n);if(!c)return null;let u;return e[3]!==c?(u=a.jsx(mn,{editor:c,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=c,e[4]=u):u=e[4],u}function Ea(s){const e=E.c(38),{message:t,className:l,onScrollToPair:n}=s,{id:c,parts:u,metadata:i}=t,[r,o]=R.useState(!1),[m,d]=R.useState(!1),f=R.useRef(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=T=>{T&&!f.current&&(f.current=!0,d(T.scrollHeight>T.clientHeight))},e[0]=p):p=e[0];const g=p;if(!u||u.length===0)return null;let h;e[1]!==n?(h=()=>{o(!0),n?.()},e[1]=n,e[2]=h):h=e[2];const x=h,v=i?.tiptapDoc;let b;e[3]!==l?(b=K("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",l),e[3]=l,e[4]=b):b=e[4];let k,j;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>o(!0),j=()=>o(!1),e[5]=k,e[6]=j):(k=e[5],j=e[6]);let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=_):_=e[7];let y;e[8]!==r||e[9]!==m?(y=K("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",r?"max-h-[50vh] overflow-auto opacity-100":K("max-h-[84px] overflow-hidden opacity-99",m&&"mask-b-from-1%")),e[8]=r,e[9]=m,e[10]=y):y=e[10];let S;if(e[11]!==c||e[12]!==u){let T;e[14]!==c?(T=($,P)=>$.type==="data-trigger-event"?a.jsx(Ia,{event:$.data},`${c}-${P}`):null,e[14]=c,e[15]=T):T=e[15],S=u.map(T),e[11]=c,e[12]=u,e[13]=S}else S=e[13];let N;e[16]!==v||e[17]!==c||e[18]!==i||e[19]!==u?(N=v?a.jsx(Ma,{tiptapDoc:i.tiptapDoc}):u.map((T,$)=>T.type==="text"?u[$-1]?.type==="data-trigger-event"?null:a.jsx($e,{id:c,part:T},`${c}-${$}`):null),e[16]=v,e[17]=c,e[18]=i,e[19]=u,e[20]=N):N=e[20];let w;e[21]!==S||e[22]!==N?(w=a.jsxs("div",{className:"flex flex-col gap-2",children:[S,N]}),e[21]=S,e[22]=N,e[23]=w):w=e[23];let C;e[24]!==w||e[25]!==y?(C=a.jsx("div",{ref:g,className:y,children:w}),e[24]=w,e[25]=y,e[26]=C):C=e[26];let M;e[27]!==x||e[28]!==C?(M=a.jsxs("div",{tabIndex:0,onClick:x,onFocus:k,onBlur:j,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-[14px] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[_,C]}),e[27]=x,e[28]=C,e[29]=M):M=e[29];let A;e[30]!==t?(A=a.jsx(zt,{message:t,className:"mt-1 mr-1 self-end"}),e[30]=t,e[31]=A):A=e[31];let L;e[32]!==M||e[33]!==A?(L=a.jsxs("div",{className:"w-full min-w-0 flex flex-col",children:[M,A]}),e[32]=M,e[33]=A,e[34]=L):L=e[34];let I;return e[35]!==L||e[36]!==b?(I=a.jsx(a.Fragment,{children:a.jsx("div",{className:b,children:L})}),e[35]=L,e[36]=b,e[37]=I):I=e[37],I}function wo(s){const e=[],t=s.filter(l=>l.role!=="system"&&!l.metadata?.internal&&!l.metadata?.subtaskJobId);for(let l=0;l<t.length;l++){const n=t[l];if(n)if(n.role==="user"){const c=t[l+1];c&&c.role==="assistant"?(e.push({user:n,assistant:c}),l++):e.push({user:n,assistant:null})}else n.role==="assistant"&&e.push({user:null,assistant:n})}return e}function Co(s){const e=E.c(19),{pair:t,isLastPair:l,status:n}=s,c=R.useRef(null),u=R.useRef(!1);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{c.current&&c.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=i):i=e[0];const r=i;let o;e[1]!==l||e[2]!==t.assistant?.metadata?.resumedFromBackground||e[3]!==n?(o=v=>{if(c.current=v,!l||!v||u.current||(u.current=!0,t.assistant?.metadata?.resumedFromBackground))return;if(n==="submitted"||n==="streaming"){v.scrollIntoView({behavior:"smooth",block:"start"});return}const b=v.closest("[data-chat-scroller]");b?b.scrollTop=b.scrollHeight:v.scrollIntoView({behavior:"instant",block:"start"})},e[1]=l,e[2]=t.assistant?.metadata?.resumedFromBackground,e[3]=n,e[4]=o):o=e[4];const m=o,d=!t.user&&"pt-8 sm:pt-6";let f;e[5]!==d?(f=K("flex flex-col pb-2 sm:pb-2",d),e[5]=d,e[6]=f):f=e[6];let p;e[7]!==t.user?(p=t.user&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),a.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:a.jsx(Ea,{message:t.user,onScrollToPair:r})})]}),e[7]=t.user,e[8]=p):p=e[8];const g=t.user?.created_at??null;let h;e[9]!==l||e[10]!==t.assistant||e[11]!==n||e[12]!==g?(h=a.jsx(wa,{message:t.assistant,turnStartedAt:g,status:n,isLast:l}),e[9]=l,e[10]=t.assistant,e[11]=n,e[12]=g,e[13]=h):h=e[13];let x;return e[14]!==m||e[15]!==f||e[16]!==p||e[17]!==h?(x=a.jsxs("div",{ref:m,className:f,children:[p,h]}),e[14]=m,e[15]=f,e[16]=p,e[17]=h,e[18]=x):x=e[18],x}export{Sn as G,Co as M,ua as O,_o as S,Nn as a,Rn as f,wo as u};
|
|
46
|
+
`:"")+n:e(c?"chat.subtask.stepLimitNoOutput":"chat.subtask.completedNoOutput")}}return Jn(s)}function Wt(s){return!!s&&typeof s=="object"&&s.background===!0}function Kt({part:s,subtaskMeta:e},t){const l=s.state==="input-streaming"||s.state==="input-available",n=s.state==="output-available"&&s.preliminary===!0,c=s.state==="output-available"&&!s.preliminary,u=s.state==="output-error",i=pe(s.state,"preliminary"in s?s.preliminary:!1),r=i==="approval"?"idle":i,o=t(l?"chat.subtask.startingEllipsis":n?"chat.subtask.runningEllipsis":c?"chat.subtask.completedTitle":u?"chat.subtask.failedTitle":"chat.subtask.subtaskNoun"),m=s.input?.prompt??"",d=s.state==="approval-requested"?t("chat.subtask.awaitingApproval"):m.length>120?m.slice(0,120)+"…":m;return{fallbackTitle:o,summary:d,usage:e?.usage,state:r}}function Gt(s){return s.state==="input-available"?!0:s.state==="output-available"?"preliminary"in s&&s.preliminary===!0:!1}function Vt(s){const e=E.c(4),t=Ne()?.taskId??null,{org:l}=ge();if(!t)return null;let n;return e[0]!==l||e[1]!==t||e[2]!==s?(n=async()=>{if(t===null)return;const c=await fetch(`/api/${encodeURIComponent(l.slug)}/decopilot/flip/${encodeURIComponent(t)}`,{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({toolCallId:s})});if(!c.ok)throw new Error(`flip failed: ${c.status}`)},e[0]=l,e[1]=t,e[2]=s,e[3]=n):n=e[3],n}function wl(s){const e=E.c(10),{onFlip:t}=s,l=U(),[n,c]=R.useState(!1);let u;e[0]!==t?(u=async m=>{m.stopPropagation(),c(!0);try{await t()}catch{c(!1)}},e[0]=t,e[1]=u):u=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=G("shrink-0 text-[12px] text-muted-foreground/70 px-2 py-1 rounded-lg transition-colors","[@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/40","disabled:opacity-50"),e[2]=i):i=e[2];let r;e[3]!==n||e[4]!==l?(r=l(n?"chat.subtask.flipping":"chat.subtask.flipToBackground"),e[3]=n,e[4]=l,e[5]=r):r=e[5];let o;return e[6]!==n||e[7]!==u||e[8]!==r?(o=a.jsx("button",{type:"button",disabled:n,onClick:u,className:i,children:r}),e[6]=n,e[7]=u,e[8]=r,e[9]=o):o=e[9],o}function Xe(s){const e=E.c(54),{icon:t,title:l,summary:n,state:c,usage:u,latency:i,onOpenChange:r,onFlip:o,children:m}=s,[d,f]=R.useState(!1);let p;e[0]!==r?(p=J=>{f(J),r?.(J)},e[0]=r,e[1]=p):p=e[1];const g=p,h=c==="loading",x=c==="error";let v;e[2]!==g?(v=()=>g(!0),e[2]=g,e[3]=v):v=e[3];const b=h&&"shimmer";let k;e[4]!==b?(k=G("group/tool flex items-center gap-2 flex-1 min-w-0 py-2.5 text-left rounded-lg transition-colors","[@media(hover:hover)]:hover:bg-accent/30",b),e[4]=b,e[5]=k):k=e[5];const j=x?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75";let _;e[6]!==j?(_=G("relative shrink-0 size-4 flex items-center justify-center [&>svg]:size-4",j),e[6]=j,e[7]=_):_=e[7];let y;e[8]!==t||e[9]!==_?(y=a.jsx("div",{className:_,children:t}),e[8]=t,e[9]=_,e[10]=y):y=e[10];const S=x?"text-warning/80":"text-foreground";let N;e[11]!==S?(N=G("shrink-0 text-[14px] font-normal",S),e[11]=S,e[12]=N):N=e[12];let w;e[13]!==N||e[14]!==l?(w=a.jsx("span",{className:N,children:l}),e[13]=N,e[14]=l,e[15]=w):w=e[15];let C;e[16]!==n?(C=n?a.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:n})}):a.jsx("div",{className:"flex-1"}),e[16]=n,e[17]=C):C=e[17];let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=a.jsx(rs,{className:"size-3.5 shrink-0 text-muted-foreground/40 opacity-0 transition-opacity [@media(hover:hover)]:group-hover/tool:opacity-100"}),e[18]=M):M=e[18];let A;e[19]!==i?(A=a.jsx(ne,{latency:i}),e[19]=i,e[20]=A):A=e[20];let L;e[21]!==u?(L=a.jsx(jt,{usage:u}),e[21]=u,e[22]=L):L=e[22];let I;e[23]!==w||e[24]!==C||e[25]!==A||e[26]!==L||e[27]!==v||e[28]!==k||e[29]!==y?(I=a.jsxs("button",{type:"button",onClick:v,className:k,children:[y,w,C,M,A,L]}),e[23]=w,e[24]=C,e[25]=A,e[26]=L,e[27]=v,e[28]=k,e[29]=y,e[30]=I):I=e[30];let T;e[31]!==h||e[32]!==o?(T=o&&h?a.jsx(wl,{onFlip:o}):null,e[31]=h,e[32]=o,e[33]=T):T=e[33];let $;e[34]!==I||e[35]!==T?($=a.jsxs("div",{className:"flex items-center gap-1 w-full",children:[I,T]}),e[34]=I,e[35]=T,e[36]=$):$=e[36];let P;e[37]!==t?(P=a.jsx("span",{className:"flex items-center [&>svg]:size-4 [&>svg]:text-muted-foreground/75",children:t}),e[37]=t,e[38]=P):P=e[38];let q;e[39]!==P||e[40]!==l?(q=a.jsx(tn,{className:"px-4 py-3 border-b border-border shrink-0",children:a.jsxs(sn,{className:"flex items-center gap-2 text-sm font-medium",children:[P,l]})}),e[39]=P,e[40]=l,e[41]=q):q=e[41];let B;e[42]!==m?(B=a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 py-4",children:m}),e[42]=m,e[43]=B):B=e[43];let D;e[44]!==q||e[45]!==B?(D=a.jsxs(nn,{side:"right",className:"w-full sm:max-w-2xl flex flex-col p-0 gap-0",children:[q,B]}),e[44]=q,e[45]=B,e[46]=D):D=e[46];let F;e[47]!==d||e[48]!==g||e[49]!==D?(F=a.jsx(ln,{open:d,onOpenChange:g,children:D}),e[47]=d,e[48]=g,e[49]=D,e[50]=F):F=e[50];let W;return e[51]!==$||e[52]!==F?(W=a.jsxs(a.Fragment,{children:[$,F]}),e[51]=$,e[52]=F,e[53]=W):W=e[53],W}function Jt(s){const e=E.c(22),{part:t}=s,l=U(),n=t.state==="output-error";let c;e[0]!==t.input?.prompt||e[1]!==l?(c=t.input?.prompt??l("chat.subtask.noPromptProvided"),e[0]=t.input?.prompt,e[1]=l,e[2]=c):c=e[2];const u=c;let i;if(e[3]!==n||e[4]!==t||e[5]!==u||e[6]!==l){const r=n?Me(t):_l(t.output,l)??"";let o;e[8]!==l?(o=l("chat.subtask.taskLabel"),e[8]=l,e[9]=o):o=e[9];let m;e[10]!==o?(m=a.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:o}),e[10]=o,e[11]=m):m=e[11];let d;e[12]!==u?(d=a.jsx("p",{className:"text-[13px] text-foreground/90 whitespace-pre-wrap wrap-break-word",children:u}),e[12]=u,e[13]=d):d=e[13];let f;e[14]!==m||e[15]!==d?(f=a.jsxs("section",{children:[m,d]}),e[14]=m,e[15]=d,e[16]=f):f=e[16];let p;e[17]!==n||e[18]!==l?(p=l(n?"chat.subtask.errorLabel":"chat.subtask.resultLabel"),e[17]=n,e[18]=l,e[19]=p):p=e[19];let g;e[20]!==p?(g=a.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:p}),e[20]=p,e[21]=g):g=e[21],i=a.jsxs("div",{className:"flex flex-col gap-4",children:[f,a.jsxs("section",{children:[g,r.trim()?a.jsx(At,{id:`${t.toolCallId}-result`,text:r}):a.jsx("p",{className:"text-[13px] text-muted-foreground/60 italic",children:l("chat.subtask.running")})]})]}),e[3]=n,e[4]=t,e[5]=u,e[6]=l,e[7]=i}else i=e[7];return i}const Re=600;function Cl(s){const e=E.c(12),{part:t}=s,l=t.type??"";let n;e[0]!==t.toolName||e[1]!==l?(n=l==="dynamic-tool"?t.toolName??"tool":l.slice(5),e[0]=t.toolName,e[1]=l,e[2]=n):n=e[2];const c=n;let u;if(e[3]!==t.input){const f=t.input!=null?JSON.stringify(t.input):"";u=f.length>80?`${f.slice(0,80)}…`:f||void 0,e[3]=t.input,e[4]=u}else u=e[4];const i=u;let r;if(e[5]!==t.input){const f=t.input!=null?JSON.stringify(t.input,null,2):null;r=f&&f.length>Re?`${f.slice(0,Re)}
|
|
47
|
+
… (${f.length-Re} more characters)`:f,e[5]=t.input,e[6]=r}else r=e[6];const o=r;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(gt,{}),e[7]=m):m=e[7];let d;return e[8]!==o||e[9]!==c||e[10]!==i?(d=a.jsx(H,{icon:m,title:c,summary:i,state:"idle",detail:o,detailVariant:"code"}),e[8]=o,e[9]=c,e[10]=i,e[11]=d):d=e[11],d}function Tl(s){const e=E.c(19),{jobId:t,prompt:l,items:n,streaming:c}=s,u=U();let i;e[0]!==u?(i=u("chat.subtask.taskLabel"),e[0]=u,e[1]=i):i=e[1];let r;e[2]!==i?(r=a.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:i}),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l?(o=a.jsx("p",{className:"text-[13px] text-foreground/90 whitespace-pre-wrap wrap-break-word",children:l}),e[4]=l,e[5]=o):o=e[5];let m;e[6]!==r||e[7]!==o?(m=a.jsxs("section",{children:[r,o]}),e[6]=r,e[7]=o,e[8]=m):m=e[8];let d;e[9]!==n||e[10]!==t||e[11]!==c||e[12]!==u?(d=n.length===0?a.jsx("p",{className:"text-[13px] text-muted-foreground/60 italic py-1",children:u("chat.subtask.runningInBackground")}):n.map((g,h)=>{const x=g,v=x.type??"";return v==="text"?x.text?.trim()?a.jsx($e,{id:`${t}-sub-${h}`,part:g,animate:c},`${t}-sub-${h}`):null:v==="dynamic-tool"||v.startsWith("tool-")&&v!=="tool-todo_write"&&v!=="tool-update_interests"?a.jsx(Cl,{part:x},`${t}-sub-${h}`):null}),e[9]=n,e[10]=t,e[11]=c,e[12]=u,e[13]=d):d=e[13];let f;e[14]!==d?(f=a.jsx("section",{className:"flex flex-col gap-3 sm:gap-2",children:d}),e[14]=d,e[15]=f):f=e[15];let p;return e[16]!==m||e[17]!==f?(p=a.jsxs("div",{className:"flex flex-col gap-4",children:[m,f]}),e[16]=m,e[17]=f,e[18]=p):p=e[18],p}function Xt(s){const e=E.c(32),{part:t}=s,l=U(),n=t.output?.jobId,c=Ne()?.taskId??null,{org:u}=ge(),[i,r]=R.useState(!1),o=Nl(n),m=c??"",d=i&&!!c;let f;e[0]!==n||e[1]!==u.slug||e[2]!==m||e[3]!==d?(f={orgSlug:u.slug,threadId:m,jobId:n,enabled:d},e[0]=n,e[1]=u.slug,e[2]=m,e[3]=d,e[4]=f):f=e[4];const p=kl(f);let g;e[5]!==p.messages?(g=p.messages.flatMap($l),e[5]=p.messages,e[6]=g):g=e[6];const h=g;let x;e[7]!==o?(x=o.flatMap(Il),e[7]=o,e[8]=x):x=e[8];const v=x,b=h.length>0?h:v;let k;e[9]!==t.input?.prompt||e[10]!==l?(k=t.input?.prompt??l("chat.subtask.noPromptProvided"),e[9]=t.input?.prompt,e[10]=l,e[11]=k):k=e[11];const j=k;let _;e[12]!==j?(_=j.length>120?`${j.slice(0,120)}…`:j,e[12]=j,e[13]=_):_=e[13];const y=_,S=o.length===0;let N;e[14]!==l?(N=l("chat.subtask.subtaskNoun"),e[14]=l,e[15]=N):N=e[15];let w;e[16]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(qe,{}),e[16]=w):w=e[16];let C;e[17]!==N?(C=a.jsx(Se,{icon:void 0,name:N,size:"2xs",className:"rounded-xs",fallbackIcon:w}),e[17]=N,e[18]=C):C=e[18];let M;e[19]!==l?(M=l("chat.subtask.subtaskNoun"),e[19]=l,e[20]=M):M=e[20];const A=S?"loading":"idle",L=p.streaming||S;let I;e[21]!==b||e[22]!==n||e[23]!==j||e[24]!==L?(I=a.jsx(Tl,{jobId:n,prompt:j,items:b,streaming:L}),e[21]=b,e[22]=n,e[23]=j,e[24]=L,e[25]=I):I=e[25];let T;return e[26]!==y||e[27]!==C||e[28]!==M||e[29]!==A||e[30]!==I?(T=a.jsx(Xe,{icon:C,title:M,summary:y,state:A,onOpenChange:r,children:I}),e[26]=y,e[27]=C,e[28]=M,e[29]=A,e[30]=I,e[31]=T):T=e[31],T}function Il(s){return s.parts??[]}function $l(s){return s.parts??[]}function Al(s){const e=E.c(24),t=U(),l=Vt(s.part.toolCallId);if(Wt(s.part.output)){let h;return e[0]!==s?(h=a.jsx(Xt,{...s}),e[0]=s,e[1]=h):h=e[1],h}let n;e[2]!==s||e[3]!==t?(n=Kt(s,t),e[2]=s,e[3]=t,e[4]=n):n=e[4];const{fallbackTitle:c,summary:u,usage:i,state:r}=n;let o;e[5]!==t?(o=t("chat.subtask.subtaskNoun"),e[5]=t,e[6]=o):o=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(qe,{}),e[7]=m):m=e[7];let d;e[8]!==o?(d=a.jsx(Se,{icon:void 0,name:o,size:"2xs",className:"rounded-xs",fallbackIcon:m}),e[8]=o,e[9]=d):d=e[9];let f;e[10]!==l||e[11]!==s.part?(f=l&&Gt(s.part)?l:void 0,e[10]=l,e[11]=s.part,e[12]=f):f=e[12];let p;e[13]!==s.part?(p=a.jsx(Jt,{part:s.part}),e[13]=s.part,e[14]=p):p=e[14];let g;return e[15]!==c||e[16]!==s.latency||e[17]!==r||e[18]!==u||e[19]!==d||e[20]!==f||e[21]!==p||e[22]!==i?(g=a.jsx(Xe,{icon:d,title:c,summary:u,state:r,usage:i,latency:s.latency,onFlip:f,children:p}),e[15]=c,e[16]=s.latency,e[17]=r,e[18]=u,e[19]=d,e[20]=f,e[21]=p,e[22]=i,e[23]=g):g=e[23],g}function Ml(s){const e=E.c(26),t=U(),l=Et(s.part.input?.agent_id),n=Vt(s.part.toolCallId);if(Wt(s.part.output)){let b;return e[0]!==s?(b=a.jsx(Xt,{...s}),e[0]=s,e[1]=b):b=e[1],b}let c;e[2]!==s||e[3]!==t?(c=Kt(s,t),e[2]=s,e[3]=t,e[4]=c):c=e[4];const{fallbackTitle:u,summary:i,usage:r,state:o}=c,m=l?.icon;let d;e[5]!==t||e[6]!==l?.title?(d=l?.title??t("chat.subtask.subtaskNoun"),e[5]=t,e[6]=l?.title,e[7]=d):d=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(qe,{}),e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==d?(p=a.jsx(Se,{icon:m,name:d,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[9]=m,e[10]=d,e[11]=p):p=e[11];const g=l?.title??u;let h;e[12]!==n||e[13]!==s.part?(h=n&&Gt(s.part)?n:void 0,e[12]=n,e[13]=s.part,e[14]=h):h=e[14];let x;e[15]!==s.part?(x=a.jsx(Jt,{part:s.part}),e[15]=s.part,e[16]=x):x=e[16];let v;return e[17]!==s.latency||e[18]!==o||e[19]!==i||e[20]!==p||e[21]!==g||e[22]!==h||e[23]!==x||e[24]!==r?(v=a.jsx(Xe,{icon:p,title:g,summary:i,state:o,usage:r,latency:s.latency,onFlip:h,children:x}),e[17]=s.latency,e[18]=o,e[19]=i,e[20]=p,e[21]=g,e[22]=h,e[23]=x,e[24]=r,e[25]=v):v=e[25],v}function El(s){const e=E.c(28),{part:t}=s,l=U();if(!t.state.startsWith("output-"))return null;const n=t.input?.plan??"",u=t.output?.approved===!0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Fe,{className:"size-4 text-special shrink-0"}),e[0]=i):i=e[0];let r;e[1]!==l?(r=l("chat.proposePlan.implementationPlan"),e[1]=l,e[2]=r):r=e[2];let o;e[3]!==r?(o=a.jsx("span",{className:"text-[14px] font-medium text-foreground/80",children:r}),e[3]=r,e[4]=o):o=e[4];let m;e[5]!==u||e[6]!==l?(m=u&&a.jsxs("span",{className:"flex items-center gap-1 text-xs text-success bg-success/10 px-1.5 py-0.5 rounded-md",children:[a.jsx(yt,{size:12}),l("chat.proposePlan.approved")]}),e[5]=u,e[6]=l,e[7]=m):m=e[7];let d;e[8]!==u||e[9]!==t.state||e[10]!==l?(d=!u&&t.state==="output-available"&&a.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:l("chat.proposePlan.rejected")}),e[8]=u,e[9]=t.state,e[10]=l,e[11]=d):d=e[11];let f;e[12]!==o||e[13]!==m||e[14]!==d?(f=a.jsxs("div",{className:"flex items-center gap-2",children:[i,o,m,d]}),e[12]=o,e[13]=m,e[14]=d,e[15]=f):f=e[15];let p;e[16]!==l?(p=l("chat.proposePlan.viewPlan"),e[16]=l,e[17]=p):p=e[17];let g;e[18]!==p?(g=a.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:p}),e[18]=p,e[19]=g):g=e[19];let h;e[20]!==n?(h=a.jsx("div",{className:"mt-1 pl-2 border-l-2 border-special/30 prose prose-sm max-w-none text-sm",children:a.jsx($e,{id:"plan-content",part:{type:"text",text:n}})}),e[20]=n,e[21]=h):h=e[21];let x;e[22]!==g||e[23]!==h?(x=a.jsxs("details",{className:"ml-6",children:[g,h]}),e[22]=g,e[23]=h,e[24]=x):x=e[24];let v;return e[25]!==x||e[26]!==f?(v=a.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[f,x]}),e[25]=x,e[26]=f,e[27]=v):v=e[27],v}function Qe(s){return{primary:s("chat.brandContext.colorPrimary"),secondary:s("chat.brandContext.colorSecondary"),accent:s("chat.brandContext.colorAccent"),background:s("chat.brandContext.colorBackground"),foreground:s("chat.brandContext.colorForeground")}}function Ll(s){try{const e=new URL(s.startsWith("http")?s:`https://${s}`);return e.protocol!=="http:"&&e.protocol!=="https:"?"about:blank":e.href}catch{return"about:blank"}}function Ye(s){return s?Object.entries(s).filter(([,e])=>typeof e=="string"&&e.trim().length>0):[]}function Pl(s){return s?Object.entries(s).filter(([,e])=>typeof e=="string"&&e.trim().length>0):[]}function ct(s){const e=E.c(2),{children:t}=s;let l;return e[0]!==t?(l=a.jsx("span",{className:"text-sm font-medium text-foreground",children:t}),e[0]=t,e[1]=l):l=e[1],l}function Rl(s){const e=E.c(12),{name:t,value:l}=s;let n;e[0]!==l?(n=a.jsx("span",{className:"size-7 shrink-0 rounded-md border border-border",style:{backgroundColor:l},"aria-hidden":!0}),e[0]=l,e[1]=n):n=e[1];let c;e[2]!==t?(c=a.jsx("span",{className:"text-sm text-foreground",children:t}),e[2]=t,e[3]=c):c=e[3];let u;e[4]!==l?(u=a.jsx("span",{className:"text-xs font-mono tabular-nums text-muted-foreground",children:l}),e[4]=l,e[5]=u):u=e[5];let i;e[6]!==c||e[7]!==u?(i=a.jsxs("div",{className:"flex flex-col leading-tight min-w-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=i):i=e[8];let r;return e[9]!==n||e[10]!==i?(r=a.jsxs("div",{className:"flex items-center gap-2.5",children:[n,i]}),e[9]=n,e[10]=i,e[11]=r):r=e[11],r}function zl(s){const e=E.c(15),{role:t,family:l}=s;let n;e[0]!==l?(n=a.jsx("span",{className:"text-2xl font-medium leading-none text-foreground shrink-0",style:{fontFamily:l},"aria-hidden":!0,children:"Aa"}),e[0]=l,e[1]=n):n=e[1];let c;e[2]!==t?(c=a.jsx("span",{className:"text-xs text-muted-foreground",children:t}),e[2]=t,e[3]=c):c=e[3];let u;e[4]!==l?(u={fontFamily:l},e[4]=l,e[5]=u):u=e[5];let i;e[6]!==l||e[7]!==u?(i=a.jsx("span",{className:"text-sm text-foreground",style:u,children:l}),e[6]=l,e[7]=u,e[8]=i):i=e[8];let r;e[9]!==c||e[10]!==i?(r=a.jsxs("div",{className:"flex flex-col leading-tight",children:[c,i]}),e[9]=c,e[10]=i,e[11]=r):r=e[11];let o;return e[12]!==n||e[13]!==r?(o=a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted px-4 py-3",children:[n,r]}),e[12]=n,e[13]=r,e[14]=o):o=e[14],o}function Dl(s){const e=E.c(3),{logo:t,favicon:l,name:n}=s,c=t??l;if(!c)return null;const u=n?`${n} logo`:"";let i;return e[0]!==c||e[1]!==u?(i=a.jsx("img",{src:c,alt:u,className:"size-16 shrink-0 rounded-lg border border-border bg-background object-contain p-2",onError:Fl}),e[0]=c,e[1]=u,e[2]=i):i=e[2],i}function Fl(s){s.target.style.display="none"}function Qt(s){const e=E.c(12),{colors:t}=s,l=U();let n;e[0]!==l?(n=Qe(l),e[0]=l,e[1]=n):n=e[1];const c=n;let u,i,r;if(e[2]!==c||e[3]!==t){r=Symbol.for("react.early_return_sentinel");e:{const m=Ye(t);if(m.length===0){r=null;break e}u="flex h-1.5";let d;e[7]!==c?(d=f=>{const[p,g]=f;return a.jsx("span",{className:"flex-1",style:{backgroundColor:g},title:`${c[p]}: ${g}`,"aria-hidden":!0},p)},e[7]=c,e[8]=d):d=e[8],i=m.map(d)}e[2]=c,e[3]=t,e[4]=u,e[5]=i,e[6]=r}else u=e[4],i=e[5],r=e[6];if(r!==Symbol.for("react.early_return_sentinel"))return r;let o;return e[9]!==u||e[10]!==i?(o=a.jsx("div",{className:u,children:i}),e[9]=u,e[10]=i,e[11]=o):o=e[11],o}function Yt(s){const e=E.c(51),{logo:t,favicon:l,name:n,domain:c,overview:u,colors:i,fonts:r,showDefaultBadge:o,isDefault:m}=s,d=U();let f;e[0]!==d?(f=Qe(d),e[0]=d,e[1]=f):f=e[1];const p=f;let g,h,x,v,b,k,j;if(e[2]!==p||e[3]!==i||e[4]!==c||e[5]!==l||e[6]!==r||e[7]!==m||e[8]!==t||e[9]!==n||e[10]!==u||e[11]!==o||e[12]!==d){const S=Ye(i),N=Pl(r);k="mt-2 rounded-lg overflow-hidden border border-border",e[20]!==i?(j=i&&a.jsx(Qt,{colors:i}),e[20]=i,e[21]=j):j=e[21],g="p-5 flex flex-col gap-6";let w;e[22]!==l||e[23]!==t||e[24]!==n?(w=a.jsx(Dl,{logo:t,favicon:l,name:n}),e[22]=l,e[23]=t,e[24]=n,e[25]=w):w=e[25];let C;e[26]!==m||e[27]!==n||e[28]!==o||e[29]!==d?(C=n&&a.jsxs("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-foreground truncate",children:[n,o&&m&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[a.jsx(xt,{className:"size-3 text-warning"}),d("chat.brandContext.defaultBadge")]})]}),e[26]=m,e[27]=n,e[28]=o,e[29]=d,e[30]=C):C=e[30];let M;e[31]!==c?(M=c&&a.jsxs("a",{href:Ll(c),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c,a.jsx(Mt,{className:"size-3 shrink-0"})]}),e[31]=c,e[32]=M):M=e[32];let A;e[33]!==C||e[34]!==M?(A=a.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[C,M]}),e[33]=C,e[34]=M,e[35]=A):A=e[35],e[36]!==A||e[37]!==w?(h=a.jsxs("div",{className:"flex items-center gap-4",children:[w,A]}),e[36]=A,e[37]=w,e[38]=h):h=e[38],e[39]!==u?(x=u&&a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:u}),e[39]=u,e[40]=x):x=e[40],v=S.length>0&&a.jsxs("div",{className:"flex flex-col gap-3",children:[a.jsx(ct,{children:d("chat.brandContext.colorsSection")}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3",children:S.map(L=>{const[I,T]=L;return a.jsx(Rl,{name:p[I],value:T},I)})})]}),b=N.length>0&&a.jsxs("div",{className:"flex flex-col gap-3",children:[a.jsx(ct,{children:d("chat.brandContext.typographySection")}),a.jsx("div",{className:"flex flex-wrap gap-2.5",children:N.map(Bl)})]}),e[2]=p,e[3]=i,e[4]=c,e[5]=l,e[6]=r,e[7]=m,e[8]=t,e[9]=n,e[10]=u,e[11]=o,e[12]=d,e[13]=g,e[14]=h,e[15]=x,e[16]=v,e[17]=b,e[18]=k,e[19]=j}else g=e[13],h=e[14],x=e[15],v=e[16],b=e[17],k=e[18],j=e[19];let _;e[41]!==g||e[42]!==h||e[43]!==x||e[44]!==v||e[45]!==b?(_=a.jsxs("div",{className:g,children:[h,x,v,b]}),e[41]=g,e[42]=h,e[43]=x,e[44]=v,e[45]=b,e[46]=_):_=e[46];let y;return e[47]!==k||e[48]!==j||e[49]!==_?(y=a.jsxs("div",{className:k,children:[j,_]}),e[47]=k,e[48]=j,e[49]=_,e[50]=y):y=e[50],y}function Bl(s){const[e,t]=s;return a.jsx(zl,{role:e,family:t},e)}function Ol(s){const e=E.c(46),{part:t,latency:l}=s,n=U();let c;e[0]!==t.state?(c=pe(t.state),e[0]=t.state,e[1]=c):c=e[1];const u=c;let i,r,o,m,d;if(e[2]!==l||e[3]!==t.input||e[4]!==t.output||e[5]!==u||e[6]!==n){d=Symbol.for("react.early_return_sentinel");e:{r=be(t.output);const N=u==="loading",w=u==="error"||r&&r.success===!1;if(N){const C=t.input;let M;e[12]===Symbol.for("react.memo_cache_sentinel")?(M=a.jsx(me,{className:"animate-pulse"}),e[12]=M):M=e[12];let A;e[13]!==n?(A=n("chat.brandContext.extractingBrand"),e[13]=n,e[14]=A):A=e[14];let L;e[15]!==C||e[16]!==n?(L=C?.domain?n("chat.brandContext.fromDomain",{domain:C.domain}):void 0,e[15]=C,e[16]=n,e[17]=L):L=e[17];let I;e[18]!==A||e[19]!==L?(I=a.jsx(H,{icon:M,title:A,summary:L,state:"loading",defaultOpen:!0}),e[18]=A,e[19]=L,e[20]=I):I=e[20],d=I;break e}if(w){let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx(me,{}),e[21]=C):C=e[21];let M;e[22]!==n?(M=n("chat.brandContext.extractionFailed"),e[22]=n,e[23]=M):M=e[23];let A;e[24]!==l?(A=a.jsx(ne,{latency:l}),e[24]=l,e[25]=A):A=e[25],d=a.jsx(H,{icon:C,title:M,summary:r?.error??n("chat.brandContext.unknownError"),state:"error",trailing:A});break e}i=H,e[26]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(me,{className:"text-special"}),e[26]=o):o=e[26],m=r?.name?n("chat.brandContext.brandSet",{name:r.name}):n("chat.brandContext.brandContextSet")}e[2]=l,e[3]=t.input,e[4]=t.output,e[5]=u,e[6]=n,e[7]=i,e[8]=r,e[9]=o,e[10]=m,e[11]=d}else i=e[7],r=e[8],o=e[9],m=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;const f=r?.domain;let p;e[27]!==l?(p=a.jsx(ne,{latency:l}),e[27]=l,e[28]=p):p=e[28];let g;e[29]!==i||e[30]!==o||e[31]!==m||e[32]!==f||e[33]!==p?(g=a.jsx(i,{icon:o,title:m,summary:f,state:"idle",trailing:p}),e[29]=i,e[30]=o,e[31]=m,e[32]=f,e[33]=p,e[34]=g):g=e[34];const h=r?.logo,x=r?.favicon,v=r?.name,b=r?.domain,k=r?.overview,j=r?.colors,_=r?.fonts;let y;e[35]!==v||e[36]!==b||e[37]!==k||e[38]!==j||e[39]!==_||e[40]!==h||e[41]!==x?(y=a.jsx(Yt,{logo:h,favicon:x,name:v,domain:b,overview:k,colors:j,fonts:_}),e[35]=v,e[36]=b,e[37]=k,e[38]=j,e[39]=_,e[40]=h,e[41]=x,e[42]=y):y=e[42];let S;return e[43]!==y||e[44]!==g?(S=a.jsxs(a.Fragment,{children:[g,y]}),e[43]=y,e[44]=g,e[45]=S):S=e[45],S}function Ul(s){const e=E.c(45),{part:t,latency:l}=s,n=U();let c;e[0]!==t.state?(c=pe(t.state),e[0]=t.state,e[1]=c):c=e[1];const u=c;let i,r,o,m,d;if(e[2]!==l||e[3]!==t.output||e[4]!==u||e[5]!==n){d=Symbol.for("react.early_return_sentinel");e:{r=be(t.output);const x=u==="loading",v=u==="error"||r&&r.success===!1;if(x){let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(me,{className:"animate-pulse"}),e[11]=b):b=e[11];let k;e[12]!==n?(k=n("chat.brandContext.loadingBrand"),e[12]=n,e[13]=k):k=e[13];let j;e[14]!==k?(j=a.jsx(H,{icon:b,title:k,state:"loading"}),e[14]=k,e[15]=j):j=e[15],d=j;break e}if(v||!r){let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(me,{}),e[16]=b):b=e[16];let k;e[17]!==n?(k=n("chat.brandContext.couldNotLoadBrand"),e[17]=n,e[18]=k):k=e[18];let j;e[19]!==l?(j=a.jsx(ne,{latency:l}),e[19]=l,e[20]=j):j=e[20];let _;e[21]!==k||e[22]!==j?(_=a.jsx(H,{icon:b,title:k,state:"error",trailing:j}),e[21]=k,e[22]=j,e[23]=_):_=e[23],d=_;break e}i=H,e[24]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(me,{className:"text-special"}),e[24]=o):o=e[24],m=r.name?n("chat.brandContext.brandWithName",{name:r.name}):n("chat.brandContext.brand")}e[2]=l,e[3]=t.output,e[4]=u,e[5]=n,e[6]=i,e[7]=r,e[8]=o,e[9]=m,e[10]=d}else i=e[6],r=e[7],o=e[8],m=e[9],d=e[10];if(d!==Symbol.for("react.early_return_sentinel"))return d;let f;e[25]!==l?(f=a.jsx(ne,{latency:l}),e[25]=l,e[26]=f):f=e[26];let p;e[27]!==i||e[28]!==r.domain||e[29]!==o||e[30]!==m||e[31]!==f?(p=a.jsx(i,{icon:o,title:m,summary:r.domain,state:"idle",trailing:f}),e[27]=i,e[28]=r.domain,e[29]=o,e[30]=m,e[31]=f,e[32]=p):p=e[32];let g;e[33]!==r.colors||e[34]!==r.domain||e[35]!==r.favicon||e[36]!==r.fonts||e[37]!==r.isDefault||e[38]!==r.logo||e[39]!==r.name||e[40]!==r.overview?(g=a.jsx(Yt,{logo:r.logo,favicon:r.favicon,name:r.name,domain:r.domain,overview:r.overview,colors:r.colors,fonts:r.fonts,showDefaultBadge:!0,isDefault:r.isDefault}),e[33]=r.colors,e[34]=r.domain,e[35]=r.favicon,e[36]=r.fonts,e[37]=r.isDefault,e[38]=r.logo,e[39]=r.name,e[40]=r.overview,e[41]=g):g=e[41];let h;return e[42]!==p||e[43]!==g?(h=a.jsxs(a.Fragment,{children:[p,g]}),e[42]=p,e[43]=g,e[44]=h):h=e[44],h}function Hl(s){const e=E.c(49),{part:t,latency:l}=s,n=U();let c;e[0]!==n?(c=Qe(n),e[0]=n,e[1]=c):c=e[1];const u=c;let i;e[2]!==t.state?(i=pe(t.state),e[2]=t.state,e[3]=i):i=e[3];const r=i;let o,m,d,f;if(e[4]!==u||e[5]!==l||e[6]!==t.output||e[7]!==r||e[8]!==n){f=Symbol.for("react.early_return_sentinel");e:{const h=be(t.output),x=Array.isArray(h?.items)?h.items:[],v=r==="loading",b=r==="error";if(v){let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(me,{className:"animate-pulse"}),e[13]=y):y=e[13];let S;e[14]!==n?(S=n("chat.brandContext.loadingBrands"),e[14]=n,e[15]=S):S=e[15];let N;e[16]!==S?(N=a.jsx(H,{icon:y,title:S,state:"loading"}),e[16]=S,e[17]=N):N=e[17],f=N;break e}if(b){let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(me,{}),e[18]=y):y=e[18];let S;e[19]!==n?(S=n("chat.brandContext.couldNotLoadBrands"),e[19]=n,e[20]=S):S=e[20];let N;e[21]!==l?(N=a.jsx(ne,{latency:l}),e[21]=l,e[22]=N):N=e[22];let w;e[23]!==S||e[24]!==N?(w=a.jsx(H,{icon:y,title:S,state:"error",trailing:N}),e[23]=S,e[24]=N,e[25]=w):w=e[25],f=w;break e}if(x.length===0){let y;e[26]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(me,{}),e[26]=y):y=e[26];let S;e[27]!==n?(S=n("chat.brandContext.noBrandsYet"),e[27]=n,e[28]=S):S=e[28];let N;e[29]!==n?(N=n("chat.brandContext.noBrandsContext"),e[29]=n,e[30]=N):N=e[30];let w;e[31]!==l?(w=a.jsx(ne,{latency:l}),e[31]=l,e[32]=w):w=e[32];let C;e[33]!==w||e[34]!==S||e[35]!==N?(C=a.jsx(H,{icon:y,title:S,summary:N,state:"idle",trailing:w}),e[33]=w,e[34]=S,e[35]=N,e[36]=C):C=e[36],f=C;break e}let k;e[37]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(me,{className:"text-special"}),e[37]=k):k=e[37];let j;e[38]!==l?(j=a.jsx(ne,{latency:l}),e[38]=l,e[39]=j):j=e[39],d=a.jsx(H,{icon:k,title:x.length===1?n("chat.brandContext.oneBrand"):n("chat.brandContext.multipleBrands",{count:x.length}),state:"idle",trailing:j}),o="mt-2 flex flex-col gap-1.5";let _;e[40]!==u||e[41]!==n?(_=(y,S)=>{const N=Ye(y.colors);return a.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[y.colors&&a.jsx(Qt,{colors:y.colors}),a.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[(y.logo||y.favicon)&&a.jsx("img",{src:y.logo??y.favicon??void 0,alt:"",className:"size-8 shrink-0 rounded-md border border-border bg-background object-contain p-0.5",onError:ql}),a.jsxs("div",{className:"flex flex-col leading-tight min-w-0 flex-1",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground truncate",children:[y.name??n("chat.brandContext.untitled"),y.isDefault&&a.jsx(xt,{className:"size-3 text-warning shrink-0"})]}),y.domain&&a.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:y.domain})]}),N.length>0&&a.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:N.slice(0,5).map(w=>{const[C,M]=w;return a.jsx("span",{className:"size-3 rounded-full border border-border",style:{backgroundColor:M},title:`${u[C]}: ${M}`,"aria-hidden":!0},C)})})]})]},y.id??`${y.name}-${y.domain}-${S}`)},e[40]=u,e[41]=n,e[42]=_):_=e[42],m=x.map(_)}e[4]=u,e[5]=l,e[6]=t.output,e[7]=r,e[8]=n,e[9]=o,e[10]=m,e[11]=d,e[12]=f}else o=e[9],m=e[10],d=e[11],f=e[12];if(f!==Symbol.for("react.early_return_sentinel"))return f;let p;e[43]!==o||e[44]!==m?(p=a.jsx("div",{className:o,children:m}),e[43]=o,e[44]=m,e[45]=p):p=e[45];let g;return e[46]!==d||e[47]!==p?(g=a.jsxs(a.Fragment,{children:[d,p]}),e[46]=d,e[47]=p,e[48]=g):g=e[48],g}function ql(s){s.target.style.display="none"}function Ue(s){const e=E.c(4),{connection_id:t,iconSize:l}=s,n=l===void 0?"xs":l,c=Et(t);if(!c)return null;let u;return e[0]!==c.icon||e[1]!==c.title||e[2]!==n?(u=a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx(Se,{icon:c.icon,name:c.title,size:n})}),e[0]=c.icon,e[1]=c.title,e[2]=n,e[3]=u):u=e[3],u}Ue.Fallback=function({iconSize:e="xs"}){const t=e==="sm"?"size-6":"size-5";return a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx("div",{className:G(t,"rounded bg-muted animate-pulse")})})};function ye(s){const e=E.c(18),{connectionIds:t,maxVisibleIcons:l,iconSize:n,className:c}=s,u=l===void 0?2:l,i=n===void 0?"xs":n;if(t.length===0)return null;let r,o,m;if(e[0]!==c||e[1]!==t||e[2]!==i||e[3]!==u){const p=t.slice(0,u);r=t.length-u,e[7]!==c?(o=G("flex items-center justify-end -space-x-2",c),e[7]=c,e[8]=o):o=e[8];let g;e[9]!==i?(g=h=>a.jsx(R.Suspense,{fallback:a.jsx(Ue.Fallback,{iconSize:i}),children:a.jsx(Ue,{connection_id:h,iconSize:i})},h),e[9]=i,e[10]=g):g=e[10],m=p.map(g),e[0]=c,e[1]=t,e[2]=i,e[3]=u,e[4]=r,e[5]=o,e[6]=m}else r=e[4],o=e[5],m=e[6];let d;e[11]!==i||e[12]!==r?(d=r>0&&a.jsx("div",{className:G("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",i==="sm"?"size-8":"size-6"),children:a.jsxs("span",{className:G(i==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${r} more`,children:["+",r]})}),e[11]=i,e[12]=r,e[13]=d):d=e[13];let f;return e[14]!==o||e[15]!==m||e[16]!==d?(f=a.jsxs("div",{className:o,children:[m,d]}),e[14]=o,e[15]=m,e[16]=d,e[17]=f):f=e[17],f}ye.Fallback=function({maxVisibleIcons:e=2,totalCount:t,iconSize:l="xs"}){const n=l==="sm"?"size-6":"size-5",c=l==="sm"?"size-8":"size-6",u=t!==void 0&&t>e;return a.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((i,r)=>a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx("div",{className:G(n,"rounded bg-muted animate-pulse")})},r)),u&&a.jsx("div",{className:G("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",c),children:a.jsx("div",{className:G(l==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const Wl="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",ut=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function Kl(s){const e=E.c(105),{part:t,latency:l}=s,n=U(),c=Lt(),u=pe(t.state),i=R.useRef(null),r=R.useRef(null),o=R.useRef(null),m=R.useRef(null),d=R.useRef(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{ut?.matches||(d.current=i.current?.getBoundingClientRect()??null,i.current&&(i.current.style.willChange="transform"))},e[0]=f):f=e[0];const p=f;let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=z=>{if(ut?.matches)return;const O=d.current,K=i.current;if(!O||!K)return;const le=(z.clientX-O.left)/O.width*100,ae=(z.clientY-O.top)/O.height*100;K.style.transform=`perspective(800px) rotateY(${(le-50)*.05}deg) rotateX(${(ae-50)*-.05}deg)`,r.current&&(r.current.style.opacity="1",r.current.style.transform=`translate(${(le-50)*.15}px, ${(ae-50)*.15}px)`),o.current&&(o.current.style.opacity="0.45"),m.current&&(m.current.style.opacity="0.45")},e[1]=g):g=e[1];const h=g;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{const z=i.current;z&&(z.style.transform="none",z.style.willChange="auto"),r.current&&(r.current.style.opacity="0.4",r.current.style.transform="translate(0, 0)"),o.current&&(o.current.style.opacity="0.3"),m.current&&(m.current.style.opacity="0.3"),d.current=null},e[2]=x):x=e[2];const v=x;if(u==="loading"){let z;e[3]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(fe,{className:"animate-pulse"}),e[3]=z):z=e[3];let O;e[4]!==n?(O=n("chat.agentCreate.creating"),e[4]=n,e[5]=O):O=e[5];let K;return e[6]!==O?(K=a.jsx(H,{icon:z,title:O,state:"loading",defaultOpen:!0}),e[6]=O,e[7]=K):K=e[7],K}if(u==="approval"){let z;e[8]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(fe,{}),e[8]=z):z=e[8];let O;e[9]!==n?(O=n("chat.agentCreate.createAgent"),e[9]=n,e[10]=O):O=e[10];let K;return e[11]!==O?(K=a.jsx(H,{icon:z,title:O,state:"idle"}),e[11]=O,e[12]=K):K=e[12],K}if(u==="error"){let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(fe,{}),e[13]=z):z=e[13];let O;e[14]!==t.state||e[15]!==n?(O=t.state==="output-denied"?n("chat.agentCreate.cancelled"):n("chat.agentCreate.couldntCreate"),e[14]=t.state,e[15]=n,e[16]=O):O=e[16];let K;e[17]!==l?(K=a.jsx(ne,{latency:l}),e[17]=l,e[18]=K):K=e[18];let le;return e[19]!==O||e[20]!==K?(le=a.jsx(H,{icon:z,title:O,state:"error",trailing:K}),e[19]=O,e[20]=K,e[21]=le):le=e[21],le}let b,k,j,_,y,S,N,w,C,M,A,L,I,T,$,P,q,B,D,F,W,J,X;if(e[22]!==l||e[23]!==c||e[24]!==t.output||e[25]!==n){q=Symbol.for("react.early_return_sentinel");e:{const z=be(t.output)?.item;if(!z?.id||!z?.title){let ie;e[49]===Symbol.for("react.memo_cache_sentinel")?(ie=a.jsx(fe,{}),e[49]=ie):ie=e[49];let ce;e[50]!==n?(ce=n("chat.agentCreate.created"),e[50]=n,e[51]=ce):ce=e[51];let V;e[52]!==l?(V=a.jsx(ne,{latency:l}),e[52]=l,e[53]=V):V=e[53];let Z;e[54]!==ce||e[55]!==V?(Z=a.jsx(H,{icon:ie,title:ce,state:"idle",trailing:V}),e[54]=ce,e[55]=V,e[56]=Z):Z=e[56],q=Z;break e}const O=(z.connections??[]).map(Gl);let K;e[57]===Symbol.for("react.memo_cache_sentinel")?(K=a.jsx(fe,{className:"text-success"}),e[57]=K):K=e[57];let le;e[58]!==l?(le=a.jsx(ne,{latency:l}),e[58]=l,e[59]=le):le=e[59],P=a.jsx(H,{icon:K,title:n("chat.agentCreate.agentCreated",{name:z.title}),state:"idle",trailing:le}),$="mt-2 overflow-hidden rounded-xl border-[0.5px] border-border bg-card p-2.5",j=i,_="relative overflow-hidden rounded-lg bg-accent/25 p-2",e[60]===Symbol.for("react.memo_cache_sentinel")?(y={transition:"transform 0.3s ease-out"},e[60]=y):y=e[60],S=p,N=h,w=v,e[61]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx("div",{ref:r,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[61]=C):C=e[61];let ae;e[62]===Symbol.for("react.memo_cache_sentinel")?(ae={textAlign:"justify",wordBreak:"break-all"},e[62]=ae):ae=e[62],e[63]===Symbol.for("react.memo_cache_sentinel")?(M=a.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:ae,"aria-hidden":"true",children:Wl.repeat(6)}),A=a.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[63]=M,e[64]=A):(M=e[63],A=e[64]),e[65]===Symbol.for("react.memo_cache_sentinel")?(L=a.jsx("img",{ref:o,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[65]=L):L=e[65],e[66]===Symbol.for("react.memo_cache_sentinel")?(I=a.jsx("img",{ref:m,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[66]=I):I=e[66],T=a.jsxs("div",{className:"relative",children:[a.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[a.jsx(ht,{icon:z.icon,name:z.title,size:"md"}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:z.title})})]}),z.description&&a.jsx("div",{className:"px-2 pt-1 pr-16",children:a.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:z.description})})]}),X="relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1";const de=O.length>0&&a.jsx(R.Suspense,{fallback:a.jsx(ye.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:O.length}),children:a.jsx(ye,{connectionIds:O,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})});e[67]!==de?(k=a.jsx("div",{className:"flex-1 min-w-0",children:de}),e[67]=de,e[68]=k):k=e[68],J="flex items-center gap-2 shrink-0",b=He,B="sm",D="h-7",F=()=>c(z.id),W=n("chat.agentCreate.seeAgentLabel",{name:z.title})}e[22]=l,e[23]=c,e[24]=t.output,e[25]=n,e[26]=b,e[27]=k,e[28]=j,e[29]=_,e[30]=y,e[31]=S,e[32]=N,e[33]=w,e[34]=C,e[35]=M,e[36]=A,e[37]=L,e[38]=I,e[39]=T,e[40]=$,e[41]=P,e[42]=q,e[43]=B,e[44]=D,e[45]=F,e[46]=W,e[47]=J,e[48]=X}else b=e[26],k=e[27],j=e[28],_=e[29],y=e[30],S=e[31],N=e[32],w=e[33],C=e[34],M=e[35],A=e[36],L=e[37],I=e[38],T=e[39],$=e[40],P=e[41],q=e[42],B=e[43],D=e[44],F=e[45],W=e[46],J=e[47],X=e[48];if(q!==Symbol.for("react.early_return_sentinel"))return q;let te;e[69]!==n?(te=n("chat.agentCreate.seeAgent"),e[69]=n,e[70]=te):te=e[70];let Q;e[71]!==b||e[72]!==te||e[73]!==B||e[74]!==D||e[75]!==F||e[76]!==W?(Q=a.jsx(b,{size:B,className:D,onClick:F,"aria-label":W,children:te}),e[71]=b,e[72]=te,e[73]=B,e[74]=D,e[75]=F,e[76]=W,e[77]=Q):Q=e[77];let se;e[78]!==Q||e[79]!==J?(se=a.jsx("div",{className:J,children:Q}),e[78]=Q,e[79]=J,e[80]=se):se=e[80];let re;e[81]!==k||e[82]!==se||e[83]!==X?(re=a.jsxs("div",{className:X,children:[k,se]}),e[81]=k,e[82]=se,e[83]=X,e[84]=re):re=e[84];let ue;e[85]!==j||e[86]!==_||e[87]!==y||e[88]!==S||e[89]!==N||e[90]!==w||e[91]!==C||e[92]!==M||e[93]!==A||e[94]!==L||e[95]!==I||e[96]!==T||e[97]!==re?(ue=a.jsxs("div",{ref:j,className:_,style:y,onMouseEnter:S,onMouseMove:N,onMouseLeave:w,children:[C,M,A,L,I,T,re]}),e[85]=j,e[86]=_,e[87]=y,e[88]=S,e[89]=N,e[90]=w,e[91]=C,e[92]=M,e[93]=A,e[94]=L,e[95]=I,e[96]=T,e[97]=re,e[98]=ue):ue=e[98];let Y;e[99]!==$||e[100]!==ue?(Y=a.jsx("div",{className:$,children:ue}),e[99]=$,e[100]=ue,e[101]=Y):Y=e[101];let oe;return e[102]!==P||e[103]!==Y?(oe=a.jsxs(a.Fragment,{children:[P,Y]}),e[102]=P,e[103]=Y,e[104]=oe):oe=e[104],oe}function Gl(s){return s.connection_id}function Vl(s){const e=E.c(24),{agent:t}=s,l=Lt();if(!t.id)return null;let n;e[0]!==t.connections?(n=t.connections??[],e[0]=t.connections,e[1]=n):n=e[1];let c;e[2]!==n?(c=n.map(Jl),e[2]=n,e[3]=c):c=e[3];const u=c;let i;e[4]!==t.id||e[5]!==l?(i=()=>l(t.id),e[4]=t.id,e[5]=l,e[6]=i):i=e[6];let r;e[7]!==t.icon||e[8]!==t.title?(r=a.jsx(ht,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=r):r=e[9];let o;e[10]!==t.title?(o=a.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=o):o=e[11];let m;e[12]!==t.description?(m=t.description&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[12]=t.description,e[13]=m):m=e[13];let d;e[14]!==o||e[15]!==m?(d=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[o,m]}),e[14]=o,e[15]=m,e[16]=d):d=e[16];let f;e[17]!==u?(f=u.length>0&&a.jsx(R.Suspense,{fallback:a.jsx(ye.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:u.length}),children:a.jsx(ye,{connectionIds:u,iconSize:"xs",maxVisibleIcons:3})}),e[17]=u,e[18]=f):f=e[18];let p;return e[19]!==i||e[20]!==r||e[21]!==d||e[22]!==f?(p=a.jsxs("button",{type:"button",onClick:i,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[r,d,f]}),e[19]=i,e[20]=r,e[21]=d,e[22]=f,e[23]=p):p=e[23],p}function Jl(s){return s.connection_id}function Xl(s){const e=E.c(59),{part:t,latency:l}=s,n=U(),c=We(),{org:u}=ge();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const r=i;let o,m,d,f,p,g;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==r||e[6]!==n){g=Symbol.for("react.early_return_sentinel");e:{const b=be(t.output);if(m=Array.isArray(b?.items)?b.items:[],r==="loading"){let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(fe,{className:"animate-pulse"}),e[13]=y):y=e[13];let S;e[14]!==n?(S=n("chat.agentList.loading"),e[14]=n,e[15]=S):S=e[15];let N;e[16]!==S?(N=a.jsx(H,{icon:y,title:S,state:"loading"}),e[16]=S,e[17]=N):N=e[17],g=N;break e}if(r==="approval"){let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(fe,{}),e[18]=y):y=e[18];let S;e[19]!==n?(S=n("chat.agentList.listAgents"),e[19]=n,e[20]=S):S=e[20];let N;e[21]!==S?(N=a.jsx(H,{icon:y,title:S,state:"idle"}),e[21]=S,e[22]=N):N=e[22],g=N;break e}if(r==="error"){let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(fe,{}),e[23]=y):y=e[23];let S;e[24]!==t.state||e[25]!==n?(S=t.state==="output-denied"?n("chat.agentList.unavailable"):n("chat.agentList.couldntLoad"),e[24]=t.state,e[25]=n,e[26]=S):S=e[26];let N;e[27]!==l?(N=a.jsx(ne,{latency:l}),e[27]=l,e[28]=N):N=e[28];let w;e[29]!==S||e[30]!==N?(w=a.jsx(H,{icon:y,title:S,state:"error",trailing:N}),e[29]=S,e[30]=N,e[31]=w):w=e[31],g=w;break e}if(m.length===0){let y;e[32]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(fe,{}),e[32]=y):y=e[32];let S;e[33]!==n?(S=n("chat.agentList.noAgents"),e[33]=n,e[34]=S):S=e[34];let N;e[35]!==n?(N=n("chat.agentList.noAgentsDesc"),e[35]=n,e[36]=N):N=e[36];let w;e[37]!==l?(w=a.jsx(ne,{latency:l}),e[37]=l,e[38]=w):w=e[38];let C;e[39]!==S||e[40]!==N||e[41]!==w?(C=a.jsx(H,{icon:y,title:S,summary:N,state:"idle",trailing:w}),e[39]=S,e[40]=N,e[41]=w,e[42]=C):C=e[42],g=C;break e}const k=m.slice(0,Pt);o=m.length-k.length;let j;e[43]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(fe,{className:"text-success"}),e[43]=j):j=e[43];let _;e[44]!==l?(_=a.jsx(ne,{latency:l}),e[44]=l,e[45]=_):_=e[45],p=a.jsx(H,{icon:j,title:m.length===1?n("chat.agentList.oneAgent"):n("chat.agentList.multiAgents",{count:m.length}),state:"idle",trailing:_}),d="mt-2 flex flex-col gap-1.5",f=k.map(Ql)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=r,e[6]=n,e[7]=o,e[8]=m,e[9]=d,e[10]=f,e[11]=p,e[12]=g}else o=e[7],m=e[8],d=e[9],f=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let h;e[46]!==o||e[47]!==m||e[48]!==c||e[49]!==u||e[50]!==n?(h=o>0&&a.jsx(Rt,{count:m.length,noun:n("chat.agentList.agentsNoun"),onClick:()=>c({to:"/$org/settings/projects",params:{org:u.slug}})}),e[46]=o,e[47]=m,e[48]=c,e[49]=u,e[50]=n,e[51]=h):h=e[51];let x;e[52]!==d||e[53]!==f||e[54]!==h?(x=a.jsxs("div",{className:d,children:[f,h]}),e[52]=d,e[53]=f,e[54]=h,e[55]=x):x=e[55];let v;return e[56]!==p||e[57]!==x?(v=a.jsxs(a.Fragment,{children:[p,x]}),e[56]=p,e[57]=x,e[58]=v):v=e[58],v}function Ql(s){return a.jsx(Vl,{agent:s},s.id)}const Yl={active:"bg-success",inactive:"bg-muted-foreground",error:"bg-destructive"};function Zl(s){const e=E.c(27),{connection:t}=s,l=We(),{org:n}=ge(),c=t.slug,u=t.description||t.app_name,i=!c||void 0;let r;e[0]!==l||e[1]!==n||e[2]!==c?(r=()=>c&&l({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:c}}),e[0]=l,e[1]=n,e[2]=c,e[3]=r):r=e[3];let o;e[4]!==t.icon||e[5]!==t.title?(o=a.jsx(Se,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=o):o=e[6];let m;e[7]!==t.title?(m=a.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[7]=t.title,e[8]=m):m=e[8];let d;e[9]!==u?(d=u&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:u}),e[9]=u,e[10]=d):d=e[10];let f;e[11]!==m||e[12]!==d?(f=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[m,d]}),e[11]=m,e[12]=d,e[13]=f):f=e[13];const p=Yl[t.status]??"bg-muted-foreground";let g;e[14]!==p?(g=G("size-2 shrink-0 rounded-full",p),e[14]=p,e[15]=g):g=e[15];let h;e[16]!==g?(h=a.jsx("span",{className:g,"aria-hidden":"true"}),e[16]=g,e[17]=h):h=e[17];let x;e[18]!==t.status?(x=a.jsx("span",{className:"sr-only",children:t.status}),e[18]=t.status,e[19]=x):x=e[19];let v;return e[20]!==i||e[21]!==x||e[22]!==r||e[23]!==o||e[24]!==f||e[25]!==h?(v=a.jsxs("button",{type:"button","aria-disabled":i,onClick:r,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[o,f,h,x]}),e[20]=i,e[21]=x,e[22]=r,e[23]=o,e[24]=f,e[25]=h,e[26]=v):v=e[26],v}function ea(s){const e=E.c(54),{part:t,latency:l}=s,n=U(),c=We(),{org:u}=ge();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const r=i;let o,m,d,f,p,g;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==r||e[6]!==n){g=Symbol.for("react.early_return_sentinel");e:{const b=be(t.output);if(m=(Array.isArray(b?.items)?b.items:[]).filter(sa),r==="loading"||r==="approval"){let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(we,{className:"animate-pulse"}),e[13]=y):y=e[13];let S;e[14]!==n?(S=n("chat.connectionList.loadingTitle"),e[14]=n,e[15]=S):S=e[15];let N;e[16]!==S?(N=a.jsx(H,{icon:y,title:S,state:"loading"}),e[16]=S,e[17]=N):N=e[17],g=N;break e}if(r==="error"){let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(we,{}),e[18]=y):y=e[18];let S;e[19]!==t.state||e[20]!==n?(S=t.state==="output-denied"?n("chat.connectionList.unavailableTitle"):n("chat.connectionList.errorTitle"),e[19]=t.state,e[20]=n,e[21]=S):S=e[21];let N;e[22]!==l?(N=a.jsx(ne,{latency:l}),e[22]=l,e[23]=N):N=e[23];let w;e[24]!==S||e[25]!==N?(w=a.jsx(H,{icon:y,title:S,state:"error",trailing:N}),e[24]=S,e[25]=N,e[26]=w):w=e[26],g=w;break e}if(m.length===0){let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(we,{}),e[27]=y):y=e[27];let S;e[28]!==n?(S=n("chat.connectionList.emptyTitle"),e[28]=n,e[29]=S):S=e[29];let N;e[30]!==n?(N=n("chat.connectionList.emptySummary"),e[30]=n,e[31]=N):N=e[31];let w;e[32]!==l?(w=a.jsx(ne,{latency:l}),e[32]=l,e[33]=w):w=e[33];let C;e[34]!==S||e[35]!==N||e[36]!==w?(C=a.jsx(H,{icon:y,title:S,summary:N,state:"idle",trailing:w}),e[34]=S,e[35]=N,e[36]=w,e[37]=C):C=e[37],g=C;break e}const k=m.slice(0,Pt);o=m.length-k.length;let j;e[38]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(we,{className:"text-success"}),e[38]=j):j=e[38];let _;e[39]!==l?(_=a.jsx(ne,{latency:l}),e[39]=l,e[40]=_):_=e[40],p=a.jsx(H,{icon:j,title:m.length===1?n("chat.connectionList.singleConnection"):n("chat.connectionList.multipleConnections",{count:m.length}),state:"idle",trailing:_}),d="mt-2 flex flex-col gap-1.5",f=k.map(ta)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=r,e[6]=n,e[7]=o,e[8]=m,e[9]=d,e[10]=f,e[11]=p,e[12]=g}else o=e[7],m=e[8],d=e[9],f=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let h;e[41]!==o||e[42]!==m||e[43]!==c||e[44]!==u||e[45]!==n?(h=o>0&&a.jsx(Rt,{count:m.length,noun:n("chat.connectionList.connectionNoun"),onClick:()=>c({to:"/$org/settings/connections",params:{org:u.slug}})}),e[41]=o,e[42]=m,e[43]=c,e[44]=u,e[45]=n,e[46]=h):h=e[46];let x;e[47]!==d||e[48]!==f||e[49]!==h?(x=a.jsxs("div",{className:d,children:[f,h]}),e[47]=d,e[48]=f,e[49]=h,e[50]=x):x=e[50];let v;return e[51]!==p||e[52]!==x?(v=a.jsxs(a.Fragment,{children:[p,x]}),e[51]=p,e[52]=x,e[53]=v):v=e[53],v}function ta(s){return a.jsx(Zl,{connection:s},s.id)}function sa(s){return s.connection_type!=="VIRTUAL"}function na(){const s=E.c(42),e=U(),t=Ne(),{sendMessage:l,isStreaming:n,messages:c}=Bs(),{org:u}=ge(),i=t?.virtualMcpId,{prompts:r}=Zs(u.slug),o=i??null;let m;s[0]!==u.id||s[1]!==u.slug||s[2]!==o?(m={connectionId:o,orgId:u.id,orgSlug:u.slug},s[0]=u.id,s[1]=u.slug,s[2]=o,s[3]=m):m=s[3];const d=_t(m),[f,p]=R.useState(null);if(!i||n||!is(i)||!c.some(la))return null;let h;if(s[4]!==r||s[5]!==i){let T;s[7]!==i?(T=$=>$.agentId===i&&$.promptName,s[7]=i,s[8]=T):T=s[8],h=r.find(T),s[4]=r,s[5]=i,s[6]=h}else h=s[6];const x=h;if(!x)return null;let v;s[9]!==d||s[10]!==l||s[11]!==e?(v=async(T,$)=>{if(!d){ze.error(e("chat.nextActionChip.mcpClientNotAvailable"));return}try{const P=await an(d,T.name,$);await l({type:"doc",content:[{type:"paragraph",content:[on({id:T.name,name:Ct(T.name,wt(T._meta)),metadata:P.messages,char:"/",kind:"prompt",args:$}),{type:"text",text:" "}]}]})}catch(P){console.error("[next-action-chip] failed",P),ze.error(e("chat.nextActionChip.failedLoadPrompt"))}},s[9]=d,s[10]=l,s[11]=e,s[12]=v):v=s[12];const b=v;let k;s[13]!==x._meta||s[14]!==x.arguments||s[15]!==x.description||s[16]!==x.promptName||s[17]!==x.title||s[18]!==b?(k=()=>{const T={name:x.promptName,title:x.title,description:x.description,arguments:x.arguments,_meta:x._meta};if(T.arguments&&T.arguments.length>0){p(T);return}b(T)},s[13]=x._meta,s[14]=x.arguments,s[15]=x.description,s[16]=x.promptName,s[17]=x.title,s[18]=b,s[19]=k):k=s[19];const j=k;let _;s[20]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(Ns,{size:12,className:"shrink-0 text-special"}),s[20]=_):_=s[20];let y;s[21]!==e?(y=e("chat.nextActionChip.next"),s[21]=e,s[22]=y):y=s[22];let S;s[23]!==y?(S=a.jsx("span",{className:"font-medium text-foreground/80",children:y}),s[23]=y,s[24]=S):S=s[24];let N;s[25]!==x.title?(N=a.jsx("span",{className:"truncate",children:x.title}),s[25]=x.title,s[26]=N):N=s[26];let w;s[27]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(bt,{size:12,className:"shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),s[27]=w):w=s[27];let C;s[28]!==j||s[29]!==S||s[30]!==N?(C=a.jsxs("button",{type:"button",onClick:j,className:"group mt-3 flex items-center gap-2 self-start rounded-lg border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:border-border hover:bg-accent/40 hover:text-foreground",children:[_,S,N,w]}),s[28]=j,s[29]=S,s[30]=N,s[31]=C):C=s[31];let M;s[32]===Symbol.for("react.memo_cache_sentinel")?(M=T=>p(T),s[32]=M):M=s[32];let A;s[33]!==f||s[34]!==b?(A=async T=>{const $=f;p(null),$&&await b($,T)},s[33]=f,s[34]=b,s[35]=A):A=s[35];let L;s[36]!==f||s[37]!==A?(L=a.jsx(rn,{prompt:f,setPrompt:M,onSubmit:A}),s[36]=f,s[37]=A,s[38]=L):L=s[38];let I;return s[39]!==C||s[40]!==L?(I=a.jsxs(a.Fragment,{children:[C,L]}),s[39]=C,s[40]=L,s[41]=I):I=s[41],I}function la(s){return s.role==="user"||s.parts.some(aa)}function aa(s){return s.type==="tool-user_ask"&&s.state==="output-available"}function oa(s){const e=new Map;for(let t=s.length-1;t>=0;t--){const l=s[t]?.parts;if(l)for(const n of l){const c=n;if(c.type!=="data-deck-updated")continue;const u=c.data;if(!u?.path)continue;const i=`deck:${u.path}`;e.has(i)||e.set(i,{tabId:cs(u.path),label:u.name||u.path,kind:u.kind==="page"?"page":"deck"})}}return Array.from(e.values())}function ra(){const s=E.c(9),e=U(),{openPanel:t}=Ve(),l=ve()?.messages??[],n=oa(l);if(n.length===0)return null;const c=n.some(ca),u=n.some(ia),i=e(c?u?"chat.threadHtmlPreviews.slidesAndPages":"chat.threadHtmlPreviews.slides":"chat.threadHtmlPreviews.pages"),r="flex flex-col gap-1.5 py-2";let o;s[0]!==i?(o=a.jsx("div",{className:"text-[12px] text-muted-foreground/70 uppercase tracking-wide",children:i}),s[0]=i,s[1]=o):o=s[1];const m="flex flex-wrap gap-2";let d;s[2]!==t?(d=h=>a.jsxs("button",{type:"button",onClick:()=>t(h.tabId),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-muted/30 hover:bg-muted/60 text-[13px] transition-colors",children:[h.kind==="deck"?a.jsx(pn,{className:"size-3.5 shrink-0 text-muted-foreground"}):a.jsx(Ss,{className:"size-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:h.label})]},h.tabId),s[2]=t,s[3]=d):d=s[3];const f=n.map(d);let p;s[4]!==f?(p=a.jsx("div",{className:m,children:f}),s[4]=f,s[5]=p):p=s[5];let g;return s[6]!==o||s[7]!==p?(g=a.jsxs("div",{className:r,children:[o,p]}),s[6]=o,s[7]=p,s[8]=g):g=s[8],g}function ia(s){return s.kind==="page"}function ca(s){return s.kind==="deck"}function ua(s){const e=E.c(29),{file:t}=s,l=U(),{openPanel:n}=Ve();let c;e[0]!==t.key||e[1]!==n?(c=()=>n(us(t.key)),e[0]=t.key,e[1]=n,e[2]=c):c=e[2];const u=c;let i;e[3]!==t.filename?(i=a.jsx(xn,{filename:t.filename,className:"h-5 w-4 shrink-0"}),e[3]=t.filename,e[4]=i):i=e[4];let r;e[5]!==t.filename||e[6]!==u?(r=a.jsx("button",{type:"button",onClick:u,className:"min-w-0 flex-1 truncate text-left text-[13px] font-medium text-foreground hover:underline",title:t.filename,children:t.filename}),e[5]=t.filename,e[6]=u,e[7]=r):r=e[7];const o=t.downloadUrl,m=t.filename;let d;e[8]!==l?(d=l("chat.outputFileRow.download"),e[8]=l,e[9]=d):d=e[9];let f;e[10]!==t.filename||e[11]!==l?(f=l("chat.outputFileRow.downloadFile",{filename:t.filename}),e[10]=t.filename,e[11]=l,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(Js,{className:"size-3.5"}),e[13]=p):p=e[13];let g;e[14]!==t.downloadUrl||e[15]!==t.filename||e[16]!==d||e[17]!==f?(g=a.jsx("a",{href:o,download:m,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block group-focus-within:block",title:d,"aria-label":f,children:p}),e[14]=t.downloadUrl,e[15]=t.filename,e[16]=d,e[17]=f,e[18]=g):g=e[18];let h;e[19]!==l?(h=l("chat.outputFileRow.open"),e[19]=l,e[20]=h):h=e[20];let x;e[21]!==u||e[22]!==h?(x=a.jsx(He,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:u,children:h}),e[21]=u,e[22]=h,e[23]=x):x=e[23];let v;return e[24]!==x||e[25]!==i||e[26]!==r||e[27]!==g?(v=a.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[i,r,g,x]}),e[24]=x,e[25]=i,e[26]=r,e[27]=g,e[28]=v):v=e[28],v}function da(s){return s.split("/").pop()??s}const fa=/(^|\/)output\//;function ma(s){const e=new Set;for(const t of s.parts??[]){const l=t;if(l.state==="output-available"&&l.type==="tool-write"){const n=l.input?.path;n&&fa.test(n)&&e.add(da(n))}}return e}function pa(s){const e=E.c(4),{threadId:t,message:l}=s,n=ma(l),c=n.size>0;let u;e[0]!==c?(u={enabled:c},e[0]=c,e[1]=u):u=e[1];const{data:i}=gn(t,u);if(n.size===0)return null;const r=(i??[]).filter(f=>n.has(f.filename));if(r.length===0)return null;const o="flex flex-col gap-1.5 py-2",m=r.map(ga);let d;return e[2]!==m?(d=a.jsx("div",{className:o,children:m}),e[2]=m,e[3]=d):d=e[3],d}function ga(s){return a.jsx(ua,{file:s},s.key)}function xa(s){return s.type==="reasoning"}function ha(s){const e=[],t=new Set,l=new Map,n=new Map,c=new Map;if(s){let i=null;for(let r=0;r<s.parts.length;r++){const o=s.parts[r];if(xa(o)){i||(i={parts:[],startIndex:r},e.push(i)),i.parts.push(o),t.add(r);continue}if(i=null,o.type==="data-tool-metadata"&&"id"in o&&"data"in o){const m=o.data,d={};m.annotations&&(d.annotations=m.annotations),typeof m.latencyMs=="number"&&Number.isFinite(m.latencyMs)&&(d.latencySeconds=m.latencyMs/1e3),typeof m.outputBytes=="number"&&Number.isFinite(m.outputBytes)&&m.outputBytes>=0&&(d.outputBytes=m.outputBytes),m._meta&&typeof m._meta=="object"&&(d._meta=m._meta),l.set(o.id,d);continue}if(o.type==="data-tool-subtask-metadata"&&"id"in o){n.set(o.id,o.data);continue}if(o.type==="data-web-search"&&"id"in o&&"data"in o){const m=o.id,d=o.data;c.set(m,d.text??"");continue}}}const u=[];if(s)for(let i=0;i<s.parts.length;i++){const r=s.parts[i];if(r.type!=="step-start"){if(t.has(i)){const o=e.find(m=>m.startIndex===i);o&&u.push({kind:"reasoning-group",group:o});continue}r.type.startsWith("data-")||u.push({kind:"part",index:i})}}return{reasoningGroups:e,renderOrder:u,dataParts:{toolMetadata:l,toolSubtaskMetadata:n,webSearchStreaming:c}}}const ba=3;function ya(s,e){let t=-1;for(let l=s.length-1;l>=0;l--){const n=s[l];if(n.kind==="part"&&e[n.index]?.type==="text"){t=l;break}}return t===-1?{collapsed:[],tail:s}:{collapsed:s.slice(0,t),tail:s.slice(t)}}function ja(s,e){let t=0,l=0;for(const n of s)if(n.kind==="reasoning-group")l++;else{const c=e[n.index]?.type;c==="text"?l++:(c==="dynamic-tool"||c?.startsWith("tool-"))&&c!=="tool-todo_write"&&c!=="tool-update_interests"&&t++}return{toolCalls:t,messages:l}}function va(s){const e=E.c(10),{toolCalls:t,messages:l}=s,n=U();let c;e[0]!==l||e[1]!==n||e[2]!==t?(c=t>0&&a.jsxs(a.Fragment,{children:[a.jsx(gt,{className:"size-3.5 shrink-0"}),a.jsxs("span",{children:[n("chat.assistant.toolCallPlural",{count:t}),l>0?",":""]})]}),e[0]=l,e[1]=n,e[2]=t,e[3]=c):c=e[3];let u;e[4]!==l||e[5]!==n?(u=l>0&&a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"size-3.5 shrink-0"}),a.jsx("span",{children:n("chat.assistant.messagePlural",{count:l})})]}),e[4]=l,e[5]=n,e[6]=u):u=e[6];let i;return e[7]!==c||e[8]!==u?(i=a.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[c,u]}),e[7]=c,e[8]=u,e[9]=i):i=e[9],i}function Na(s){const e=E.c(28),{items:t,message:l,reasoningGroups:n,isReasoningActive:c,totalDuration:u,dataParts:i,isLoading:r,isLast:o}=s;let m;e[0]!==t||e[1]!==l.parts?(m=ja(t,l.parts),e[0]=t,e[1]=l.parts,e[2]=m):m=e[2];const{toolCalls:d,messages:f}=m;if(d===0&&f===0)return null;let p;e[3]!==f||e[4]!==d?(p=a.jsx(va,{toolCalls:d,messages:f}),e[3]=f,e[4]=d,e[5]=p):p=e[5];let g;if(e[6]!==i||e[7]!==o||e[8]!==r||e[9]!==c||e[10]!==t||e[11]!==l||e[12]!==n||e[13]!==u){let v;e[15]!==i||e[16]!==o||e[17]!==r||e[18]!==c||e[19]!==l||e[20]!==n||e[21]!==u?(v=(b,k)=>Zt({item:b,renderIndex:k,message:l,reasoningGroups:n,isReasoningActive:c,totalDuration:u,dataParts:i,isLoading:r,isLast:o,isLastVisiblePart:!1}),e[15]=i,e[16]=o,e[17]=r,e[18]=c,e[19]=l,e[20]=n,e[21]=u,e[22]=v):v=e[22],g=t.map(v),e[6]=i,e[7]=o,e[8]=r,e[9]=c,e[10]=t,e[11]=l,e[12]=n,e[13]=u,e[14]=g}else g=e[14];let h;e[23]!==g?(h=a.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:g}),e[23]=g,e[24]=h):h=e[24];let x;return e[25]!==p||e[26]!==h?(x=a.jsx(H,{icon:null,alwaysChevron:!0,title:p,state:"idle",children:h}),e[25]=p,e[26]=h,e[27]=x):x=e[27],x}function Zt({item:s,renderIndex:e,message:t,reasoningGroups:l,isReasoningActive:n,totalDuration:c,dataParts:u,isLoading:i,isLast:r,isLastVisiblePart:o,renderOrder:m}){if(s.kind==="reasoning-group"){const{group:g}=s,h=g===l[l.length-1],x=n&&h;if(!g.parts.some(k=>k.text?.trim())&&!x)return null;const b=l.length===1?c:null;return a.jsx(An,{duration:b,parts:g.parts,isStreaming:x},`${t.id}-reasoning-${g.startIndex}`)}const d=t.parts[s.index],f=o||(m?m.findLastIndex(g=>g.kind==="part")===e:!1),p=f?Os(Us(),t.metadata?.usage):null;return a.jsx(Sa,{part:d,id:t.id,usageStats:f&&a.jsx(Es,{usage:p,duration:c}),dataParts:u,isLoading:i,isLastMessage:r},`${t.id}-${s.index}`)}function Sa(s){const e=E.c(117),{part:t,id:l,usageStats:n,dataParts:c,isLoading:u,isLastMessage:i}=s;let r;e[0]!==c.toolMetadata?(r=f=>c.toolMetadata.get(f),e[0]=c.toolMetadata,e[1]=r):r=e[1];const o=r;let m;e[2]!==c.toolSubtaskMetadata?(m=f=>c.toolSubtaskMetadata.get(f),e[2]=c.toolSubtaskMetadata,e[3]=m):m=e[3];const d=m;switch(t.type){case"dynamic-tool":{let f;e[4]!==o||e[5]!==t.toolCallId?(f=o(t.toolCallId)?.annotations,e[4]=o,e[5]=t.toolCallId,e[6]=f):f=e[6];let p;e[7]!==o||e[8]!==t.toolCallId?(p=o(t.toolCallId)?.latencySeconds,e[7]=o,e[8]=t.toolCallId,e[9]=p):p=e[9];let g;e[10]!==o||e[11]!==t.toolCallId?(g=o(t.toolCallId)?.outputBytes,e[10]=o,e[11]=t.toolCallId,e[12]=g):g=e[12];let h;e[13]!==o||e[14]!==t.toolCallId?(h=o(t.toolCallId)?._meta,e[13]=o,e[14]=t.toolCallId,e[15]=h):h=e[15];let x;return e[16]!==i||e[17]!==t||e[18]!==f||e[19]!==p||e[20]!==g||e[21]!==h?(x=a.jsx(ot,{part:t,annotations:f,latency:p,outputBytes:g,isLastMessage:i,toolMeta:h}),e[16]=i,e[17]=t,e[18]=f,e[19]=p,e[20]=g,e[21]=h,e[22]=x):x=e[22],x}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let f;e[23]!==o||e[24]!==t.toolCallId?(f=o(t.toolCallId)?.latencySeconds,e[23]=o,e[24]=t.toolCallId,e[25]=f):f=e[25];let p;return e[26]!==t||e[27]!==f?(p=a.jsx(jl,{part:t,latency:f}),e[26]=t,e[27]=f,e[28]=p):p=e[28],p}case"tool-suggest_task":{let f;return e[29]!==t?(f=a.jsx(vl,{part:t}),e[29]=t,e[30]=f):f=e[30],f}case"tool-propose_plan":{let f;return e[31]!==t?(f=a.jsx(El,{part:t}),e[31]=t,e[32]=f):f=e[32],f}case"tool-generate_image":{let f;e[33]!==o||e[34]!==t.toolCallId?(f=o(t.toolCallId)?.latencySeconds,e[33]=o,e[34]=t.toolCallId,e[35]=f):f=e[35];let p;return e[36]!==t||e[37]!==f?(p=a.jsx(rl,{part:t,latency:f}),e[36]=t,e[37]=f,e[38]=p):p=e[38],p}case"tool-web_search":case"tool-deep_research":{let f;e[39]!==o||e[40]!==t.toolCallId?(f=o(t.toolCallId)?.latencySeconds,e[39]=o,e[40]=t.toolCallId,e[41]=f):f=e[41];let p;e[42]!==c.webSearchStreaming||e[43]!==t.toolCallId?(p=c.webSearchStreaming.get(t.toolCallId),e[42]=c.webSearchStreaming,e[43]=t.toolCallId,e[44]=p):p=e[44];let g;return e[45]!==t||e[46]!==f||e[47]!==p?(g=a.jsx(yl,{part:t,latency:f,streamingText:p}),e[45]=t,e[46]=f,e[47]=p,e[48]=g):g=e[48],g}case"tool-subtask":{let f;e[49]!==d||e[50]!==t.toolCallId?(f=d(t.toolCallId),e[49]=d,e[50]=t.toolCallId,e[51]=f):f=e[51];let p;e[52]!==o||e[53]!==t.toolCallId?(p=o(t.toolCallId)?.annotations,e[52]=o,e[53]=t.toolCallId,e[54]=p):p=e[54];let g;e[55]!==o||e[56]!==t.toolCallId?(g=o(t.toolCallId)?.latencySeconds,e[55]=o,e[56]=t.toolCallId,e[57]=g):g=e[57];let h;e[58]!==t||e[59]!==f||e[60]!==p||e[61]!==g?(h={part:t,subtaskMeta:f,annotations:p,latency:g},e[58]=t,e[59]=f,e[60]=p,e[61]=g,e[62]=h):h=e[62];const x=h;let v;return e[63]!==x?(v=a.jsx(R.Suspense,{fallback:a.jsx(Al,{...x}),children:a.jsx(Ml,{...x})}),e[63]=x,e[64]=v):v=e[64],v}case"text":{const f=!!n&&!u,p=u&&i;let g;return e[65]!==l||e[66]!==t||e[67]!==f||e[68]!==p||e[69]!==n?(g=a.jsx($e,{id:l,part:t,extraActions:n,copyable:!0,alwaysShowActions:f,animate:p}),e[65]=l,e[66]=t,e[67]=f,e[68]=p,e[69]=n,e[70]=g):g=e[70],g}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const f=t;if(f.type==="tool-brand_context_setup"||f.type==="tool-BRAND_CONTEXT_EXTRACT"){let p;e[71]!==f.toolCallId||e[72]!==o?(p=o(f.toolCallId)?.latencySeconds,e[71]=f.toolCallId,e[72]=o,e[73]=p):p=e[73];let g;return e[74]!==f||e[75]!==p?(g=a.jsx(Ol,{part:f,latency:p}),e[74]=f,e[75]=p,e[76]=g):g=e[76],g}if(f.type==="tool-BRAND_CONTEXT_GET"){let p;e[77]!==f.toolCallId||e[78]!==o?(p=o(f.toolCallId)?.latencySeconds,e[77]=f.toolCallId,e[78]=o,e[79]=p):p=e[79];let g;return e[80]!==f||e[81]!==p?(g=a.jsx(Ul,{part:f,latency:p}),e[80]=f,e[81]=p,e[82]=g):g=e[82],g}if(f.type==="tool-BRAND_CONTEXT_LIST"){let p;e[83]!==f.toolCallId||e[84]!==o?(p=o(f.toolCallId)?.latencySeconds,e[83]=f.toolCallId,e[84]=o,e[85]=p):p=e[85];let g;return e[86]!==f||e[87]!==p?(g=a.jsx(Hl,{part:f,latency:p}),e[86]=f,e[87]=p,e[88]=g):g=e[88],g}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let p;e[89]!==f.toolCallId||e[90]!==o?(p=o(f.toolCallId)?.latencySeconds,e[89]=f.toolCallId,e[90]=o,e[91]=p):p=e[91];let g;return e[92]!==f||e[93]!==p?(g=a.jsx(Kl,{part:f,latency:p}),e[92]=f,e[93]=p,e[94]=g):g=e[94],g}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let p;e[95]!==f.toolCallId||e[96]!==o?(p=o(f.toolCallId)?.latencySeconds,e[95]=f.toolCallId,e[96]=o,e[97]=p):p=e[97];let g;return e[98]!==f||e[99]!==p?(g=a.jsx(Xl,{part:f,latency:p}),e[98]=f,e[99]=p,e[100]=g):g=e[100],g}if(f.type==="tool-COLLECTION_CONNECTIONS_LIST"){let p;e[101]!==f.toolCallId||e[102]!==o?(p=o(f.toolCallId)?.latencySeconds,e[101]=f.toolCallId,e[102]=o,e[103]=p):p=e[103];let g;return e[104]!==f||e[105]!==p?(g=a.jsx(ea,{part:f,latency:p}),e[104]=f,e[105]=p,e[106]=g):g=e[106],g}if(f.type.startsWith("tool-")){const p=f.toolCallId;let g;e[107]!==c.toolMetadata||e[108]!==p?(g=c.toolMetadata.get(p),e[107]=c.toolMetadata,e[108]=p,e[109]=g):g=e[109];const h=g,x=h?.annotations,v=h?.latencySeconds,b=h?.outputBytes,k=h?._meta;let j;return e[110]!==f||e[111]!==i||e[112]!==x||e[113]!==v||e[114]!==b||e[115]!==k?(j=a.jsx(ot,{part:f,annotations:x,latency:v,outputBytes:b,isLastMessage:i,toolMeta:k}),e[110]=f,e[111]=i,e[112]=x,e[113]=v,e[114]=b,e[115]=k,e[116]=j):j=e[116],j}if(f.type.startsWith("data-"))return null;throw new Error(`Unknown part type: ${f.type}`)}}}function ka(s){const e=E.c(9),{isRunInProgress:t}=s,l=U();if(t){let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(Ie,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),e[0]=u):u=e[0];let i;e[1]!==l?(i=l("chat.assistant.resumingTask"),e[1]=l,e[2]=i):i=e[2];let r;return e[3]!==i?(r=a.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[u,a.jsx("span",{className:"text-[14px] text-muted-foreground shimmer",children:i})]})}),e[3]=i,e[4]=r):r=e[4],r}let n;e[5]!==l?(n=l("chat.assistant.noResponseGenerated"),e[5]=l,e[6]=n):n=e[6];let c;return e[7]!==n?(c=a.jsx("div",{className:"text-[14px] text-muted-foreground/60 py-2",children:n}),e[7]=n,e[8]=c):c=e[8],c}function _a(s){const e=E.c(7),{className:t,children:l}=s;let n;e[0]!==t?(n=G("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=n):n=e[1];let c;e[2]!==l?(c=a.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:a.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[14px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:l})}),e[2]=l,e[3]=c):c=e[3];let u;return e[4]!==n||e[5]!==c?(u=a.jsx("div",{className:n,children:c}),e[4]=n,e[5]=c,e[6]=u):u=e[6],u}function wa(s){const e=E.c(32),{message:t,turnStartedAt:l,status:n,className:c,isLast:u}=s,i=u===void 0?!1:u,r=U(),{isRunInProgress:o}=ve()??{},m=o===void 0?!1:o,d=Ne()?.taskId??null,f=n==="streaming",g=f||n==="submitted";let h;e[0]!==l?(h=Ke(l),e[0]=l,e[1]=h):h=e[1];const x=h;let v;e[2]!==g?(v=()=>g?Date.now():null,e[2]=g,e[3]=v):v=e[3];const[b,k]=R.useState(v),[j,_]=R.useState(g);j!==g&&(_(g),k(()=>g?Date.now():null));const y=x??b,{reasoningGroups:S,renderOrder:N,dataParts:w}=ha(t),C=t!==null&&N.length>0,M=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,A=f&&M?.type==="reasoning";let L;if(e[4]!==t){const D=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,F=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;L=D!==null?F.getTime()-D.getTime():null,e[4]=t,e[5]=L}else L=e[5];const I=L;let T;e[6]!==i||e[7]!==t?(T=!i||!t||!t.parts.some(Ta),e[6]=i,e[7]=t,e[8]=T):T=e[8];const $=T;let P;e[9]!==C||e[10]!==g||e[11]!==$||e[12]!==t||e[13]!==N?(P=!g&&C&&$&&(()=>{let D=0;for(const F of N)if(F.kind==="part"){const W=t.parts[F.index]?.type;(W==="dynamic-tool"||W?.startsWith("tool-"))&&D++}return D>=ba})(),e[9]=C,e[10]=g,e[11]=$,e[12]=t,e[13]=N,e[14]=P):P=e[14];const q=P;let B;if(e[15]!==c||e[16]!==w||e[17]!==C||e[18]!==i||e[19]!==g||e[20]!==A||e[21]!==m||e[22]!==$||e[23]!==t||e[24]!==S||e[25]!==N||e[26]!==q||e[27]!==y||e[28]!==r||e[29]!==d||e[30]!==I){const{collapsed:D,tail:F}=q?ya(N,t.parts):{collapsed:[],tail:N};B=a.jsx(_a,{className:c,children:C?a.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[t.metadata?.resumedFromBackground&&a.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground/60 select-none",children:[a.jsx(ft,{className:"size-3 shrink-0"}),a.jsx("span",{children:r("chat.assistant.resumedBackgroundTask")})]}),D.length>0&&a.jsx(Na,{items:D,message:t,reasoningGroups:S,isReasoningActive:A,totalDuration:I,dataParts:w,isLoading:g,isLast:i}),F.map((W,J)=>{const X=D.length+J,te=F.findLastIndex(Ca)===J;return Zt({item:W,renderIndex:X,message:t,reasoningGroups:S,isReasoningActive:A,totalDuration:I,dataParts:w,isLoading:g,isLast:i,isLastVisiblePart:te,renderOrder:N})}),d&&a.jsx(pa,{threadId:d,message:t}),i&&g&&y!==null&&a.jsx(Tn,{startedAt:y}),i&&!g&&d&&a.jsxs(a.Fragment,{children:[a.jsx(ra,{}),$&&a.jsx(na,{})]}),!g&&a.jsx(zt,{message:t})]}):g?a.jsx($n,{startedAt:y}):a.jsx(ka,{isRunInProgress:i&&m})}),e[15]=c,e[16]=w,e[17]=C,e[18]=i,e[19]=g,e[20]=A,e[21]=m,e[22]=$,e[23]=t,e[24]=S,e[25]=N,e[26]=q,e[27]=y,e[28]=r,e[29]=d,e[30]=I,e[31]=B}else B=e[31];return B}function Ca(s){return s.kind==="part"}function Ta(s){const e=s.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=s.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function Ia(s){const e=E.c(25),{event:t}=s,l=U(),[n,c]=R.useState(!1);let u;e[0]!==t.data?(u=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=u):u=e[1];const i=u;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>c($a),e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(_s,{className:"size-4 shrink-0 text-muted-foreground"}),e[3]=o):o=e[3];let m;e[4]!==l?(m=l("chat.triggerEventPart.triggeredByEvent"),e[4]=l,e[5]=m):m=e[5];let d;e[6]!==m?(d=a.jsx("span",{className:"font-medium",children:m}),e[6]=m,e[7]=d):d=e[7];let f;e[8]!==t.type?(f=a.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[8]=t.type,e[9]=f):f=e[9];const p=n&&"rotate-180";let g;e[10]!==p?(g=G("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",p),e[10]=p,e[11]=g):g=e[11];let h;e[12]!==g?(h=a.jsx(hn,{className:g}),e[12]=g,e[13]=h):h=e[13];let x;e[14]!==d||e[15]!==f||e[16]!==h?(x=a.jsxs("button",{type:"button",onClick:r,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[o,d,f,h]}),e[14]=d,e[15]=f,e[16]=h,e[17]=x):x=e[17];let v;e[18]!==t.source||e[19]!==n||e[20]!==i?(v=n&&a.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[a.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),a.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:i})]}),e[18]=t.source,e[19]=n,e[20]=i,e[21]=v):v=e[21];let b;return e[22]!==x||e[23]!==v?(b=a.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[x,v]}),e[22]=x,e[23]=v,e[24]=b):b=e[24],b}function $a(s){return!s}const Aa=[fn.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),un,dn];function Ma(s){const e=E.c(5),{tiptapDoc:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=l):l=e[0];let n;e[1]!==t?(n={extensions:Aa,content:t,editable:!1,editorProps:l},e[1]=t,e[2]=n):n=e[2];const c=cn(n);if(!c)return null;let u;return e[3]!==c?(u=a.jsx(mn,{editor:c,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=c,e[4]=u):u=e[4],u}function Ea(s){const e=E.c(38),{message:t,className:l,onScrollToPair:n}=s,{id:c,parts:u,metadata:i}=t,[r,o]=R.useState(!1),[m,d]=R.useState(!1),f=R.useRef(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=T=>{T&&!f.current&&(f.current=!0,d(T.scrollHeight>T.clientHeight))},e[0]=p):p=e[0];const g=p;if(!u||u.length===0)return null;let h;e[1]!==n?(h=()=>{o(!0),n?.()},e[1]=n,e[2]=h):h=e[2];const x=h,v=i?.tiptapDoc;let b;e[3]!==l?(b=G("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",l),e[3]=l,e[4]=b):b=e[4];let k,j;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>o(!0),j=()=>o(!1),e[5]=k,e[6]=j):(k=e[5],j=e[6]);let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=_):_=e[7];let y;e[8]!==r||e[9]!==m?(y=G("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",r?"max-h-[50vh] overflow-auto opacity-100":G("max-h-[84px] overflow-hidden opacity-99",m&&"mask-b-from-1%")),e[8]=r,e[9]=m,e[10]=y):y=e[10];let S;if(e[11]!==c||e[12]!==u){let T;e[14]!==c?(T=($,P)=>$.type==="data-trigger-event"?a.jsx(Ia,{event:$.data},`${c}-${P}`):null,e[14]=c,e[15]=T):T=e[15],S=u.map(T),e[11]=c,e[12]=u,e[13]=S}else S=e[13];let N;e[16]!==v||e[17]!==c||e[18]!==i||e[19]!==u?(N=v?a.jsx(Ma,{tiptapDoc:i.tiptapDoc}):u.map((T,$)=>T.type==="text"?u[$-1]?.type==="data-trigger-event"?null:a.jsx($e,{id:c,part:T},`${c}-${$}`):null),e[16]=v,e[17]=c,e[18]=i,e[19]=u,e[20]=N):N=e[20];let w;e[21]!==S||e[22]!==N?(w=a.jsxs("div",{className:"flex flex-col gap-2",children:[S,N]}),e[21]=S,e[22]=N,e[23]=w):w=e[23];let C;e[24]!==w||e[25]!==y?(C=a.jsx("div",{ref:g,className:y,children:w}),e[24]=w,e[25]=y,e[26]=C):C=e[26];let M;e[27]!==x||e[28]!==C?(M=a.jsxs("div",{tabIndex:0,onClick:x,onFocus:k,onBlur:j,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-[14px] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[_,C]}),e[27]=x,e[28]=C,e[29]=M):M=e[29];let A;e[30]!==t?(A=a.jsx(zt,{message:t,className:"mt-1 mr-1 self-end"}),e[30]=t,e[31]=A):A=e[31];let L;e[32]!==M||e[33]!==A?(L=a.jsxs("div",{className:"w-full min-w-0 flex flex-col",children:[M,A]}),e[32]=M,e[33]=A,e[34]=L):L=e[34];let I;return e[35]!==L||e[36]!==b?(I=a.jsx(a.Fragment,{children:a.jsx("div",{className:b,children:L})}),e[35]=L,e[36]=b,e[37]=I):I=e[37],I}function wo(s){const e=[],t=s.filter(l=>l.role!=="system"&&!l.metadata?.internal&&!l.metadata?.subtaskJobId);for(let l=0;l<t.length;l++){const n=t[l];if(n)if(n.role==="user"){const c=t[l+1];c&&c.role==="assistant"?(e.push({user:n,assistant:c}),l++):e.push({user:n,assistant:null})}else n.role==="assistant"&&e.push({user:null,assistant:n})}return e}function Co(s){const e=E.c(19),{pair:t,isLastPair:l,status:n}=s,c=R.useRef(null),u=R.useRef(!1);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{c.current&&c.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=i):i=e[0];const r=i;let o;e[1]!==l||e[2]!==t.assistant?.metadata?.resumedFromBackground||e[3]!==n?(o=v=>{if(c.current=v,!l||!v||u.current||(u.current=!0,t.assistant?.metadata?.resumedFromBackground))return;if(n==="submitted"||n==="streaming"){v.scrollIntoView({behavior:"smooth",block:"start"});return}const b=v.closest("[data-chat-scroller]");b?b.scrollTop=b.scrollHeight:v.scrollIntoView({behavior:"instant",block:"start"})},e[1]=l,e[2]=t.assistant?.metadata?.resumedFromBackground,e[3]=n,e[4]=o):o=e[4];const m=o,d=!t.user&&"pt-8 sm:pt-6";let f;e[5]!==d?(f=G("flex flex-col pb-2 sm:pb-2",d),e[5]=d,e[6]=f):f=e[6];let p;e[7]!==t.user?(p=t.user&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),a.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:a.jsx(Ea,{message:t.user,onScrollToPair:r})})]}),e[7]=t.user,e[8]=p):p=e[8];const g=t.user?.created_at??null;let h;e[9]!==l||e[10]!==t.assistant||e[11]!==n||e[12]!==g?(h=a.jsx(wa,{message:t.assistant,turnStartedAt:g,status:n,isLast:l}),e[9]=l,e[10]=t.assistant,e[11]=n,e[12]=g,e[13]=h):h=e[13];let x;return e[14]!==m||e[15]!==f||e[16]!==p||e[17]!==h?(x=a.jsxs("div",{ref:m,className:f,children:[p,h]}),e[14]=m,e[15]=f,e[16]=p,e[17]=h,e[18]=x):x=e[18],x}export{Sn as G,Co as M,ua as O,_o as S,Nn as a,Rn as f,wo as u};
|