decocms 4.508.0 → 4.508.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-C3FzlJkn.js → ActiveShapeUtils-CtRUGMbL.js} +1 -1
- package/dist/client/assets/{AlertCircle-DRgK9JB_.js → AlertCircle-by-5kqnE.js} +1 -1
- package/dist/client/assets/{AreaChart-D2DvxH5P.js → AreaChart-DPHfsoSm.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BzwJwvy1.js → ArrowLeft-DWHALVEd.js} +1 -1
- package/dist/client/assets/{ArrowUp-CxFxaW35.js → ArrowUp-e3Opy0PO.js} +1 -1
- package/dist/client/assets/{BarChart-BeLSl_Z5.js → BarChart-B2A5KMmp.js} +1 -1
- package/dist/client/assets/{Building02-rClnD4uc.js → Building02-C75pDvUR.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Dxc9tBh7.js → CategoricalChart-CucOWBrj.js} +1 -1
- package/dist/client/assets/{CheckCircle-mTX9fWaM.js → CheckCircle-lYcI54Vv.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Dl1xrKr0.js → ChevronSelectorVertical-D_uPm-4f.js} +1 -1
- package/dist/client/assets/{ChevronUp-kQFA9QX6.js → ChevronUp-smii6Hlt.js} +1 -1
- package/dist/client/assets/{Copy01-hfEOHSDl.js → Copy01-DVlkUD5V.js} +1 -1
- package/dist/client/assets/{CreditCard01-DF7MTKJ3.js → CreditCard01-BkikusPK.js} +1 -1
- package/dist/client/assets/{DotsVertical-C3XWNKuz.js → DotsVertical-Cy12MGZ0.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-LolURZUN.js → ErrorBarContext-CVFpZWbV.js} +1 -1
- package/dist/client/assets/{Globe04-JT--e5Bh.js → Globe04-DITEFn6p.js} +1 -1
- package/dist/client/assets/{Image01-jGkvOWRJ.js → Image01-6XuOVbfs.js} +1 -1
- package/dist/client/assets/{Key01-BzxD_x8A.js → Key01-B7FTNQKN.js} +1 -1
- package/dist/client/assets/{Link01-OCnw3a5L.js → Link01-D7ZWNxWv.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CHV_OJuf.js → LinkBroken01-BI9YpAHA.js} +1 -1
- package/dist/client/assets/{Monitor01-CvJxGIjI.js → Monitor01-BY4V4Xgw.js} +1 -1
- package/dist/client/assets/{Play-03q5nxE3.js → Play-CY4OkrRf.js} +1 -1
- package/dist/client/assets/{Plus-DNWiwlMd.js → Plus-DSBe1yGh.js} +1 -1
- package/dist/client/assets/{SearchMd-uZ1fg-aL.js → SearchMd-CqwBSDQT.js} +1 -1
- package/dist/client/assets/{Sector-C1Q0fcJu.js → Sector-DqeSTYOa.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-C6lx54lK.js → ShoppingBag01-BMmyUEOt.js} +1 -1
- package/dist/client/assets/{Sun-hQOE8_Ah.js → Sun-CAxM-a_y.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BRLZiSEm.js → SwitchHorizontal01-DM4kWBA7.js} +1 -1
- package/dist/client/assets/{Tool01-BsXZFLbB.js → Tool01-Cy7q1W_-.js} +1 -1
- package/dist/client/assets/{Trash01-AnrBN8Oq.js → Trash01-BPlh1JSc.js} +1 -1
- package/dist/client/assets/{Upload01-D1D--Ifq.js → Upload01-BuZMuOmA.js} +1 -1
- package/dist/client/assets/{User01-D7NqDG9h.js → User01-DQ4IrSrc.js} +1 -1
- package/dist/client/assets/{UserSquare-BO3h4SWI.js → UserSquare-D4mxgHNW.js} +1 -1
- package/dist/client/assets/{Users01-BCrqWlZC.js → Users01-7b4wbG2Z.js} +1 -1
- package/dist/client/assets/{XAxis-Cdyr85g2.js → XAxis-ecJPq7Dx.js} +1 -1
- package/dist/client/assets/{XClose-BHIq2rSj.js → XClose-CGy86Cja.js} +1 -1
- package/dist/client/assets/{ZoomOut-CKwphFFF.js → ZoomOut-CbNseg5O.js} +1 -1
- package/dist/client/assets/{access-gate-Ds8y-c7d.js → access-gate-CziQZW7X.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CI2jVjIC.js → add-connection-dialog--y45-jSV.js} +1 -1
- package/dist/client/assets/{agent-analytics-BBNdaLPH.js → agent-analytics-5sWxVF9i.js} +1 -1
- package/dist/client/assets/agent-app-DLjt6as9.js +1 -0
- package/dist/client/assets/{agent-assets-w7G4G7NG.js → agent-assets-DlKlOjzu.js} +1 -1
- package/dist/client/assets/{agent-automation-DoUvIa4h.js → agent-automation-DN9b9vLA.js} +1 -1
- package/dist/client/assets/{agent-automations-DRXZ46C-.js → agent-automations-B16kRxAs.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-lMSZjLpx.js → agent-connect-sources-CDCBO7Fb.js} +1 -1
- package/dist/client/assets/agent-deck-BQoivJJr.js +1 -0
- package/dist/client/assets/{agent-e2e-4_Wcmxwo.js → agent-e2e-B_EXmW9Z.js} +1 -1
- package/dist/client/assets/{agent-experiments-Kqg0ctEE.js → agent-experiments-BIdRz3zD.js} +1 -1
- package/dist/client/assets/{agent-file-BU_XbaPw.js → agent-file-j6qfWGBp.js} +1 -1
- package/dist/client/assets/{agent-hosting-BR2uRV4C.js → agent-hosting-CoNPCmEI.js} +1 -1
- package/dist/client/assets/{agent-icon-ndY1RWjU.js → agent-icon-DELSa-FD.js} +1 -1
- package/dist/client/assets/agent-library-F51HQyDB.js +1 -0
- package/dist/client/assets/agent-library-file-B79kDzgZ.js +1 -0
- package/dist/client/assets/{agent-monitor-yoz-N-1r.js → agent-monitor-kUncSkEl.js} +1 -1
- package/dist/client/assets/{agent-overview-CUf0Y3ir.js → agent-overview-DaDLZhiK.js} +1 -1
- package/dist/client/assets/{agent-releases-szVOzGiC.js → agent-releases-Bn6c_aFm.js} +1 -1
- package/dist/client/assets/agent-settings-CFQuRpJL.js +1 -0
- package/dist/client/assets/{agent-site-editor-B7iEqwmc.js → agent-site-editor-DHedFsfC.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Ckxxyg2G.js +2 -0
- package/dist/client/assets/agent-site-editor-content-B1_0UiN2.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DVdc6THr.js +1 -0
- package/dist/client/assets/agent-view-32IUeuks.js +1 -0
- package/dist/client/assets/{agent-view-guard-D3N2evVp.js → agent-view-guard-TAhW-82L.js} +1 -1
- package/dist/client/assets/{agents-list-DyLpBolv.js → agents-list-CJNxRxsQ.js} +1 -1
- package/dist/client/assets/{ai-providers-B0Oo6J0F.js → ai-providers-BxbV9_8k.js} +1 -1
- package/dist/client/assets/{alert-BMizf1K4.js → alert-D_immXfn.js} +1 -1
- package/dist/client/assets/{alert-dialog-BwIOugPC.js → alert-dialog-Cg7oMLzs.js} +1 -1
- package/dist/client/assets/{analytics-sections-Dt6_PKUK.js → analytics-sections-RRkkXiBY.js} +1 -1
- package/dist/client/assets/api-keys-D5-LbahX.js +1 -0
- package/dist/client/assets/{api-keys-dCavcgAr.js → api-keys-Piuzxkwg.js} +1 -1
- package/dist/client/assets/{app-editor-DXunZc54.js → app-editor-f-lYJvHO.js} +1 -1
- package/dist/client/assets/{asset-utils-BIz3ln3H.js → asset-utils-T9ZI1IFe.js} +1 -1
- package/dist/client/assets/{auth-Ru0XeHze.js → auth-DKxemjZk.js} +1 -1
- package/dist/client/assets/{auth-catchall-D7KASRkB.js → auth-catchall-DAIsxM7o.js} +1 -1
- package/dist/client/assets/{auth-entry-CnbgzVrn.js → auth-entry-DvjWN-tT.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BlnrsRxb.js → auth-split-layout-D4C2znZG.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bdc0JCPD.js → authenticate-and-persist-oauth-7YgBQPGH.js} +1 -1
- package/dist/client/assets/{automation-list-row-CwFLSkkD.js → automation-list-row-3cEJbpl-.js} +1 -1
- package/dist/client/assets/{automation-runs-3gdVKwGN.js → automation-runs-Blz-Z_vg.js} +1 -1
- package/dist/client/assets/{automations-Mz8s_9Y-.js → automations-CgIRdlDR.js} +1 -1
- package/dist/client/assets/{autosend-BkZD94wn.js → autosend-Bj5T7XMB.js} +1 -1
- package/dist/client/assets/{avatar-svlBTViV.js → avatar-B80eBo98.js} +1 -1
- package/dist/client/assets/{badge-DV-csERH.js → badge-CPEOztIS.js} +1 -1
- package/dist/client/assets/{block-document-CPap6Hoh.js → block-document-CDmX2huR.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-C6DV9nNg.js → blocks-preview-workspace-context-CjkBzKS9.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BiTn5vNe.js → blocks-tab-states-D1b96Kfl.js} +3 -3
- package/dist/client/assets/{blog-schema-m8oXhY_o.js → blog-schema-MUQBxbLM.js} +1 -1
- package/dist/client/assets/{board-analytics-qsIYH9UQ.js → board-analytics-rTSk7WOt.js} +1 -1
- package/dist/client/assets/{buckets-B2eTUubY.js → buckets-DjIBuiGp.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CXtDfPwS.js → build-improve-prompt-doc-D1MomPDB.js} +1 -1
- package/dist/client/assets/{calendar-BJAZ7ITP.js → calendar-CeVyImjd.js} +1 -1
- package/dist/client/assets/{capability-load-error-DfOS2qD0.js → capability-load-error-BxrnIrpf.js} +1 -1
- package/dist/client/assets/{category-editor-DwIdkmBC.js → category-editor-B3926mZV.js} +1 -1
- package/dist/client/assets/{chart-B2WOgoqq.js → chart-CvSFgXYp.js} +1 -1
- package/dist/client/assets/{chat-context-ChcTnk8Q.js → chat-context-DJXt2Oc4.js} +1 -1
- package/dist/client/assets/{chat-draft-iM4uBzs8.js → chat-draft-CWFitEFr.js} +1 -1
- package/dist/client/assets/{checkbox-CWzVH6do.js → checkbox-CcmIjGV4.js} +1 -1
- package/dist/client/assets/{choose-editor-L8_fuH5l.js → choose-editor-CR8SYrJv.js} +1 -1
- package/dist/client/assets/{cli-auth-success-xPKL8BL-.js → cli-auth-success-BbgwwzYA.js} +1 -1
- package/dist/client/assets/{client-icons-C0i-kUEb.js → client-icons-BPxwZ9DC.js} +1 -1
- package/dist/client/assets/cms-settings-editor-Cg3yLz1O.js +1 -0
- package/dist/client/assets/{collapsible-wEeZPPIk.js → collapsible-DnxYZLlO.js} +1 -1
- package/dist/client/assets/{collection-detail-DkQebCJX.js → collection-detail--8X3tJRS.js} +1 -1
- package/dist/client/assets/{collection-display-button-BKVS2PGV.js → collection-display-button-CxicoQ4g.js} +1 -1
- package/dist/client/assets/{collection-search-Ov4rPa97.js → collection-search-BWTLUEjF.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cd2H8RtH.js → collection-table-wrapper-nIue-tpf.js} +1 -1
- package/dist/client/assets/{collection-tabs-D-zLkcuK.js → collection-tabs-KLOhnFKb.js} +1 -1
- package/dist/client/assets/{column-rules-BqHh278p.js → column-rules-BB5nUteI.js} +1 -1
- package/dist/client/assets/{combobox-AVFbBj8k.js → combobox-WLTBDSrY.js} +1 -1
- package/dist/client/assets/{command-ChZnkO48.js → command-CxgcokcP.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BdsvuyO-.js → companion-mcps-section-Bz9KQYJN.js} +1 -1
- package/dist/client/assets/{config-Bm6KxaFP.js → config-C8oi2h4w.js} +1 -1
- package/dist/client/assets/{connect-CVqC_htJ.js → connect-Dx3isQnQ.js} +1 -1
- package/dist/client/assets/{connect-layout-BnvEVu6w.js → connect-layout-BhoPuuHt.js} +1 -1
- package/dist/client/assets/{connection-BQYwMjUn.js → connection-Ij0oiNg8.js} +1 -1
- package/dist/client/assets/{connection-card-w1pyA0AW.js → connection-card-DO9oLayF.js} +1 -1
- package/dist/client/assets/{connection-detail-D3sGWJ5y.js → connection-detail-CQ_45U-q.js} +1 -1
- package/dist/client/assets/{connection-form-helpers--5_FBdwa.js → connection-form-helpers-4hGiWkBg.js} +1 -1
- package/dist/client/assets/{connections-2CDOGfAf.js → connections-DyI95T0W.js} +1 -1
- package/dist/client/assets/{content-tab-ufWzSoXT.js → content-tab-XYry_IHR.js} +3 -3
- package/dist/client/assets/{context-CRfcwldP.js → context-CZ7mjU2h.js} +1 -1
- package/dist/client/assets/{context-menu-CeIyABDi.js → context-menu-L9B1AKUT.js} +1 -1
- package/dist/client/assets/{core.esm-BfHJA0TA.js → core.esm-B6s0CaQt.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-C9vMS6wi.js → create-organization-dialog-D_24Qwy0.js} +1 -1
- package/dist/client/assets/{daily-pulse-C0yqxvJM.js → daily-pulse-CNg9tU_P.js} +1 -1
- package/dist/client/assets/{discover-DbQRR_O3.js → discover-uJZTBBDB.js} +1 -1
- package/dist/client/assets/{domain-settings-CkpWWkS-.js → domain-settings-CM-l3ya0.js} +1 -1
- package/dist/client/assets/{drawer-BMFFvaL0.js → drawer-Bk3Nkdes.js} +1 -1
- package/dist/client/assets/{editor-Cskgo4t5.js → editor-9MPzOd2_.js} +1 -1
- package/dist/client/assets/{editor-classes-C28rWAPt.js → editor-classes-DIrlSRWz.js} +1 -1
- package/dist/client/assets/{empty-state-5cqHHAHm.js → empty-state-Dx75BoXW.js} +1 -1
- package/dist/client/assets/{empty-state-B_hi_eG9.js → empty-state-rsqdpdQ7.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BP7KazgH.js → extract-connection-data-BZaE_Tz1.js} +1 -1
- package/dist/client/assets/{feature-gate-Dm218ZjC.js → feature-gate-CZnWzEkz.js} +1 -1
- package/dist/client/assets/{feature-paywall-Cgz8CMXc.js → feature-paywall-CGSRGOpW.js} +1 -1
- package/dist/client/assets/{file-explorer-CS89g_zS.js → file-explorer-D_2JxV90.js} +1 -1
- package/dist/client/assets/{file-preview-U5Y7TvR2.js → file-preview-L-qJKVew.js} +1 -1
- package/dist/client/assets/{file-share-button-B8Qy9vuB.js → file-share-button-CxcUx0_V.js} +1 -1
- package/dist/client/assets/{file-type-icon-DYutf45Y.js → file-type-icon-Dnk4TRFb.js} +1 -1
- package/dist/client/assets/flat-project-A1FTptiE.js +1 -0
- package/dist/client/assets/{folder-icon-DLicGE7r.js → folder-icon-1nw9D4Ca.js} +1 -1
- package/dist/client/assets/{form-Bca46vhe.js → form-D5bbHtx7.js} +1 -1
- package/dist/client/assets/{general-yd6vlutH.js → general-CxxHWN9C.js} +1 -1
- package/dist/client/assets/{home-BU4NK3v6.js → home-CZFDhFxM.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-DnsB267D.js → hosted-publish-feedback-DJGUtyZ8.js} +1 -1
- package/dist/client/assets/{icon-button-ChLL5yDL.js → icon-button-7Lw3dugt.js} +1 -1
- package/dist/client/assets/{index-CTh6BzVi.js → index-B5Iv9fyb.js} +3 -3
- package/dist/client/assets/{index-BOCmUs5e.js → index-BMFPQnxF.js} +2 -2
- package/dist/client/assets/{index-DZEft5uP.js → index-BMG54iU1.js} +1 -1
- package/dist/client/assets/{index-BlpRem7Q.js → index-BYDbr5aX.js} +1 -1
- package/dist/client/assets/{index-BRvSRRRr.js → index-B_j2RsVu.js} +1 -1
- package/dist/client/assets/{index-BB6qJjD3.js → index-Bc5jQEXz.js} +1 -1
- package/dist/client/assets/{index-BJ6dsjIl.js → index-Bef0lnhH.js} +1 -1
- package/dist/client/assets/{index-DgJzDYIg.js → index-BfeDEqo4.js} +1 -1
- package/dist/client/assets/{index-BoFHO5RY.js → index-CUvc14G0.js} +1 -1
- package/dist/client/assets/{index-DVNE46xa.js → index-CVZ3m2_P.js} +1 -1
- package/dist/client/assets/{index-BGvlkI3R.js → index-CxG3zYnR.js} +1 -1
- package/dist/client/assets/{index-DbEiru9a.js → index-DANaQuQW.js} +1 -1
- package/dist/client/assets/{index-DwyX0Lfk.js → index-KGAPnbhI.js} +1 -1
- package/dist/client/assets/{index-B87t6NQf.js → index-NaSzhCtj.js} +1 -1
- package/dist/client/assets/{index-DKhF_H6j.js → index-nGDAk1xB.js} +1 -1
- package/dist/client/assets/{index-redirect-DqSAK9om.js → index-redirect-CiUnKOtC.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B7_k3f99.js → infiniteQueryObserver-DYIaKApT.js} +1 -1
- package/dist/client/assets/{infra-billing-CjvIyWFt.js → infra-billing-CmTMh8ao.js} +1 -1
- package/dist/client/assets/{input-VU9TmbHH.js → input-DX1wtqAr.js} +1 -1
- package/dist/client/assets/{input-DkRYN8U-.js → input-DqqMSuUL.js} +3 -3
- package/dist/client/assets/{integration-icon-ak9Kf0du.js → integration-icon-CnHHjXOU.js} +1 -1
- package/dist/client/assets/{jira-icon-BWCPEjrr.js → jira-icon-C6pbnhWO.js} +1 -1
- package/dist/client/assets/{label-C-ZL8muP.js → label-Bl40umMK.js} +1 -1
- package/dist/client/assets/{layout-cY3CgJvq.js → layout-CDigbbtJ.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-D4us0T0O.js → legacy-agents-deep-CF2uq7C1.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BkaZ5ZhP.js → legacy-main-redirect-aUGUrc6h.js} +1 -1
- package/dist/client/assets/library-Bzx1D3nm.js +1 -0
- package/dist/client/assets/{library-tab-BVMhkwRQ.js → library-tab-B-R8uO94.js} +1 -1
- package/dist/client/assets/{login-B9_RQM1l.js → login-CKPMMXq9.js} +1 -1
- package/dist/client/assets/{markdown-139du5-r.js → markdown-CaI6qicy.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-Bdo6XZex.js → mcp-app-renderer-C5yRHoTM.js} +1 -1
- package/dist/client/assets/{mcp-oauth-xr1jliP9.js → mcp-oauth-By8cHkWa.js} +1 -1
- package/dist/client/assets/{mcp-oauth-OreG94Sz.js → mcp-oauth-pZjhJiYE.js} +1 -1
- package/dist/client/assets/{members-DPGoTLnj.js → members-BPIFqraf.js} +1 -1
- package/dist/client/assets/{memory-luaHcViv.js → memory-BHtw-zwQ.js} +1 -1
- package/dist/client/assets/{mini-report-page-BYczJDsY.js → mini-report-page-k7h8LaE2.js} +1 -1
- package/dist/client/assets/{mock-board-vqGO01s1.js → mock-board-BR3MfgR3.js} +1 -1
- package/dist/client/assets/{monaco-editor-CK_xL2d8.js → monaco-editor-BLFXVMUp.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C0--I9c_.js → monitoring-stats-row-CD_1Qmyn.js} +1 -1
- package/dist/client/assets/{multi-select-DIKIJUkK.js → multi-select-DFdTpX6Z.js} +1 -1
- package/dist/client/assets/{mustache-CKk3zMw1.js → mustache-Cs4KKpmG.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CkYId2Lh.js → new-project-dialog-CnmLgxCp.js} +1 -1
- package/dist/client/assets/{oauth-callback-C7eYh3k9.js → oauth-callback-DQ7cDxKS.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-pn9TQm4S.js → oauth-callback-ai-provider-B64rDjy4.js} +1 -1
- package/dist/client/assets/{onboarding-BiAjLS4d.js → onboarding-DmIfFLPf.js} +1 -1
- package/dist/client/assets/{openai-conversation-DhLlByyF.js → openai-conversation-BK5DjZve.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DrJTLDvq.js → optimistic-project-sidebar-views-DYcFObkr.js} +1 -1
- package/dist/client/assets/{order-monitor-day-D2DPF_-7.js → order-monitor-day-BckajSjD.js} +1 -1
- package/dist/client/assets/{organization-choice-DXXDw6Ka.js → organization-choice-D6x7Xpz1.js} +1 -1
- package/dist/client/assets/{orgs-B_kVR_CR.js → orgs-BTDtzrrR.js} +1 -1
- package/dist/client/assets/{page-seo-form-JACX4dVa.js → page-seo-form-CHMwQRZM.js} +1 -1
- package/dist/client/assets/{pair-BuwlHYqc.js → pair-CH_P8lS5.js} +1 -1
- package/dist/client/assets/{plan-ladder-B_I9AoFo.js → plan-ladder-hfbyBvbA.js} +1 -1
- package/dist/client/assets/{popover-hPl3gZkE.js → popover-CZq_pbU-.js} +1 -1
- package/dist/client/assets/{post-calendar-BOa7Fn-g.js → post-calendar-Bf71EX6c.js} +1 -1
- package/dist/client/assets/{post-editor-CEBQzcL7.js → post-editor-BYfg-K6H.js} +1 -1
- package/dist/client/assets/{preview-content-B_u1AtxU.js → preview-content-D3MZPuqj.js} +1 -1
- package/dist/client/assets/{preview-dialog-CVUIwuSI.js → preview-dialog-CzVe85i8.js} +1 -1
- package/dist/client/assets/{preview-panel-CA1qen4u.js → preview-panel-AYRyU8GY.js} +1 -1
- package/dist/client/assets/{preview-tab-CWys0pQE.js → preview-tab-CbqYkOa8.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-BHaMx_oO.js → product-picker-dialog-MknLOJa4.js} +1 -1
- package/dist/client/assets/{profile-B--MUGfI.js → profile-BU8nJhXU.js} +1 -1
- package/dist/client/assets/{project-app-view-KzZdUmqf.js → project-app-view-CSUHaM1p.js} +1 -1
- package/dist/client/assets/{project-feed-CeCiO4WF.js → project-feed-yFB5Lseu.js} +1 -1
- package/dist/client/assets/{project-icon-BbXZsYe5.js → project-icon-CCSQmnno.js} +1 -1
- package/dist/client/assets/project-reports-Czat66fR.js +1 -0
- package/dist/client/assets/project-tasks-CGM7k3la.js +1 -0
- package/dist/client/assets/{projects-CawKsgaS.js → projects-CLoVMWlc.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CVMx-csZ.js → projects-empty-state-CMpBRaMk.js} +1 -1
- package/dist/client/assets/{prompts-GV6vHi3Q.js → prompts-BG8m-yeF.js} +1 -1
- package/dist/client/assets/record-editor-DE5fEL5O.js +1 -0
- package/dist/client/assets/{redirect-editor-DZy0GaYH.js → redirect-editor-jgGWX0o-.js} +1 -1
- package/dist/client/assets/{reports-DOGEO98v.js → reports-CT6feGG8.js} +1 -1
- package/dist/client/assets/reports-CmZ47ZJ7.js +1 -0
- package/dist/client/assets/{reports-onboarding-CKfiI8-p.js → reports-onboarding-BTUYa8ac.js} +1 -1
- package/dist/client/assets/{reports-tab-Dun2p-H0.js → reports-tab-C8PhtdGE.js} +2 -2
- package/dist/client/assets/{repositories-ChgrXMYY.js → repositories-dJQZEXu9.js} +1 -1
- package/dist/client/assets/{repository-binding-CRho0p-d.js → repository-binding-rwRHiq0J.js} +1 -1
- package/dist/client/assets/{repository-import-picker-B4RkmAHQ.js → repository-import-picker-CWrlpup1.js} +1 -1
- package/dist/client/assets/{repository-picker-CkFN3RpX.js → repository-picker-B6qDEI1n.js} +1 -1
- package/dist/client/assets/{require-capability-TRUTQOME.js → require-capability-CHQBHXuM.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DfsZRaZp.js → required-auth-layout-C8yreOmP.js} +1 -1
- package/dist/client/assets/{reset-password-BEwZW6TX.js → reset-password-DQpIfOgp.js} +1 -1
- package/dist/client/assets/{resizable-9eb5yMBY.js → resizable-Bm0Du5cF.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BG71jGkO.js → resolve-tab-icon-CH-AUUKU.js} +1 -1
- package/dist/client/assets/{review-settings-D73xrL00.js → review-settings-D5UATYQy.js} +1 -1
- package/dist/client/assets/{roles-w5iALB5v.js → roles-T5ABYWD4.js} +1 -1
- package/dist/client/assets/route-CWNGHiZD.js +1 -0
- package/dist/client/assets/{route-djIv8e5Q.js → route-Dfuw6Dd9.js} +1 -1
- package/dist/client/assets/{route-BIP1ydTX.js → route-jlvxRWKx.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BpxXnBl4.js → sandbox-lifecycle-context-DsmXEbI7.js} +1 -1
- package/dist/client/assets/{schema-cIPnPaZy.js → schema-BK2nNbUV.js} +1 -1
- package/dist/client/assets/{schema-CWcCrp1Z.js → schema-CPINmJPP.js} +1 -1
- package/dist/client/assets/{scroll-area-HEEo7zAl.js → scroll-area-lKvwrVqB.js} +1 -1
- package/dist/client/assets/{search-input-C1zHzfNa.js → search-input-DHnp4KYj.js} +1 -1
- package/dist/client/assets/{search-toggle-C2-3cqGH.js → search-toggle-BYGwcnWX.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-CSc2OLqA.js → secret-ciphertext-tkX783tP.js} +1 -1
- package/dist/client/assets/{secret-picker-BuZft72r.js → secret-picker-BMJibzDc.js} +1 -1
- package/dist/client/assets/{secrets-DzgdyJ5L.js → secrets-ohytl3xQ.js} +1 -1
- package/dist/client/assets/{sections-editor-DneoLEuW.js → sections-editor-DK6w3rb1.js} +1 -1
- package/dist/client/assets/{select-Bq0vTEkX.js → select-k27ndNUF.js} +1 -1
- package/dist/client/assets/{select-model-f8FsMuYz.js → select-model-mQHdCjgY.js} +1 -1
- package/dist/client/assets/{seo-editor-VV8qaVCj.js → seo-editor-5flBmQTo.js} +1 -1
- package/dist/client/assets/{separator-DLgfXwLN.js → separator-BmNQZPqf.js} +1 -1
- package/dist/client/assets/{settings-tab-Dupxn9u_.js → settings-tab-1xu4tbAP.js} +1 -1
- package/dist/client/assets/{sheet-ByjoR9NZ.js → sheet-DjxhamUM.js} +1 -1
- package/dist/client/assets/{shell-layout--nu4TX02.js → shell-layout-DrGCCpLI.js} +1 -1
- package/dist/client/assets/site-editor-0P2dF0Qc.js +1 -0
- package/dist/client/assets/{site-editor-toast-BJ5z9pNz.js → site-editor-toast-DKws6Ota.js} +1 -1
- package/dist/client/assets/{skills-D7KiBQsN.js → skills-DYzY-mGh.js} +1 -1
- package/dist/client/assets/{slider-tPJKX_XF.js → slider-6ighpdWs.js} +1 -1
- package/dist/client/assets/{sortable.esm-D7jA01m7.js → sortable.esm-DQU2qOYK.js} +1 -1
- package/dist/client/assets/{sso-DnQMM0g9.js → sso-C0TeJpS7.js} +1 -1
- package/dist/client/assets/{suggestion-BoKW7C2P.js → suggestion-DCtVuRZs.js} +1 -1
- package/dist/client/assets/{switch-Dubjp7kN.js → switch-BQE_eHhJ.js} +1 -1
- package/dist/client/assets/{symbol-CV7scdpJ.js → symbol-F_KNowG4.js} +1 -1
- package/dist/client/assets/{synced-repos-CiN18kni.js → synced-repos-CpU_XW02.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Clsy5Yie.js → tab-icon-glyph-D843BRNP.js} +1 -1
- package/dist/client/assets/{table-CZt5xP25.js → table-DOUVno8Z.js} +1 -1
- package/dist/client/assets/{tabs-j67RnvdQ.js → tabs-E4kiI4aw.js} +1 -1
- package/dist/client/assets/{task-board-C94vU4ou.js → task-board-3mk2XuN5.js} +1 -1
- package/dist/client/assets/{task-route-BszFrOaw.js → task-route-BwIVXmhI.js} +1 -1
- package/dist/client/assets/{task-status-CEagG8m_.js → task-status-BgFi9Xzp.js} +1 -1
- package/dist/client/assets/taskboard-analytics-bEBG5Wjy.js +1 -0
- package/dist/client/assets/{tasks-BFNjlX11.js → tasks-0Nw35wLc.js} +1 -1
- package/dist/client/assets/tasks-Cjhjp8SR.js +1 -0
- package/dist/client/assets/{textarea-TaCrk10b.js → textarea-CCvGRkOQ.js} +1 -1
- package/dist/client/assets/{thread-analytics-DSCs8wQv.js → thread-analytics-BMhei67t.js} +1 -1
- package/dist/client/assets/{thread-intent-FDeXaDYT.js → thread-intent-C62cIvr-.js} +1 -1
- package/dist/client/assets/{thread-route-BJT1AZOr.js → thread-route-7XSumLv2.js} +1 -1
- package/dist/client/assets/{thread-route-CCdwsU-Y.js → thread-route-o0uoUAhl.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-JXcJ3O56.js → thread-sheet-body-BCUkVghc.js} +1 -1
- package/dist/client/assets/{time-range-picker-C4Z7sFIS.js → time-range-picker-BydY2kYE.js} +1 -1
- package/dist/client/assets/{toggle-group-Cjg5yTIq.js → toggle-group-ik84U8rL.js} +1 -1
- package/dist/client/assets/{tool-namespace-DqRUFWOS.js → tool-namespace-B5xkebXj.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-FvedXQUt.js → toolbar-icon-button-AbZuc2O0.js} +1 -1
- package/dist/client/assets/{tooltip-BK6bkzFU.js → tooltip-DkPjtX65.js} +1 -1
- package/dist/client/assets/{tooltipContext-6dHCyOPT.js → tooltipContext-BhSB4VA2.js} +1 -1
- package/dist/client/assets/{track-1DCyrBU8.js → track-BuogFla7.js} +1 -1
- package/dist/client/assets/{types-CQaTVPow.js → types-DuP_vZkY.js} +1 -1
- package/dist/client/assets/{url-slug-W3nScHaD.js → url-slug-B-Y6MpkE.js} +1 -1
- package/dist/client/assets/{usage-stats-B2hjYXg0.js → usage-stats-gx6NXtBh.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BQUzk2kS.js → use-ai-providers-SfOQeHq4.js} +1 -1
- package/dist/client/assets/{use-app-takeover-CfJ3KcD6.js → use-app-takeover-BradKAB-.js} +1 -1
- package/dist/client/assets/{use-automations-Be9X1Kx9.js → use-automations-CmB7LiAp.js} +1 -1
- package/dist/client/assets/{use-autosave-C2TsZDuz.js → use-autosave-3q5Nt_kR.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-DdZ6WAy-.js → use-chat-navigation-D0fuO1s8.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DIulXUbJ.js → use-clock-tick-DvI1LKpl.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Cv_xXpoU.js → use-connect-companion-Dj7qCXre.js} +1 -1
- package/dist/client/assets/{use-connection-D1Zl0xok.js → use-connection-PBAmt9Wi.js} +1 -1
- package/dist/client/assets/{use-content-sync-bWtwlxQJ.js → use-content-sync-CDhv_Xjy.js} +1 -1
- package/dist/client/assets/{use-copy-qf10DRy9.js → use-copy-DhtGSqvc.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D6s3wkOf.js → use-create-virtual-mcp-0bfGRFIU.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DzeoHUz7.js → use-date-fns-locale-BCzjBIhU.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-PPu22Bhc.js → use-debounced-autosave-CKd6HYRr.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CGXDj-PA.js → use-debounced-value-Boui__b8.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Cn5WFssl.js → use-deco-credits-CS2dyLmU.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-B-KnnZSr.js → use-decopilot-events-GlJzYxPp.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BWr_htDe.js → use-delete-connection-DN9vsKv4.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DgT8SM2M.js → use-deployment-admin-DlpWHA-N.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-B8iEdtWi.js → use-ensure-project-folder-CX-XOXhh.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-2FsUFQjh.js → use-fast-preview-draft-url-wvxnSwDx.js} +1 -1
- package/dist/client/assets/{use-file-configs-Pqo7OuGa.js → use-file-configs-ybHdH56V.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BBMDPJ8Y.js → use-infinite-scroll-CaorhroL.js} +1 -1
- package/dist/client/assets/{use-join-requests-DkDnq2t0.js → use-join-requests-CEGGknMN.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-D5V3Apbl.js → use-main-panel-tabs-B14e2mb0.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-B2dxPIqA.js → use-mcp-auth-status-pV4pImK3.js} +1 -1
- package/dist/client/assets/{use-mcp-client-52cULFEI.js → use-mcp-client-snQz_ewh.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-cFJG9oH_.js → use-mcp-prompts-DZpcHayW.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CZHcwTNA.js → use-mcp-tools-jx1VcXQd.js} +1 -1
- package/dist/client/assets/{use-members-DGxX_vQB.js → use-members-jIELfIqs.js} +1 -1
- package/dist/client/assets/{use-mobile-CbyN-2jY.js → use-mobile-KovosPkT.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BXAeHaex.js → use-navigate-to-agent-vAefpVTW.js} +1 -1
- package/dist/client/assets/{use-open-billing-url--GFaVN_O.js → use-open-billing-url-R1ffvDHi.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BvpKSYmO.js → use-org-auth-client-BtXUoIf7.js} +1 -1
- package/dist/client/assets/{use-org-fs-CmUmucUf.js → use-org-fs-CQin-Vkj.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-8zIOfMQj.js → use-org-repo-syncs-Cv6Xqx3q.js} +1 -1
- package/dist/client/assets/{use-org-sso-DgTtAFtU.js → use-org-sso-BKWcRTDe.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CILDS-HZ.js → use-organization-roles-2wMPL2bp.js} +1 -1
- package/dist/client/assets/{use-organization-settings-oW1-A4fr.js → use-organization-settings-Ceh2DXjh.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-sC31QNLz.js → use-panel-navigate-Zih2UthO.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DoHDLNAG.js → use-project-native-view-presence-DTuOKlwK.js} +1 -1
- package/dist/client/assets/{use-project-scope-PpktGVbB.js → use-project-scope-CJr07eE6.js} +1 -1
- package/dist/client/assets/{use-recent-apps-F4etVz5-.js → use-recent-apps-Dzl8uBSP.js} +1 -1
- package/dist/client/assets/{use-releases-DJ3_3r6L.js → use-releases-DATIF1aw.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-YYi2gy8_.js → use-reports-diagnostic-Di7B4lod.js} +1 -1
- package/dist/client/assets/{use-secrets-BlmA3MrX.js → use-secrets-CmBUuZZx.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DXQMfLn9.js → use-section-preview-base-CuK_Oczp.js} +1 -1
- package/dist/client/assets/{use-tags-BPSIOz7Y.js → use-tags-CYQWCjAQ.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DnzZMM3Q.js → use-task-board-analytics-D9pcTswM.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Bn6hAZVM.js → use-task-board-events-BSSWSAEh.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-m9_KRZoq.js → use-task-board-item-prs-B6wuTmH-.js} +1 -1
- package/dist/client/assets/{use-task-board-items-DA_UDa8i.js → use-task-board-items-YdIpmqZv.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Cq4Zn8Tm.js → use-task-metadata-BJwA9QBq.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-B9ptnv1A.js → use-thread-analytics-CDCJckFs.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BPKnTsgd.js → use-thread-outputs-ClS22V04.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D-6_jcBc.js +1 -0
- package/dist/client/assets/{useQueries-Btn7O7jr.js → useQueries-C6OiVJ20.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CeuHL631.js +1 -0
- package/dist/client/assets/{users-Bgwi7pZL.js → users-8ecU5_lG.js} +1 -1
- package/dist/client/assets/{utils-Ci8APlrm.js → utils-BONHqZRZ.js} +1 -1
- package/dist/client/assets/{variant-calendar-BOVhedq0.js → variant-calendar-B1be7Hfi.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-C9f5IZVL.js → variant-draft-pointer-Chs17zu3.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Drydf5me.js → view-mode-toggle-Bk3BDzpx.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DTVuDZwT.js → virtual-mcp-Jk0_PJfj.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-DJ0G_gEe.js → watch-sse-pool-Bu2tYWcO.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +116 -116
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Tk7ibbxk.js +0 -1
- package/dist/client/assets/agent-deck-G9eN_-lW.js +0 -1
- package/dist/client/assets/agent-library-BtjlzgNd.js +0 -1
- package/dist/client/assets/agent-library-file-CGC_OSnB.js +0 -1
- package/dist/client/assets/agent-settings-vKXRBe4W.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CyNojH-R.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CxWPoAy6.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-B2DApGX5.js +0 -1
- package/dist/client/assets/agent-view-CD5NqqDd.js +0 -1
- package/dist/client/assets/api-keys-D24Q5aDz.js +0 -1
- package/dist/client/assets/cms-settings-editor-Crw1X5_M.js +0 -1
- package/dist/client/assets/flat-project-mVjYSjvy.js +0 -1
- package/dist/client/assets/library-C4jtiJlg.js +0 -1
- package/dist/client/assets/project-reports-B8eXEkZp.js +0 -1
- package/dist/client/assets/project-tasks-prm6sFyB.js +0 -1
- package/dist/client/assets/record-editor-s1ymOqml.js +0 -1
- package/dist/client/assets/reports-Cvitp0af.js +0 -1
- package/dist/client/assets/route-CH7llhC9.js +0 -1
- package/dist/client/assets/site-editor-DWPmz9wn.js +0 -1
- package/dist/client/assets/taskboard-analytics-xx9cuDQq.js +0 -1
- package/dist/client/assets/tasks-BUWNyzBS.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DLiHmV3M.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DKelDyyv.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a2 as X,o as Be,r as k,j as n,K as W,b8 as ie,c as F,aL as Oe,l as H,H as Ae,b as Z,t as ce,h as ue,s as be,v as ye,q as ve,D as Se,d as je,y as de,aM as Ie,B as Ee}from"./index-
|
|
1
|
+
import{a2 as X,o as Be,r as k,j as n,K as W,b8 as ie,c as F,aL as Oe,l as H,H as Ae,b as Z,t as ce,h as ue,s as be,v as ye,q as ve,D as Se,d as je,y as de,aM as Ie,B as Ee}from"./index-BMFPQnxF.js";import{u as we,d as $e,b as Ne,f as Fe,T as He,A as ze,i as Ke,c as qe,j as Ge,k as Ue,p as Qe,L as Ve}from"./chat-context-DJXt2Oc4.js";import{b as Ye}from"./sandbox-url-D3mC8qhT.js";import{a as Je}from"./repository-binding-rwRHiq0J.js";import{e as We}from"./backoff-CrEUbyZT.js";import{n as Xe}from"./ArrowUp-e3Opy0PO.js";import{s as Ze,g as Ce,d as et}from"./tool-namespace-B5xkebXj.js";import{b as se,T as tt,a as st,c as nt}from"./tooltip-DkPjtX65.js";import{d as rt,b as at,a as ot,D as lt}from"./drawer-Bk3Nkdes.js";import{C as it}from"./collection-search-BWTLUEjF.js";import{u as ct}from"./use-mobile-KovosPkT.js";import{u as ut}from"./use-mcp-client-snQz_ewh.js";import{u as dt,g as ft}from"./use-mcp-prompts-DZpcHayW.js";import{c as mt,P as pt}from"./usage-stats-gx6NXtBh.js";import{T as ht,d as gt,c as xt,e as bt,H as yt}from"./input-DqqMSuUL.js";import{u as vt,a as St,S as jt,M as fe}from"./pair-CH_P8lS5.js";import{a as Et}from"./use-panel-navigate-Zih2UthO.js";import{u as wt}from"./thread-intent-C62cIvr-.js";import{N as Nt}from"./index-BfeDEqo4.js";import{i as Ct}from"./LinkBroken01-BI9YpAHA.js";import{e as Te}from"./agent-icon-DELSa-FD.js";import{e as Tt}from"./use-decopilot-events-GlJzYxPp.js";import{u as kt}from"./use-deco-credits-CS2dyLmU.js";import{F as Pt}from"./feature-paywall-CGSRGOpW.js";import{i as Dt}from"./AlertCircle-by-5kqnE.js";function me(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const Rt={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ke=k.createContext(Rt),pe=16384;class _t{data="";append(e){this.data+=e,this.data.length>pe&&(this.data=this.data.slice(this.data.length-pe))}get(){return this.data}clear(){this.data=""}}const Lt=1e3,Mt=3e4,Bt=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],ge="log";function Ot(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function At(t){return t===404}async function It(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Bt)});return await e.body?.cancel().catch(()=>{}),At(e.status)}catch{return!1}}function Ds({virtualMcpId:t,branch:e,previewUrl:r=null,enabled:o=!0,children:s}){const{org:a}=X(),l=Be(),i=we()?.taskId??null,[c,u]=k.useState(null),[d,f]=k.useState({phase:"idle"}),[m,S]=k.useState({state:"running"}),[j,E]=k.useState({kind:"unknown"}),[x,b]=k.useState(!1),[C,y]=k.useState([]),[P,g]=k.useState([]),[,D]=k.useState(0),T=k.useRef(new Map),B=k.useRef(new Set),M=k.useRef(new Set),L=k.useRef(null),_=Ot(r),p=Je(t)?.metadata?.runtime?.selected==="deno",w=v=>{let N=T.current.get(v);return N||(N=new _t,T.current.set(v,N)),N};k.useEffect(()=>{if(u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),L.current=null,b(!1),y([]),g([]),T.current.clear(),!t||!e||!o)return;const v=Ye({orgSlug:a.slug,virtualMcpId:t,branch:e,threadId:i??null},"events");let N=!1,$=0,Y=null,q=null,G=null,K=null,z=null,J=null;const Le=R=>{try{const O=JSON.parse(R.data);u(O),O.kind!=="failed"&&(b(!1),$=0),O.kind==="ready"&&oe()}catch(O){console.warn("[vm-events] bad phase payload",O)}},ne=()=>{b(!0),u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),y([]),g([]),T.current.clear()},re=R=>{try{const O=JSON.parse(R.data);if(typeof O.data!="string")return;$=0;const I=O.data.replace(/\r?\n/g,`\r
|
|
2
2
|
`);w(O.source).append(I);for(const A of B.current)try{A(O.source,I)}catch{}D(A=>A+1)}catch{}},ae=R=>{const O=R.type;try{const I=JSON.parse(R.data);switch($=0,O){case"lifecycle":{const A=I;f(A.state);const U=`${a.slug}/${t}/${e}`;if(me(A.state.phase)&&!(J&&me(J))){ie(l,a.id);const V=W.decofile(U);l.getQueryData(V)===void 0&&l.invalidateQueries({queryKey:V})}A.state.phase==="running"&&J!=="running"&&(ie(l,a.id),l.invalidateQueries({queryKey:W.decofile(U)}),l.invalidateQueries({queryKey:W.liveMeta(a.slug,t,e)})),J=A.state.phase;const Q=A.state.phase==="running"?A.state.port:null,te=L.current;if(L.current=Q,te!==null&&Q!==null&&te!==Q)for(const V of M.current)try{V()}catch{}return}case"status":S(I);return;case"tasks":{const U=I.active.map(Q=>Q.logName??"").filter(Boolean);g(U);return}case"scripts":y(I.scripts);return;case"branch":{const A=I.meta;E(A);return}case"reload":for(const A of M.current)try{A()}catch{}return;case"file-changed":{const{path:A}=I,U=`${a.slug}/${t}/${e}`;if(A.startsWith(".deco/")||A.includes("/.deco/")){if(!(J==="running"))return;G&&clearTimeout(G),G=setTimeout(()=>{if(G=null,l.invalidateQueries({queryKey:W.decofile(U)}),p)for(const V of M.current)try{V()}catch{}},500)}else q&&clearTimeout(q),q=setTimeout(()=>{q=null,l.invalidateQueries({queryKey:W.liveMeta(a.slug,t,e)})},1e3);return}}}catch{}};function ee(){if(N)return;const R=new EventSource(v);K=R,R.onopen=()=>{},R.onerror=()=>{K===R&&R.readyState===EventSource.CLOSED&&le("studio")},R.addEventListener("phase",Le),R.addEventListener("gone",ne),R.addEventListener(ge,re);for(const O of he)R.addEventListener(O,ae)}function oe(){if(N||!_||z)return;const R=new EventSource(_);z=R;let O=!1;R.onopen=()=>{if(N||z!==R)return;O=!0,$=0;const I=K;K=null,I?.close()},R.onerror=()=>{z===R&&R.readyState===EventSource.CLOSED&&Me(R,O)},R.addEventListener(ge,re);for(const I of he)R.addEventListener(I,ae)}async function Me(R,O){const I=_?await It(_):!1;if(!(N||z!==R)){if(R.close(),z=null,I){ne(),K||ee();return}O&&le("direct")}}function le(R){if(N||Y)return;const O=We(Mt,Lt,$,2,0);$++,Y=setTimeout(()=>{if(Y=null,!N){if(R==="direct"){z?.close(),z=null,oe();return}K?.close(),K=null,ee()}},O)}return ee(),()=>{N=!0,K?.close(),z?.close(),Y&&clearTimeout(Y),q&&clearTimeout(q),G&&clearTimeout(G)}},[t,e,a.slug,a.id,o,i,_,l,p]);const h={phase:c,lifecycle:d,status:m,branch:j,notFound:x,scripts:C,activeProcesses:P,getBuffer:v=>T.current.get(v)?.get()??"",hasData:v=>(T.current.get(v)?.get().length??0)>0,subscribeChunks:v=>(B.current.add(v),()=>{B.current.delete(v)}),subscribeReload:v=>(M.current.add(v),()=>{M.current.delete(v)})};return n.jsx(ke,{value:h,children:s})}function Pe(){return k.use(ke)}function Rs(t){const{subscribeChunks:e}=Pe(),r=k.useRef(t);r.current=t,k.useEffect(()=>e((a,l)=>{r.current?.(a,l)}),[e])}function _s(t){const{subscribeReload:e}=Pe(),r=k.useRef(t);r.current=t,k.useEffect(()=>e(()=>{r.current?.()}),[e])}const xe=3,De="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",$t="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function Re(t){const e=F.c(46),{item:r,onSelect:o,isLoading:s,isDisabled:a,variant:l}=t,i=l===void 0?"pill":l,{prompt:c}=r;let u;if(e[0]!==c._meta||e[1]!==c.name||e[2]!==c.title){const T=Ce(c._meta);u=c.title??et(c.name,T),e[0]=c._meta,e[1]=c.name,e[2]=c.title,e[3]=u}else u=e[3];const d=u,f=c.description||null;if(i==="card"){let T;e[4]!==o||e[5]!==c?(T=()=>o(c),e[4]=o,e[5]=c,e[6]=T):T=e[6];const B=a||s,M=s&&"bg-accent/40",L=(a||s)&&"cursor-not-allowed opacity-50";let _;e[7]!==M||e[8]!==L?(_=H($t,"hover:bg-accent/60 text-foreground",M,L),e[7]=M,e[8]=L,e[9]=_):_=e[9];let p;e[10]!==d?(p=n.jsx("span",{className:"font-medium truncate capitalize",children:d}),e[10]=d,e[11]=p):p=e[11];let w;e[12]!==s?(w=s&&n.jsx(ue,{size:"xs"}),e[12]=s,e[13]=w):w=e[13];let h;e[14]!==p||e[15]!==w?(h=n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p,w]}),e[14]=p,e[15]=w,e[16]=h):h=e[16];let v;e[17]!==f?(v=f&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=v):v=e[18];let N;return e[19]!==h||e[20]!==v||e[21]!==T||e[22]!==B||e[23]!==_?(N=n.jsxs("button",{type:"button",onClick:T,disabled:B,className:_,children:[h,v]}),e[19]=h,e[20]=v,e[21]=T,e[22]=B,e[23]=_,e[24]=N):N=e[24],N}let m;e[25]!==o||e[26]!==c?(m=()=>o(c),e[25]=o,e[26]=c,e[27]=m):m=e[27];const S=a||s,j=s&&"bg-muted/50",E=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==j||e[29]!==E?(x=H(De,"hover:bg-muted/70 hover:text-foreground",j,E),e[28]=j,e[29]=E,e[30]=x):x=e[30];let b;e[31]!==d?(b=n.jsx("span",{className:"capitalize",children:d}),e[31]=d,e[32]=b):b=e[32];let C;e[33]!==s?(C=s&&n.jsx(ue,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let y;e[35]!==m||e[36]!==S||e[37]!==x||e[38]!==b||e[39]!==C?(y=n.jsx(tt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:m,disabled:S,className:x,children:[b,C]})}),e[35]=m,e[36]=S,e[37]=x,e[38]=b,e[39]=C,e[40]=y):y=e[40];const P=f??d;let g;e[41]!==P?(g=n.jsx(st,{side:"top",className:"max-w-xs",children:n.jsx("p",{className:"text-xs",children:P})}),e[41]=P,e[42]=g):g=e[42];let D;return e[43]!==y||e[44]!==g?(D=n.jsxs(nt,{delayDuration:400,children:[y,g]}),e[43]=y,e[44]=g,e[45]=D):D=e[45],D}function Ft(t){const e=F.c(61),{items:r,open:o,onOpenChange:s,onSelect:a,loadingPrompt:l}=t,i=Z(),[c,u]=k.useState(""),d=!!l;let f;e[0]!==r||e[1]!==c?(f=c.trim()?r.filter(p=>{const w=c.toLowerCase();return p.prompt.name.toLowerCase().includes(w)||(p.prompt.title??"").toLowerCase().includes(w)||(p.prompt.description??"").toLowerCase().includes(w)}):r,e[0]=r,e[1]=c,e[2]=f):f=e[2];const m=f,S=ct();let j;e[3]!==m.length||e[4]!==c||e[5]!==i?(j=m.length===0&&n.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:i("chat.iceBreakers.noPromptsMatch",{search:c})}),e[3]=m.length,e[4]=c,e[5]=i,e[6]=j):j=e[6];let E;if(e[7]!==m||e[8]!==d||e[9]!==l?.name||e[10]!==s||e[11]!==a){let p;e[13]!==d||e[14]!==l?.name||e[15]!==s||e[16]!==a?(p=w=>n.jsx(Re,{item:w,variant:"card",onSelect:h=>{s(!1),a(h)},isLoading:l?.name===w.prompt.name,isDisabled:d&&l?.name!==w.prompt.name},w.prompt.name),e[13]=d,e[14]=l?.name,e[15]=s,e[16]=a,e[17]=p):p=e[17],E=m.map(p),e[7]=m,e[8]=d,e[9]=l?.name,e[10]=s,e[11]=a,e[12]=E}else E=e[12];let x;e[18]!==j||e[19]!==E?(x=n.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[j,E]})}),e[18]=j,e[19]=E,e[20]=x):x=e[20];const b=x;let C;e[21]!==i?(C=i("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=i,e[22]=C):C=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=p=>{p.key==="Escape"&&u("")},e[23]=y):y=e[23];let P;e[24]!==c||e[25]!==C?(P=n.jsx(it,{value:c,onChange:u,placeholder:C,onKeyDown:y}),e[24]=c,e[25]=C,e[26]=P):P=e[26];const g=P;if(S){let p;e[27]!==i?(p=i("chat.iceBreakers.allPromptsTitle"),e[27]=i,e[28]=p):p=e[28];let w;e[29]!==p?(w=n.jsx(rt,{className:"sr-only",children:n.jsx(at,{children:p})}),e[29]=p,e[30]=w):w=e[30];let h;e[31]!==i?(h=i("chat.iceBreakers.promptsLabel"),e[31]=i,e[32]=h):h=e[32];let v;e[33]!==h?(v=n.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:n.jsx("span",{className:"text-sm font-medium text-foreground",children:h})}),e[33]=h,e[34]=v):v=e[34];let N;e[35]!==b||e[36]!==g||e[37]!==v||e[38]!==w?(N=n.jsxs(ot,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[w,v,g,b]}),e[35]=b,e[36]=g,e[37]=v,e[38]=w,e[39]=N):N=e[39];let $;return e[40]!==s||e[41]!==o||e[42]!==N?($=n.jsx(se,{delayDuration:400,children:n.jsx(lt,{open:o,onOpenChange:s,children:N})}),e[40]=s,e[41]=o,e[42]=N,e[43]=$):$=e[43],$}let D;e[44]!==i?(D=i("chat.iceBreakers.allPromptsTitle"),e[44]=i,e[45]=D):D=e[45];let T;e[46]!==D?(T=n.jsx(be,{className:"sr-only",children:n.jsx(ye,{children:D})}),e[46]=D,e[47]=T):T=e[47];let B;e[48]!==i?(B=i("chat.iceBreakers.promptsLabel"),e[48]=i,e[49]=B):B=e[49];let M;e[50]!==B?(M=n.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:n.jsx("span",{className:"text-sm font-medium text-foreground",children:B})}),e[50]=B,e[51]=M):M=e[51];let L;e[52]!==b||e[53]!==g||e[54]!==M||e[55]!==T?(L=n.jsxs(ve,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[T,M,g,b]}),e[52]=b,e[53]=g,e[54]=M,e[55]=T,e[56]=L):L=e[56];let _;return e[57]!==s||e[58]!==o||e[59]!==L?(_=n.jsx(se,{delayDuration:400,children:n.jsx(Se,{open:o,onOpenChange:s,children:L})}),e[57]=s,e[58]=o,e[59]=L,e[60]=_):_=e[60],_}function Ht(t){const e=F.c(30),{items:r,onSelect:o,loadingPrompt:s,className:a}=t,l=Z(),[i,c]=k.useState(!1);if(r.length===0)return null;let u,d,f,m,S;if(e[0]!==a||e[1]!==r||e[2]!==s||e[3]!==o||e[4]!==l){const b=r.slice(0,xe),C=r.slice(xe),y=!!s;let P;e[10]!==y||e[11]!==s?.name||e[12]!==o?(P=D=>n.jsx(Re,{item:D,onSelect:o,isLoading:s?.name===D.prompt.name,isDisabled:y&&s?.name!==D.prompt.name},D.prompt.name),e[10]=y,e[11]=s?.name,e[12]=o,e[13]=P):P=e[13];const g=b.map(P);u=se,S=400,e[14]!==a?(d=H("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=d):d=e[15],f=g,m=C.length>0&&n.jsx("button",{type:"button",disabled:y,onClick:()=>c(!0),className:H(De,"hover:bg-muted/70 hover:text-foreground",y&&"opacity-50 cursor-not-allowed"),children:l("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=a,e[1]=r,e[2]=s,e[3]=o,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=m,e[9]=S}else u=e[5],d=e[6],f=e[7],m=e[8],S=e[9];let j;e[16]!==d||e[17]!==f||e[18]!==m?(j=n.jsxs("div",{className:d,children:[f,m]}),e[16]=d,e[17]=f,e[18]=m,e[19]=j):j=e[19];let E;e[20]!==r||e[21]!==s||e[22]!==i||e[23]!==o?(E=n.jsx(Ft,{items:r,open:i,onOpenChange:c,onSelect:o,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=i,e[23]=o,e[24]=E):E=e[24];let x;return e[25]!==u||e[26]!==S||e[27]!==j||e[28]!==E?(x=n.jsxs(u,{delayDuration:S,children:[j,E]}),e[25]=u,e[26]=S,e[27]=j,e[28]=E,e[29]=x):x=e[29],x}function zt(){return null}function Kt(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 qt(t){const e=F.c(31),{connectionId:r}=t,o=Z(),{sendMessage:s}=Ne(),{org:a}=X();let l;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const i=ut(l);let c;e[4]!==i?(c={client:i,staleTime:6e4},e[4]=i,e[5]=c):c=e[5];const{data:u}=dt(c);let d;e[6]!==u?.prompts?(d=u?.prompts??[],e[6]=u?.prompts,e[7]=d):d=e[7];const f=d;let m;e[8]!==f?(m=f.map(Gt),e[8]=f,e[9]=m):m=e[9];const S=m;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j={stage:"idle"},e[10]=j):j=e[10];const[E,x]=k.useReducer(Kt,j),[b,C]=k.useState(null);let y;e[11]!==i||e[12]!==s||e[13]!==o?(y=async(h,v)=>{if(!i){ce.error(o("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const N=await ft(i,h.name,v);x({type:"RESET"});const $={type:"doc",content:[{type:"paragraph",content:[mt({id:h.name,name:Ze(h.name,Ce(h._meta)),metadata:N.messages,char:"/",kind:"prompt",args:v}),{type:"text",text:" "}]}]};await s($)}catch(N){console.error("[ice-breakers] Failed to fetch prompt:",N),ce.error(o("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=i,e[12]=s,e[13]=o,e[14]=y):y=e[14];const P=y;let g;e[15]!==P?(g=async h=>{if(h.arguments&&h.arguments.length>0){x({type:"SELECT_PROMPT",prompt:h}),C(h);return}x({type:"START_LOADING",prompt:h}),await P(h)},e[15]=P,e[16]=g):g=e[16];const D=g;let T;e[17]!==b||e[18]!==P?(T=async h=>{b&&(x({type:"START_LOADING",prompt:b,arguments:h}),C(null),await P(b,h))},e[17]=b,e[18]=P,e[19]=T):T=e[19];const B=T;if(S.length===0)return null;const M=E.stage==="loading"?E.prompt:null;let L;e[20]!==D||e[21]!==S||e[22]!==M?(L=n.jsx(Ht,{items:S,onSelect:D,loadingPrompt:M}),e[20]=D,e[21]=S,e[22]=M,e[23]=L):L=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{C(null),x({type:"RESET"})},e[24]=_):_=e[24];let p;e[25]!==b||e[26]!==B?(p=n.jsx(pt,{prompt:b,setPrompt:_,onSubmit:B}),e[25]=b,e[26]=B,e[27]=p):p=e[27];let w;return e[28]!==L||e[29]!==p?(w=n.jsxs(n.Fragment,{children:[L,p]}),e[28]=L,e[29]=p,e[30]=w):w=e[30],w}function Gt(t){return{prompt:t}}function Ut(t){const e=F.c(13),{className:r}=t,{selectedVirtualMcp:o}=$e(),{org:s}=X();let a;e[0]!==s.id?(a=Oe(s.id),e[0]=s.id,e[1]=a):a=e[1];const l=a.id,i=o?.id??l;let c;e[2]!==r?(c=H("w-full @container",r),e[2]=r,e[3]=c):c=e[3];const u=i??"default";let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(zt,{}),e[4]=d):d=e[4];let f;e[5]!==i?(f=n.jsx(qt,{connectionId:i}),e[5]=i,e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==f?(m=n.jsx(Ae,{fallback:null,children:n.jsx(k.Suspense,{fallback:d,children:f},u)}),e[7]=u,e[8]=f,e[9]=m):m=e[9];let S;return e[10]!==c||e[11]!==m?(S=n.jsx("div",{className:c,children:m}),e[10]=c,e[11]=m,e[12]=S):S=e[12],S}function Qt(t){let e=0;for(const r of t)for(const o of r.parts??[]){const s=o;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function Vt(){const t=F.c(8),{openPanel:e}=Et(),r=wt(),o=Fe()?.messages??[],s=we()?.taskId??null;let a;t[0]!==o?(a=Qt(o),t[0]=o,t[1]=a):a=t[1];const l=a,i=k.useRef(null),c=k.useRef(null);let u,d;t[2]!==l||t[3]!==r||t[4]!==e||t[5]!==s?(u=()=>{if(!l||!s)return;const f=`${s}:${l}`;c.current!==f&&(c.current=f,r?.refreshThreadMetadata(s)),i.current!==s&&(i.current=s,e("site-editor"))},d=[l,s,e,r],t[2]=l,t[3]=r,t[4]=e,t[5]=s,t[6]=u,t[7]=d):(u=t[6],d=t[7]),k.useEffect(u,d)}function _e(t){return`deco-credits-empty-dismissed:${t}`}function Ls(t){try{return localStorage.getItem(_e(t))==="1"}catch{return!1}}function Yt(){const t=F.c(56),e=Z(),{org:r}=X(),o=Tt("credits"),s=je(),{decoKeyId:a}=kt(),[l,i]=k.useState(!0);let c;t[0]!==r.id?(c=()=>{de("credits_empty_state_dismissed",{organization_id:r.id}),i(!1);try{localStorage.setItem(_e(r.id),"1")}catch{}},t[0]=r.id,t[1]=c):c=t[1];const u=c;let d,f;if(t[2]!==l||t[3]!==r.id?(d=()=>{l&&de("credits_empty_state_shown",{organization_id:r.id})},f=[l,r.id],t[2]=l,t[3]=r.id,t[4]=d,t[5]=f):(d=t[4],f=t[5]),k.useEffect(d,f),!l)return null;if(!o){let h;t[6]!==e?(h=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=h):h=t[7];let v;t[8]!==h?(v={title:h},t[8]=h,t[9]=v):v=t[9];let N;return t[10]!==u||t[11]!==v?(N=n.jsx(Pt,{feature:"chat",copy:v,onDismiss:u}),t[10]=u,t[11]=v,t[12]=N):N=t[12],N}let m;t[13]!==u?(m=h=>!h&&u(),t[13]=u,t[14]=m):m=t[14];let S;t[15]===Symbol.for("react.memo_cache_sentinel")?(S=n.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]=S):S=t[15];let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:n.jsx(Te,{size:20,className:"text-warning"})}),t[16]=j):j=t[16];let E;t[17]!==e?(E=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=E):E=t[18];let x;t[19]!==E?(x=n.jsx(ye,{className:"text-lg font-semibold",children:E}),t[19]=E,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 C;t[23]!==b?(C=n.jsx(Ie,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=C):C=t[24];let y;t[25]!==x||t[26]!==C?(y=n.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[S,n.jsxs(be,{className:"relative gap-3",children:[j,n.jsxs("div",{className:"text-center",children:[x,C]})]})]}),t[25]=x,t[26]=C,t[27]=y):y=t[27];let P;t[28]!==a||t[29]!==u?(P=a&&n.jsx("div",{className:"px-6 pb-5",children:n.jsx(ht,{source:"empty_state",onDone:u})}),t[28]=a,t[29]=u,t[30]=P):P=t[30];let g;t[31]!==u||t[32]!==s||t[33]!==r.slug?(g=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),u()},t[31]=u,t[32]=s,t[33]=r.slug,t[34]=g):g=t[34];let D;t[35]!==e?(D=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=D):D=t[36];let T;t[37]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(Ct,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=T):T=t[37];let B;t[38]!==g||t[39]!==D?(B=n.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:g,children:[D,T]}),t[38]=g,t[39]=D,t[40]=B):B=t[40];let M;t[41]!==e?(M=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=M):M=t[42];let L;t[43]!==u||t[44]!==M?(L=n.jsx(Ee,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:u,children:M}),t[43]=u,t[44]=M,t[45]=L):L=t[45];let _;t[46]!==B||t[47]!==L?(_=n.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[B,L]}),t[46]=B,t[47]=L,t[48]=_):_=t[48];let p;t[49]!==y||t[50]!==P||t[51]!==_?(p=n.jsxs(ve,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Jt,children:[y,P,_]}),t[49]=y,t[50]=P,t[51]=_,t[52]=p):p=t[52];let w;return t[53]!==p||t[54]!==m?(w=n.jsx(Se,{open:!0,onOpenChange:m,children:p}),t[53]=p,t[54]=m,t[55]=w):w=t[55],w}function Jt(t){return t.preventDefault()}function Wt(t){const e=F.c(6),{balanceDollars:r}=t;let o;e[0]!==r?(o=r.toFixed(2),e[0]=r,e[1]=o):o=e[1];const s=o;let a,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=H("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"),l=n.jsx(Te,{size:13,className:"text-success"}),e[2]=a,e[3]=l):(a=e[2],l=e[3]);let i;return e[4]!==s?(i=n.jsxs("div",{className:a,children:[l,n.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=i):i=e[5],i}function Xt(){const t=F.c(8),{org:e}=X(),r=je();let o;t[0]!==r||t[1]!==e.slug?(o=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=o):o=t[2];let s,a,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=H("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg 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=n.jsx(Dt,{size:13,className:"text-warning"}),l=n.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=l):(s=t[3],a=t[4],l=t[5]);let i;return t[6]!==o?(i=n.jsxs("button",{type:"button",onClick:o,className:s,children:[a,l]}),t[6]=o,t[7]=i):i=t[7],i}function Zt(t){const e=F.c(7),{scrollRef:r,sentinelRef:o,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:l}=t;let i,c;e[0]!==l||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==o?(i=()=>{const u=o.current,d=r.current;if(!u||!d||!s)return;const f=new IntersectionObserver(async m=>{if(!m[0]?.isIntersecting||a||!s)return;const j=d.scrollHeight,E=d.scrollTop;await l(),requestAnimationFrame(()=>{const x=d.scrollHeight;d.scrollTop=E+(x-j)})},{root:d,rootMargin:"200px 0px 0px 0px"});return f.observe(u),()=>f.disconnect()},c=[r,o,s,a,l],e[0]=l,e[1]=s,e[2]=a,e[3]=r,e[4]=o,e[5]=i,e[6]=c):(i=e[5],c=e[6]),k.useEffect(i,c)}function es(t){const e=F.c(5),{className:r,children:o}=t;let s;e[0]!==r?(s=H("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]!==o||e[3]!==s?(a=n.jsx("div",{className:s,children:o}),e[2]=o,e[3]=s,e[4]=a):a=e[4],a}function ts(t){const e=F.c(5),{children:r,className:o}=t;let s;e[0]!==o?(s=H("flex-1 min-h-0 overflow-y-auto isolate",o),e[0]=o,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=n.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}function ss(t){const e=F.c(2),{children:r}=t;let o;return e[0]!==r?(o=n.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]=o):o=e[1],o}function ns(){const t=Z(),{messages:e,status:r,hasMoreOlder:o,isFetchingOlder:s,fetchOlderMessages:a,isRunInProgress:l}=Ne(),{taskId:i}=qe();Vt();const c=Ge(i??""),u=Ue(c),d=u.size===0?e:e.filter(g=>!u.has(g.id)),f=Qe(d,r==="submitted"||r==="streaming"||l),m=f.visible,S=vt(m),j=S.at(-1),x=bt()*yt+16,b=k.useRef(null),C=k.useRef(null);Zt({scrollRef:b,sentinelRef:C,hasMoreOlder:o,isFetchingOlder:s,fetchOlderMessages:a});const y=St({initial:!1}),P=g=>{b.current=g,y.scrollRef(g)};return n.jsx(Ve.Provider,{value:f,children:n.jsx(jt,{messages:e,children:n.jsxs("div",{className:"relative h-full w-full min-w-0",children:[n.jsx("div",{ref:P,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:x},children:n.jsxs("div",{ref:y.contentRef,className:"overflow-x-clip",children:[n.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[n.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&n.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),S.slice(0,-1).map((g,D)=>n.jsx(fe,{pair:g,isLastPair:!1,status:D===S.length-1?r:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),j&&n.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:n.jsx(fe,{pair:j,isLastPair:!0,status:r},`pair-${j.user?.id??j.assistant?.id}`)})]})}),!y.isAtBottom&&n.jsx(Ee,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:x+8},onClick:()=>{y.scrollToBottom()},children:n.jsx(Xe,{size:14})})]})})})}function rs(t){const e=F.c(5),{children:r,className:o}=t;let s;e[0]!==o?(s=H("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",o),e[0]=o,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=n.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}const Ms=Object.assign(es,{Main:ts,Messages:ns,EmptyState:ss,Footer:rs,Input:xt,Provider:Ke,ActiveTaskProvider:ze,ThreadlessProvider:He,IceBreakers:Ut,NoAiProviderEmptyState:Nt,CreditsEmptyState:Yt,CreditsEyebrow:Wt,NoCreditsEyebrow:Xt,CreditsExhaustedBanner:gt});export{Ms as C,Ds as S,Rs as a,_s as b,me as i,Pe as u,Ls as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,r as G,l as B,j as i,b as X,B as je,a as he,t as te,G as Te,at as fe,av as ge,a2 as we,d as Ie,E as Le,L as ze,Y as Ee,y as ue,ab as Pe,P as $e}from"./index-BOCmUs5e.js";import{h as Me,P as Oe,u as xe,i as De,j as Ke,l as We,m as Be}from"./use-app-takeover-CfJ3KcD6.js";import{S as Fe,a as Ge,b as Xe}from"./sheet-ByjoR9NZ.js";import{u as He}from"./use-mobile-CbyN-2jY.js";import{u as Ye,a as qe,D as Ue,c as Je,C as Ve,P as Ze}from"./core.esm-BfHJA0TA.js";import{S as Qe,v as et,u as tt}from"./sortable.esm-D7jA01m7.js";import{i as st}from"./Tool01-BsXZFLbB.js";import{A as nt,z as ve,B as it}from"./agent-icon-ndY1RWjU.js";import{s as rt}from"./Plus-DNWiwlMd.js";import{s as _e}from"./XClose-BHIq2rSj.js";import{T as ie,a as re,c as oe}from"./tooltip-BK6bkzFU.js";import{C as me,f as ot,g as lt,e as at}from"./context-menu-CeIyABDi.js";import{C as ct}from"./create-organization-dialog-C9vMS6wi.js";import{u as dt,a as ut,b as ft}from"./use-recent-apps-F4etVz5-.js";import{i as ht}from"./UserSquare-BO3h4SWI.js";import{e as mt,C as pt,b as gt,c as xt,f as bt}from"./command-ChZnkO48.js";function jt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const o=Math.abs(e)%360;return{backgroundColor:`hsl(${o} 55% 70%)`,color:`hsl(${o} 55% 20%)`}}const vt={xs:{box:"size-5",text:"text-[9px]"},sm:{box:"size-6",text:"text-xs"},lg:{box:"size-9",text:"text-sm"}};function be(t){const e=L.c(14),{org:o,size:r,rounded:n}=t,l=r===void 0?"sm":r,s=n===void 0?"rounded-md":n,{box:a,text:c}=vt[l],[d,p]=G.useState(null),u=o.logo&&o.logo!==d?o.logo:null;let h;e[0]!==s||e[1]!==a?(h=B(a,s,"shrink-0 flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=s,e[1]=a,e[2]=h):h=e[2];let m;e[3]!==u||e[4]!==o.name?(m=u?void 0:jt(o.name),e[3]=u,e[4]=o.name,e[5]=m):m=e[5];let f;e[6]!==u||e[7]!==o.name||e[8]!==c?(f=u?i.jsx("img",{src:u,alt:"",className:"size-full object-cover",onError:()=>p(u)}):i.jsx("span",{className:B("font-semibold leading-none",c),children:o.name.slice(0,2).toUpperCase()}),e[6]=u,e[7]=o.name,e[8]=c,e[9]=f):f=e[9];let g;return e[10]!==h||e[11]!==m||e[12]!==f?(g=i.jsx("div",{className:h,style:m,children:f}),e[10]=h,e[11]=m,e[12]=f,e[13]=g):g=e[13],g}function bs({invitation:t,onChanged:e}){const o=X(),[r,n]=G.useState(!1),l=t.organizationName??o("header.orgSwitcher.unknownOrganization"),s=async()=>{n(!0);try{const d=await he.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),n(!1);return}}catch{te.error(o("header.orgSwitcher.failedToAcceptInvitation")),n(!1);return}te.success(o("header.orgSwitcher.joined",{name:l})),Te();let c;try{c=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{n(!0);try{const c=await he.organization.rejectInvitation({invitationId:t.id});if(c.error){te.error(c.error.message),n(!1);return}te.success(o("header.orgSwitcher.invitationDeclined")),n(!1),e()}catch{te.error(o("header.orgSwitcher.failedToDeclineInvitation")),n(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(be,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:o("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:s,disabled:r,children:o("header.orgSwitcher.accept")}),i.jsx(je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:r,"aria-label":o("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(_e,{size:14})})]})]})}const yt=3,Ce=10,St=440,wt=55;function Re(t){const e=Math.floor((t-St)/wt);return Math.min(Ce,Math.max(yt,e))}function zt(t,e,o=Ce*3,r=[]){return[...new Set([e,...r,...t])].slice(0,o)}function Ot(t,e,o,r,n=[]){if(t.length<=r)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),s=new Set;o&&l.has(o)&&s.add(o);for(const a of n)l.has(a)&&s.add(a);for(const a of e){if(s.size>=r)break;l.has(a)&&s.add(a)}for(const a of t){if(s.size>=r)break;s.add(a.slug)}return{shown:t.filter(a=>s.has(a.slug)),hidden:t.filter(a=>!s.has(a.slug))}}const ye=[];function _t(){const t=L.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ge.recentOrgs(),t[0]=e):e=t[0];const[o,r]=fe(e,ye),n=Array.isArray(o)?o:ye;let l;t[1]!==r?(l=(a,c)=>r(d=>zt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=r,t[2]=l):l=t[2];let s;return t[3]!==n||t[4]!==l?(s={recent:n,remember:l},t[3]=n,t[4]=l,t[5]=s):s=t[5],s}const Ne={hidden:[],pinned:[],order:[]},ne=(t,e)=>t.filter(o=>o!==e);function se(t){if(typeof t!="object"||t===null)return Ne;const e=r=>Array.isArray(r)?r.filter(n=>typeof n=="string"):[],o=t;return{hidden:e(o.hidden),pinned:e(o.pinned),order:e(o.order)}}function Ct(t,e){return{...t,hidden:[...ne(t.hidden,e),e],pinned:ne(t.pinned,e)}}function Rt(t,e){return{...t,hidden:ne(t.hidden,e)}}function Nt(t,e){return t.pinned.includes(e)?{...t,pinned:ne(t.pinned,e)}:{...t,hidden:ne(t.hidden,e),pinned:[...t.pinned,e]}}function At(t,e,o){const r=n=>{const l=e.order.indexOf(n);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(n=>n.slug===o||!e.hidden.includes(n.slug)).map((n,l)=>({org:n,index:l})).sort((n,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(n.org.slug))||r(n.org.slug)-r(l.org.slug)||n.index-l.index).map(({org:n})=>n)}function kt(t,e,o,r){const n=e.indexOf(o),l=e.indexOf(r);if(n===-1||l===-1||n===l||t.pinned.includes(o)!==t.pinned.includes(r))return t;const s=[...e];return s.splice(n,1),s.splice(l,0,o),{...t,order:[...s,...t.order.filter(a=>!s.includes(a))]}}function le(t){const e=L.c(11),{active:o,label:r,children:n}=t,l=o?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let s;e[0]!==l?(s=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==s?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-0 flex h-9 items-center",children:i.jsx("span",{className:s})}),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==o||e[5]!==r?(c=r&&i.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",o?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=o,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==n||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,n,c]}),e[7]=n,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Tt(t){const e=L.c(47),{orgs:o,currentSlug:r,hiddenCount:n,onSelect:l}=t,s=X(),[a,c]=G.useState(!1);let d;e[0]!==s?(d=s("sidebar.rail.searchOrganizations"),e[0]=s,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[2]=p):p=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ht,{size:18}),e[3]=u):u=e[3];let h;e[4]!==d?(h=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":d,onClick:p,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u})}),e[4]=d,e[5]=h):h=e[5];let m;e[6]!==n||e[7]!==s?(m=n>0?s("sidebar.rail.searchMoreOrganizations",{count:n}):s("sidebar.rail.searchOrganizations"),e[6]=n,e[7]=s,e[8]=m):m=e[8];let f;e[9]!==m?(f=i.jsx(re,{side:"right",children:m}),e[9]=m,e[10]=f):f=e[10];let g;e[11]!==h||e[12]!==f?(g=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[h,f]})}),e[11]=h,e[12]=f,e[13]=g):g=e[13];let b;e[14]!==s?(b=s("sidebar.rail.searchOrganizations"),e[14]=s,e[15]=b):b=e[15];let y;e[16]!==s?(y=s("sidebar.rail.searchPlaceholder"),e[16]=s,e[17]=y):y=e[17];let v;e[18]!==s?(v=s("sidebar.rail.searchPlaceholder"),e[18]=s,e[19]=v):v=e[19];let w;e[20]!==v?(w=i.jsx(mt,{placeholder:v}),e[20]=v,e[21]=w):w=e[21];let S;e[22]!==s?(S=s("sidebar.rail.searchEmpty"),e[22]=s,e[23]=S):S=e[23];let j;e[24]!==S?(j=i.jsx(pt,{children:S}),e[24]=S,e[25]=j):j=e[25];let x;if(e[26]!==r||e[27]!==l||e[28]!==o||e[29]!==s){let R;e[31]!==r||e[32]!==l||e[33]!==s?(R=_=>i.jsxs(gt,{value:`${_.name} ${_.slug}`,onSelect:()=>{c(!1),_.slug!==r&&l(_.slug)},className:"gap-2.5",children:[i.jsx(be,{org:_,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:_.name}),_.slug===r&&i.jsx("span",{className:"text-meta shrink-0",children:s("sidebar.rail.currentOrganization")})]},_.id),e[31]=r,e[32]=l,e[33]=s,e[34]=R):R=e[34],x=o.map(R),e[26]=r,e[27]=l,e[28]=o,e[29]=s,e[30]=x}else x=e[30];let O;e[35]!==j||e[36]!==x?(O=i.jsxs(xt,{children:[j,x]}),e[35]=j,e[36]=x,e[37]=O):O=e[37];let C;e[38]!==a||e[39]!==w||e[40]!==O||e[41]!==b||e[42]!==y?(C=i.jsxs(bt,{open:a,onOpenChange:c,title:b,description:y,children:[w,O]}),e[38]=a,e[39]=w,e[40]=O,e[41]=b,e[42]=y,e[43]=C):C=e[43];let N;return e[44]!==C||e[45]!==g?(N=i.jsxs(i.Fragment,{children:[g,C]}),e[44]=C,e[45]=g,e[46]=N):N=e[46],N}function It(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Lt=()=>Re(globalThis.innerHeight),Et=()=>Re(0);function Pt(t){const e=L.c(57),{org:o,active:r,onSelect:n,pinned:l,onOpenSettings:s,onTogglePin:a,onHide:c}=t,d=X();let p;e[0]!==o.slug?(p={id:o.slug},e[0]=o.slug,e[1]=p):p=e[1];const{setNodeRef:u,listeners:h,transform:m,transition:f,isDragging:g}=tt(p);let b;e[2]!==m?(b=Ve.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=b):b=e[3];const y=g?1:void 0;let v;e[4]!==b||e[5]!==y||e[6]!==f?(v={transform:b,transition:f,zIndex:y},e[4]=b,e[5]=y,e[6]=f,e[7]=v):v=e[7];const w=o.name,S=r||void 0,j=r?void 0:n,x=r?"opacity-100":"cursor-pointer opacity-60 hover:scale-105 hover:opacity-100";let O;e[8]!==x?(O=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",x),e[8]=x,e[9]=O):O=e[9];let C;e[10]!==o?(C=i.jsx(be,{org:o,size:"lg",rounded:"rounded-xl"}),e[10]=o,e[11]=C):C=e[11];let N;e[12]!==l?(N=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(ve,{size:9})}),e[12]=l,e[13]=N):N=e[13];let R;e[14]!==o.name||e[15]!==C||e[16]!==N||e[17]!==S||e[18]!==j||e[19]!==O?(R=i.jsx(ie,{asChild:!0,children:i.jsx(ot,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":w,"aria-current":S,onClick:j,className:O,children:[C,N]})})}),e[14]=o.name,e[15]=C,e[16]=N,e[17]=S,e[18]=j,e[19]=O,e[20]=R):R=e[20];let _;e[21]!==o.name?(_=i.jsx(re,{side:"right",children:o.name}),e[21]=o.name,e[22]=_):_=e[22];let A;e[23]!==R||e[24]!==_?(A=i.jsxs(oe,{children:[R,_]}),e[23]=R,e[24]=_,e[25]=A):A=e[25];let E;e[26]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(it,{}),e[26]=E):E=e[26];let $;e[27]!==d?($=d("sidebar.rail.organizationSettings"),e[27]=d,e[28]=$):$=e[28];let M;e[29]!==s||e[30]!==$?(M=i.jsxs(me,{onSelect:s,children:[E,$]}),e[29]=s,e[30]=$,e[31]=M):M=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=i.jsx(ve,{}),e[32]=F):F=e[32];let D;e[33]!==l||e[34]!==d?(D=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[33]=l,e[34]=d,e[35]=D):D=e[35];let K;e[36]!==a||e[37]!==D?(K=i.jsxs(me,{onSelect:a,children:[F,D]}),e[36]=a,e[37]=D,e[38]=K):K=e[38];let W;e[39]!==c||e[40]!==d?(W=c&&i.jsxs(me,{onSelect:c,children:[i.jsx(st,{}),d("sidebar.rail.hideOrganization")]}),e[39]=c,e[40]=d,e[41]=W):W=e[41];let k;e[42]!==M||e[43]!==K||e[44]!==W?(k=i.jsxs(lt,{children:[M,K,W]}),e[42]=M,e[43]=K,e[44]=W,e[45]=k):k=e[45];let T;e[46]!==A||e[47]!==k?(T=i.jsxs(at,{children:[A,k]}),e[46]=A,e[47]=k,e[48]=T):T=e[48];let I;e[49]!==r||e[50]!==T?(I=i.jsx(le,{active:r,children:T}),e[49]=r,e[50]=T,e[51]=I):I=e[51];let P;return e[52]!==h||e[53]!==u||e[54]!==I||e[55]!==v?(P=i.jsx("div",{ref:u,...h,style:v,className:"w-full shrink-0 touch-none",children:I}),e[52]=h,e[53]=u,e[54]=I,e[55]=v,e[56]=P):P=e[56],P}function $t(t,e,o){const r={org:e,agentId:t.projectId};if(t.connection){const{label:l,icon:s,id:a,toolName:c}=t.connection;return{label:l,link:{to:Ee.app,params:{...r,connectionId:a,toolName:c}},glyph:i.jsx(nt,{icon:s,name:l,size:"sm+",className:"size-9 rounded-xl"})}}const n=Oe[t.app];return n?{label:o(n.labelKey),link:{to:n.to,params:r},tone:n.tone,glyph:i.jsx(n.Icon,{size:18})}:null}function Mt(t){const e=L.c(31),{entry:o,orgSlug:r,active:n,onClose:l}=t,s=X();let a,c,d,p,u,h,m,f;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s){f=Symbol.for("react.early_return_sentinel");e:{const j=$t(o,r,s);if(!j){f=null;break e}a=le,h=n,m=j.label,p="relative";let x;e[12]!==o.projectTitle?(x=i.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",o.projectTitle]}),e[12]=o.projectTitle,e[13]=x):x=e[13],u=i.jsxs(oe,{children:[i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:j.link.to,params:j.link.params,"aria-label":`${j.label} · ${o.projectTitle}`,"aria-current":n||void 0,onClick:Dt,className:B("flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",j.tone,n?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100"),children:j.glyph})}),i.jsxs(re,{side:"right",children:[j.label,x]})]}),c="button",d=s("sidebar.rail.closeApp",{name:j.label})}e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=p,e[8]=u,e[9]=h,e[10]=m,e[11]=f}else a=e[4],c=e[5],d=e[6],p=e[7],u=e[8],h=e[9],m=e[10],f=e[11];if(f!==Symbol.for("react.early_return_sentinel"))return f;let g;e[14]!==l?(g=()=>{ue("org_rail_recent_app_closed"),l()},e[14]=l,e[15]=g):g=e[15];let b,y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=B("absolute -top-1.5 -right-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),b=i.jsx(_e,{size:10}),e[16]=b,e[17]=y):(b=e[16],y=e[17]);let v;e[18]!==c||e[19]!==d||e[20]!==g?(v=i.jsx("button",{type:c,"aria-label":d,onClick:g,className:y,children:b}),e[18]=c,e[19]=d,e[20]=g,e[21]=v):v=e[21];let w;e[22]!==v||e[23]!==p||e[24]!==u?(w=i.jsxs("div",{className:p,children:[u,v]}),e[22]=v,e[23]=p,e[24]=u,e[25]=w):w=e[25];let S;return e[26]!==a||e[27]!==w||e[28]!==h||e[29]!==m?(S=i.jsx(a,{active:h,label:m,children:w}),e[26]=a,e[27]=w,e[28]=h,e[29]=m,e[30]=S):S=e[30],S}function Dt(){return ue("org_rail_recent_app_opened")}const Kt={"site-editor":"/site-editor"};function Wt(t){const e=L.c(26),{app:o}=t,r=X(),n=Oe[o],l=Kt[o];if(!n||!l)return null;let s;e[0]!==n.labelKey||e[1]!==r?(s=r(n.labelKey),e[0]=n.labelKey,e[1]=r,e[2]=s):s=e[2];let a;e[3]!==n.labelKey||e[4]!==r?(a=r(n.labelKey),e[3]=n.labelKey,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==n.tone?(c=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",n.tone),e[6]=n.tone,e[7]=c):c=e[7];let d;e[8]!==n.Icon?(d=i.jsx(n.Icon,{size:18}),e[8]=n.Icon,e[9]=d):d=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(p=i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=p):p=e[14];let u;e[15]!==n.labelKey||e[16]!==r?(u=r(n.labelKey),e[15]=n.labelKey,e[16]=r,e[17]=u):u=e[17];let h;e[18]!==u?(h=i.jsx(re,{side:"right",children:u}),e[18]=u,e[19]=h):h=e[19];let m;e[20]!==p||e[21]!==h?(m=i.jsxs(oe,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=m):m=e[22];let f;return e[23]!==s||e[24]!==m?(f=i.jsx(le,{active:!0,label:s,children:m}),e[23]=s,e[24]=m,e[25]=f):f=e[25],f}function Bt(){const{org:t}=we();return dt(t.slug),null}function Ft(){const t=L.c(56),e=X(),o=Ie(),{org:r}=we(),{data:n}=Le(),[l,s]=G.useState(!1),a=Me(),{recent:c,forget:d}=ut(r.slug),p=ft(),u=p&&p.projectId===null?p.app:null;let h;t[0]!==u||t[1]!==c?(h=u?[]:c,t[0]=u,t[1]=c,t[2]=h):h=t[2];const m=h,f=n??[],{recent:g,remember:b}=_t();let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=ge.railOrgPrefs(),t[3]=y):y=t[3];const[v,w]=fe(y,Ne),S=se(v),j=G.useSyncExternalStore(It,Lt,Et),{shown:x}=Ot(At(f,S,r.slug),g,r.slug,j,S.pinned);let O;t[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},t[4]=O):O=t[4];const C=Ye(qe(Ze,O)),N=z=>{const{active:H,over:ee}=z;ee&&(ue("org_rail_reordered"),w(ke=>kt(se(ke),x.map(Ht),String(H.id),String(ee.id))))},R=z=>{ue("org_rail_travel");const H=x.some(ee=>ee.slug===z);w(ee=>Rt(se(ee),z)),b(z,H?x.map(Xt):void 0),o({to:"/$org/home",params:{org:z}})},_=!a&&"border-r border-sidebar-border";let A;t[5]!==_?(A=B("flex w-16 shrink-0 flex-col items-center gap-1.5 overflow-y-auto bg-sidebar pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",_),t[5]=_,t[6]=A):A=t[6];let E;t[7]!==e?(E=e("sidebar.rail.ariaLabel"),t[7]=e,t[8]=E):E=t[8];const $=Ue,M=Je,F=Qe,D=x.map(Gt),K=et,W=x.map(z=>i.jsx(Pt,{org:z,active:z.slug===r.slug,pinned:S.pinned.includes(z.slug),onSelect:()=>R(z.slug),onOpenSettings:()=>o({to:"/$org/settings",params:{org:z.slug}}),onTogglePin:()=>w(H=>Nt(se(H),z.slug)),onHide:z.slug===r.slug?void 0:()=>w(H=>Ct(se(H),z.slug))},z.id));let k;t[9]!==F||t[10]!==W||t[11]!==D||t[12]!==K?(k=i.jsx(F,{items:D,strategy:K,children:W}),t[9]=F,t[10]=W,t[11]=D,t[12]=K,t[13]=k):k=t[13];let T;t[14]!==$||t[15]!==N||t[16]!==C||t[17]!==k||t[18]!==M?(T=i.jsx($,{sensors:C,collisionDetection:M,onDragEnd:N,children:k}),t[14]=$,t[15]=N,t[16]=C,t[17]=k,t[18]=M,t[19]=T):T=t[19];let I;t[20]!==r.slug||t[21]!==f||t[22]!==x.length||t[23]!==R?(I=f.length>x.length&&i.jsx(Tt,{orgs:f,currentSlug:r.slug,hiddenCount:f.length-x.length,onSelect:R}),t[20]=r.slug,t[21]=f,t[22]=x.length,t[23]=R,t[24]=I):I=t[24];let P;t[25]!==e?(P=e("sidebar.picker.newOrganization"),t[25]=e,t[26]=P):P=t[26];let ae;t[27]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>s(!0),t[27]=ae):ae=t[27];let ce;t[28]===Symbol.for("react.memo_cache_sentinel")?(ce=i.jsx(rt,{size:18}),t[28]=ce):ce=t[28];let Y;t[29]!==P?(Y=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":P,onClick:ae,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:ce})}),t[29]=P,t[30]=Y):Y=t[30];let q;t[31]!==e?(q=e("sidebar.picker.newOrganization"),t[31]=e,t[32]=q):q=t[32];let U;t[33]!==q?(U=i.jsx(re,{side:"right",children:q}),t[33]=q,t[34]=U):U=t[34];let J;t[35]!==Y||t[36]!==U?(J=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[Y,U]})}),t[35]=Y,t[36]=U,t[37]=J):J=t[37];let V;t[38]!==r.slug||t[39]!==d||t[40]!==u||t[41]!==p||t[42]!==m?(V=(m.length>0||u)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),m.map(z=>i.jsx(Mt,{entry:z,orgSlug:r.slug,active:p?.app===z.app&&p.projectId===z.projectId,onClose:()=>d(z)},`${z.app}:${z.projectId}`)),u&&i.jsx(Wt,{app:u})]}),t[38]=r.slug,t[39]=d,t[40]=u,t[41]=p,t[42]=m,t[43]=V):V=t[43];let Z;t[44]!==T||t[45]!==I||t[46]!==J||t[47]!==V||t[48]!==A||t[49]!==E?(Z=i.jsxs("div",{className:A,"aria-label":E,children:[T,I,J,V]}),t[44]=T,t[45]=I,t[46]=J,t[47]=V,t[48]=A,t[49]=E,t[50]=Z):Z=t[50];let Q;t[51]!==l?(Q=i.jsx(ct,{open:l,onOpenChange:s}),t[51]=l,t[52]=Q):Q=t[52];let de;return t[53]!==Z||t[54]!==Q?(de=i.jsxs(i.Fragment,{children:[Z,Q]}),t[53]=Z,t[54]=Q,t[55]=de):de=t[55],de}function Gt(t){return t.slug}function Xt(t){return t.slug}function Ht(t){return t.slug}function Yt(){const{state:t,isMobile:e}=xe();return t==="collapsed"&&!e}function qt(t){const e=L.c(15),{width:o,minWidth:r,maxWidth:n,onPointerDown:l,onKeyDown:s,onDoubleClick:a}=t,c=X(),{isMobile:d}=xe(),p=Yt();if(d||p)return null;let u;e[0]!==c?(u=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=u):u=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let m,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},f=i.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=f):(m=e[4],f=e[5]);let g;return e[6]!==n||e[7]!==r||e[8]!==a||e[9]!==s||e[10]!==l||e[11]!==u||e[12]!==h||e[13]!==o?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":u,"aria-valuenow":o,"aria-valuemin":r,"aria-valuemax":n,title:h,tabIndex:0,onPointerDown:l,onKeyDown:s,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:f}),e[6]=n,e[7]=r,e[8]=a,e[9]=s,e[10]=l,e[11]=u,e[12]=h,e[13]=o,e[14]=g):g=e[14],g}const pe=400,Se=16,Ut="sidebar.width.v2";function Jt(){const t=L.c(14),e=Vt;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=f=>typeof f=="number"?e(f):192,t[0]=o):o=t[0];const[r,n]=fe(Ut,o),l=G.useRef(null);let s;t[1]!==n||t[2]!==r?(s=f=>{f.preventDefault();const g=f.clientX,b=e(r),y=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),v=y?Array.from(y.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const j of v)j.style.transition="none";const w=j=>{const x=e(b+(j.clientX-g));y?.style.setProperty("--sidebar-width",`${x}px`)},S=j=>{const x=e(b+(j.clientX-g));n(x);for(const O of v)O.style.transition="";window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",w),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)},t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s;let c;t[4]!==n?(c=()=>{n(192)},t[4]=n,t[5]=c):c=t[5];const d=c;let p;t[6]!==n||t[7]!==r?(p=f=>{if(f.key==="ArrowLeft")n(e(r-Se));else if(f.key==="ArrowRight")n(e(r+Se));else if(f.key==="Home")n(192);else if(f.key==="End")n(pe);else return;f.preventDefault()},t[6]=n,t[7]=r,t[8]=p):p=t[8];const u=p,h=e(r);let m;return t[9]!==u||t[10]!==a||t[11]!==d||t[12]!==h?(m={width:h,minWidth:192,maxWidth:pe,wrapperRef:l,onStartResize:a,onKeyDownResize:u,resetWidth:d},t[9]=u,t[10]=a,t[11]=d,t[12]=h,t[13]=m):m=t[13],m}function Vt(t){return Math.max(192,Math.min(pe,t))}const Ae=G.createContext(null);function Zt(){const t=G.use(Ae);if(!t)throw new Error("Layout regions require a Layout");return t}function Qt({children:t,notice:e,outsideOrg:o}){const r=He(),[n,l]=fe(ge.sidebarOpen(),!0),s=Jt(),a=Pe();return i.jsx(Ae,{value:{isMobile:r,resize:s},children:i.jsx(De,{open:n,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!o&&i.jsx(Bt,{}),!r&&a&&(o?.rail??!0)&&i.jsx(Ft,{}),i.jsx(Ke,{ref:s.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${s.width}px`,"--sidebar-width-icon":a?"3.25rem":"3.125rem"},children:i.jsx(We,{children:t})})]})]})})})}function es(t){const e=L.c(26),{children:o,renderMobile:r}=t,n=X(),{isMobile:l,resize:s}=Zt(),{openMobile:a,setOpenMobile:c}=xe();if(!l){let g;e[0]!==s.maxWidth||e[1]!==s.minWidth||e[2]!==s.onKeyDownResize||e[3]!==s.onStartResize||e[4]!==s.resetWidth||e[5]!==s.width?(g=i.jsx(qt,{width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth,onPointerDown:s.onStartResize,onKeyDown:s.onKeyDownResize,onDoubleClick:s.resetWidth}),e[0]=s.maxWidth,e[1]=s.minWidth,e[2]=s.onKeyDownResize,e[3]=s.onStartResize,e[4]=s.resetWidth,e[5]=s.width,e[6]=g):g=e[6];let b;return e[7]!==o||e[8]!==g?(b=i.jsxs(i.Fragment,{children:[o,g]}),e[7]=o,e[8]=g,e[9]=b):b=e[9],b}let d;e[10]!==n?(d=n("layouts.shellControls.navigationTitle"),e[10]=n,e[11]=d):d=e[11];let p;e[12]!==d?(p=i.jsx(Fe,{className:"sr-only",children:d}),e[12]=d,e[13]=p):p=e[13];let u;e[14]!==c?(u=()=>c(!1),e[14]=c,e[15]=u):u=e[15];let h;e[16]!==r||e[17]!==u?(h=r({onClose:u}),e[16]=r,e[17]=u,e[18]=h):h=e[18];let m;e[19]!==p||e[20]!==h?(m=i.jsxs(Ge,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[p,h]}),e[19]=p,e[20]=h,e[21]=m):m=e[21];let f;return e[22]!==a||e[23]!==c||e[24]!==m?(f=i.jsx(Xe,{open:a,onOpenChange:c,children:m}),e[22]=a,e[23]=c,e[24]=m,e[25]=f):f=e[25],f}function ts(t){const e=L.c(3),{children:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let n;return e[1]!==o?(n=i.jsx(Be,{className:"flex flex-col min-h-0",style:r,children:i.jsx($e,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o})})}),e[1]=o,e[2]=n):n=e[2],n}const js=Object.assign(Qt,{Sidebar:es,Content:ts});export{bs as I,js as L,be as O,Yt as u};
|
|
1
|
+
import{c as L,r as G,l as B,j as i,b as X,B as je,a as he,t as te,G as Te,at as fe,av as ge,a2 as we,d as Ie,E as Le,L as ze,Y as Ee,y as ue,ab as Pe,P as $e}from"./index-BMFPQnxF.js";import{h as Me,P as Oe,u as xe,i as De,j as Ke,l as We,m as Be}from"./use-app-takeover-BradKAB-.js";import{S as Fe,a as Ge,b as Xe}from"./sheet-DjxhamUM.js";import{u as He}from"./use-mobile-KovosPkT.js";import{u as Ye,a as qe,D as Ue,c as Je,C as Ve,P as Ze}from"./core.esm-B6s0CaQt.js";import{S as Qe,v as et,u as tt}from"./sortable.esm-DQU2qOYK.js";import{i as st}from"./Tool01-Cy7q1W_-.js";import{A as nt,z as ve,B as it}from"./agent-icon-DELSa-FD.js";import{s as rt}from"./Plus-DSBe1yGh.js";import{s as _e}from"./XClose-CGy86Cja.js";import{T as ie,a as re,c as oe}from"./tooltip-DkPjtX65.js";import{C as me,f as ot,g as lt,e as at}from"./context-menu-L9B1AKUT.js";import{C as ct}from"./create-organization-dialog-D_24Qwy0.js";import{u as dt,a as ut,b as ft}from"./use-recent-apps-Dzl8uBSP.js";import{i as ht}from"./UserSquare-D4mxgHNW.js";import{e as mt,C as pt,b as gt,c as xt,f as bt}from"./command-CxgcokcP.js";function jt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const o=Math.abs(e)%360;return{backgroundColor:`hsl(${o} 55% 70%)`,color:`hsl(${o} 55% 20%)`}}const vt={xs:{box:"size-5",text:"text-[9px]"},sm:{box:"size-6",text:"text-xs"},lg:{box:"size-9",text:"text-sm"}};function be(t){const e=L.c(14),{org:o,size:r,rounded:n}=t,l=r===void 0?"sm":r,s=n===void 0?"rounded-md":n,{box:a,text:c}=vt[l],[d,p]=G.useState(null),u=o.logo&&o.logo!==d?o.logo:null;let h;e[0]!==s||e[1]!==a?(h=B(a,s,"shrink-0 flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=s,e[1]=a,e[2]=h):h=e[2];let m;e[3]!==u||e[4]!==o.name?(m=u?void 0:jt(o.name),e[3]=u,e[4]=o.name,e[5]=m):m=e[5];let f;e[6]!==u||e[7]!==o.name||e[8]!==c?(f=u?i.jsx("img",{src:u,alt:"",className:"size-full object-cover",onError:()=>p(u)}):i.jsx("span",{className:B("font-semibold leading-none",c),children:o.name.slice(0,2).toUpperCase()}),e[6]=u,e[7]=o.name,e[8]=c,e[9]=f):f=e[9];let g;return e[10]!==h||e[11]!==m||e[12]!==f?(g=i.jsx("div",{className:h,style:m,children:f}),e[10]=h,e[11]=m,e[12]=f,e[13]=g):g=e[13],g}function bs({invitation:t,onChanged:e}){const o=X(),[r,n]=G.useState(!1),l=t.organizationName??o("header.orgSwitcher.unknownOrganization"),s=async()=>{n(!0);try{const d=await he.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),n(!1);return}}catch{te.error(o("header.orgSwitcher.failedToAcceptInvitation")),n(!1);return}te.success(o("header.orgSwitcher.joined",{name:l})),Te();let c;try{c=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{n(!0);try{const c=await he.organization.rejectInvitation({invitationId:t.id});if(c.error){te.error(c.error.message),n(!1);return}te.success(o("header.orgSwitcher.invitationDeclined")),n(!1),e()}catch{te.error(o("header.orgSwitcher.failedToDeclineInvitation")),n(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(be,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:o("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:s,disabled:r,children:o("header.orgSwitcher.accept")}),i.jsx(je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:r,"aria-label":o("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(_e,{size:14})})]})]})}const yt=3,Ce=10,St=440,wt=55;function Re(t){const e=Math.floor((t-St)/wt);return Math.min(Ce,Math.max(yt,e))}function zt(t,e,o=Ce*3,r=[]){return[...new Set([e,...r,...t])].slice(0,o)}function Ot(t,e,o,r,n=[]){if(t.length<=r)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),s=new Set;o&&l.has(o)&&s.add(o);for(const a of n)l.has(a)&&s.add(a);for(const a of e){if(s.size>=r)break;l.has(a)&&s.add(a)}for(const a of t){if(s.size>=r)break;s.add(a.slug)}return{shown:t.filter(a=>s.has(a.slug)),hidden:t.filter(a=>!s.has(a.slug))}}const ye=[];function _t(){const t=L.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ge.recentOrgs(),t[0]=e):e=t[0];const[o,r]=fe(e,ye),n=Array.isArray(o)?o:ye;let l;t[1]!==r?(l=(a,c)=>r(d=>zt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=r,t[2]=l):l=t[2];let s;return t[3]!==n||t[4]!==l?(s={recent:n,remember:l},t[3]=n,t[4]=l,t[5]=s):s=t[5],s}const Ne={hidden:[],pinned:[],order:[]},ne=(t,e)=>t.filter(o=>o!==e);function se(t){if(typeof t!="object"||t===null)return Ne;const e=r=>Array.isArray(r)?r.filter(n=>typeof n=="string"):[],o=t;return{hidden:e(o.hidden),pinned:e(o.pinned),order:e(o.order)}}function Ct(t,e){return{...t,hidden:[...ne(t.hidden,e),e],pinned:ne(t.pinned,e)}}function Rt(t,e){return{...t,hidden:ne(t.hidden,e)}}function Nt(t,e){return t.pinned.includes(e)?{...t,pinned:ne(t.pinned,e)}:{...t,hidden:ne(t.hidden,e),pinned:[...t.pinned,e]}}function At(t,e,o){const r=n=>{const l=e.order.indexOf(n);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(n=>n.slug===o||!e.hidden.includes(n.slug)).map((n,l)=>({org:n,index:l})).sort((n,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(n.org.slug))||r(n.org.slug)-r(l.org.slug)||n.index-l.index).map(({org:n})=>n)}function kt(t,e,o,r){const n=e.indexOf(o),l=e.indexOf(r);if(n===-1||l===-1||n===l||t.pinned.includes(o)!==t.pinned.includes(r))return t;const s=[...e];return s.splice(n,1),s.splice(l,0,o),{...t,order:[...s,...t.order.filter(a=>!s.includes(a))]}}function le(t){const e=L.c(11),{active:o,label:r,children:n}=t,l=o?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let s;e[0]!==l?(s=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==s?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-0 flex h-9 items-center",children:i.jsx("span",{className:s})}),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==o||e[5]!==r?(c=r&&i.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",o?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=o,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==n||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,n,c]}),e[7]=n,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Tt(t){const e=L.c(47),{orgs:o,currentSlug:r,hiddenCount:n,onSelect:l}=t,s=X(),[a,c]=G.useState(!1);let d;e[0]!==s?(d=s("sidebar.rail.searchOrganizations"),e[0]=s,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[2]=p):p=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ht,{size:18}),e[3]=u):u=e[3];let h;e[4]!==d?(h=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":d,onClick:p,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u})}),e[4]=d,e[5]=h):h=e[5];let m;e[6]!==n||e[7]!==s?(m=n>0?s("sidebar.rail.searchMoreOrganizations",{count:n}):s("sidebar.rail.searchOrganizations"),e[6]=n,e[7]=s,e[8]=m):m=e[8];let f;e[9]!==m?(f=i.jsx(re,{side:"right",children:m}),e[9]=m,e[10]=f):f=e[10];let g;e[11]!==h||e[12]!==f?(g=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[h,f]})}),e[11]=h,e[12]=f,e[13]=g):g=e[13];let b;e[14]!==s?(b=s("sidebar.rail.searchOrganizations"),e[14]=s,e[15]=b):b=e[15];let y;e[16]!==s?(y=s("sidebar.rail.searchPlaceholder"),e[16]=s,e[17]=y):y=e[17];let v;e[18]!==s?(v=s("sidebar.rail.searchPlaceholder"),e[18]=s,e[19]=v):v=e[19];let w;e[20]!==v?(w=i.jsx(mt,{placeholder:v}),e[20]=v,e[21]=w):w=e[21];let S;e[22]!==s?(S=s("sidebar.rail.searchEmpty"),e[22]=s,e[23]=S):S=e[23];let j;e[24]!==S?(j=i.jsx(pt,{children:S}),e[24]=S,e[25]=j):j=e[25];let x;if(e[26]!==r||e[27]!==l||e[28]!==o||e[29]!==s){let R;e[31]!==r||e[32]!==l||e[33]!==s?(R=_=>i.jsxs(gt,{value:`${_.name} ${_.slug}`,onSelect:()=>{c(!1),_.slug!==r&&l(_.slug)},className:"gap-2.5",children:[i.jsx(be,{org:_,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:_.name}),_.slug===r&&i.jsx("span",{className:"text-meta shrink-0",children:s("sidebar.rail.currentOrganization")})]},_.id),e[31]=r,e[32]=l,e[33]=s,e[34]=R):R=e[34],x=o.map(R),e[26]=r,e[27]=l,e[28]=o,e[29]=s,e[30]=x}else x=e[30];let O;e[35]!==j||e[36]!==x?(O=i.jsxs(xt,{children:[j,x]}),e[35]=j,e[36]=x,e[37]=O):O=e[37];let C;e[38]!==a||e[39]!==w||e[40]!==O||e[41]!==b||e[42]!==y?(C=i.jsxs(bt,{open:a,onOpenChange:c,title:b,description:y,children:[w,O]}),e[38]=a,e[39]=w,e[40]=O,e[41]=b,e[42]=y,e[43]=C):C=e[43];let N;return e[44]!==C||e[45]!==g?(N=i.jsxs(i.Fragment,{children:[g,C]}),e[44]=C,e[45]=g,e[46]=N):N=e[46],N}function It(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Lt=()=>Re(globalThis.innerHeight),Et=()=>Re(0);function Pt(t){const e=L.c(57),{org:o,active:r,onSelect:n,pinned:l,onOpenSettings:s,onTogglePin:a,onHide:c}=t,d=X();let p;e[0]!==o.slug?(p={id:o.slug},e[0]=o.slug,e[1]=p):p=e[1];const{setNodeRef:u,listeners:h,transform:m,transition:f,isDragging:g}=tt(p);let b;e[2]!==m?(b=Ve.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=b):b=e[3];const y=g?1:void 0;let v;e[4]!==b||e[5]!==y||e[6]!==f?(v={transform:b,transition:f,zIndex:y},e[4]=b,e[5]=y,e[6]=f,e[7]=v):v=e[7];const w=o.name,S=r||void 0,j=r?void 0:n,x=r?"opacity-100":"cursor-pointer opacity-60 hover:scale-105 hover:opacity-100";let O;e[8]!==x?(O=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",x),e[8]=x,e[9]=O):O=e[9];let C;e[10]!==o?(C=i.jsx(be,{org:o,size:"lg",rounded:"rounded-xl"}),e[10]=o,e[11]=C):C=e[11];let N;e[12]!==l?(N=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(ve,{size:9})}),e[12]=l,e[13]=N):N=e[13];let R;e[14]!==o.name||e[15]!==C||e[16]!==N||e[17]!==S||e[18]!==j||e[19]!==O?(R=i.jsx(ie,{asChild:!0,children:i.jsx(ot,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":w,"aria-current":S,onClick:j,className:O,children:[C,N]})})}),e[14]=o.name,e[15]=C,e[16]=N,e[17]=S,e[18]=j,e[19]=O,e[20]=R):R=e[20];let _;e[21]!==o.name?(_=i.jsx(re,{side:"right",children:o.name}),e[21]=o.name,e[22]=_):_=e[22];let A;e[23]!==R||e[24]!==_?(A=i.jsxs(oe,{children:[R,_]}),e[23]=R,e[24]=_,e[25]=A):A=e[25];let E;e[26]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(it,{}),e[26]=E):E=e[26];let $;e[27]!==d?($=d("sidebar.rail.organizationSettings"),e[27]=d,e[28]=$):$=e[28];let M;e[29]!==s||e[30]!==$?(M=i.jsxs(me,{onSelect:s,children:[E,$]}),e[29]=s,e[30]=$,e[31]=M):M=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=i.jsx(ve,{}),e[32]=F):F=e[32];let D;e[33]!==l||e[34]!==d?(D=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[33]=l,e[34]=d,e[35]=D):D=e[35];let K;e[36]!==a||e[37]!==D?(K=i.jsxs(me,{onSelect:a,children:[F,D]}),e[36]=a,e[37]=D,e[38]=K):K=e[38];let W;e[39]!==c||e[40]!==d?(W=c&&i.jsxs(me,{onSelect:c,children:[i.jsx(st,{}),d("sidebar.rail.hideOrganization")]}),e[39]=c,e[40]=d,e[41]=W):W=e[41];let k;e[42]!==M||e[43]!==K||e[44]!==W?(k=i.jsxs(lt,{children:[M,K,W]}),e[42]=M,e[43]=K,e[44]=W,e[45]=k):k=e[45];let T;e[46]!==A||e[47]!==k?(T=i.jsxs(at,{children:[A,k]}),e[46]=A,e[47]=k,e[48]=T):T=e[48];let I;e[49]!==r||e[50]!==T?(I=i.jsx(le,{active:r,children:T}),e[49]=r,e[50]=T,e[51]=I):I=e[51];let P;return e[52]!==h||e[53]!==u||e[54]!==I||e[55]!==v?(P=i.jsx("div",{ref:u,...h,style:v,className:"w-full shrink-0 touch-none",children:I}),e[52]=h,e[53]=u,e[54]=I,e[55]=v,e[56]=P):P=e[56],P}function $t(t,e,o){const r={org:e,agentId:t.projectId};if(t.connection){const{label:l,icon:s,id:a,toolName:c}=t.connection;return{label:l,link:{to:Ee.app,params:{...r,connectionId:a,toolName:c}},glyph:i.jsx(nt,{icon:s,name:l,size:"sm+",className:"size-9 rounded-xl"})}}const n=Oe[t.app];return n?{label:o(n.labelKey),link:{to:n.to,params:r},tone:n.tone,glyph:i.jsx(n.Icon,{size:18})}:null}function Mt(t){const e=L.c(31),{entry:o,orgSlug:r,active:n,onClose:l}=t,s=X();let a,c,d,p,u,h,m,f;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s){f=Symbol.for("react.early_return_sentinel");e:{const j=$t(o,r,s);if(!j){f=null;break e}a=le,h=n,m=j.label,p="relative";let x;e[12]!==o.projectTitle?(x=i.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",o.projectTitle]}),e[12]=o.projectTitle,e[13]=x):x=e[13],u=i.jsxs(oe,{children:[i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:j.link.to,params:j.link.params,"aria-label":`${j.label} · ${o.projectTitle}`,"aria-current":n||void 0,onClick:Dt,className:B("flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",j.tone,n?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100"),children:j.glyph})}),i.jsxs(re,{side:"right",children:[j.label,x]})]}),c="button",d=s("sidebar.rail.closeApp",{name:j.label})}e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=p,e[8]=u,e[9]=h,e[10]=m,e[11]=f}else a=e[4],c=e[5],d=e[6],p=e[7],u=e[8],h=e[9],m=e[10],f=e[11];if(f!==Symbol.for("react.early_return_sentinel"))return f;let g;e[14]!==l?(g=()=>{ue("org_rail_recent_app_closed"),l()},e[14]=l,e[15]=g):g=e[15];let b,y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=B("absolute -top-1.5 -right-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),b=i.jsx(_e,{size:10}),e[16]=b,e[17]=y):(b=e[16],y=e[17]);let v;e[18]!==c||e[19]!==d||e[20]!==g?(v=i.jsx("button",{type:c,"aria-label":d,onClick:g,className:y,children:b}),e[18]=c,e[19]=d,e[20]=g,e[21]=v):v=e[21];let w;e[22]!==v||e[23]!==p||e[24]!==u?(w=i.jsxs("div",{className:p,children:[u,v]}),e[22]=v,e[23]=p,e[24]=u,e[25]=w):w=e[25];let S;return e[26]!==a||e[27]!==w||e[28]!==h||e[29]!==m?(S=i.jsx(a,{active:h,label:m,children:w}),e[26]=a,e[27]=w,e[28]=h,e[29]=m,e[30]=S):S=e[30],S}function Dt(){return ue("org_rail_recent_app_opened")}const Kt={"site-editor":"/site-editor"};function Wt(t){const e=L.c(26),{app:o}=t,r=X(),n=Oe[o],l=Kt[o];if(!n||!l)return null;let s;e[0]!==n.labelKey||e[1]!==r?(s=r(n.labelKey),e[0]=n.labelKey,e[1]=r,e[2]=s):s=e[2];let a;e[3]!==n.labelKey||e[4]!==r?(a=r(n.labelKey),e[3]=n.labelKey,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==n.tone?(c=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",n.tone),e[6]=n.tone,e[7]=c):c=e[7];let d;e[8]!==n.Icon?(d=i.jsx(n.Icon,{size:18}),e[8]=n.Icon,e[9]=d):d=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(p=i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=p):p=e[14];let u;e[15]!==n.labelKey||e[16]!==r?(u=r(n.labelKey),e[15]=n.labelKey,e[16]=r,e[17]=u):u=e[17];let h;e[18]!==u?(h=i.jsx(re,{side:"right",children:u}),e[18]=u,e[19]=h):h=e[19];let m;e[20]!==p||e[21]!==h?(m=i.jsxs(oe,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=m):m=e[22];let f;return e[23]!==s||e[24]!==m?(f=i.jsx(le,{active:!0,label:s,children:m}),e[23]=s,e[24]=m,e[25]=f):f=e[25],f}function Bt(){const{org:t}=we();return dt(t.slug),null}function Ft(){const t=L.c(56),e=X(),o=Ie(),{org:r}=we(),{data:n}=Le(),[l,s]=G.useState(!1),a=Me(),{recent:c,forget:d}=ut(r.slug),p=ft(),u=p&&p.projectId===null?p.app:null;let h;t[0]!==u||t[1]!==c?(h=u?[]:c,t[0]=u,t[1]=c,t[2]=h):h=t[2];const m=h,f=n??[],{recent:g,remember:b}=_t();let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=ge.railOrgPrefs(),t[3]=y):y=t[3];const[v,w]=fe(y,Ne),S=se(v),j=G.useSyncExternalStore(It,Lt,Et),{shown:x}=Ot(At(f,S,r.slug),g,r.slug,j,S.pinned);let O;t[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},t[4]=O):O=t[4];const C=Ye(qe(Ze,O)),N=z=>{const{active:H,over:ee}=z;ee&&(ue("org_rail_reordered"),w(ke=>kt(se(ke),x.map(Ht),String(H.id),String(ee.id))))},R=z=>{ue("org_rail_travel");const H=x.some(ee=>ee.slug===z);w(ee=>Rt(se(ee),z)),b(z,H?x.map(Xt):void 0),o({to:"/$org/home",params:{org:z}})},_=!a&&"border-r border-sidebar-border";let A;t[5]!==_?(A=B("flex w-16 shrink-0 flex-col items-center gap-1.5 overflow-y-auto bg-sidebar pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",_),t[5]=_,t[6]=A):A=t[6];let E;t[7]!==e?(E=e("sidebar.rail.ariaLabel"),t[7]=e,t[8]=E):E=t[8];const $=Ue,M=Je,F=Qe,D=x.map(Gt),K=et,W=x.map(z=>i.jsx(Pt,{org:z,active:z.slug===r.slug,pinned:S.pinned.includes(z.slug),onSelect:()=>R(z.slug),onOpenSettings:()=>o({to:"/$org/settings",params:{org:z.slug}}),onTogglePin:()=>w(H=>Nt(se(H),z.slug)),onHide:z.slug===r.slug?void 0:()=>w(H=>Ct(se(H),z.slug))},z.id));let k;t[9]!==F||t[10]!==W||t[11]!==D||t[12]!==K?(k=i.jsx(F,{items:D,strategy:K,children:W}),t[9]=F,t[10]=W,t[11]=D,t[12]=K,t[13]=k):k=t[13];let T;t[14]!==$||t[15]!==N||t[16]!==C||t[17]!==k||t[18]!==M?(T=i.jsx($,{sensors:C,collisionDetection:M,onDragEnd:N,children:k}),t[14]=$,t[15]=N,t[16]=C,t[17]=k,t[18]=M,t[19]=T):T=t[19];let I;t[20]!==r.slug||t[21]!==f||t[22]!==x.length||t[23]!==R?(I=f.length>x.length&&i.jsx(Tt,{orgs:f,currentSlug:r.slug,hiddenCount:f.length-x.length,onSelect:R}),t[20]=r.slug,t[21]=f,t[22]=x.length,t[23]=R,t[24]=I):I=t[24];let P;t[25]!==e?(P=e("sidebar.picker.newOrganization"),t[25]=e,t[26]=P):P=t[26];let ae;t[27]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>s(!0),t[27]=ae):ae=t[27];let ce;t[28]===Symbol.for("react.memo_cache_sentinel")?(ce=i.jsx(rt,{size:18}),t[28]=ce):ce=t[28];let Y;t[29]!==P?(Y=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":P,onClick:ae,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:ce})}),t[29]=P,t[30]=Y):Y=t[30];let q;t[31]!==e?(q=e("sidebar.picker.newOrganization"),t[31]=e,t[32]=q):q=t[32];let U;t[33]!==q?(U=i.jsx(re,{side:"right",children:q}),t[33]=q,t[34]=U):U=t[34];let J;t[35]!==Y||t[36]!==U?(J=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[Y,U]})}),t[35]=Y,t[36]=U,t[37]=J):J=t[37];let V;t[38]!==r.slug||t[39]!==d||t[40]!==u||t[41]!==p||t[42]!==m?(V=(m.length>0||u)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),m.map(z=>i.jsx(Mt,{entry:z,orgSlug:r.slug,active:p?.app===z.app&&p.projectId===z.projectId,onClose:()=>d(z)},`${z.app}:${z.projectId}`)),u&&i.jsx(Wt,{app:u})]}),t[38]=r.slug,t[39]=d,t[40]=u,t[41]=p,t[42]=m,t[43]=V):V=t[43];let Z;t[44]!==T||t[45]!==I||t[46]!==J||t[47]!==V||t[48]!==A||t[49]!==E?(Z=i.jsxs("div",{className:A,"aria-label":E,children:[T,I,J,V]}),t[44]=T,t[45]=I,t[46]=J,t[47]=V,t[48]=A,t[49]=E,t[50]=Z):Z=t[50];let Q;t[51]!==l?(Q=i.jsx(ct,{open:l,onOpenChange:s}),t[51]=l,t[52]=Q):Q=t[52];let de;return t[53]!==Z||t[54]!==Q?(de=i.jsxs(i.Fragment,{children:[Z,Q]}),t[53]=Z,t[54]=Q,t[55]=de):de=t[55],de}function Gt(t){return t.slug}function Xt(t){return t.slug}function Ht(t){return t.slug}function Yt(){const{state:t,isMobile:e}=xe();return t==="collapsed"&&!e}function qt(t){const e=L.c(15),{width:o,minWidth:r,maxWidth:n,onPointerDown:l,onKeyDown:s,onDoubleClick:a}=t,c=X(),{isMobile:d}=xe(),p=Yt();if(d||p)return null;let u;e[0]!==c?(u=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=u):u=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let m,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},f=i.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=f):(m=e[4],f=e[5]);let g;return e[6]!==n||e[7]!==r||e[8]!==a||e[9]!==s||e[10]!==l||e[11]!==u||e[12]!==h||e[13]!==o?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":u,"aria-valuenow":o,"aria-valuemin":r,"aria-valuemax":n,title:h,tabIndex:0,onPointerDown:l,onKeyDown:s,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:f}),e[6]=n,e[7]=r,e[8]=a,e[9]=s,e[10]=l,e[11]=u,e[12]=h,e[13]=o,e[14]=g):g=e[14],g}const pe=400,Se=16,Ut="sidebar.width.v2";function Jt(){const t=L.c(14),e=Vt;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=f=>typeof f=="number"?e(f):192,t[0]=o):o=t[0];const[r,n]=fe(Ut,o),l=G.useRef(null);let s;t[1]!==n||t[2]!==r?(s=f=>{f.preventDefault();const g=f.clientX,b=e(r),y=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),v=y?Array.from(y.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const j of v)j.style.transition="none";const w=j=>{const x=e(b+(j.clientX-g));y?.style.setProperty("--sidebar-width",`${x}px`)},S=j=>{const x=e(b+(j.clientX-g));n(x);for(const O of v)O.style.transition="";window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",w),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)},t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s;let c;t[4]!==n?(c=()=>{n(192)},t[4]=n,t[5]=c):c=t[5];const d=c;let p;t[6]!==n||t[7]!==r?(p=f=>{if(f.key==="ArrowLeft")n(e(r-Se));else if(f.key==="ArrowRight")n(e(r+Se));else if(f.key==="Home")n(192);else if(f.key==="End")n(pe);else return;f.preventDefault()},t[6]=n,t[7]=r,t[8]=p):p=t[8];const u=p,h=e(r);let m;return t[9]!==u||t[10]!==a||t[11]!==d||t[12]!==h?(m={width:h,minWidth:192,maxWidth:pe,wrapperRef:l,onStartResize:a,onKeyDownResize:u,resetWidth:d},t[9]=u,t[10]=a,t[11]=d,t[12]=h,t[13]=m):m=t[13],m}function Vt(t){return Math.max(192,Math.min(pe,t))}const Ae=G.createContext(null);function Zt(){const t=G.use(Ae);if(!t)throw new Error("Layout regions require a Layout");return t}function Qt({children:t,notice:e,outsideOrg:o}){const r=He(),[n,l]=fe(ge.sidebarOpen(),!0),s=Jt(),a=Pe();return i.jsx(Ae,{value:{isMobile:r,resize:s},children:i.jsx(De,{open:n,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!o&&i.jsx(Bt,{}),!r&&a&&(o?.rail??!0)&&i.jsx(Ft,{}),i.jsx(Ke,{ref:s.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${s.width}px`,"--sidebar-width-icon":a?"3.25rem":"3.125rem"},children:i.jsx(We,{children:t})})]})]})})})}function es(t){const e=L.c(26),{children:o,renderMobile:r}=t,n=X(),{isMobile:l,resize:s}=Zt(),{openMobile:a,setOpenMobile:c}=xe();if(!l){let g;e[0]!==s.maxWidth||e[1]!==s.minWidth||e[2]!==s.onKeyDownResize||e[3]!==s.onStartResize||e[4]!==s.resetWidth||e[5]!==s.width?(g=i.jsx(qt,{width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth,onPointerDown:s.onStartResize,onKeyDown:s.onKeyDownResize,onDoubleClick:s.resetWidth}),e[0]=s.maxWidth,e[1]=s.minWidth,e[2]=s.onKeyDownResize,e[3]=s.onStartResize,e[4]=s.resetWidth,e[5]=s.width,e[6]=g):g=e[6];let b;return e[7]!==o||e[8]!==g?(b=i.jsxs(i.Fragment,{children:[o,g]}),e[7]=o,e[8]=g,e[9]=b):b=e[9],b}let d;e[10]!==n?(d=n("layouts.shellControls.navigationTitle"),e[10]=n,e[11]=d):d=e[11];let p;e[12]!==d?(p=i.jsx(Fe,{className:"sr-only",children:d}),e[12]=d,e[13]=p):p=e[13];let u;e[14]!==c?(u=()=>c(!1),e[14]=c,e[15]=u):u=e[15];let h;e[16]!==r||e[17]!==u?(h=r({onClose:u}),e[16]=r,e[17]=u,e[18]=h):h=e[18];let m;e[19]!==p||e[20]!==h?(m=i.jsxs(Ge,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[p,h]}),e[19]=p,e[20]=h,e[21]=m):m=e[21];let f;return e[22]!==a||e[23]!==c||e[24]!==m?(f=i.jsx(Xe,{open:a,onOpenChange:c,children:m}),e[22]=a,e[23]=c,e[24]=m,e[25]=f):f=e[25],f}function ts(t){const e=L.c(3),{children:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let n;return e[1]!==o?(n=i.jsx(Be,{className:"flex flex-col min-h-0",style:r,children:i.jsx($e,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o})})}),e[1]=o,e[2]=n):n=e[2],n}const js=Object.assign(Qt,{Sidebar:es,Content:ts});export{bs as I,js as L,be as O,Yt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cv as _}from"./index-
|
|
1
|
+
import{cv as _}from"./index-BMFPQnxF.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,b as j,r as E,j as x,l as q,ah as Tt,t as ue,aX as Xe,a2 as vt,m as At,K as Mt,b4 as St,h as Je}from"./index-BOCmUs5e.js";import{a as Ct,n as Ye,E as ie,o as Rt,x as Et,y as P,z as $t,A as _t,B as et,C as N,G as Ee,H as Lt,I as It,J as $e,K as zt,L as V,N as D,m as H,O as Y,T as tt,R as ke,Q as be,U as Pt,V as Ht,W as jt,X as Nt,Y as Ot,s as Bt,Z as Dt,u as Ft,b as qt}from"./usage-stats-B2hjYXg0.js";import{T as _,n as Wt,i as Ut,E as Zt}from"./editor-classes-C28rWAPt.js";import{a as Gt,e as nt,s as Vt,S as Kt}from"./suggestion-BoKW7C2P.js";import{B as Qt,c as Xt,t as Jt,C as rt,f as Yt,g as _e,s as en,m as Le,a as Ie,b as tn,d as ze,e as nn,h as rn,i as sn,j as an,k as on,l as ln,n as cn}from"./index-DbEiru9a.js";import{ag as un,ah as hn,aj as dn,Z as pn,bd as fn,aV as gn}from"./agent-icon-ndY1RWjU.js";import{i as mn}from"./SwitchHorizontal01-BRLZiSEm.js";import{i as kn}from"./Link01-OCnw3a5L.js";import{s as bn}from"./Trash01-AnrBN8Oq.js";import{i as xn,b as wn}from"./use-org-fs-CmUmucUf.js";import{E as Pe,i as st,c as yn,d as Tn,A as vn,e as An,m as Mn,f as Sn,g as Cn}from"./markdown-139du5-r.js";import{A as Rn}from"./avatar-svlBTViV.js";import{d as En,e as $n,c as _n,C as Ln,b as In}from"./command-ChZnkO48.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-BvpKSYmO.js";import{I as Hn}from"./icon-button-ChLL5yDL.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=Wt(a);if(M===""){g();return}if(!Ut(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(Tt,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=Ct(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Qt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(dn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(mn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(fn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=st(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?yn:Tn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Ye("uploadSlots"),Zn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Rt({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Gn(t,e){return ee.getState(t)?.get(e)}function Vn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Et.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Kn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=st(g);Vn(h,Gn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Kn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:K,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
1
|
+
import{c as $,b as j,r as E,j as x,l as q,ah as Tt,t as ue,aX as Xe,a2 as vt,m as At,K as Mt,b4 as St,h as Je}from"./index-BMFPQnxF.js";import{a as Ct,n as Ye,E as ie,o as Rt,x as Et,y as P,z as $t,A as _t,B as et,C as N,G as Ee,H as Lt,I as It,J as $e,K as zt,L as V,N as D,m as H,O as Y,T as tt,R as ke,Q as be,U as Pt,V as Ht,W as jt,X as Nt,Y as Ot,s as Bt,Z as Dt,u as Ft,b as qt}from"./usage-stats-gx6NXtBh.js";import{T as _,n as Wt,i as Ut,E as Zt}from"./editor-classes-DIrlSRWz.js";import{a as Gt,e as nt,s as Vt,S as Kt}from"./suggestion-DCtVuRZs.js";import{B as Qt,c as Xt,t as Jt,C as rt,f as Yt,g as _e,s as en,m as Le,a as Ie,b as tn,d as ze,e as nn,h as rn,i as sn,j as an,k as on,l as ln,n as cn}from"./index-DANaQuQW.js";import{ag as un,ah as hn,aj as dn,Z as pn,bd as fn,aV as gn}from"./agent-icon-DELSa-FD.js";import{i as mn}from"./SwitchHorizontal01-DM4kWBA7.js";import{i as kn}from"./Link01-D7ZWNxWv.js";import{s as bn}from"./Trash01-BPlh1JSc.js";import{i as xn,b as wn}from"./use-org-fs-CQin-Vkj.js";import{E as Pe,i as st,c as yn,d as Tn,A as vn,e as An,m as Mn,f as Sn,g as Cn}from"./markdown-CaI6qicy.js";import{A as Rn}from"./avatar-B80eBo98.js";import{d as En,e as $n,c as _n,C as Ln,b as In}from"./command-CxgcokcP.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-BtXUoIf7.js";import{I as Hn}from"./icon-button-7Lw3dugt.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=Wt(a);if(M===""){g();return}if(!Ut(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(Tt,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=Ct(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Qt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(dn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(mn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(fn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=st(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?yn:Tn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Ye("uploadSlots"),Zn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Rt({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Gn(t,e){return ee.getState(t)?.get(e)}function Vn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Et.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Kn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=st(g);Vn(h,Gn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Kn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:K,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",lt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ur=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ut=/^( {2,}|\\)\n(?!\s*$)/,dr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,oe=/[\s\p{P}\p{S}]/u,Me=/[^\s\p{P}\p{S}]/u,pr=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oe).getRegex(),ht=/(?!~)[\p{P}\p{S}]/u,fr=/(?!~)[\s\p{P}\p{S}]/u,gr=/(?:[^\s\p{P}\p{S}]|~)/u,mr=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kr=A(dt,"u").replace(/punct/g,W).getRegex(),br=A(dt,"u").replace(/punct/g,ht).getRegex(),pt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=A(pt,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),wr=A(pt,"gu").replace(/notPunctSpace/g,gr).replace(/punctSpace/g,fr).replace(/punct/g,ht).getRegex(),yr=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Tr=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),vr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ar=A(vr,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Mr=A(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),Sr=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cr=A(ve).replace("(?:-->|$)","-->").getRegex(),Rr=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Er=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ft=A(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",Te).getRegex(),gt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),$r=A("reflink|nolink(?!\\()","g").replace("reflink",ft).replace("nolink",gt).getRegex(),Ne=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Se={_backpedal:O,anyPunctuation:Mr,autolink:Sr,blockSkip:mr,br:ut,code:hr,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:kr,emStrongRDelimAst:xr,emStrongRDelimUnd:yr,escape:ur,link:Er,nolink:gt,punctuation:pr,reflink:ft,reflinkSearch:$r,tag:Rr,text:dr,url:O},_r={...Se,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},de={...Se,emStrongRDelimAst:wr,emStrongLDelim:br,delLDelim:Tr,delRDelim:Ar,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ne).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ne).getRegex()},Lr={...de,br:A(ut).replace("{2,}","*").getRegex(),text:A(de.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:Ae,gfm:lr,pedantic:cr},U={normal:Se,gfm:de,breaks:Lr,pedantic:_r},Ir={"&":"&","<":"<",">":">",'"':""","'":"'"},Oe=t=>Ir[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,Oe)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,Oe);return t}function Be(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function De(t,e){let n=t.replace(R.findPipe,(i,a,l)=>{let o=!1,u=a;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(R.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(R.slashPipe,"|");return r}function Z(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function zr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Pr(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function Fe(t,e,n,r,s){let i=e.href,a=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,o}function Hr(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
|
|
3
3
|
`).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
4
4
|
`)}var ne=class{options;rules;lexer;constructor(t){this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Z(n,`
|