decocms 4.367.0 → 4.367.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-lddbBWh0.js → AlertCircle-rRQrnsQT.js} +1 -1
- package/dist/client/assets/{AreaChart-DKAyw_K7.js → AreaChart-CfdWNyEQ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DDPJQXhG.js → ArrowLeft-BZ_V0Q9t.js} +1 -1
- package/dist/client/assets/{ArrowRight-Cm4rUCam.js → ArrowRight-DLmMx1GH.js} +1 -1
- package/dist/client/assets/{ArrowUp-BlHEAyyd.js → ArrowUp-DhMsgJkj.js} +1 -1
- package/dist/client/assets/{Check-B2FZLF1O.js → Check-jwHdO8X-.js} +1 -1
- package/dist/client/assets/{CheckCircle-2GspG_XT.js → CheckCircle-BXhLNUG6.js} +1 -1
- package/dist/client/assets/{ChevronRight-byX-3L9r.js → ChevronRight-qjdwy3ht.js} +1 -1
- package/dist/client/assets/{ChevronUp-DgIot4i7.js → ChevronUp-DUyCnbNx.js} +1 -1
- package/dist/client/assets/{Copy01-DN3tqM8L.js → Copy01-Ba_DXyYG.js} +1 -1
- package/dist/client/assets/{CreditCard01-wo9mx3CN.js → CreditCard01-D8ve3i2_.js} +1 -1
- package/dist/client/assets/{Database01-BsiMLwmb.js → Database01-CKtQnfwM.js} +1 -1
- package/dist/client/assets/{DotsVertical-BFzwtdUn.js → DotsVertical-2ZMqd-18.js} +1 -1
- package/dist/client/assets/{Download01-DzANKKkw.js → Download01-CoH-UuQa.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CFHTziNp.js → ErrorBarContext-B_FyGPF3.js} +1 -1
- package/dist/client/assets/{Eye-DFJEK6aw.js → Eye-BpslXSuU.js} +1 -1
- package/dist/client/assets/{File02-BE1-Eszh.js → File02-aDup41Qr.js} +1 -1
- package/dist/client/assets/{GitBranch01-CI-WDVa2.js → GitBranch01-DzU0sPJc.js} +1 -1
- package/dist/client/assets/{Globe01-BkG0TYp3.js → Globe01-CDkkg2Cy.js} +1 -1
- package/dist/client/assets/{HardDrive-DuIbEWGl.js → HardDrive-DNp6sr7j.js} +1 -1
- package/dist/client/assets/{Image01-CUco8f4C.js → Image01-DZX0wWyU.js} +1 -1
- package/dist/client/assets/{Key01-Ctr214Q3.js → Key01-D2uCgYpN.js} +1 -1
- package/dist/client/assets/{Link01-CyA36bfv.js → Link01-B6QrVU3H.js} +1 -1
- package/dist/client/assets/{LinkExternal01-EKFZjMJY.js → LinkExternal01-CKgmWkkp.js} +1 -1
- package/dist/client/assets/{MessageCircle01-BMp3tiX2.js → MessageCircle01-DOh30ucD.js} +1 -1
- package/dist/client/assets/{Monitor01-C8W3wbFB.js → Monitor01-DT1NSOaN.js} +1 -1
- package/dist/client/assets/{Package-CpB6vYlT.js → Package-DZFJNJtq.js} +1 -1
- package/dist/client/assets/{Palette-CBU77GJ1.js → Palette-D9x-keux.js} +1 -1
- package/dist/client/assets/{Play-Uhe4ebTG.js → Play-nvjmkgl9.js} +1 -1
- package/dist/client/assets/{Plus-BiYlKLxl.js → Plus-p771xfxl.js} +1 -1
- package/dist/client/assets/{Printer-CSBhu2Re.js → Printer-CEzVuZMa.js} +1 -1
- package/dist/client/assets/{SearchLg-CN4JJES9.js → SearchLg-C5H_nx3W.js} +1 -1
- package/dist/client/assets/{SearchMd-C6NFUW36.js → SearchMd-BnbGkmUb.js} +1 -1
- package/dist/client/assets/{Sector-UzdbcO_5.js → Sector-B0EhClQm.js} +1 -1
- package/dist/client/assets/{Settings02-CqMjj8Oq.js → Settings02-CFq2ETVr.js} +1 -1
- package/dist/client/assets/{Share07-DH92YWbU.js → Share07-hoEgdikb.js} +1 -1
- package/dist/client/assets/{Shield01-Cm4rFm8N.js → Shield01-C_kVJsrZ.js} +1 -1
- package/dist/client/assets/{Stars01-BxBiTUsk.js → Stars01-jOH0yCKk.js} +1 -1
- package/dist/client/assets/{Sun-sJn8WeT-.js → Sun-BvckUZh0.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BT-naaH0.js → SwitchHorizontal01-DVbyXy1C.js} +1 -1
- package/dist/client/assets/{Tool01-0YKAjW__.js → Tool01-Co_K8urR.js} +1 -1
- package/dist/client/assets/{Tool02-Bco71KeO.js → Tool02-BHzOpk5z.js} +1 -1
- package/dist/client/assets/{Trash01-Dp2yrMxt.js → Trash01-B1H2nTDv.js} +1 -1
- package/dist/client/assets/{TrendUp01-D1K9L0xP.js → TrendUp01-Cxcr4-0l.js} +1 -1
- package/dist/client/assets/{Upload01-BUf7qRrI.js → Upload01-CiNRxnSv.js} +1 -1
- package/dist/client/assets/{User01-Da1WckIS.js → User01-_uMnR0k7.js} +1 -1
- package/dist/client/assets/{UserSquare-XPgiOUWe.js → UserSquare-SK2C9JwY.js} +1 -1
- package/dist/client/assets/{Users01-BsVs6-8w.js → Users01-C8QAjTFh.js} +1 -1
- package/dist/client/assets/{Users03-DL_upBh-.js → Users03-BsQdFF8i.js} +1 -1
- package/dist/client/assets/{X-D6lVPJzO.js → X-MotBpvxg.js} +1 -1
- package/dist/client/assets/{XCircle-DReUcNBS.js → XCircle-mKrW5aBV.js} +1 -1
- package/dist/client/assets/{XClose-DYRx__Hg.js → XClose-nT83baSx.js} +1 -1
- package/dist/client/assets/{Zap-CCglgveU.js → Zap-DlMFCTS-.js} +1 -1
- package/dist/client/assets/{ZoomOut-BlidBzgG.js → ZoomOut-DbeadNC9.js} +1 -1
- package/dist/client/assets/{access-gate-BYH1blGF.js → access-gate-DB08KYAT.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BBa9lb3g.js → add-connection-dialog-COIUcaiE.js} +1 -1
- package/dist/client/assets/{agent-analytics-CBzZ6fW4.js → agent-analytics-ByqAUaQE.js} +1 -1
- package/dist/client/assets/agent-app-BKrsF-WP.js +1 -0
- package/dist/client/assets/{agent-assets-1uSvOIMs.js → agent-assets-DnGvnA0Q.js} +1 -1
- package/dist/client/assets/{agent-automation-DlziYH2t.js → agent-automation-iBayfasb.js} +1 -1
- package/dist/client/assets/{agent-automations-qFcyvr7g.js → agent-automations-DHGdzWCZ.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BT8vowWZ.js → agent-connect-sources-bgjFIcuF.js} +1 -1
- package/dist/client/assets/agent-deck-UyiKhWO_.js +1 -0
- package/dist/client/assets/{agent-e2e-W6x_fKn9.js → agent-e2e-AC5zIMUC.js} +1 -1
- package/dist/client/assets/agent-file-B4OnBR_y.js +1 -0
- package/dist/client/assets/{agent-git-CMGleuHk.js → agent-git-DAYDiQ9u.js} +1 -1
- package/dist/client/assets/{agent-hosting-Bs-VQ5Tn.js → agent-hosting-Cf3SmUBN.js} +1 -1
- package/dist/client/assets/{agent-icon-ByB43Wsk.js → agent-icon-DEBX0Uac.js} +1 -1
- package/dist/client/assets/agent-library-file-DdleqgF9.js +1 -0
- package/dist/client/assets/{agent-monitor-BU7G1axZ.js → agent-monitor-d85zzawa.js} +1 -1
- package/dist/client/assets/{agent-overview-7sMywsGa.js → agent-overview-Csd64fRN.js} +1 -1
- package/dist/client/assets/agent-settings-CplZAGJ4.js +1 -0
- package/dist/client/assets/{agent-site-editor-Dl6mOkZF.js → agent-site-editor-BcVdz-Ob.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-7lKpRg2_.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-rdCLpJuB.js → agent-site-editor-content-B5eM-F4q.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-D--whZiK.js → agent-site-editor-preview-CMLkSP5C.js} +20 -6
- package/dist/client/assets/agent-view-_FqH7P3W.js +1 -0
- package/dist/client/assets/{agent-view-guard-D33PMiXB.js → agent-view-guard-DFIgCPk2.js} +1 -1
- package/dist/client/assets/{agents-list-DIdvmd8H.js → agents-list-z4xSfcE9.js} +1 -1
- package/dist/client/assets/{ai-providers-CA1xaqJ_.js → ai-providers-DcQSO7lc.js} +1 -1
- package/dist/client/assets/{alert-DU6nnBIl.js → alert-CpXgpduJ.js} +1 -1
- package/dist/client/assets/{alert-dialog-OWb4AclI.js → alert-dialog-jSpWtFPv.js} +1 -1
- package/dist/client/assets/{api-keys-BriZrFLd.js → api-keys-DYNE9_r9.js} +1 -1
- package/dist/client/assets/api-keys-DqcXXCDi.js +1 -0
- package/dist/client/assets/app-editor-IwdF7Nlj.js +1 -0
- package/dist/client/assets/{asset-utils-C0vjSwsk.js → asset-utils-CvLbIoHR.js} +1 -1
- package/dist/client/assets/{auth-CJPyBAbS.js → auth-DekSX5bd.js} +1 -1
- package/dist/client/assets/{auth-catchall-BILSMXXP.js → auth-catchall-BsRxFmiX.js} +1 -1
- package/dist/client/assets/{auth-entry-7DJ--D3o.js → auth-entry-C-RAgds2.js} +1 -1
- package/dist/client/assets/{auth-split-layout-fmBItRen.js → auth-split-layout-CuV5bVjY.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B8kXJK6h.js → authenticate-and-persist-oauth-3J_jvNQZ.js} +1 -1
- package/dist/client/assets/{automation-list-row-BUB2WmQy.js → automation-list-row-BDwOWXYr.js} +1 -1
- package/dist/client/assets/{automation-runs-CQxYoSpJ.js → automation-runs-BXCUbDGI.js} +1 -1
- package/dist/client/assets/{automations-DxWDAERW.js → automations-BAHyqM26.js} +1 -1
- package/dist/client/assets/{autosend-CB-A5Oif.js → autosend-Cp5vfPIB.js} +1 -1
- package/dist/client/assets/{avatar-Dr6RkrBb.js → avatar-Db6Ad7E2.js} +1 -1
- package/dist/client/assets/{badge-o8ORXLbv.js → badge-cq278MQI.js} +1 -1
- package/dist/client/assets/{block-document-CWUKuN2J.js → block-document-C2UBIqOL.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-yyXFM1pu.js → blocks-preview-workspace-context-E_vt1Y-f.js} +1 -1
- package/dist/client/assets/{breadcrumb-DjBKZboG.js → breadcrumb-CHaXT_pT.js} +1 -1
- package/dist/client/assets/{buckets-D3fP10lQ.js → buckets-D5G_Ai7S.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-D6CNE90Q.js → build-improve-prompt-doc-sYHKN5HP.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DlUo9-SK.js → bulk-category-panel-D_9ku8X6.js} +1 -1
- package/dist/client/assets/{calendar-jFNLP3nP.js → calendar-DnxVN00Q.js} +1 -1
- package/dist/client/assets/{capability-load-error-3FwAUk2n.js → capability-load-error-DIrZadSW.js} +1 -1
- package/dist/client/assets/{cards-Lh-AxhUg.js → cards-BHWXUZZV.js} +1 -1
- package/dist/client/assets/category-editor-DwuLsa5M.js +1 -0
- package/dist/client/assets/{chart-C3EhY9Id.js → chart-C4HFqNub.js} +1 -1
- package/dist/client/assets/{chat-context-BmwCoPvA.js → chat-context-g3Ysek-D.js} +1 -1
- package/dist/client/assets/{chat-draft-Bpg7GYsG.js → chat-draft-DZWcf9MH.js} +1 -1
- package/dist/client/assets/{checkbox-rssR-x4C.js → checkbox-CtSIa9d0.js} +1 -1
- package/dist/client/assets/{choose-editor-BoaRUynl.js → choose-editor-DSx37Ddq.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DoXjcGUB.js → cli-auth-success-CLpiF4Ff.js} +1 -1
- package/dist/client/assets/{client-icons-CsD5fxts.js → client-icons-CQ0ZvrpV.js} +1 -1
- package/dist/client/assets/{collapsible-MEYp44rr.js → collapsible-S74ix7rA.js} +1 -1
- package/dist/client/assets/{collection-detail-BTrYASGj.js → collection-detail-W3NJKwhu.js} +1 -1
- package/dist/client/assets/{collection-display-button-B9zzr0DV.js → collection-display-button-saVrgyWc.js} +1 -1
- package/dist/client/assets/{collection-search-Cp-PQjLX.js → collection-search-Cw88RONI.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BX-5C3VA.js → collection-table-wrapper-syS0MeUq.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bhq66UPx.js → collection-tabs-DjIYbOQ5.js} +1 -1
- package/dist/client/assets/{command-CuPZrFd2.js → command-Cnr_FK8b.js} +1 -1
- package/dist/client/assets/{command-palette-store-CQCOE6E9.js → command-palette-store-DQWkqX24.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-ChtNCiV-.js → commerce-onboarding-BKBw1cRC.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-JuBB0H1F.js → companion-mcps-section-QuNNjI2b.js} +1 -1
- package/dist/client/assets/{connect-AnJHgcIC.js → connect-CBV8hDBb.js} +1 -1
- package/dist/client/assets/{connect-layout-uMSVoZmd.js → connect-layout-Cj9Ty8o6.js} +1 -1
- package/dist/client/assets/{connection-_wLcpevb.js → connection-Cl0tFuDE.js} +1 -1
- package/dist/client/assets/{connection-card-BD4O904L.js → connection-card-CtC01b_S.js} +1 -1
- package/dist/client/assets/{connection-detail-Dq9rhx2O.js → connection-detail-COtd6Ff1.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CHUbN92C.js → connection-form-helpers-BGax9Typ.js} +1 -1
- package/dist/client/assets/{connections-C-e6hoJv.js → connections-Cxr9eDlU.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-AyZ1qfrO.js → create-organization-dialog-B4v62Y0V.js} +1 -1
- package/dist/client/assets/{decofile-api-f5Z3Fh46.js → decofile-api-epQGqIXQ.js} +1 -1
- package/dist/client/assets/{decopilot-DmAS8lky.js → decopilot-D-EmElSn.js} +1 -1
- package/dist/client/assets/{dialog-CDr-V9u8.js → dialog-BbF8R0Rt.js} +1 -1
- package/dist/client/assets/{discover-CRB51pJ_.js → discover-CkgfHo2F.js} +1 -1
- package/dist/client/assets/{domain-settings-gVa1mMOx.js → domain-settings-D5auGtqN.js} +1 -1
- package/dist/client/assets/{download-app-dialog-rP5j-4Hl.js → download-app-dialog-CTBm_E5V.js} +1 -1
- package/dist/client/assets/{drawer-DCRH2Qpg.js → drawer-BBk33oYJ.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CvTP8MXO.js → dropdown-menu-BS01WOe-.js} +1 -1
- package/dist/client/assets/{editor-BXo85dw5.js → editor-DS43SgZS.js} +1 -1
- package/dist/client/assets/{empty-state-0Ti4PZnG.js → empty-state-BFgGw8Jd.js} +1 -1
- package/dist/client/assets/{empty-state-3JGStYdL.js → empty-state-CNNGduB2.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DfDSW6rF.js → extract-connection-data-CulqgUEu.js} +1 -1
- package/dist/client/assets/{feature-gate-_qHluhhA.js → feature-gate-Bjx-4ie7.js} +1 -1
- package/dist/client/assets/{feature-paywall-C0IUXXGE.js → feature-paywall-BFqNEmgI.js} +1 -1
- package/dist/client/assets/{file-explorer-DIqSzJnZ.js → file-explorer-DKmwRzTp.js} +1 -1
- package/dist/client/assets/{file-preview-4BjNg9D7.js → file-preview-ivFLf1WP.js} +1 -1
- package/dist/client/assets/{file-share-button-CKeISPD2.js → file-share-button-DvzGz33j.js} +1 -1
- package/dist/client/assets/{file-type-icon-B5ajUaH0.js → file-type-icon-B-E6HvV1.js} +1 -1
- package/dist/client/assets/{folder-icon-DhN6dyAf.js → folder-icon-Bjly98Qc.js} +1 -1
- package/dist/client/assets/{form-DxDjuvl5.js → form-Cq6wKFPC.js} +1 -1
- package/dist/client/assets/{gateway-client-DboI1W5S.js → gateway-client-BrWtEU1u.js} +1 -1
- package/dist/client/assets/{general-CJYuoUO5.js → general-CbF61Hyu.js} +1 -1
- package/dist/client/assets/{github-icon-D8EPSRUD.js → github-icon--lTAh1jj.js} +1 -1
- package/dist/client/assets/{home-EmaTOsm4.js → home-uOOuFeme.js} +1 -1
- package/dist/client/assets/{hooks-DWxJwjQc.js → hooks-BECLyGBb.js} +1 -1
- package/dist/client/assets/{hooks-Rl0qRFjy.js → hooks-BU6oBSHV.js} +1 -1
- package/dist/client/assets/{index-BoL7Aq4U.js → index-8f5lsphO.js} +1 -1
- package/dist/client/assets/{index-C2k5rbY0.js → index-BOZLd_mz.js} +1 -1
- package/dist/client/assets/{index-Bt0u5D-K.js → index-BSRzECMD.js} +1 -1
- package/dist/client/assets/{index-CLlne17T.js → index-C6mMoKV9.js} +2 -2
- package/dist/client/assets/{index-CGenpwLF.js → index-CAThN-6U.js} +1 -1
- package/dist/client/assets/{index-Cir1rvR_.js → index-CbsAifRT.js} +1 -1
- package/dist/client/assets/{index-BYBuvEpZ.js → index-CexxzinB.js} +1 -1
- package/dist/client/assets/{index-TJxYXD6j.js → index-D-LZ1OFU.js} +1 -1
- package/dist/client/assets/{index-Dy8qHvsj.js → index-D05N9gl5.js} +1 -1
- package/dist/client/assets/{index-Bo7i1ufS.js → index-D7nIUPsf.js} +1 -1
- package/dist/client/assets/{index-1nNyw18J.js → index-DQY7PyCl.js} +1 -1
- package/dist/client/assets/{index-Ccua9zYy.js → index-DWaEFd6i.js} +1 -1
- package/dist/client/assets/{index-Do5lCsEj.js → index-Dnovg-Ty.js} +1 -1
- package/dist/client/assets/{index-DTkDXM1A.js → index-Dq-6H-UD.js} +1 -1
- package/dist/client/assets/{index-Biw-u0ne.js → index-eO9HPkdF.js} +1 -1
- package/dist/client/assets/{index-redirect-C-LJ2IxB.js → index-redirect-BJFYUP0H.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Q0vfsI8m.js → infiniteQueryObserver-8SjYC_ek.js} +1 -1
- package/dist/client/assets/{infra-billing-C3BRkhFd.js → infra-billing-DfO1Oemo.js} +1 -1
- package/dist/client/assets/{input-CP_e0ZMg.js → input-CZquufhh.js} +1 -1
- package/dist/client/assets/{input-DaHZvHYb.js → input-Dm5tdFv-.js} +1 -1
- package/dist/client/assets/{input-dbYO6Ois.js → input-LjvMOQDt.js} +1 -1
- package/dist/client/assets/{integration-icon-Bd7DOoer.js → integration-icon-Xt_LxCp3.js} +1 -1
- package/dist/client/assets/{label-Lvgg69zF.js → label-BdNnPzHo.js} +1 -1
- package/dist/client/assets/{last-preview-page-Dmtdjb2d.js → last-preview-page-BZLtgGkm.js} +1 -1
- package/dist/client/assets/{layout-C0CNJ4xY.js → layout-B1u4t30k.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CfMH707B.js → legacy-agents-deep-H0Rp20sO.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BsB8qBiK.js → legacy-main-redirect-DIKp0kQl.js} +1 -1
- package/dist/client/assets/{library-CMXpCscl.js → library-Dh6WH95I.js} +1 -1
- package/dist/client/assets/{login-BGgwQ8Ty.js → login-hW6Rr0Lp.js} +1 -1
- package/dist/client/assets/{markdown-B0HtiDwM.js → markdown-COVWapDi.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-qnfatYvU.js → mcp-app-renderer-CI5q52w8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BKPj-D9q.js → mcp-oauth-DZAKWi1a.js} +1 -1
- package/dist/client/assets/{members-DEVgt_I_.js → members-BgKBsFZn.js} +1 -1
- package/dist/client/assets/{message-templates-Db9KMnea.js → message-templates-DniWMJBm.js} +1 -1
- package/dist/client/assets/{mini-report-page-BiDLml8V.js → mini-report-page-DsuczQQS.js} +1 -1
- package/dist/client/assets/{mock-board-DE899Anf.js → mock-board-C8czbdf7.js} +3 -3
- package/dist/client/assets/{monaco-editor-DI4bGJ1L.js → monaco-editor-BoDXf1bj.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C-A-ogsB.js → monitoring-stats-row-ChtEPHtm.js} +1 -1
- package/dist/client/assets/{multi-select-D7KHOgJh.js → multi-select-D7hN0Qm5.js} +1 -1
- package/dist/client/assets/{mustache-D0PR-jG1.js → mustache-DX19G3kt.js} +1 -1
- package/dist/client/assets/{oauth-callback-BU4_oSma.js → oauth-callback-BZE2EwPT.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DTD6AsuQ.js → oauth-callback-ai-provider-sipE83AE.js} +1 -1
- package/dist/client/assets/{onboarding-hmcqGfvZ.js → onboarding-CiPKh68r.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CwCqyNNZ.js → optimistic-project-sidebar-views-ZTcPooMv.js} +1 -1
- package/dist/client/assets/{organization-choice-Dmu0-74y.js → organization-choice-D-oi84RO.js} +1 -1
- package/dist/client/assets/{orgs-DrLboKbj.js → orgs-DRAiPJB7.js} +1 -1
- package/dist/client/assets/{page-seo-form-CPacwdAv.js → page-seo-form-BuUhQyS6.js} +1 -1
- package/dist/client/assets/{pair-CEyOVwXU.js → pair-BSoDGPcF.js} +1 -1
- package/dist/client/assets/{plan-ladder-D0ghMEom.js → plan-ladder-BasR5sqC.js} +1 -1
- package/dist/client/assets/{popover-CvNYvXj5.js → popover-DsPp8JNb.js} +1 -1
- package/dist/client/assets/{post-calendar-12hOW48s.js → post-calendar-DYJg8aHS.js} +1 -1
- package/dist/client/assets/{post-editor-Bx6vNsJq.js → post-editor-uz9JDFPY.js} +1 -1
- package/dist/client/assets/{preview-content-DSrgT3Dg.js → preview-content-WSVxEL_f.js} +1 -1
- package/dist/client/assets/{preview-dialog-BigpJ-wP.js → preview-dialog-C7MVz9-R.js} +1 -1
- package/dist/client/assets/{primitives-CYYl5pry.js → primitives-7kD9L60b.js} +1 -1
- package/dist/client/assets/{profile-DSIrGgr7.js → profile-BXsHvHMb.js} +1 -1
- package/dist/client/assets/{project-app-view-CxnHBgZr.js → project-app-view-CjrslCgD.js} +1 -1
- package/dist/client/assets/{project-feed-DYdRscqS.js → project-feed-C4HxbzNr.js} +1 -1
- package/dist/client/assets/{project-icon-W8WrTXup.js → project-icon-DZXi7sAH.js} +1 -1
- package/dist/client/assets/project-reports-CNKYAaup.js +1 -0
- package/dist/client/assets/project-tasks-CMDg0YDK.js +1 -0
- package/dist/client/assets/{prompts-Dxmn6DzV.js → prompts-BoViURa3.js} +1 -1
- package/dist/client/assets/record-editor-D8q1_FVg.js +1 -0
- package/dist/client/assets/{redirect-editor-BicSD98z.js → redirect-editor-urSJYZih.js} +1 -1
- package/dist/client/assets/registry-CfKndDp8.js +2 -0
- package/dist/client/assets/{registry-layout-SAOVarb5.js → registry-layout-DnAQGV3j.js} +1 -1
- package/dist/client/assets/reports-BQYFQSFf.js +1 -0
- package/dist/client/assets/{reports-vY0C9O6P.js → reports-ILQ519eV.js} +1 -1
- package/dist/client/assets/{reports-tab-L9i_aDYL.js → reports-tab-BHiPO-Yt.js} +2 -2
- package/dist/client/assets/{repositories-CfMNwm6d.js → repositories-BQcksodE.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Dj8ScZou.js → repository-import-picker-DysBPsrE.js} +1 -1
- package/dist/client/assets/{repository-picker-Bu500wwQ.js → repository-picker-DJL8W4-t.js} +1 -1
- package/dist/client/assets/{require-capability-w06E-xRt.js → require-capability-B2v3wdWj.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CClBZN5w.js → required-auth-layout-CIegJY7n.js} +1 -1
- package/dist/client/assets/{reset-password-D5reLCMr.js → reset-password-Cv_pw9qG.js} +1 -1
- package/dist/client/assets/{resizable-BEe23Qjj.js → resizable-DrI2TVoh.js} +1 -1
- package/dist/client/assets/{review-settings-Bzb1wEUt.js → review-settings-DsMk5rhJ.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-D9zHtwKH.js → rich-text-link-control-Bh8SMhbX.js} +1 -1
- package/dist/client/assets/{roles-BYxRS6nZ.js → roles-BaQnKFl-.js} +1 -1
- package/dist/client/assets/{route-Fz81W799.js → route-B51TExGQ.js} +1 -1
- package/dist/client/assets/{route-C0b8KT9l.js → route-CDvOzABP.js} +1 -1
- package/dist/client/assets/{route-Bli9iRli.js → route-CV4jYjd5.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-Cf0uletx.js → runnable-block-editor-Bd1lE8Yl.js} +3 -3
- package/dist/client/assets/{sandbox-lifecycle-context-D2W8d_qX.js → sandbox-lifecycle-context-D0cxi8em.js} +1 -1
- package/dist/client/assets/{schema-Brgh1n5m.js → schema-WP2X1X1Z.js} +1 -1
- package/dist/client/assets/{scroll-area-zDkh0OU8.js → scroll-area-B5uAtJE9.js} +1 -1
- package/dist/client/assets/{search-input-CLI3bW2v.js → search-input-vrIAmgoh.js} +1 -1
- package/dist/client/assets/{secrets-BhfHpWkv.js → secrets-CDE7HDDb.js} +1 -1
- package/dist/client/assets/{sections-editor-BwtdYc1z.js → sections-editor-rEdLlc_u.js} +1 -1
- package/dist/client/assets/{select-dS1ZvUUC.js → select-DPtaqnbY.js} +1 -1
- package/dist/client/assets/{select-model-B-XEXZYZ.js → select-model-GkNjuCgL.js} +1 -1
- package/dist/client/assets/{seo-editor-BOejkPTg.js → seo-editor-BySdX6vM.js} +1 -1
- package/dist/client/assets/{settings-tab-0wITPKID.js → settings-tab-DWyBmp9C.js} +1 -1
- package/dist/client/assets/{sheet-D8oc8gwN.js → sheet-7dqWERZ-.js} +1 -1
- package/dist/client/assets/{shell-layout-ZE4ZeZq_.js → shell-layout-DlWVwnY3.js} +1 -1
- package/dist/client/assets/{sidebar-DulDmOuQ.js → sidebar-CSLIo5wG.js} +1 -1
- package/dist/client/assets/{skill-preview-C43g2jxT.js → skill-preview-CLQ6hpRU.js} +1 -1
- package/dist/client/assets/{skills-Du2wIHgh.js → skills-B0DlqgoY.js} +1 -1
- package/dist/client/assets/{sso-Cw7-rQ6R.js → sso-Dv7aOBLL.js} +1 -1
- package/dist/client/assets/{store-D_25PptJ.js → store-Sh4jPZ0Y.js} +1 -1
- package/dist/client/assets/store-registry-pejOBHcx.js +2 -0
- package/dist/client/assets/{switch-BJDpH17-.js → switch-CEhYE68G.js} +1 -1
- package/dist/client/assets/{synced-repos-f5wwGE-G.js → synced-repos-_Nkfv1T8.js} +1 -1
- package/dist/client/assets/{table-CzYba_wo.js → table-D5pPenOV.js} +1 -1
- package/dist/client/assets/{tabs-BH0t-Qit.js → tabs-C7ptBuB8.js} +1 -1
- package/dist/client/assets/{task-board-DlaQdjME.js → task-board-D_f-LuAE.js} +1 -1
- package/dist/client/assets/{task-route-BLgjDNsc.js → task-route-DyX9s2aH.js} +1 -1
- package/dist/client/assets/{task-status-B6cn6__r.js → task-status-DAaJYuJC.js} +1 -1
- package/dist/client/assets/{tasks-DyFKgkmx.js → tasks-BYBzCFtN.js} +1 -1
- package/dist/client/assets/tasks-Dsb1PXv5.js +1 -0
- package/dist/client/assets/{textarea-BztNtiTQ.js → textarea-BPcKOU7a.js} +1 -1
- package/dist/client/assets/{thread-intent-DzYbKhDO.js → thread-intent-CqreAI8n.js} +1 -1
- package/dist/client/assets/{thread-route-CTWLcToH.js → thread-route-DNVTuSKD.js} +1 -1
- package/dist/client/assets/{thread-route-CHuHE7Ay.js → thread-route-DxXQ46K1.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-HNIw97fV.js → thread-sheet-body-B21HbiTN.js} +1 -1
- package/dist/client/assets/{toggle-group-DHEZ824d.js → toggle-group-_I41ei63.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-SyfxXpxQ.js → toolbar-icon-button-BhlTbEE9.js} +1 -1
- package/dist/client/assets/{tooltip-Cg0iEw6_.js → tooltip-CYhjJgVA.js} +1 -1
- package/dist/client/assets/{track-CiOLlkxc.js → track-CWiVykNy.js} +1 -1
- package/dist/client/assets/{types-BQ0XHiBr.js → types-Bgn578U0.js} +1 -1
- package/dist/client/assets/{usage-stats-BHRSI5Ar.js → usage-stats-lU60GCl7.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DXXr4ex9.js → use-ai-providers-Cotfg7SS.js} +1 -1
- package/dist/client/assets/{use-automations-CtSWH9Gm.js → use-automations-BWbEauvr.js} +1 -1
- package/dist/client/assets/{use-autosave-CLkEbl1C.js → use-autosave-DWTyxx6Q.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-DSqBK8vF.js → use-commerce-diagnostic-ByTG1aVP.js} +1 -1
- package/dist/client/assets/{use-connect-companion-D42lIu9-.js → use-connect-companion-C5E889gV.js} +1 -1
- package/dist/client/assets/{use-connection-DnMnsTE-.js → use-connection-TGwBsBZ6.js} +1 -1
- package/dist/client/assets/{use-copy-ya7aFfBC.js → use-copy-D7Iw1LrJ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DEQ3sE6r.js → use-create-virtual-mcp-DmXpf3QG.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-m9kXRT36.js → use-date-fns-locale-rgfXEg1T.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BWXcEqzZ.js → use-debounced-autosave-BZKMq5sx.js} +1 -1
- package/dist/client/assets/{use-debounced-value-FVaTkLaF.js → use-debounced-value-DGsEitJX.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DWdd9zLS.js → use-deco-credits-zGfUt8ra.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BCNV6ibO.js → use-decopilot-events-QHgLexrJ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-YAR5H2YF.js → use-delete-connection-D4tGHNgD.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-B_U4o3d8.js → use-deployment-admin-C8IvUlh8.js} +1 -1
- package/dist/client/assets/{use-entitlements-CVFQAC4Y.js → use-entitlements-B4c1c87k.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BNr78t_k.js → use-fast-preview-draft-url-eUMqGqhz.js} +1 -1
- package/dist/client/assets/{use-file-configs-CL8MhWZX.js → use-file-configs-5YZVd1Le.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BE00Qe2y.js → use-infinite-scroll-BcvDIGP6.js} +1 -1
- package/dist/client/assets/{use-join-requests-BfYhVugX.js → use-join-requests-BkX600q-.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-jGwhFlPh.js → use-main-panel-tabs-BHJmXQos.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dGV2RcmM.js → use-mcp-auth-status-CDs5_VuQ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B-bmV-eU.js → use-mcp-client-B8avk6p1.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DwCio0Xs.js → use-mcp-prompts-C35IeKKU.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CaJdkF9p.js → use-mcp-tools-BX_9PtQS.js} +1 -1
- package/dist/client/assets/{use-members-Dy9zZpXX.js → use-members-DpENbm_3.js} +1 -1
- package/dist/client/assets/{use-mobile-DmHecFjh.js → use-mobile-RHIQOVil.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DE31VYsQ.js → use-navigate-to-agent-BsGybLOl.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BHFODZxq.js → use-open-billing-url-V4LAVsZZ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DuCptBd8.js → use-org-auth-client-WNBip5me.js} +1 -1
- package/dist/client/assets/{use-org-fs-aqzk40Pl.js → use-org-fs-Dvfg7DBA.js} +1 -1
- package/dist/client/assets/{use-org-notice-CPsPmLRD.js → use-org-notice-BDJtNsoi.js} +1 -1
- package/dist/client/assets/{use-org-sso-D8APIoa8.js → use-org-sso-B_DIN1FR.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CNPGuhUA.js → use-organization-roles-C44BiWk2.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CKJ6hB3u.js → use-organization-settings-D0M2z89A.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-D0KroJxZ.js → use-panel-navigate-VJU3jAVP.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-SUH-E6N_.js → use-project-native-view-presence-DsW3Hqqc.js} +1 -1
- package/dist/client/assets/{use-project-scope-BzLiG5Sw.js → use-project-scope-BCYsjRUp.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Byi4BCrC.js → use-registry-connections-C1VQdjvR.js} +1 -1
- package/dist/client/assets/{use-releases-DZzTh-C4.js → use-releases-BRVhx5jV.js} +1 -1
- package/dist/client/assets/{use-route-default-main-L5fisYjs.js → use-route-default-main-D5obmIIM.js} +1 -1
- package/dist/client/assets/{use-secrets-BAMuePEI.js → use-secrets-CmMeSYxT.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BOQVHncG.js → use-section-preview-base-DxAPy40-.js} +1 -1
- package/dist/client/assets/{use-session-runtime-DXY6Lube.js → use-session-runtime-Dl206Bga.js} +1 -1
- package/dist/client/assets/{use-tags-B7zGz5EU.js → use-tags-Bx2BF4Ke.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CVUabh4r.js → use-task-metadata-2SHzp2HZ.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-3ycn6tX8.js → use-thread-outputs-TjNPQ11p.js} +1 -1
- package/dist/client/assets/{use-view-mode-CcO0vm3d.js → use-view-mode-CxLDv3cx.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-oRiYDLbO.js → use-virtual-mcp-2feYNqBo.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Br9KmFLf.js +1 -0
- package/dist/client/assets/{useQueries-DETG9PJR.js → useQueries-Bq52TmOw.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-zJ2PG_QY.js +1 -0
- package/dist/client/assets/{users-CMAbB3Qz.js → users-Cmnw5TH5.js} +1 -1
- package/dist/client/assets/{utils-DuFbetE2.js → utils-DUD_ZrVn.js} +1 -1
- package/dist/client/assets/{variant-calendar-CknIseH6.js → variant-calendar-BcGUj9x1.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-JFVRJ7oL.js → variant-matcher-override-CMpCnI5C.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B2YdDaMp.js → view-mode-toggle-C5wJufOT.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C4_P0xXR.js → virtual-mcp-DCGU1nRB.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DGCD93Vx.js +0 -1
- package/dist/client/assets/agent-deck-CyvSbus-.js +0 -1
- package/dist/client/assets/agent-file-CXkQKVDt.js +0 -1
- package/dist/client/assets/agent-library-file-DW8DzCgD.js +0 -1
- package/dist/client/assets/agent-settings-mefV_YtU.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DD5tKDCm.js +0 -2
- package/dist/client/assets/agent-view-ebzx1vyF.js +0 -1
- package/dist/client/assets/api-keys-DhuHR0tx.js +0 -1
- package/dist/client/assets/app-editor-CaGUmHu7.js +0 -1
- package/dist/client/assets/category-editor-DJs_8pc1.js +0 -1
- package/dist/client/assets/project-reports-CVNdDbXr.js +0 -1
- package/dist/client/assets/project-tasks-De-26kaC.js +0 -1
- package/dist/client/assets/record-editor-b-fde42v.js +0 -1
- package/dist/client/assets/registry-BN9FgxEJ.js +0 -2
- package/dist/client/assets/reports-CI88jReb.js +0 -1
- package/dist/client/assets/store-registry-DTZL5u8o.js +0 -2
- package/dist/client/assets/tasks-wsieNYYy.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BquFrdik.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-430FeaXt.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as oo,r as H,b as rc,ac as Lf,j as D,h as $f,B as rl,ab as il,aa as zf,ad as Bf,d_ as ic,d$ as Ff,aw as Hf,dH as Vt,e0 as Vf,l as sc}from"./index-CLlne17T.js";import{d as jf,g as Wf}from"./gateway-client-DboI1W5S.js";import{d as Kf,c as Uf,e as _f,b as qf,D as Jf}from"./dialog-CDr-V9u8.js";import{a as Gf,F as Yf,b as Xf,c as Qf,d as Zf,f as eh}from"./form-DxDjuvl5.js";import{I as th}from"./input-CP_e0ZMg.js";import{t as sl}from"./utils-CVEq3hMx.js";import{T as nh,a as rh,c as ih}from"./tooltip-Cg0iEw6_.js";function sh(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?il().min(1,e):il();return zf(n)}function oh(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function cx(t){const e=oo.c(74),{prompt:n,setPrompt:r,onSubmit:i,defaultValues:s}=t,o=H.useId(),l=rc();let a,c;if(e[0]!==n||e[1]!==l){const ce=sh(n,l("chat.dialogPromptArguments.required"));c=Bf,a=Lf(ce),e[0]=n,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==s||e[5]!==n?(u=n?oh(n,s):{},e[4]=s,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==i||e[14]!==r?(g=async ce=>{await i(ce),r(null),f.reset()},e[12]=f,e[13]=i,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ce=>{ce||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!n)return null;let S;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(S=n.title||jf(n.name,Wf(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=S):S=e[22];let C;e[23]!==S?(C=D.jsx(Kf,{children:D.jsx("span",{className:"capitalize",children:S})}),e[23]=S,e[24]=C):C=e[24];let v;e[25]!==n.description?(v=n.description&&D.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=v):v=e[26];let R;e[27]!==v||e[28]!==C?(R=D.jsxs(Uf,{children:[C,v]}),e[27]=v,e[28]=C,e[29]=R):R=e[29];let w;e[30]!==f||e[31]!==m?(w=ce=>{ce.stopPropagation(),f.handleSubmit(m)(ce)},e[30]=f,e[31]=m,e[32]=w):w=e[32];let N;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let ce;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ce=Yt=>D.jsx(Yf,{control:f.control,name:Yt.name,render:Pf=>{const{field:nl}=Pf;return D.jsxs(Xf,{children:[D.jsxs(Qf,{className:"text-xs",children:[Yt.name,Yt.required?null:D.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),D.jsx(Zf,{children:D.jsx(th,{...nl,value:nl.value??"",required:Yt.required,placeholder:Yt.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),D.jsx(eh,{})]})}},Yt.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ce):ce=e[41],N=p.map(ce),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=N}else N=e[37];let I;e[42]!==b?(I=()=>b(!1),e[42]=b,e[43]=I):I=e[43];const Z=f.formState.isSubmitting;let le;e[44]!==l?(le=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=le):le=e[45];let ae;e[46]!==f.formState.isSubmitting||e[47]!==I||e[48]!==le?(ae=D.jsx(rl,{type:"button",variant:"ghost",onClick:I,disabled:Z,children:le}),e[46]=f.formState.isSubmitting,e[47]=I,e[48]=le,e[49]=ae):ae=e[49];let V;e[50]!==f.formState.isSubmitting||e[51]!==l?(V=f.formState.isSubmitting?D.jsxs("span",{className:"flex items-center gap-2",children:[D.jsx($f,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=V):V=e[52];let q;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==V?(q=D.jsx(rl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:V}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=V,e[56]=q):q=e[56];let z;e[57]!==ae||e[58]!==q?(z=D.jsxs(_f,{children:[ae,q]}),e[57]=ae,e[58]=q,e[59]=z):z=e[59];let J;e[60]!==o||e[61]!==w||e[62]!==N||e[63]!==z?(J=D.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:w,children:[N,z]}),e[60]=o,e[61]=w,e[62]=N,e[63]=z,e[64]=J):J=e[64];let Oe;e[65]!==f||e[66]!==J?(Oe=D.jsx(Gf,{...f,children:J}),e[65]=f,e[66]=J,e[67]=Oe):Oe=e[67];let he;e[68]!==R||e[69]!==Oe?(he=D.jsxs(qf,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[R,Oe]}),e[68]=R,e[69]=Oe,e[70]=he):he=e[70];let Et;return e[71]!==b||e[72]!==he?(Et=D.jsx(Jf,{open:!0,onOpenChange:b,children:he}),e[71]=b,e[72]=he,e[73]=Et):Et=e[73],Et}var ol=Object.defineProperty,lh=(t,e)=>{let n={};for(var r in t)ol(n,r,{get:t[r],enumerable:!0});return ol(n,Symbol.toStringTag,{value:"Module"}),n};function re(t){this.content=t}re.prototype={constructor:re,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new re(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new re(n)},addToStart:function(t,e){return new re([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new re(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new re(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=re.from(t),t.size?new re(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=re.from(t),t.size?new re(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=re.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};re.from=function(t){if(t instanceof re)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new re(e)};function oc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)n++;return a&&a<o.length&&a<l.length&&cc(o.charCodeAt(a-1))&&ac(o.charCodeAt(a))&&n--,n}if(i.content.size||s.content.size){let o=oc(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function lc(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&cc(c.charCodeAt(d-1))&&ac(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||l.content.size){let c=lc(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}function ac(t){return t>=56320&&t<57344}function cc(t){return t>=55296&&t<56320}class k{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return oc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return lc(this,e,n,r)}findIndex(e){if(e==0)return gr(0,e);if(e==this.size)return gr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?gr(n+1,s):gr(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new k(n||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Wi={index:0,offset:0};function gr(t,e){return Wi.index=t,Wi.offset=e,Wi}function Lr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Lr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Lr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $=class ks{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Lr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ks.none;if(e instanceof ks)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$.none=[];class Jn extends Error{}class M{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=dc(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,n){return new M(uc(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return M.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new M(e,r,i)}}M.empty=new M(k.empty,0,0);function uc(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(uc(s.content,e-i-1,n-i-1)))}function dc(t,e,n,r,i,s){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=dc(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function ah(t,e,n){if(n.openStart>t.depth)throw new Jn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Jn("Inconsistent open depths");return fc(t,e,n,0)}function fc(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=fc(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Pt(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=ch(n,t);return Pt(s,pc(t,o,l,e,r))}else return Pt(s,$r(t,e,r))}function hc(t,e){if(!e.type.compatibleContent(t.type))throw new Jn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ss(t,e,n){let r=t.node(n);return hc(r,e.node(n)),r}function It(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function In(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(It(t.nodeAfter,r),s++));for(let l=s;l<o;l++)It(i.child(l),r);e&&e.depth==n&&e.textOffset&&It(e.nodeBefore,r)}function Pt(t,e){if(!t.type.validContent(e))throw new Jn("Invalid content for node "+t.type.name);return t.copy(e)}function pc(t,e,n,r,i){let s=t.depth>i&&Ss(t,e,i+1),o=r.depth>i&&Ss(n,r,i+1),l=[];return In(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(hc(s,o),It(Pt(s,pc(t,e,n,r,i+1)),l)):(s&&It(Pt(s,$r(t,e,i+1)),l),In(e,n,i,l),o&&It(Pt(o,$r(n,r,i+1)),l)),In(r,null,i,l),new k(l)}function $r(t,e,n){let r=[];if(In(null,t,n,r),t.depth>n){let i=Ss(t,e,n+1);It(Pt(i,$r(t,e,n+1)),r)}return In(e,null,n,r),new k(r)}function ch(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Gn{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new zr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new Gn(n,r,s)}static resolveCached(e,n){let r=ll.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else ll.set(e,r=new uh);let i=r.elts[r.i]=Gn.resolve(e,n);return r.i=(r.i+1)%dh,i}}class uh{constructor(){this.elts=[],this.i=0}}const dh=12,ll=new WeakMap;class zr{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const fh=Object.create(null);let Lt=class xs{constructor(e,n,r,i=$.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Lr(this.attrs,n||e.defaultAttrs||fh)&&$.sameSet(this.marks,r||$.none)}copy(e=null){return e==this.content?this:new xs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new xs(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new M(c,i.depth-o,s.depth-o)}replace(e,n,r){return ah(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Gn.resolveCached(this,e)}resolveNoCache(e){return Gn.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),mc(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Lt.prototype.text=void 0;class Br extends Lt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Br(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Br(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function mc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class jt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new hh(e,n);if(r.next==null)return jt.empty;let i=gc(r);r.next&&r.err("Unexpected trailing text");let s=Sh(kh(i));return xh(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
1
|
+
import{c as oo,r as H,b as rc,ac as Lf,j as D,h as $f,B as rl,ab as il,aa as zf,ad as Bf,d_ as ic,d$ as Ff,aw as Hf,dH as Vt,e0 as Vf,l as sc}from"./index-C6mMoKV9.js";import{d as jf,g as Wf}from"./gateway-client-BrWtEU1u.js";import{d as Kf,c as Uf,e as _f,b as qf,D as Jf}from"./dialog-BbF8R0Rt.js";import{a as Gf,F as Yf,b as Xf,c as Qf,d as Zf,f as eh}from"./form-Cq6wKFPC.js";import{I as th}from"./input-CZquufhh.js";import{t as sl}from"./utils-CVEq3hMx.js";import{T as nh,a as rh,c as ih}from"./tooltip-CYhjJgVA.js";function sh(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?il().min(1,e):il();return zf(n)}function oh(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function cx(t){const e=oo.c(74),{prompt:n,setPrompt:r,onSubmit:i,defaultValues:s}=t,o=H.useId(),l=rc();let a,c;if(e[0]!==n||e[1]!==l){const ce=sh(n,l("chat.dialogPromptArguments.required"));c=Bf,a=Lf(ce),e[0]=n,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==s||e[5]!==n?(u=n?oh(n,s):{},e[4]=s,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==i||e[14]!==r?(g=async ce=>{await i(ce),r(null),f.reset()},e[12]=f,e[13]=i,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ce=>{ce||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!n)return null;let S;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(S=n.title||jf(n.name,Wf(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=S):S=e[22];let C;e[23]!==S?(C=D.jsx(Kf,{children:D.jsx("span",{className:"capitalize",children:S})}),e[23]=S,e[24]=C):C=e[24];let v;e[25]!==n.description?(v=n.description&&D.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=v):v=e[26];let R;e[27]!==v||e[28]!==C?(R=D.jsxs(Uf,{children:[C,v]}),e[27]=v,e[28]=C,e[29]=R):R=e[29];let w;e[30]!==f||e[31]!==m?(w=ce=>{ce.stopPropagation(),f.handleSubmit(m)(ce)},e[30]=f,e[31]=m,e[32]=w):w=e[32];let N;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let ce;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ce=Yt=>D.jsx(Yf,{control:f.control,name:Yt.name,render:Pf=>{const{field:nl}=Pf;return D.jsxs(Xf,{children:[D.jsxs(Qf,{className:"text-xs",children:[Yt.name,Yt.required?null:D.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),D.jsx(Zf,{children:D.jsx(th,{...nl,value:nl.value??"",required:Yt.required,placeholder:Yt.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),D.jsx(eh,{})]})}},Yt.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ce):ce=e[41],N=p.map(ce),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=N}else N=e[37];let I;e[42]!==b?(I=()=>b(!1),e[42]=b,e[43]=I):I=e[43];const Z=f.formState.isSubmitting;let le;e[44]!==l?(le=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=le):le=e[45];let ae;e[46]!==f.formState.isSubmitting||e[47]!==I||e[48]!==le?(ae=D.jsx(rl,{type:"button",variant:"ghost",onClick:I,disabled:Z,children:le}),e[46]=f.formState.isSubmitting,e[47]=I,e[48]=le,e[49]=ae):ae=e[49];let V;e[50]!==f.formState.isSubmitting||e[51]!==l?(V=f.formState.isSubmitting?D.jsxs("span",{className:"flex items-center gap-2",children:[D.jsx($f,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=V):V=e[52];let q;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==V?(q=D.jsx(rl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:V}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=V,e[56]=q):q=e[56];let z;e[57]!==ae||e[58]!==q?(z=D.jsxs(_f,{children:[ae,q]}),e[57]=ae,e[58]=q,e[59]=z):z=e[59];let J;e[60]!==o||e[61]!==w||e[62]!==N||e[63]!==z?(J=D.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:w,children:[N,z]}),e[60]=o,e[61]=w,e[62]=N,e[63]=z,e[64]=J):J=e[64];let Oe;e[65]!==f||e[66]!==J?(Oe=D.jsx(Gf,{...f,children:J}),e[65]=f,e[66]=J,e[67]=Oe):Oe=e[67];let he;e[68]!==R||e[69]!==Oe?(he=D.jsxs(qf,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[R,Oe]}),e[68]=R,e[69]=Oe,e[70]=he):he=e[70];let Et;return e[71]!==b||e[72]!==he?(Et=D.jsx(Jf,{open:!0,onOpenChange:b,children:he}),e[71]=b,e[72]=he,e[73]=Et):Et=e[73],Et}var ol=Object.defineProperty,lh=(t,e)=>{let n={};for(var r in t)ol(n,r,{get:t[r],enumerable:!0});return ol(n,Symbol.toStringTag,{value:"Module"}),n};function re(t){this.content=t}re.prototype={constructor:re,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new re(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new re(n)},addToStart:function(t,e){return new re([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new re(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new re(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=re.from(t),t.size?new re(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=re.from(t),t.size?new re(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=re.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};re.from=function(t){if(t instanceof re)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new re(e)};function oc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)n++;return a&&a<o.length&&a<l.length&&cc(o.charCodeAt(a-1))&&ac(o.charCodeAt(a))&&n--,n}if(i.content.size||s.content.size){let o=oc(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function lc(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&cc(c.charCodeAt(d-1))&&ac(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||l.content.size){let c=lc(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}function ac(t){return t>=56320&&t<57344}function cc(t){return t>=55296&&t<56320}class k{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return oc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return lc(this,e,n,r)}findIndex(e){if(e==0)return gr(0,e);if(e==this.size)return gr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?gr(n+1,s):gr(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new k(n||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Wi={index:0,offset:0};function gr(t,e){return Wi.index=t,Wi.offset=e,Wi}function Lr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Lr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Lr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $=class ks{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Lr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ks.none;if(e instanceof ks)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$.none=[];class Jn extends Error{}class M{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=dc(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,n){return new M(uc(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return M.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new M(e,r,i)}}M.empty=new M(k.empty,0,0);function uc(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(uc(s.content,e-i-1,n-i-1)))}function dc(t,e,n,r,i,s){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=dc(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function ah(t,e,n){if(n.openStart>t.depth)throw new Jn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Jn("Inconsistent open depths");return fc(t,e,n,0)}function fc(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=fc(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Pt(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=ch(n,t);return Pt(s,pc(t,o,l,e,r))}else return Pt(s,$r(t,e,r))}function hc(t,e){if(!e.type.compatibleContent(t.type))throw new Jn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ss(t,e,n){let r=t.node(n);return hc(r,e.node(n)),r}function It(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function In(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(It(t.nodeAfter,r),s++));for(let l=s;l<o;l++)It(i.child(l),r);e&&e.depth==n&&e.textOffset&&It(e.nodeBefore,r)}function Pt(t,e){if(!t.type.validContent(e))throw new Jn("Invalid content for node "+t.type.name);return t.copy(e)}function pc(t,e,n,r,i){let s=t.depth>i&&Ss(t,e,i+1),o=r.depth>i&&Ss(n,r,i+1),l=[];return In(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(hc(s,o),It(Pt(s,pc(t,e,n,r,i+1)),l)):(s&&It(Pt(s,$r(t,e,i+1)),l),In(e,n,i,l),o&&It(Pt(o,$r(n,r,i+1)),l)),In(r,null,i,l),new k(l)}function $r(t,e,n){let r=[];if(In(null,t,n,r),t.depth>n){let i=Ss(t,e,n+1);It(Pt(i,$r(t,e,n+1)),r)}return In(e,null,n,r),new k(r)}function ch(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Gn{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new zr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new Gn(n,r,s)}static resolveCached(e,n){let r=ll.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else ll.set(e,r=new uh);let i=r.elts[r.i]=Gn.resolve(e,n);return r.i=(r.i+1)%dh,i}}class uh{constructor(){this.elts=[],this.i=0}}const dh=12,ll=new WeakMap;class zr{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const fh=Object.create(null);let Lt=class xs{constructor(e,n,r,i=$.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Lr(this.attrs,n||e.defaultAttrs||fh)&&$.sameSet(this.marks,r||$.none)}copy(e=null){return e==this.content?this:new xs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new xs(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new M(c,i.depth-o,s.depth-o)}replace(e,n,r){return ah(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Gn.resolveCached(this,e)}resolveNoCache(e){return Gn.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),mc(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Lt.prototype.text=void 0;class Br extends Lt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Br(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Br(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function mc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class jt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new hh(e,n);if(r.next==null)return jt.empty;let i=gc(r);r.next&&r.err("Unexpected trailing text");let s=Sh(kh(i));return xh(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
2
2
|
`)}}jt.empty=new jt(!0);class hh{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function gc(t){let e=[];do e.push(ph(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function ph(t){let e=[];do e.push(mh(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function mh(t){let e=bh(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=gh(t,e);else break;return e}function al(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function gh(t,e){let n=al(t),r=n;return t.eat(",")&&(t.next!="}"?r=al(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function yh(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function bh(t){if(t.eat("(")){let e=gc(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=yh(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function kh(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=n())}else if(o.type=="star"){let a=n();return r(l,a),i(s(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return i(s(o.expr,l),a),i(s(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=n();i(s(o.expr,a),u),a=u}if(o.max==-1)i(s(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=n();r(a,u),i(s(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function yc(t,e){return e-t}function cl(t,e){let n=[];return r(e),n.sort(yc);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&n.indexOf(a)==-1&&r(a)}}}function Sh(t){let e=Object.create(null);return n(cl(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<i.length;u++)i[u][0]==l&&(c=i[u][1]);cl(t,a).forEach(u=>{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new jt(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(yc);s.next.push({type:i[o][0],next:e[l.join(",")]||n(l)})}return s}}function xh(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:a,next:c}=i.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function bc(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function kc(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Sc(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function xc(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Mh(t,r,e[r]);return n}let ul=class Cc{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=xc(e,r.attrs),this.defaultAttrs=bc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==jt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:kc(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Lt(this,this.computeAttrs(e),k.from(n),$.setFrom(r))}createChecked(e=null,n,r){return n=k.from(n),this.checkContent(n),new Lt(this,this.computeAttrs(e),n,$.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=k.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(k.empty,!0);return s?new Lt(this,e,n.append(s),$.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Sc(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:$.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Cc(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ch(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Mh{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ch(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class vi{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=xc(e,i.attrs),this.excluded=null;let s=bc(this.attrs);this.instance=s?new $(this,s):null}create(e=null){return!e&&this.instance?this.instance:new $(this,kc(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new vi(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Sc(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Mc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=re.from(e.nodes),n.marks=re.from(e.marks||{}),this.nodes=ul.compile(this.spec.nodes,this),this.marks=vi.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=jt.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?dl(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:dl(this,o.split(" "))}this.nodeFromJSON=i=>Lt.fromJSON(this,i),this.markFromJSON=i=>$.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ul){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Br(r,r.defaultAttrs,e,$.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function dl(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let l in t.marks){let a=t.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Eh(t){return t.tag!=null}function Th(t){return t.style!=null}class Fe{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Eh(i))this.tags.push(i);else if(Th(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new hl(this,n,!1);return r.addAll(e,$.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new hl(this,n,!0);return r.addAll(e,$.none,n.from,n.to),M.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Ah(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=pl(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=pl(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Fe(e,Fe.schemaRules(e)))}}const Ec={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},wh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tc={ol:!0,ul:!0},Yn=1,Cs=2,Pn=4;function fl(t,e,n){return e!=null?(e?Yn:0)|(e==="full"?Cs:0):t&&t.whitespace=="pre"?Yn|Cs:n&~Pn}class yr{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=$.none,this.match=s||(o&Pn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(k.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Yn)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=k.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ec.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class hl{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=fl(null,n.preserveWhitespace,0)|(r?Pn:0);i?s=new yr(i.type,i.attrs,$.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new yr(null,null,$.none,!0,null,o):s=new yr(e.schema.topNodeType,null,$.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&Cs?"full":this.localPreserveWS||(i.options&Yn)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Tc.hasOwnProperty(o)&&this.parser.normalizeLists&&vh(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:wh.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Ec.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=a&&a.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=$.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):ml(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=fl(e,s,o.options);o.options&Pn&&o.content.length==0&&(l|=Pn);let a=$.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):ml(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new yr(e,n,a,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Yn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function vh(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Tc.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Ah(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function pl(t){let e={};for(let n in t)e[n]=t[n];return e}function ml(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class et{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=br(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,n);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return br(n).createTextNode(e.text);let{dom:r,contentDOM:i}=Or(br(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Or(br(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:Or(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new et(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=gl(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return gl(e.marks)}}function gl(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function br(t){return t.document||window.document}const yl=new WeakMap;function Nh(t){let e=yl.get(t);return e===void 0&&yl.set(t,e=Oh(t)),e}function Oh(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Or(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Nh(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let l,a=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(t.createTextNode(f));else{let{dom:h,contentDOM:p}=Or(t,f,n,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const wc=65535,vc=Math.pow(2,16);function Dh(t,e){return t+e*vc}function bl(t){return t&wc}function Rh(t){return(t-(t&wc))/vc}const Ac=1,Nc=2,Dr=4,Oc=8;class Ms{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Oc)>0}get deletedBefore(){return(this.delInfo&(Ac|Dr))>0}get deletedAfter(){return(this.delInfo&(Nc|Dr))>0}get deletedAcross(){return(this.delInfo&Dr)>0}}class xe{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&xe.empty)return xe.empty}recover(e){let n=0,r=bl(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Rh(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let c=this.ranges[l+s],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,h=a+i+(f<0?0:u);if(r)return h;let p=e==(n<0?a:d)?null:Dh(l/3,e-a),g=e==a?Nc:e==d?Ac:Dr;return(n<0?e!=a:e!=d)&&(g|=Oc),new Ms(h,g,p)}i+=u-c}return r?e+i:new Ms(e+i,0,null)}touches(e,n){let r=0,i=bl(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),c=this.ranges[i+n],u=this.ranges[i+r];e(l,l+c,a,a+u),s+=u-c}}invert(){return new xe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?xe.empty:new xe(e<0?[0,-e,0]:[0,0,e])}}xe.empty=new xe([]);class Xn{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Xn(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Xn;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Ms(e,i,null)}}const Ki=Object.create(null);class fe{getMap(){return xe.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ki[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ki)throw new RangeError("Duplicate use of step JSON ID "+e);return Ki[e]=n,n.prototype.jsonID=e,n}}class G{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new G(e,null)}static fail(e){return new G(null,e)}static fromReplace(e,n,r,i){try{return G.ok(e.replace(n,r,i))}catch(s){if(s instanceof Jn)return G.fail(s.message);throw s}}}function lo(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(lo(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return k.fromArray(r)}class dt extends fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new M(lo(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return G.fromReplace(e,this.from,this.to,s)}invert(){return new Re(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new dt(n.pos,r.pos,this.mark)}merge(e){return e instanceof dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new dt(n.from,n.to,e.markFromJSON(n.mark))}}fe.jsonID("addMark",dt);class Re extends fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new M(lo(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return G.fromReplace(e,this.from,this.to,r)}invert(){return new dt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Re(n.pos,r.pos,this.mark)}merge(e){return e instanceof Re&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Re(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Re(n.from,n.to,e.markFromJSON(n.mark))}}fe.jsonID("removeMark",Re);class ft extends fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return G.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return G.fromReplace(e,this.pos,this.pos+1,new M(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new ft(this.pos,n.marks[i]);return new ft(this.pos,this.mark)}}return new Wt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ft(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ft(n.pos,e.markFromJSON(n.mark))}}fe.jsonID("addNodeMark",ft);class Wt extends fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return G.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return G.fromReplace(e,this.pos,this.pos+1,new M(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ft(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Wt(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wt(n.pos,e.markFromJSON(n.mark))}}fe.jsonID("removeNodeMark",Wt);class _ extends fe{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Es(e,this.from,this.to)?G.fail("Structure replace would overwrite content"):G.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xe([this.from,this.to-this.from,this.slice.size])}invert(e){return new _(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&_.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new _(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof _)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new _(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new _(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new _(n.from,n.to,M.fromJSON(e,n.slice),!!n.structure)}}_.MAP_BIAS=1;fe.jsonID("replace",_);class te extends fe{constructor(e,n,r,i,s,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Es(e,this.from,this.gapFrom)||Es(e,this.gapTo,this.to)))return G.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return G.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?G.fromReplace(e,this.from,this.to,r):G.fail("Content does not fit in gap")}getMap(){return new xe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new te(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new te(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new te(n.from,n.to,n.gapFrom,n.gapTo,M.fromJSON(e,n.slice),n.insert,!!n.structure)}}fe.jsonID("replaceAround",te);function Es(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Ih(t,e,n,r){let i=[],s=[],o,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:i.push(o=new Re(f,h,d[g])));l&&l.to==f?l.to=h:s.push(l=new dt(f,h,r))}}),i.forEach(a=>t.step(a)),s.forEach(a=>t.step(a))}function Ph(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof vi){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&d.eq(i[h].style)&&(f=p)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(l,e),to:c,step:s})}}}),i.forEach(o=>t.step(new Re(o.from,o.to,o.style)))}function ao(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new _(l,u,M.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new Re(l,u,c.marks[f]));if(i&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new M(k.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new _(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);t.replace(l,l,new M(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function Lh(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Sn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+i,a=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!Lh(o,l,a))break;l&&(i=1),a<o.childCount&&(s=1)}return null}function $h(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),l=i.after(s+1),a=o,c=l,u=k.empty,d=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=s,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=k.from(i.node(p).copy(f)),h++):c++;t.step(new te(a,c,o,l,new M(u.append(f),d,h),u.size-d,!0))}function co(t,e,n=null,r=t){let i=zh(t,e),s=i&&Bh(r,e);return s?i.map(kl).concat({type:e,attrs:n}).concat(s.map(kl)):null}function kl(t){return{type:t,attrs:null}}function zh(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function Bh(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<i;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:o}function Fh(t,e,n){let r=k.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new te(i,s,i,s,new M(r,0,0),n.length,!0))}function Hh(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,a)&&Vh(t.doc,t.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Rc(t,o,l,s),ao(t,t.mapping.slice(s).map(l,1),r,void 0,c===null);let u=t.mapping.slice(s),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return t.step(new te(d,f,d+1,f-1,new M(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Dc(t,o,l,s),!1}})}function Dc(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Rc(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B,M as A,ag as re,l as L,j as l,E as ne,r as O,b as $,t as z,h as H,d as U,o as G,B as V}from"./index-CLlne17T.js";import{n as ae}from"./ArrowUp-BlHEAyyd.js";import{c as oe,a as Q,f as ie,u as ce,T as de,A as me,h as ue,b as fe,i as pe,j as xe}from"./chat-context-BmwCoPvA.js";import{s as he,g as W,d as ge}from"./gateway-client-DboI1W5S.js";import{b as F,T as be,a as je,c as ye}from"./tooltip-Cg0iEw6_.js";import{c as X,d as Y,b as Z,D as J,h as ve}from"./dialog-CDr-V9u8.js";import{f as we,b as Ne,a as Ce,D as Se}from"./drawer-DCRH2Qpg.js";import{C as Te}from"./collection-search-Cp-PQjLX.js";import{u as Pe}from"./use-mobile-DmHecFjh.js";import{u as ke}from"./use-mcp-client-B-bmV-eU.js";import{u as Ee,g as De}from"./use-mcp-prompts-DwCio0Xs.js";import{c as _e,P as Ie}from"./index-Do5lCsEj.js";import{T as Me,a as Be,C as Oe,u as Le,H as Re}from"./input-DaHZvHYb.js";import{a as $e,b as Ae,S as Fe,M as K}from"./pair-CEyOVwXU.js";import{a as ze}from"./use-panel-navigate-D0KroJxZ.js";import{u as He}from"./hooks-Rl0qRFjy.js";import{N as Ge}from"./decopilot-DmAS8lky.js";import{i as Ke}from"./ArrowRight-Cm4rUCam.js";import{b as ee}from"./agent-icon-ByB43Wsk.js";import{d as qe}from"./use-entitlements-CVFQAC4Y.js";import{u as Ue}from"./use-deco-credits-DWdd9zLS.js";import{F as Ve}from"./feature-paywall-C0IUXXGE.js";import{i as Qe}from"./AlertCircle-lddbBWh0.js";const q=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",We="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=B.c(46),{item:r,onSelect:n,isLoading:s,isDisabled:a,variant:d}=t,o=d===void 0?"pill":d,{prompt:i}=r;let m;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=W(i._meta);m=i.title??ge(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=m}else m=e[3];const c=m,u=i.description||null;if(o==="card"){let P;e[4]!==n||e[5]!==i?(P=()=>n(i),e[4]=n,e[5]=i,e[6]=P):P=e[6];const _=a||s,I=s&&"bg-accent/40",k=(a||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==I||e[8]!==k?(E=L(We,"hover:bg-accent/60 text-foreground",I,k),e[7]=I,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=l.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let v;e[12]!==s?(v=s&&l.jsx(H,{size:"xs"}),e[12]=s,e[13]=v):v=e[13];let p;e[14]!==h||e[15]!==v?(p=l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,v]}),e[14]=h,e[15]=v,e[16]=p):p=e[16];let D;e[17]!==u?(D=u&&l.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:u}),e[17]=u,e[18]=D):D=e[18];let M;return e[19]!==p||e[20]!==D||e[21]!==P||e[22]!==_||e[23]!==E?(M=l.jsxs("button",{type:"button",onClick:P,disabled:_,className:E,children:[p,D]}),e[19]=p,e[20]=D,e[21]=P,e[22]=_,e[23]=E,e[24]=M):M=e[24],M}let f;e[25]!==n||e[26]!==i?(f=()=>n(i),e[25]=n,e[26]=i,e[27]=f):f=e[27];const w=a||s,j=s&&"bg-muted/50",y=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==j||e[29]!==y?(x=L(te,"hover:bg-muted/70 hover:text-foreground",j,y),e[28]=j,e[29]=y,e[30]=x):x=e[30];let b;e[31]!==c?(b=l.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=b):b=e[32];let g;e[33]!==s?(g=s&&l.jsx(H,{size:"xs"}),e[33]=s,e[34]=g):g=e[34];let N;e[35]!==f||e[36]!==w||e[37]!==x||e[38]!==b||e[39]!==g?(N=l.jsx(be,{asChild:!0,children:l.jsxs("button",{type:"button",onClick:f,disabled:w,className:x,children:[b,g]})}),e[35]=f,e[36]=w,e[37]=x,e[38]=b,e[39]=g,e[40]=N):N=e[40];const C=u??c;let S;e[41]!==C?(S=l.jsx(je,{side:"top",className:"max-w-xs",children:l.jsx("p",{className:"text-xs",children:C})}),e[41]=C,e[42]=S):S=e[42];let T;return e[43]!==N||e[44]!==S?(T=l.jsxs(ye,{delayDuration:400,children:[N,S]}),e[43]=N,e[44]=S,e[45]=T):T=e[45],T}function Xe(t){const e=B.c(61),{items:r,open:n,onOpenChange:s,onSelect:a,loadingPrompt:d}=t,o=$(),[i,m]=O.useState(""),c=!!d;let u;e[0]!==r||e[1]!==i?(u=i.trim()?r.filter(h=>{const v=i.toLowerCase();return h.prompt.name.toLowerCase().includes(v)||(h.prompt.title??"").toLowerCase().includes(v)||(h.prompt.description??"").toLowerCase().includes(v)}):r,e[0]=r,e[1]=i,e[2]=u):u=e[2];const f=u,w=Pe();let j;e[3]!==f.length||e[4]!==i||e[5]!==o?(j=f.length===0&&l.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=f.length,e[4]=i,e[5]=o,e[6]=j):j=e[6];let y;if(e[7]!==f||e[8]!==c||e[9]!==d?.name||e[10]!==s||e[11]!==a){let h;e[13]!==c||e[14]!==d?.name||e[15]!==s||e[16]!==a?(h=v=>l.jsx(se,{item:v,variant:"card",onSelect:p=>{s(!1),a(p)},isLoading:d?.name===v.prompt.name,isDisabled:c&&d?.name!==v.prompt.name},v.prompt.name),e[13]=c,e[14]=d?.name,e[15]=s,e[16]=a,e[17]=h):h=e[17],y=f.map(h),e[7]=f,e[8]=c,e[9]=d?.name,e[10]=s,e[11]=a,e[12]=y}else y=e[12];let x;e[18]!==j||e[19]!==y?(x=l.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[j,y]})}),e[18]=j,e[19]=y,e[20]=x):x=e[20];const b=x;let g;e[21]!==o?(g=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=g):g=e[22];let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=h=>{h.key==="Escape"&&m("")},e[23]=N):N=e[23];let C;e[24]!==i||e[25]!==g?(C=l.jsx(Te,{value:i,onChange:m,placeholder:g,onKeyDown:N}),e[24]=i,e[25]=g,e[26]=C):C=e[26];const S=C;if(w){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let v;e[29]!==h?(v=l.jsx(we,{className:"sr-only",children:l.jsx(Ne,{children:h})}),e[29]=h,e[30]=v):v=e[30];let p;e[31]!==o?(p=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=p):p=e[32];let D;e[33]!==p?(D=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:p})}),e[33]=p,e[34]=D):D=e[34];let M;e[35]!==b||e[36]!==S||e[37]!==D||e[38]!==v?(M=l.jsxs(Ce,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[v,D,S,b]}),e[35]=b,e[36]=S,e[37]=D,e[38]=v,e[39]=M):M=e[39];let R;return e[40]!==s||e[41]!==n||e[42]!==M?(R=l.jsx(F,{delayDuration:400,children:l.jsx(Se,{open:n,onOpenChange:s,children:M})}),e[40]=s,e[41]=n,e[42]=M,e[43]=R):R=e[43],R}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=l.jsx(X,{className:"sr-only",children:l.jsx(Y,{children:T})}),e[46]=T,e[47]=P):P=e[47];let _;e[48]!==o?(_=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=_):_=e[49];let I;e[50]!==_?(I=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:_})}),e[50]=_,e[51]=I):I=e[51];let k;e[52]!==b||e[53]!==S||e[54]!==I||e[55]!==P?(k=l.jsxs(Z,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,I,S,b]}),e[52]=b,e[53]=S,e[54]=I,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==n||e[59]!==k?(E=l.jsx(F,{delayDuration:400,children:l.jsx(J,{open:n,onOpenChange:s,children:k})}),e[57]=s,e[58]=n,e[59]=k,e[60]=E):E=e[60],E}function Ye(t){const e=B.c(30),{items:r,onSelect:n,loadingPrompt:s,className:a}=t,d=$(),[o,i]=O.useState(!1);if(r.length===0)return null;let m,c,u,f,w;if(e[0]!==a||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==d){const b=r.slice(0,q),g=r.slice(q),N=!!s;let C;e[10]!==N||e[11]!==s?.name||e[12]!==n?(C=T=>l.jsx(se,{item:T,onSelect:n,isLoading:s?.name===T.prompt.name,isDisabled:N&&s?.name!==T.prompt.name},T.prompt.name),e[10]=N,e[11]=s?.name,e[12]=n,e[13]=C):C=e[13];const S=b.map(C);m=F,w=400,e[14]!==a?(c=L("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=c):c=e[15],u=S,f=g.length>0&&l.jsx("button",{type:"button",disabled:N,onClick:()=>i(!0),className:L(te,"hover:bg-muted/70 hover:text-foreground",N&&"opacity-50 cursor-not-allowed"),children:d("chat.iceBreakers.moreButton",{count:g.length})}),e[0]=a,e[1]=r,e[2]=s,e[3]=n,e[4]=d,e[5]=m,e[6]=c,e[7]=u,e[8]=f,e[9]=w}else m=e[5],c=e[6],u=e[7],f=e[8],w=e[9];let j;e[16]!==c||e[17]!==u||e[18]!==f?(j=l.jsxs("div",{className:c,children:[u,f]}),e[16]=c,e[17]=u,e[18]=f,e[19]=j):j=e[19];let y;e[20]!==r||e[21]!==s||e[22]!==o||e[23]!==n?(y=l.jsx(Xe,{items:r,open:o,onOpenChange:i,onSelect:n,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=o,e[23]=n,e[24]=y):y=e[24];let x;return e[25]!==m||e[26]!==w||e[27]!==j||e[28]!==y?(x=l.jsxs(m,{delayDuration:w,children:[j,y]}),e[25]=m,e[26]=w,e[27]=j,e[28]=y,e[29]=x):x=e[29],x}function Ze(){return null}function Je(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function et(t){const e=B.c(31),{connectionId:r}=t,n=$(),{sendMessage:s}=Q(),{org:a}=A();let d;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const o=ke(d);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:m}=Ee(i);let c;e[6]!==m?.prompts?(c=m?.prompts??[],e[6]=m?.prompts,e[7]=c):c=e[7];const u=c;let f;e[8]!==u?(f=u.map(tt),e[8]=u,e[9]=f):f=e[9];const w=f;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j={stage:"idle"},e[10]=j):j=e[10];const[y,x]=O.useReducer(Je,j),[b,g]=O.useState(null);let N;e[11]!==o||e[12]!==s||e[13]!==n?(N=async(p,D)=>{if(!o){z.error(n("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const M=await De(o,p.name,D);x({type:"RESET"});const R={type:"doc",content:[{type:"paragraph",content:[_e({id:p.name,name:he(p.name,W(p._meta)),metadata:M.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(R)}catch(M){console.error("[ice-breakers] Failed to fetch prompt:",M),z.error(n("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=n,e[14]=N):N=e[14];const C=N;let S;e[15]!==C?(S=async p=>{if(p.arguments&&p.arguments.length>0){x({type:"SELECT_PROMPT",prompt:p}),g(p);return}x({type:"START_LOADING",prompt:p}),await C(p)},e[15]=C,e[16]=S):S=e[16];const T=S;let P;e[17]!==b||e[18]!==C?(P=async p=>{b&&(x({type:"START_LOADING",prompt:b,arguments:p}),g(null),await C(b,p))},e[17]=b,e[18]=C,e[19]=P):P=e[19];const _=P;if(w.length===0)return null;const I=y.stage==="loading"?y.prompt:null;let k;e[20]!==T||e[21]!==w||e[22]!==I?(k=l.jsx(Ye,{items:w,onSelect:T,loadingPrompt:I}),e[20]=T,e[21]=w,e[22]=I,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{g(null),x({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==b||e[26]!==_?(h=l.jsx(Ie,{prompt:b,setPrompt:E,onSubmit:_}),e[25]=b,e[26]=_,e[27]=h):h=e[27];let v;return e[28]!==k||e[29]!==h?(v=l.jsxs(l.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=v):v=e[30],v}function tt(t){return{prompt:t}}function st(t){const e=B.c(13),{className:r}=t,{selectedVirtualMcp:n}=oe(),{org:s}=A();let a;e[0]!==s.id?(a=re(s.id),e[0]=s.id,e[1]=a):a=e[1];const d=a.id,o=n?.id??d;let i;e[2]!==r?(i=L("w-full @container",r),e[2]=r,e[3]=i):i=e[3];const m=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(Ze,{}),e[4]=c):c=e[4];let u;e[5]!==o?(u=l.jsx(et,{connectionId:o}),e[5]=o,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=l.jsx(ne,{fallback:null,children:l.jsx(O.Suspense,{fallback:c,children:u},m)}),e[7]=m,e[8]=u,e[9]=f):f=e[9];let w;return e[10]!==i||e[11]!==f?(w=l.jsx("div",{className:i,children:f}),e[10]=i,e[11]=f,e[12]=w):w=e[12],w}function lt(t){let e=0;for(const r of t)for(const n of r.parts??[]){const s=n;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function rt(){const t=B.c(8),{openPanel:e}=ze(),r=He(),n=ie()?.messages??[],s=ce()?.taskId??null;let a;t[0]!==n?(a=lt(n),t[0]=n,t[1]=a):a=t[1];const d=a,o=O.useRef(null),i=O.useRef(null);let m,c;t[2]!==d||t[3]!==r||t[4]!==e||t[5]!==s?(m=()=>{if(!d||!s)return;const u=`${s}:${d}`;i.current!==u&&(i.current=u,r?.refreshThreadMetadata(s)),o.current!==s&&(o.current=s,e("site-editor"))},c=[d,s,e,r],t[2]=d,t[3]=r,t[4]=e,t[5]=s,t[6]=m,t[7]=c):(m=t[6],c=t[7]),O.useEffect(m,c)}function le(t){return`deco-credits-empty-dismissed:${t}`}function $t(t){try{return localStorage.getItem(le(t))==="1"}catch{return!1}}function nt(){const t=B.c(56),e=$(),{org:r}=A(),n=qe("credits"),s=U(),{decoKeyId:a}=Ue(),[d,o]=O.useState(!0);let i;t[0]!==r.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:r.id}),o(!1);try{localStorage.setItem(le(r.id),"1")}catch{}},t[0]=r.id,t[1]=i):i=t[1];const m=i;let c,u;if(t[2]!==d||t[3]!==r.id?(c=()=>{d&&G("credits_empty_state_shown",{organization_id:r.id})},u=[d,r.id],t[2]=d,t[3]=r.id,t[4]=c,t[5]=u):(c=t[4],u=t[5]),O.useEffect(c,u),!d)return null;if(!n){let p;t[6]!==e?(p=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=p):p=t[7];let D;t[8]!==p?(D={title:p},t[8]=p,t[9]=D):D=t[9];let M;return t[10]!==m||t[11]!==D?(M=l.jsx(Ve,{feature:"chat",copy:D,onDismiss:m}),t[10]=m,t[11]=D,t[12]=M):M=t[12],M}let f;t[13]!==m?(f=p=>!p&&m(),t[13]=m,t[14]=f):f=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=w):w=t[15];let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:l.jsx(ee,{size:20,className:"text-warning"})}),t[16]=j):j=t[16];let y;t[17]!==e?(y=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=y):y=t[18];let x;t[19]!==y?(x=l.jsx(Y,{className:"text-lg font-semibold",children:y}),t[19]=y,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let g;t[23]!==b?(g=l.jsx(ve,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=g):g=t[24];let N;t[25]!==x||t[26]!==g?(N=l.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[w,l.jsxs(X,{className:"relative gap-3",children:[j,l.jsxs("div",{className:"text-center",children:[x,g]})]})]}),t[25]=x,t[26]=g,t[27]=N):N=t[27];let C;t[28]!==a||t[29]!==m?(C=a&&l.jsx("div",{className:"px-6 pb-5",children:l.jsx(Me,{source:"empty_state",onDone:m})}),t[28]=a,t[29]=m,t[30]=C):C=t[30];let S;t[31]!==m||t[32]!==s||t[33]!==r.slug?(S=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),m()},t[31]=m,t[32]=s,t[33]=r.slug,t[34]=S):S=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx(Ke,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let _;t[38]!==S||t[39]!==T?(_=l.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:S,children:[T,P]}),t[38]=S,t[39]=T,t[40]=_):_=t[40];let I;t[41]!==e?(I=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=I):I=t[42];let k;t[43]!==m||t[44]!==I?(k=l.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:m,children:I}),t[43]=m,t[44]=I,t[45]=k):k=t[45];let E;t[46]!==_||t[47]!==k?(E=l.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[_,k]}),t[46]=_,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==N||t[50]!==C||t[51]!==E?(h=l.jsxs(Z,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:at,children:[N,C,E]}),t[49]=N,t[50]=C,t[51]=E,t[52]=h):h=t[52];let v;return t[53]!==h||t[54]!==f?(v=l.jsx(J,{open:!0,onOpenChange:f,children:h}),t[53]=h,t[54]=f,t[55]=v):v=t[55],v}function at(t){return t.preventDefault()}function ot(t){const e=B.c(6),{balanceDollars:r}=t;let n;e[0]!==r?(n=r.toFixed(2),e[0]=r,e[1]=n):n=e[1];const s=n;let a,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),d=l.jsx(ee,{size:13,className:"text-success"}),e[2]=a,e[3]=d):(a=e[2],d=e[3]);let o;return e[4]!==s?(o=l.jsxs("div",{className:a,children:[d,l.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function it(){const t=B.c(8),{org:e}=A(),r=U();let n;t[0]!==r||t[1]!==e.slug?(n=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=n):n=t[2];let s,a,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-full cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=l.jsx(Qe,{size:13,className:"text-warning"}),d=l.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=d):(s=t[3],a=t[4],d=t[5]);let o;return t[6]!==n?(o=l.jsxs("button",{type:"button",onClick:n,className:s,children:[a,d]}),t[6]=n,t[7]=o):o=t[7],o}function ct(t){const e=B.c(7),{scrollRef:r,sentinelRef:n,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:d}=t;let o,i;e[0]!==d||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==n?(o=()=>{const m=n.current,c=r.current;if(!m||!c||!s)return;const u=new IntersectionObserver(async f=>{if(!f[0]?.isIntersecting||a||!s)return;const j=c.scrollHeight,y=c.scrollTop;await d(),requestAnimationFrame(()=>{const x=c.scrollHeight;c.scrollTop=y+(x-j)})},{root:c,rootMargin:"200px 0px 0px 0px"});return u.observe(m),()=>u.disconnect()},i=[r,n,s,a,d],e[0]=d,e[1]=s,e[2]=a,e[3]=r,e[4]=n,e[5]=o,e[6]=i):(o=e[5],i=e[6]),O.useEffect(o,i)}function dt(t){const e=B.c(5),{className:r,children:n}=t;let s;e[0]!==r?(s=L("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",r),e[0]=r,e[1]=s):s=e[1];let a;return e[2]!==n||e[3]!==s?(a=l.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a}function mt(t){const e=B.c(5),{children:r,className:n}=t;let s;e[0]!==n?(s=L("flex-1 min-h-0 overflow-y-auto isolate",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}function ut(t){const e=B.c(2),{children:r}=t;let n;return e[0]!==r?(n=l.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:r}),e[0]=r,e[1]=n):n=e[1],n}function ft(){const t=$(),{messages:e,status:r,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a}=Q(),{taskId:d}=fe();rt();const o=pe(d??""),i=xe(o),m=i.size===0?e:e.filter(g=>!i.has(g.id)),c=$e(m),u=c.at(-1),w=Le()*Re+16,j=O.useRef(null),y=O.useRef(null);ct({scrollRef:j,sentinelRef:y,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a});const x=Ae({initial:!1}),b=g=>{j.current=g,x.scrollRef(g)};return l.jsx(Fe,{messages:e,children:l.jsxs("div",{className:"relative h-full w-full min-w-0",children:[l.jsx("div",{ref:b,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:w},children:l.jsxs("div",{ref:x.contentRef,className:"overflow-x-clip",children:[l.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx("div",{ref:y,"aria-hidden":!0,className:"h-px"}),s&&l.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),c.slice(0,-1).map((g,N)=>l.jsx(K,{pair:g,isLastPair:!1,status:N===c.length-1?r:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),u&&l.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:l.jsx(K,{pair:u,isLastPair:!0,status:r},`pair-${u.user?.id??u.assistant?.id}`)})]})}),!x.isAtBottom&&l.jsx(V,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 rounded-full shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:w+8},onClick:()=>{x.scrollToBottom()},children:l.jsx(ae,{size:14})})]})})}function pt(t){const e=B.c(5),{children:r,className:n}=t;let s;e[0]!==n?(s=L("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}const At=Object.assign(dt,{Main:mt,Messages:ft,EmptyState:ut,Footer:pt,Input:Oe,Provider:ue,ActiveTaskProvider:me,ThreadlessProvider:de,IceBreakers:st,NoAiProviderEmptyState:Ge,CreditsEmptyState:nt,CreditsEyebrow:ot,NoCreditsEyebrow:it,CreditsExhaustedBanner:Be});export{At as C,$t as w};
|
|
1
|
+
import{c as B,M as A,ag as re,l as L,j as l,E as ne,r as O,b as $,t as z,h as H,d as U,o as G,B as V}from"./index-C6mMoKV9.js";import{n as ae}from"./ArrowUp-DhMsgJkj.js";import{c as oe,a as Q,f as ie,u as ce,T as de,A as me,h as ue,b as fe,i as pe,j as xe}from"./chat-context-g3Ysek-D.js";import{s as he,g as W,d as ge}from"./gateway-client-BrWtEU1u.js";import{b as F,T as be,a as je,c as ye}from"./tooltip-CYhjJgVA.js";import{c as X,d as Y,b as Z,D as J,h as ve}from"./dialog-BbF8R0Rt.js";import{f as we,b as Ne,a as Ce,D as Se}from"./drawer-BBk33oYJ.js";import{C as Te}from"./collection-search-Cw88RONI.js";import{u as Pe}from"./use-mobile-RHIQOVil.js";import{u as ke}from"./use-mcp-client-B8avk6p1.js";import{u as Ee,g as De}from"./use-mcp-prompts-C35IeKKU.js";import{c as _e,P as Ie}from"./index-Dnovg-Ty.js";import{T as Me,a as Be,C as Oe,u as Le,H as Re}from"./input-Dm5tdFv-.js";import{a as $e,b as Ae,S as Fe,M as K}from"./pair-BSoDGPcF.js";import{a as ze}from"./use-panel-navigate-VJU3jAVP.js";import{u as He}from"./hooks-BU6oBSHV.js";import{N as Ge}from"./decopilot-D-EmElSn.js";import{i as Ke}from"./ArrowRight-DLmMx1GH.js";import{b as ee}from"./agent-icon-DEBX0Uac.js";import{d as qe}from"./use-entitlements-B4c1c87k.js";import{u as Ue}from"./use-deco-credits-zGfUt8ra.js";import{F as Ve}from"./feature-paywall-BFqNEmgI.js";import{i as Qe}from"./AlertCircle-rRQrnsQT.js";const q=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",We="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=B.c(46),{item:r,onSelect:n,isLoading:s,isDisabled:a,variant:d}=t,o=d===void 0?"pill":d,{prompt:i}=r;let m;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=W(i._meta);m=i.title??ge(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=m}else m=e[3];const c=m,u=i.description||null;if(o==="card"){let P;e[4]!==n||e[5]!==i?(P=()=>n(i),e[4]=n,e[5]=i,e[6]=P):P=e[6];const _=a||s,I=s&&"bg-accent/40",k=(a||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==I||e[8]!==k?(E=L(We,"hover:bg-accent/60 text-foreground",I,k),e[7]=I,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=l.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let v;e[12]!==s?(v=s&&l.jsx(H,{size:"xs"}),e[12]=s,e[13]=v):v=e[13];let p;e[14]!==h||e[15]!==v?(p=l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,v]}),e[14]=h,e[15]=v,e[16]=p):p=e[16];let D;e[17]!==u?(D=u&&l.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:u}),e[17]=u,e[18]=D):D=e[18];let M;return e[19]!==p||e[20]!==D||e[21]!==P||e[22]!==_||e[23]!==E?(M=l.jsxs("button",{type:"button",onClick:P,disabled:_,className:E,children:[p,D]}),e[19]=p,e[20]=D,e[21]=P,e[22]=_,e[23]=E,e[24]=M):M=e[24],M}let f;e[25]!==n||e[26]!==i?(f=()=>n(i),e[25]=n,e[26]=i,e[27]=f):f=e[27];const w=a||s,j=s&&"bg-muted/50",y=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==j||e[29]!==y?(x=L(te,"hover:bg-muted/70 hover:text-foreground",j,y),e[28]=j,e[29]=y,e[30]=x):x=e[30];let b;e[31]!==c?(b=l.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=b):b=e[32];let g;e[33]!==s?(g=s&&l.jsx(H,{size:"xs"}),e[33]=s,e[34]=g):g=e[34];let N;e[35]!==f||e[36]!==w||e[37]!==x||e[38]!==b||e[39]!==g?(N=l.jsx(be,{asChild:!0,children:l.jsxs("button",{type:"button",onClick:f,disabled:w,className:x,children:[b,g]})}),e[35]=f,e[36]=w,e[37]=x,e[38]=b,e[39]=g,e[40]=N):N=e[40];const C=u??c;let S;e[41]!==C?(S=l.jsx(je,{side:"top",className:"max-w-xs",children:l.jsx("p",{className:"text-xs",children:C})}),e[41]=C,e[42]=S):S=e[42];let T;return e[43]!==N||e[44]!==S?(T=l.jsxs(ye,{delayDuration:400,children:[N,S]}),e[43]=N,e[44]=S,e[45]=T):T=e[45],T}function Xe(t){const e=B.c(61),{items:r,open:n,onOpenChange:s,onSelect:a,loadingPrompt:d}=t,o=$(),[i,m]=O.useState(""),c=!!d;let u;e[0]!==r||e[1]!==i?(u=i.trim()?r.filter(h=>{const v=i.toLowerCase();return h.prompt.name.toLowerCase().includes(v)||(h.prompt.title??"").toLowerCase().includes(v)||(h.prompt.description??"").toLowerCase().includes(v)}):r,e[0]=r,e[1]=i,e[2]=u):u=e[2];const f=u,w=Pe();let j;e[3]!==f.length||e[4]!==i||e[5]!==o?(j=f.length===0&&l.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=f.length,e[4]=i,e[5]=o,e[6]=j):j=e[6];let y;if(e[7]!==f||e[8]!==c||e[9]!==d?.name||e[10]!==s||e[11]!==a){let h;e[13]!==c||e[14]!==d?.name||e[15]!==s||e[16]!==a?(h=v=>l.jsx(se,{item:v,variant:"card",onSelect:p=>{s(!1),a(p)},isLoading:d?.name===v.prompt.name,isDisabled:c&&d?.name!==v.prompt.name},v.prompt.name),e[13]=c,e[14]=d?.name,e[15]=s,e[16]=a,e[17]=h):h=e[17],y=f.map(h),e[7]=f,e[8]=c,e[9]=d?.name,e[10]=s,e[11]=a,e[12]=y}else y=e[12];let x;e[18]!==j||e[19]!==y?(x=l.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[j,y]})}),e[18]=j,e[19]=y,e[20]=x):x=e[20];const b=x;let g;e[21]!==o?(g=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=g):g=e[22];let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=h=>{h.key==="Escape"&&m("")},e[23]=N):N=e[23];let C;e[24]!==i||e[25]!==g?(C=l.jsx(Te,{value:i,onChange:m,placeholder:g,onKeyDown:N}),e[24]=i,e[25]=g,e[26]=C):C=e[26];const S=C;if(w){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let v;e[29]!==h?(v=l.jsx(we,{className:"sr-only",children:l.jsx(Ne,{children:h})}),e[29]=h,e[30]=v):v=e[30];let p;e[31]!==o?(p=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=p):p=e[32];let D;e[33]!==p?(D=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:p})}),e[33]=p,e[34]=D):D=e[34];let M;e[35]!==b||e[36]!==S||e[37]!==D||e[38]!==v?(M=l.jsxs(Ce,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[v,D,S,b]}),e[35]=b,e[36]=S,e[37]=D,e[38]=v,e[39]=M):M=e[39];let R;return e[40]!==s||e[41]!==n||e[42]!==M?(R=l.jsx(F,{delayDuration:400,children:l.jsx(Se,{open:n,onOpenChange:s,children:M})}),e[40]=s,e[41]=n,e[42]=M,e[43]=R):R=e[43],R}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=l.jsx(X,{className:"sr-only",children:l.jsx(Y,{children:T})}),e[46]=T,e[47]=P):P=e[47];let _;e[48]!==o?(_=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=_):_=e[49];let I;e[50]!==_?(I=l.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:l.jsx("span",{className:"text-sm font-medium text-foreground",children:_})}),e[50]=_,e[51]=I):I=e[51];let k;e[52]!==b||e[53]!==S||e[54]!==I||e[55]!==P?(k=l.jsxs(Z,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,I,S,b]}),e[52]=b,e[53]=S,e[54]=I,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==n||e[59]!==k?(E=l.jsx(F,{delayDuration:400,children:l.jsx(J,{open:n,onOpenChange:s,children:k})}),e[57]=s,e[58]=n,e[59]=k,e[60]=E):E=e[60],E}function Ye(t){const e=B.c(30),{items:r,onSelect:n,loadingPrompt:s,className:a}=t,d=$(),[o,i]=O.useState(!1);if(r.length===0)return null;let m,c,u,f,w;if(e[0]!==a||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==d){const b=r.slice(0,q),g=r.slice(q),N=!!s;let C;e[10]!==N||e[11]!==s?.name||e[12]!==n?(C=T=>l.jsx(se,{item:T,onSelect:n,isLoading:s?.name===T.prompt.name,isDisabled:N&&s?.name!==T.prompt.name},T.prompt.name),e[10]=N,e[11]=s?.name,e[12]=n,e[13]=C):C=e[13];const S=b.map(C);m=F,w=400,e[14]!==a?(c=L("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=c):c=e[15],u=S,f=g.length>0&&l.jsx("button",{type:"button",disabled:N,onClick:()=>i(!0),className:L(te,"hover:bg-muted/70 hover:text-foreground",N&&"opacity-50 cursor-not-allowed"),children:d("chat.iceBreakers.moreButton",{count:g.length})}),e[0]=a,e[1]=r,e[2]=s,e[3]=n,e[4]=d,e[5]=m,e[6]=c,e[7]=u,e[8]=f,e[9]=w}else m=e[5],c=e[6],u=e[7],f=e[8],w=e[9];let j;e[16]!==c||e[17]!==u||e[18]!==f?(j=l.jsxs("div",{className:c,children:[u,f]}),e[16]=c,e[17]=u,e[18]=f,e[19]=j):j=e[19];let y;e[20]!==r||e[21]!==s||e[22]!==o||e[23]!==n?(y=l.jsx(Xe,{items:r,open:o,onOpenChange:i,onSelect:n,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=o,e[23]=n,e[24]=y):y=e[24];let x;return e[25]!==m||e[26]!==w||e[27]!==j||e[28]!==y?(x=l.jsxs(m,{delayDuration:w,children:[j,y]}),e[25]=m,e[26]=w,e[27]=j,e[28]=y,e[29]=x):x=e[29],x}function Ze(){return null}function Je(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function et(t){const e=B.c(31),{connectionId:r}=t,n=$(),{sendMessage:s}=Q(),{org:a}=A();let d;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const o=ke(d);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:m}=Ee(i);let c;e[6]!==m?.prompts?(c=m?.prompts??[],e[6]=m?.prompts,e[7]=c):c=e[7];const u=c;let f;e[8]!==u?(f=u.map(tt),e[8]=u,e[9]=f):f=e[9];const w=f;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j={stage:"idle"},e[10]=j):j=e[10];const[y,x]=O.useReducer(Je,j),[b,g]=O.useState(null);let N;e[11]!==o||e[12]!==s||e[13]!==n?(N=async(p,D)=>{if(!o){z.error(n("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const M=await De(o,p.name,D);x({type:"RESET"});const R={type:"doc",content:[{type:"paragraph",content:[_e({id:p.name,name:he(p.name,W(p._meta)),metadata:M.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(R)}catch(M){console.error("[ice-breakers] Failed to fetch prompt:",M),z.error(n("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=n,e[14]=N):N=e[14];const C=N;let S;e[15]!==C?(S=async p=>{if(p.arguments&&p.arguments.length>0){x({type:"SELECT_PROMPT",prompt:p}),g(p);return}x({type:"START_LOADING",prompt:p}),await C(p)},e[15]=C,e[16]=S):S=e[16];const T=S;let P;e[17]!==b||e[18]!==C?(P=async p=>{b&&(x({type:"START_LOADING",prompt:b,arguments:p}),g(null),await C(b,p))},e[17]=b,e[18]=C,e[19]=P):P=e[19];const _=P;if(w.length===0)return null;const I=y.stage==="loading"?y.prompt:null;let k;e[20]!==T||e[21]!==w||e[22]!==I?(k=l.jsx(Ye,{items:w,onSelect:T,loadingPrompt:I}),e[20]=T,e[21]=w,e[22]=I,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{g(null),x({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==b||e[26]!==_?(h=l.jsx(Ie,{prompt:b,setPrompt:E,onSubmit:_}),e[25]=b,e[26]=_,e[27]=h):h=e[27];let v;return e[28]!==k||e[29]!==h?(v=l.jsxs(l.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=v):v=e[30],v}function tt(t){return{prompt:t}}function st(t){const e=B.c(13),{className:r}=t,{selectedVirtualMcp:n}=oe(),{org:s}=A();let a;e[0]!==s.id?(a=re(s.id),e[0]=s.id,e[1]=a):a=e[1];const d=a.id,o=n?.id??d;let i;e[2]!==r?(i=L("w-full @container",r),e[2]=r,e[3]=i):i=e[3];const m=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(Ze,{}),e[4]=c):c=e[4];let u;e[5]!==o?(u=l.jsx(et,{connectionId:o}),e[5]=o,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=l.jsx(ne,{fallback:null,children:l.jsx(O.Suspense,{fallback:c,children:u},m)}),e[7]=m,e[8]=u,e[9]=f):f=e[9];let w;return e[10]!==i||e[11]!==f?(w=l.jsx("div",{className:i,children:f}),e[10]=i,e[11]=f,e[12]=w):w=e[12],w}function lt(t){let e=0;for(const r of t)for(const n of r.parts??[]){const s=n;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function rt(){const t=B.c(8),{openPanel:e}=ze(),r=He(),n=ie()?.messages??[],s=ce()?.taskId??null;let a;t[0]!==n?(a=lt(n),t[0]=n,t[1]=a):a=t[1];const d=a,o=O.useRef(null),i=O.useRef(null);let m,c;t[2]!==d||t[3]!==r||t[4]!==e||t[5]!==s?(m=()=>{if(!d||!s)return;const u=`${s}:${d}`;i.current!==u&&(i.current=u,r?.refreshThreadMetadata(s)),o.current!==s&&(o.current=s,e("site-editor"))},c=[d,s,e,r],t[2]=d,t[3]=r,t[4]=e,t[5]=s,t[6]=m,t[7]=c):(m=t[6],c=t[7]),O.useEffect(m,c)}function le(t){return`deco-credits-empty-dismissed:${t}`}function $t(t){try{return localStorage.getItem(le(t))==="1"}catch{return!1}}function nt(){const t=B.c(56),e=$(),{org:r}=A(),n=qe("credits"),s=U(),{decoKeyId:a}=Ue(),[d,o]=O.useState(!0);let i;t[0]!==r.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:r.id}),o(!1);try{localStorage.setItem(le(r.id),"1")}catch{}},t[0]=r.id,t[1]=i):i=t[1];const m=i;let c,u;if(t[2]!==d||t[3]!==r.id?(c=()=>{d&&G("credits_empty_state_shown",{organization_id:r.id})},u=[d,r.id],t[2]=d,t[3]=r.id,t[4]=c,t[5]=u):(c=t[4],u=t[5]),O.useEffect(c,u),!d)return null;if(!n){let p;t[6]!==e?(p=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=p):p=t[7];let D;t[8]!==p?(D={title:p},t[8]=p,t[9]=D):D=t[9];let M;return t[10]!==m||t[11]!==D?(M=l.jsx(Ve,{feature:"chat",copy:D,onDismiss:m}),t[10]=m,t[11]=D,t[12]=M):M=t[12],M}let f;t[13]!==m?(f=p=>!p&&m(),t[13]=m,t[14]=f):f=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=w):w=t[15];let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:l.jsx(ee,{size:20,className:"text-warning"})}),t[16]=j):j=t[16];let y;t[17]!==e?(y=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=y):y=t[18];let x;t[19]!==y?(x=l.jsx(Y,{className:"text-lg font-semibold",children:y}),t[19]=y,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let g;t[23]!==b?(g=l.jsx(ve,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=g):g=t[24];let N;t[25]!==x||t[26]!==g?(N=l.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[w,l.jsxs(X,{className:"relative gap-3",children:[j,l.jsxs("div",{className:"text-center",children:[x,g]})]})]}),t[25]=x,t[26]=g,t[27]=N):N=t[27];let C;t[28]!==a||t[29]!==m?(C=a&&l.jsx("div",{className:"px-6 pb-5",children:l.jsx(Me,{source:"empty_state",onDone:m})}),t[28]=a,t[29]=m,t[30]=C):C=t[30];let S;t[31]!==m||t[32]!==s||t[33]!==r.slug?(S=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),m()},t[31]=m,t[32]=s,t[33]=r.slug,t[34]=S):S=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx(Ke,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let _;t[38]!==S||t[39]!==T?(_=l.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:S,children:[T,P]}),t[38]=S,t[39]=T,t[40]=_):_=t[40];let I;t[41]!==e?(I=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=I):I=t[42];let k;t[43]!==m||t[44]!==I?(k=l.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:m,children:I}),t[43]=m,t[44]=I,t[45]=k):k=t[45];let E;t[46]!==_||t[47]!==k?(E=l.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[_,k]}),t[46]=_,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==N||t[50]!==C||t[51]!==E?(h=l.jsxs(Z,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:at,children:[N,C,E]}),t[49]=N,t[50]=C,t[51]=E,t[52]=h):h=t[52];let v;return t[53]!==h||t[54]!==f?(v=l.jsx(J,{open:!0,onOpenChange:f,children:h}),t[53]=h,t[54]=f,t[55]=v):v=t[55],v}function at(t){return t.preventDefault()}function ot(t){const e=B.c(6),{balanceDollars:r}=t;let n;e[0]!==r?(n=r.toFixed(2),e[0]=r,e[1]=n):n=e[1];const s=n;let a,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),d=l.jsx(ee,{size:13,className:"text-success"}),e[2]=a,e[3]=d):(a=e[2],d=e[3]);let o;return e[4]!==s?(o=l.jsxs("div",{className:a,children:[d,l.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function it(){const t=B.c(8),{org:e}=A(),r=U();let n;t[0]!==r||t[1]!==e.slug?(n=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=n):n=t[2];let s,a,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-full cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=l.jsx(Qe,{size:13,className:"text-warning"}),d=l.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=d):(s=t[3],a=t[4],d=t[5]);let o;return t[6]!==n?(o=l.jsxs("button",{type:"button",onClick:n,className:s,children:[a,d]}),t[6]=n,t[7]=o):o=t[7],o}function ct(t){const e=B.c(7),{scrollRef:r,sentinelRef:n,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:d}=t;let o,i;e[0]!==d||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==n?(o=()=>{const m=n.current,c=r.current;if(!m||!c||!s)return;const u=new IntersectionObserver(async f=>{if(!f[0]?.isIntersecting||a||!s)return;const j=c.scrollHeight,y=c.scrollTop;await d(),requestAnimationFrame(()=>{const x=c.scrollHeight;c.scrollTop=y+(x-j)})},{root:c,rootMargin:"200px 0px 0px 0px"});return u.observe(m),()=>u.disconnect()},i=[r,n,s,a,d],e[0]=d,e[1]=s,e[2]=a,e[3]=r,e[4]=n,e[5]=o,e[6]=i):(o=e[5],i=e[6]),O.useEffect(o,i)}function dt(t){const e=B.c(5),{className:r,children:n}=t;let s;e[0]!==r?(s=L("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",r),e[0]=r,e[1]=s):s=e[1];let a;return e[2]!==n||e[3]!==s?(a=l.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a}function mt(t){const e=B.c(5),{children:r,className:n}=t;let s;e[0]!==n?(s=L("flex-1 min-h-0 overflow-y-auto isolate",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}function ut(t){const e=B.c(2),{children:r}=t;let n;return e[0]!==r?(n=l.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:r}),e[0]=r,e[1]=n):n=e[1],n}function ft(){const t=$(),{messages:e,status:r,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a}=Q(),{taskId:d}=fe();rt();const o=pe(d??""),i=xe(o),m=i.size===0?e:e.filter(g=>!i.has(g.id)),c=$e(m),u=c.at(-1),w=Le()*Re+16,j=O.useRef(null),y=O.useRef(null);ct({scrollRef:j,sentinelRef:y,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a});const x=Ae({initial:!1}),b=g=>{j.current=g,x.scrollRef(g)};return l.jsx(Fe,{messages:e,children:l.jsxs("div",{className:"relative h-full w-full min-w-0",children:[l.jsx("div",{ref:b,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:w},children:l.jsxs("div",{ref:x.contentRef,className:"overflow-x-clip",children:[l.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx("div",{ref:y,"aria-hidden":!0,className:"h-px"}),s&&l.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),c.slice(0,-1).map((g,N)=>l.jsx(K,{pair:g,isLastPair:!1,status:N===c.length-1?r:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),u&&l.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:l.jsx(K,{pair:u,isLastPair:!0,status:r},`pair-${u.user?.id??u.assistant?.id}`)})]})}),!x.isAtBottom&&l.jsx(V,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 rounded-full shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:w+8},onClick:()=>{x.scrollToBottom()},children:l.jsx(ae,{size:14})})]})})}function pt(t){const e=B.c(5),{children:r,className:n}=t;let s;e[0]!==n?(s=L("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=l.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}const At=Object.assign(dt,{Main:mt,Messages:ft,EmptyState:ut,Footer:pt,Input:Oe,Provider:ue,ActiveTaskProvider:me,ThreadlessProvider:de,IceBreakers:st,NoAiProviderEmptyState:Ge,CreditsEmptyState:nt,CreditsEyebrow:ot,NoCreditsEyebrow:it,CreditsExhaustedBanner:Be});export{At as C,$t as w};
|