decocms 4.576.5 → 4.577.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-C4gtVV8B.js → AlertCircle-Bj2NuHQY.js} +1 -1
- package/dist/client/assets/{AreaChart-DoDuLI5t.js → AreaChart-wF798x8i.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DpMV6ZsI.js → ArrowLeft-DCMq103h.js} +1 -1
- package/dist/client/assets/{ArrowUp-BZtzDI6h.js → ArrowUp-AwRcCsuH.js} +1 -1
- package/dist/client/assets/BookOpen01-D2g_6Ti1.js +1 -0
- package/dist/client/assets/{CartesianChart-T_ULwjNy.js → CartesianChart-B6p3i5Ce.js} +1 -1
- package/dist/client/assets/{CategoricalChart-ysoAqy8Y.js → CategoricalChart-Bjq2Qe33.js} +1 -1
- package/dist/client/assets/{CheckCircle-DSJM5Ipe.js → CheckCircle-BfCYdSA_.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Y1qRZSrs.js → ChevronSelectorVertical-Bwduw2Hp.js} +1 -1
- package/dist/client/assets/{ChevronUp-DlMNWluH.js → ChevronUp-JSFuaLqF.js} +1 -1
- package/dist/client/assets/{CreditCard01-DDsAjKey.js → CreditCard01-DsaJOWgX.js} +1 -1
- package/dist/client/assets/{Globe04-xh_ZOoQS.js → Globe04-BBKBtEaK.js} +1 -1
- package/dist/client/assets/{Key01-BnxP0_QL.js → Key01-BTIXWKkS.js} +1 -1
- package/dist/client/assets/{LinkBroken01-4XuFjBFS.js → LinkBroken01-DjOOxf0e.js} +1 -1
- package/dist/client/assets/{Minus-D8UqNYy4.js → Minus-BAq-AD33.js} +1 -1
- package/dist/client/assets/{Monitor01-CVDkBVET.js → Monitor01-CqtNhdJN.js} +1 -1
- package/dist/client/assets/{Play--aCtxlXx.js → Play-kmXfE4Am.js} +1 -1
- package/dist/client/assets/{Plus-DXpzgENj.js → Plus-Bq5KiXqn.js} +1 -1
- package/dist/client/assets/ReferenceLine-CcfMMo9r.js +1 -0
- package/dist/client/assets/{SearchMd-CWmEKOOP.js → SearchMd-D1P7yVqT.js} +1 -1
- package/dist/client/assets/ShoppingBag01-CAQ4NRTU.js +1 -0
- package/dist/client/assets/{Sun-wXzOhHYv.js → Sun-C5iV1Zpq.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C42vJfgE.js → SwitchHorizontal01-CP6L8rlm.js} +1 -1
- package/dist/client/assets/{Tool01-DB3xqZeL.js → Tool01-DAYJL0v-.js} +1 -1
- package/dist/client/assets/{Tooltip-Dz7b9lTi.js → Tooltip-DiDmzDgy.js} +1 -1
- package/dist/client/assets/{Trash01-BAWUFhrC.js → Trash01-Dt7pyOwE.js} +1 -1
- package/dist/client/assets/{Upload01-CMkGIZuR.js → Upload01-CZ2h76oj.js} +1 -1
- package/dist/client/assets/{UserSquare-NNxs0RWc.js → UserSquare-CBWDFbi3.js} +1 -1
- package/dist/client/assets/{Users01-DIshv_Ib.js → Users01-BZzvQda-.js} +1 -1
- package/dist/client/assets/{XClose-E_Sbr7JC.js → XClose-D2u966Hj.js} +1 -1
- package/dist/client/assets/{Zap-BFWL2aD-.js → Zap-CDj8jJFt.js} +1 -1
- package/dist/client/assets/{access-gate-H6si3iA0.js → access-gate-DL6Fx00C.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BCsDq0oB.js → add-connection-dialog-DXVmpebU.js} +1 -1
- package/dist/client/assets/agent-app-DClrb2ok.js +1 -0
- package/dist/client/assets/agent-assets-C4JxM7ek.js +1 -0
- package/dist/client/assets/agent-automation-BRLWOY9Z.js +20 -0
- package/dist/client/assets/agent-automations-Bi4PZQpt.js +1 -0
- package/dist/client/assets/agent-blog-CZFhSkNf.js +2 -0
- package/dist/client/assets/agent-blog-post-DWjaJsuP.js +2 -0
- package/dist/client/assets/agent-calendar-DVRrZoQI.js +1 -0
- package/dist/client/assets/{agent-capabilities-C7nwtlfn.js → agent-capabilities-DHVCvnvi.js} +1 -1
- package/dist/client/assets/agent-connect-sources-zocgSqV4.js +1 -0
- package/dist/client/assets/agent-deck-BQ_G3Xvk.js +1 -0
- package/dist/client/assets/agent-e2e-C7P50BKx.js +1 -0
- package/dist/client/assets/agent-experiments-B7tgn9fP.js +1 -0
- package/dist/client/assets/agent-file-CVIHN4Pv.js +1 -0
- package/dist/client/assets/agent-hosting-DmUbTOe2.js +1 -0
- package/dist/client/assets/agent-icon-BwEytdmh.js +1 -0
- package/dist/client/assets/agent-library-BhTWSN-a.js +1 -0
- package/dist/client/assets/agent-library-file-C9nXPWjk.js +1 -0
- package/dist/client/assets/agent-overview-gQqe-_Zq.js +1 -0
- package/dist/client/assets/agent-releases-Bxmxt--5.js +2 -0
- package/dist/client/assets/agent-settings-BZlQcdRN.js +1 -0
- package/dist/client/assets/{agent-site-editor-D7f7n9V8.js → agent-site-editor-Bxgpwy-D.js} +9 -9
- package/dist/client/assets/agent-site-editor-code-D3XwSBBo.js +2 -0
- package/dist/client/assets/agent-site-editor-content-5EK8c-yC.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DtbJe_5m.js +1 -0
- package/dist/client/assets/agent-view-DJh235b7.js +1 -0
- package/dist/client/assets/agent-view-guard-B4P_nOY3.js +1 -0
- package/dist/client/assets/ai-providers-CvpoHUFb.js +1 -0
- package/dist/client/assets/{alert-gT8z0xwu.js → alert-0-4Lk02S.js} +1 -1
- package/dist/client/assets/{analytics-sections-eEEKYoEI.js → analytics-sections-DEuK9yNO.js} +1 -1
- package/dist/client/assets/{api-keys-DQU6MrN9.js → api-keys-BWb-_Fqf.js} +1 -1
- package/dist/client/assets/api-keys-PaXWWj2O.js +1 -0
- package/dist/client/assets/app-editor-DVjFa_ip.js +1 -0
- package/dist/client/assets/{asset-utils-ClCcVH6C.js → asset-utils-DSh1-4fR.js} +1 -1
- package/dist/client/assets/{auth-DzshLgt0.js → auth-DFCgioOs.js} +1 -1
- package/dist/client/assets/{auth-catchall-knKXQdld.js → auth-catchall-_w9pWMK8.js} +1 -1
- package/dist/client/assets/{auth-entry-CjhDapLF.js → auth-entry-HAlWF4UX.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Cs3K7qF9.js → auth-split-layout-BSaVPfK6.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DyNu9KE-.js → authenticate-and-persist-oauth-BGX0Y23v.js} +1 -1
- package/dist/client/assets/{automation-list-row-BIIymyig.js → automation-list-row-Xayp8iFs.js} +1 -1
- package/dist/client/assets/{automation-runs-BJn2B7cC.js → automation-runs-CUwzltO7.js} +1 -1
- package/dist/client/assets/automations-C0bs2qin.js +1 -0
- package/dist/client/assets/{badge-FhnYiqmQ.js → badge-DbKUf3vA.js} +1 -1
- package/dist/client/assets/block-document-zkAHP8m2.js +3 -0
- package/dist/client/assets/{blocks-preview-workspace-context-DPP_AgWW.js → blocks-preview-workspace-context-DQL_zlqC.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-DS5PjKyJ.js → blocks-tab-states-BUfMyINR.js} +1 -1
- package/dist/client/assets/blog-preview-url-CT-VZElJ.js +1 -0
- package/dist/client/assets/blog-schema-Dys-tzF0.js +1 -0
- package/dist/client/assets/blog-source-gate-CYaEgV9t.js +1 -0
- package/dist/client/assets/blog-view-gate-zXMdlu7Q.js +1 -0
- package/dist/client/assets/{buckets-Cm1lK-tx.js → buckets-DOgpbimo.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CKmcH9eT.js → build-improve-prompt-doc-BMf33123.js} +1 -1
- package/dist/client/assets/{calendar-Dj2F2D9c.js → calendar-5Nt9EKO9.js} +1 -1
- package/dist/client/assets/{capability-load-error-YlZMyLIu.js → capability-load-error-BSxnBi9L.js} +1 -1
- package/dist/client/assets/category-editor-DziWemO6.js +1 -0
- package/dist/client/assets/category-tree-Cm0a3nBT.js +4 -0
- package/dist/client/assets/{chart-4euqV-4L.js → chart-DPgJVmAl.js} +1 -1
- package/dist/client/assets/chat-context-D8Eje7xK.js +39 -0
- package/dist/client/assets/{chat-draft-B1Q_ptQ-.js → chat-draft-ArmxHiV6.js} +1 -1
- package/dist/client/assets/{checkbox-Bq5cgSkE.js → checkbox-CCw3an34.js} +1 -1
- package/dist/client/assets/choose-editor-CXiL24Bl.js +1 -0
- package/dist/client/assets/{cli-auth-success-C9VZDuEf.js → cli-auth-success-c7wBWUO5.js} +1 -1
- package/dist/client/assets/{client-icons-x0Kj4XXu.js → client-icons-CuJeSv2A.js} +1 -1
- package/dist/client/assets/cms-settings-editor-gxtK9SOp.js +1 -0
- package/dist/client/assets/cms-store-drafts-chLFxeWf.js +1 -0
- package/dist/client/assets/collapsible-CVtLl5wO.js +1 -0
- package/dist/client/assets/collection-detail-D_Bcp_j6.js +1 -0
- package/dist/client/assets/{collection-display-button-B9tDNz3Q.js → collection-display-button-CnhRvkGN.js} +1 -1
- package/dist/client/assets/{collection-search-o_TUN55Q.js → collection-search-CC2QUXh2.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CovrSOmj.js → collection-table-wrapper-DSy_nx4_.js} +1 -1
- package/dist/client/assets/{collection-tabs-C-HhSJ3V.js → collection-tabs-DHZJ_O9U.js} +1 -1
- package/dist/client/assets/{combobox-N56ErTGA.js → combobox-CB15NqGc.js} +1 -1
- package/dist/client/assets/{command-C4A_k1m6.js → command-BOSLOC8n.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BIgg4-5f.js → companion-mcps-section-CeNpBYo7.js} +1 -1
- package/dist/client/assets/config-DqdBgCnO.js +1 -0
- package/dist/client/assets/{connect-CAWALh6X.js → connect-WyHpmSHS.js} +3 -3
- package/dist/client/assets/{connect-layout-BGSvt_fK.js → connect-layout-D_zQARSX.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-zXoRskIf.js → connect-source-dialog-DHtZw9ff.js} +1 -1
- package/dist/client/assets/{connection-DWztoPJi.js → connection-D0YCkaZO.js} +1 -1
- package/dist/client/assets/{connection-card-CWeiT8GU.js → connection-card-B1Rl2nXN.js} +1 -1
- package/dist/client/assets/connection-detail-LxUhih2_.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DvFcvjHg.js → connection-form-helpers-CAOx4zgX.js} +1 -1
- package/dist/client/assets/{connection-slug-7qrL1eY0.js → connection-slug-BH_NX0Ks.js} +1 -1
- package/dist/client/assets/connections-BhxOwljy.js +1 -0
- package/dist/client/assets/content-tab-BdaE3oCc.js +19 -0
- package/dist/client/assets/context-BmOpD-Hr.js +1 -0
- package/dist/client/assets/{context-menu-CzVow7cK.js → context-menu-Df7WW_d5.js} +1 -1
- package/dist/client/assets/{context-shell-A1z9qMT_.js → context-shell-cJbikpSJ.js} +3 -3
- package/dist/client/assets/{core.esm-DbuDfvWF.js → core.esm-CAA73EV4.js} +2 -2
- package/dist/client/assets/{create-organization-dialog-D6MpLXO5.js → create-organization-dialog-BLvG9G-Z.js} +1 -1
- package/dist/client/assets/delete-copy-CAFEtw8Z.js +4 -0
- package/dist/client/assets/{device-hint-DKfCoj9a.js → device-hint-DgkMhcRQ.js} +1 -1
- package/dist/client/assets/discover-Cceep_sX.js +1 -0
- package/dist/client/assets/{domain-settings-EcbckpYF.js → domain-settings-52h_8fKM.js} +1 -1
- package/dist/client/assets/{drawer-DO5xJQb9.js → drawer-B9PFQFcy.js} +1 -1
- package/dist/client/assets/{editor-T1DFIh20.js → editor-DZ4pzlHx.js} +2 -2
- package/dist/client/assets/{editor-classes-XhTpecj4.js → editor-classes-Cb5f4sl2.js} +1 -1
- package/dist/client/assets/empty-message-CXYzekmD.js +15 -0
- package/dist/client/assets/{empty-state-DPWCLNrd.js → empty-state-BkAAjXrp.js} +1 -1
- package/dist/client/assets/{empty-state-DtO_Mv2g.js → empty-state-DMtSEEQ1.js} +1 -1
- package/dist/client/assets/experiments-tab-choice-CDm4A9Wq.js +1 -0
- package/dist/client/assets/{extract-connection-data-DBROTNmw.js → extract-connection-data-u6K4j2aJ.js} +1 -1
- package/dist/client/assets/feature-gate-DFWAlRCv.js +1 -0
- package/dist/client/assets/{feature-paywall-jPIGYZOc.js → feature-paywall-BiIzjBeB.js} +1 -1
- package/dist/client/assets/file-explorer-M__gA7Xu.js +2 -0
- package/dist/client/assets/{file-preview-D0iM2K-b.js → file-preview-D7WeSAA4.js} +1 -1
- package/dist/client/assets/{file-share-button-BsYWO9Hm.js → file-share-button-BtW_yxzc.js} +1 -1
- package/dist/client/assets/{file-type-icon-HeI2BZTs.js → file-type-icon-mKSSLPP8.js} +1 -1
- package/dist/client/assets/{folder-icon-DTWsvVbL.js → folder-icon-DCyvwLH6.js} +1 -1
- package/dist/client/assets/{form-BTSAyeiz.js → form-8HJUl2GV.js} +1 -1
- package/dist/client/assets/frame-navigation-Bp6fuuV5.js +1 -0
- package/dist/client/assets/general-C9cj7tJH.js +1 -0
- package/dist/client/assets/{github-icon-B_en9n_0.js → github-icon-DEvD-SlA.js} +1 -1
- package/dist/client/assets/held-block-view-DRxUlNuB.js +3 -0
- package/dist/client/assets/home-DR1hV3al.js +1 -0
- package/dist/client/assets/{home-overview-BRS8Q3rl.js → home-overview-CgBJdfHr.js} +1 -1
- package/dist/client/assets/hosted-reconcile-DH_YtUfF.js +1 -0
- package/dist/client/assets/{icon-button-BMTp1-QM.js → icon-button-CadQrI05.js} +1 -1
- package/dist/client/assets/{index-DwNl1Km0.js → index-8kUWDN7v.js} +1 -1
- package/dist/client/assets/index-BLdRRqFU.js +1 -0
- package/dist/client/assets/index-Bkf6As2Q.js +1 -0
- package/dist/client/assets/index-ButqNodW.js +4 -0
- package/dist/client/assets/{index-dCHDMdOx.js → index-BvGbwvSS.js} +1 -1
- package/dist/client/assets/{index-qsOMiawp.js → index-C1fc6W9Q.js} +1 -1
- package/dist/client/assets/{index-DGy42Noz.js → index-C5aoCNXr.js} +1 -1
- package/dist/client/assets/{index-DFaIOW9N.js → index-C9E0iqgh.js} +2 -2
- package/dist/client/assets/{index-DVvmeJMJ.js → index-CWKxkTwy.js} +47 -47
- package/dist/client/assets/{index-CWuPd_va.js → index-CcTmEE1N.js} +6 -6
- package/dist/client/assets/index-CzrYE4jE.js +1 -0
- package/dist/client/assets/{index-DlkOiyYS.js → index-DVdV24aR.js} +2 -2
- package/dist/client/assets/index-DYPWHH-M.css +1 -0
- package/dist/client/assets/{index-DlxA0Tmo.js → index-Tvs593C1.js} +1 -1
- package/dist/client/assets/{index-D1ksSwz3.js → index-_sPF1edR.js} +1 -1
- package/dist/client/assets/{index-DTVEZmhV.js → index-gX7QfQio.js} +1 -1
- package/dist/client/assets/{index-redirect-BEZcO3ft.js → index-redirect-DOlNtcAX.js} +1 -1
- package/dist/client/assets/{index-laonBzOU.js → index-t9nYrZiR.js} +1 -1
- package/dist/client/assets/{index-DyEEK3cc.js → index-yzkfeOP2.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Depn9DGH.js → infiniteQueryObserver-DCK-YXw1.js} +1 -1
- package/dist/client/assets/{infra-billing-BGMskgUq.js → infra-billing-B-pN25L9.js} +1 -1
- package/dist/client/assets/{input-aWrDx9Iy.js → input-1NX4JUHA.js} +3 -3
- package/dist/client/assets/{input-D4HN-yNN.js → input-DA-TtdGL.js} +1 -1
- package/dist/client/assets/{integration-icon-C9OIwyFH.js → integration-icon-C1bpkd7s.js} +1 -1
- package/dist/client/assets/item-actions-kNG-BlG3.js +1 -0
- package/dist/client/assets/{jira-icon-CnIpLe3l.js → jira-icon-CnBOGlR6.js} +1 -1
- package/dist/client/assets/{label-DxsI69Ti.js → label-BXSXPHWU.js} +1 -1
- package/dist/client/assets/{layout-m_pr21sI.js → layout-C0J9eFzL.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DIDvLt4b.js → legacy-admin-welcome-dialog-DbVWjlJ6.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CK9Gbzky.js → legacy-agents-deep-DVKmxbFS.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Cep_68fb.js → legacy-main-redirect-D0wT4Yry.js} +1 -1
- package/dist/client/assets/library-sYbbN7ux.js +1 -0
- package/dist/client/assets/{library-tab-Dy0wbynU.js → library-tab-gK_7g-te.js} +4 -4
- package/dist/client/assets/{login-FVvIKUmZ.js → login-DnxvVl1t.js} +1 -1
- package/dist/client/assets/{markdown-DY1gkJzE.js → markdown-DiEygcQw.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CbbHrG36.js → mcp-app-renderer-BbTTGmQC.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B4bma3Oc.js → mcp-oauth-CQGGouuy.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Dz6mx5UF.js → mcp-oauth-TUUsAJpA.js} +1 -1
- package/dist/client/assets/{members-CoNUsoOs.js → members-nUmVbnC9.js} +1 -1
- package/dist/client/assets/{memory-CJmsq8GA.js → memory-Blrtbn8a.js} +2 -2
- package/dist/client/assets/{mock-board-C-Bptu2a.js → mock-board-CC-isAOX.js} +3 -3
- package/dist/client/assets/{monaco-editor-ChRuLOCA.js → monaco-editor-C9ZwdTpU.js} +1 -1
- package/dist/client/assets/{monitoring-DOIwwqmT.js → monitoring-B36SUiOP.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-MlJzIKBz.js → monitoring-stats-row-H3pnSbDz.js} +1 -1
- package/dist/client/assets/{multi-select-HzpZ3y0m.js → multi-select-obeT7dRo.js} +1 -1
- package/dist/client/assets/mustache-gM754ehf.js +4 -0
- package/dist/client/assets/named-rule-step-W9P9uG-f.js +1 -0
- package/dist/client/assets/named-rule-view-BJLbVNsp.js +1 -0
- package/dist/client/assets/{new-project-dialog-DNs6nXJU.js → new-project-dialog-Cfdy4DZo.js} +1 -1
- package/dist/client/assets/{oauth-callback-DJ1LZft0.js → oauth-callback-Cxz67hG6.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DdjujeOM.js → oauth-callback-ai-provider-Diui0sS6.js} +1 -1
- package/dist/client/assets/{oauth-consent-C7arrnjn.js → oauth-consent-BWS32jU1.js} +1 -1
- package/dist/client/assets/{onboarding-DCEuM15Q.js → onboarding-Cg2Txb26.js} +1 -1
- package/dist/client/assets/openai-conversation-CGGu6BWJ.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-Bxu9JyYq.js → optimistic-project-sidebar-views-cd4O2LnM.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BHRAsIfi.js → order-monitor-day-DrziIuIu.js} +1 -1
- package/dist/client/assets/{organization-choice-BLi_jfq-.js → organization-choice-CPef1x_g.js} +1 -1
- package/dist/client/assets/{orgs-B0FFSMlY.js → orgs--h6JaB89.js} +1 -1
- package/dist/client/assets/{own-accounts-section-BPiQsCnH.js → own-accounts-section-D0sCVz2F.js} +1 -1
- package/dist/client/assets/{pair-BefVcuJk.js → pair-DbwVEDlq.js} +7 -7
- package/dist/client/assets/parse-sections-CMxFIp3d.js +4 -0
- package/dist/client/assets/plan-1pM1JHac.js +1 -0
- package/dist/client/assets/{plan-ladder-BIrfRC9w.js → plan-ladder-XiZUV3-n.js} +1 -1
- package/dist/client/assets/{plan-usage-card-9-4sECew.js → plan-usage-card-BsCyr1kn.js} +2 -2
- package/dist/client/assets/{popover-DVbSl4_S.js → popover-CTEYICXO.js} +1 -1
- package/dist/client/assets/post-calendar-DbsJgYWp.js +1 -0
- package/dist/client/assets/post-editor-GP7cTHEm.js +2 -0
- package/dist/client/assets/{preview-content-4sXQQAYj.js → preview-content-BYvAegAr.js} +1 -1
- package/dist/client/assets/{preview-dialog-DdT5D37e.js → preview-dialog-tONoLcHy.js} +1 -1
- package/dist/client/assets/{preview-panel-08gBYjqh.js → preview-panel-CxdwWGtV.js} +1 -1
- package/dist/client/assets/preview-tab-BJQS3_gN.js +551 -0
- package/dist/client/assets/{product-picker-dialog-CK0DishF.js → product-picker-dialog-DVmdugXw.js} +1 -1
- package/dist/client/assets/{profile-D-F6LVIp.js → profile-CFEIL030.js} +1 -1
- package/dist/client/assets/project-app-view-DpcLMitT.js +1 -0
- package/dist/client/assets/project-apps-T4OBSnxG.js +1 -0
- package/dist/client/assets/{project-icon-BfdBakvS.js → project-icon-CsM5Xu_3.js} +1 -1
- package/dist/client/assets/{project-index-CIwgcHHa.js → project-index-CnwYmkRd.js} +1 -1
- package/dist/client/assets/project-reports-Bsj_xvMI.js +1 -0
- package/dist/client/assets/project-tasks-BGrqP4mL.js +1 -0
- package/dist/client/assets/projects-D9OLRq0V.js +1 -0
- package/dist/client/assets/{projects-empty-state-CNEfVw65.js → projects-empty-state-DAdhJyFi.js} +1 -1
- package/dist/client/assets/{prompts-xdLcYGyB.js → prompts-hNC_o6uG.js} +1 -1
- package/dist/client/assets/record-editor-BUh6IBbj.js +1 -0
- package/dist/client/assets/redirect-editor-CRbYvUNE.js +1 -0
- package/dist/client/assets/{reports-BoYTb5US.js → reports-CoqdbgJH.js} +1 -1
- package/dist/client/assets/reports-D5qXQXTJ.js +1 -0
- package/dist/client/assets/reports-onboarding-B8pLePIS.js +1 -0
- package/dist/client/assets/reports-tab-BTcGlLJG.js +2 -0
- package/dist/client/assets/repositories-Cb1lXF50.js +1 -0
- package/dist/client/assets/repositories-cxta7jGt.js +1 -0
- package/dist/client/assets/{repository-binding-DJpVzzIq.js → repository-binding-DScgU6HN.js} +1 -1
- package/dist/client/assets/repository-picker-BUWqEoln.js +1 -0
- package/dist/client/assets/{require-capability-BpMqCrIS.js → require-capability-Cqs162cO.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BIQCwVTO.js → required-auth-layout-BiIyXd3D.js} +1 -1
- package/dist/client/assets/{reset-password-BKzfgMBU.js → reset-password-da4PvhID.js} +1 -1
- package/dist/client/assets/{resizable-C9_scy3R.js → resizable-Bf-xwR0k.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-CGJDnTEl.js +1 -0
- package/dist/client/assets/review-settings-Ulx4CyPZ.js +1 -0
- package/dist/client/assets/role-color-C7dBdDUi.js +1 -0
- package/dist/client/assets/roles-z96sRIvs.js +1 -0
- package/dist/client/assets/route-CNldsqd_.js +1 -0
- package/dist/client/assets/route-D7eWiLEQ.js +1 -0
- package/dist/client/assets/route-UFlyMaLZ.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-_uINbsP3.js → sandbox-lifecycle-context-DY2xu0Uo.js} +1 -1
- package/dist/client/assets/save-status-DshwUBI8.js +1 -0
- package/dist/client/assets/{schema-ChSE97DN.js → schema-DUByfd2Y.js} +1 -1
- package/dist/client/assets/{schema-CzuWRpLl.js → schema-DWYnTC39.js} +1 -1
- package/dist/client/assets/{scroll-area-D1j-ZNOk.js → scroll-area-EO9hsjie.js} +1 -1
- package/dist/client/assets/search-input-Dc1w2xyv.js +1 -0
- package/dist/client/assets/{search-toggle-BSwOQVMD.js → search-toggle-BZIowSkC.js} +1 -1
- package/dist/client/assets/{secret-picker-zgl1t1WE.js → secret-picker-t9uXEG8-.js} +1 -1
- package/dist/client/assets/{secrets-Dvs-hzm1.js → secrets-CPHCsh_T.js} +1 -1
- package/dist/client/assets/section-array-field-BFg67nYp.js +1 -0
- package/dist/client/assets/{sections-COYsDPZ3.js → sections-CrmI_GQr.js} +1 -1
- package/dist/client/assets/sections-editor-CrXI2Bvd.js +1 -0
- package/dist/client/assets/{select-CBAbBtbp.js → select-CWL8C0Pw.js} +1 -1
- package/dist/client/assets/{select-model-CScqhZ6D.js → select-model-_wNlq-Z9.js} +1 -1
- package/dist/client/assets/seo-editor-B3mQn1CH.js +1 -0
- package/dist/client/assets/{separator-B-2WnIuS.js → separator-Cyq4ZO_K.js} +1 -1
- package/dist/client/assets/settings-tab-CDHhpvzE.js +1 -0
- package/dist/client/assets/{sheet-BSTYuLMa.js → sheet-Bqz29cSo.js} +1 -1
- package/dist/client/assets/shell-layout-DVIwCYxA.js +1 -0
- package/dist/client/assets/site-draft-actions-DQ2Ndjsf.js +3 -0
- package/dist/client/assets/site-draft-view-CIEvFlZ7.js +1 -0
- package/dist/client/assets/site-editor-C927WhHx.js +1 -0
- package/dist/client/assets/{site-editor-toast-Bz5hIXUq.js → site-editor-toast-BLqoqKy_.js} +1 -1
- package/dist/client/assets/skills-0h7pumIQ.js +1 -0
- package/dist/client/assets/{slider-B-4p3Nob.js → slider-GCMZAdst.js} +1 -1
- package/dist/client/assets/{sortable.esm-BMq0DSBR.js → sortable.esm-CYzspn3s.js} +1 -1
- package/dist/client/assets/{sso-D7rzaxll.js → sso-Ca2H_kJv.js} +1 -1
- package/dist/client/assets/suggestion-CppSMZxc.js +2 -0
- package/dist/client/assets/{super-agent-icon-CSXn8PV0.js → super-agent-icon-Dq0ZAaMf.js} +1 -1
- package/dist/client/assets/{switch-BoeP0_DT.js → switch-DBO_GrNe.js} +1 -1
- package/dist/client/assets/synced-repos-BTn3MABM.js +1 -0
- package/dist/client/assets/{tab-icon-glyph-DWwnpbAG.js → tab-icon-glyph-BaeBTavE.js} +1 -1
- package/dist/client/assets/{table-XIxdhyNo.js → table-xCmpwB0s.js} +1 -1
- package/dist/client/assets/{tabs-B314G2il.js → tabs-rkhPwLiJ.js} +1 -1
- package/dist/client/assets/{task-board-D-pfBnAn.js → task-board-D7RCmGkN.js} +1 -1
- package/dist/client/assets/{task-route-DrEh97G3.js → task-route-BJeZEOaQ.js} +1 -1
- package/dist/client/assets/{task-status-B5Pet88z.js → task-status-ISwbNtXh.js} +1 -1
- package/dist/client/assets/taskboard-analytics-B3vmd83_.js +1 -0
- package/dist/client/assets/{tasks-D1UDrE84.js → tasks-BLz1W4rF.js} +3 -3
- package/dist/client/assets/tasks-hZ3cVL1W.js +1 -0
- package/dist/client/assets/{textarea-yEyl1P1k.js → textarea-CvY2QE-l.js} +1 -1
- package/dist/client/assets/thread-analytics-DmP3G179.js +1 -0
- package/dist/client/assets/{thread-intent-BNVTtSHt.js → thread-intent-0TjSPqLd.js} +6 -6
- package/dist/client/assets/thread-route-4ZjlovaL.js +1 -0
- package/dist/client/assets/{thread-route-C8VqFbkH.js → thread-route-BbSych2c.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BPfgeSL4.js → thread-sheet-body-JQX8n1oy.js} +1 -1
- package/dist/client/assets/{time-range-picker-BvmuiVyh.js → time-range-picker-Bcp8sqUk.js} +1 -1
- package/dist/client/assets/{toggle-group-pyWm-TzL.js → toggle-group-BPubP3Pi.js} +1 -1
- package/dist/client/assets/{tool-namespace-CtWbol20.js → tool-namespace-c-MaHIy3.js} +1 -1
- package/dist/client/assets/{tool-set-selector-o7QGolVt.js → tool-set-selector-qnchAzSg.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DJE3OEfz.js → toolbar-icon-button-DqW_CkJO.js} +1 -1
- package/dist/client/assets/{tooltip-BVrosRIK.js → tooltip-mM1fQXaq.js} +1 -1
- package/dist/client/assets/{tooltipContext-qYwD6VMh.js → tooltipContext-B2y0_sWP.js} +1 -1
- package/dist/client/assets/{track-CeXWn-zt.js → track-XkKLQQJT.js} +1 -1
- package/dist/client/assets/{types-DDm1cJJv.js → types-E9_eqrxO.js} +3 -3
- package/dist/client/assets/{url-slug-W6aFEmJF.js → url-slug-BVpN8K6B.js} +1 -1
- package/dist/client/assets/{usage-stats-Dhf-DrML.js → usage-stats-DT9jvl-J.js} +2 -2
- package/dist/client/assets/{use-ai-providers-Cq3xA9Zt.js → use-ai-providers-Bku85sJ3.js} +1 -1
- package/dist/client/assets/use-apply-named-rule-Bwm7LB-d.js +1 -0
- package/dist/client/assets/use-ask-in-chat-C5w0G3Ru.js +1 -0
- package/dist/client/assets/{use-automations-BVThKMGQ.js → use-automations-D9iFnWhp.js} +1 -1
- package/dist/client/assets/use-autosave-CLbBIg-P.js +1 -0
- package/dist/client/assets/use-blocks-v8-project-BTQz7erp.js +1 -0
- package/dist/client/assets/use-chat-layout-state-Cbkyo6cP.js +1 -0
- package/dist/client/assets/{use-cms-publish-actions-C7zW1hZf.js → use-cms-publish-actions-XYKTfqt2.js} +5 -5
- package/dist/client/assets/{use-connect-companion-B9VAml3x.js → use-connect-companion-DCIdJC0W.js} +1 -1
- package/dist/client/assets/use-connection-CLoaxXGr.js +1 -0
- package/dist/client/assets/use-content-sync-14ry1gRC.js +1 -0
- package/dist/client/assets/{use-copy-DT5ZzrsX.js → use-copy-D3ELC0tX.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Co74b8Ww.js → use-date-fns-locale-DU1bARSL.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-4hpLvgm-.js → use-debounced-autosave-Dxp05968.js} +1 -1
- package/dist/client/assets/{use-debounced-value-jJnqowMI.js → use-debounced-value-CgYJanEq.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BQqUH0BV.js → use-deco-credits-DlgC2mIc.js} +1 -1
- package/dist/client/assets/use-decopilot-events-DhxeqkWl.js +1 -0
- package/dist/client/assets/use-delete-block-BJD7162e.js +1 -0
- package/dist/client/assets/use-delete-connection-DtzGQTsr.js +1 -0
- package/dist/client/assets/{use-deployment-admin-CDyLX01_.js → use-deployment-admin-8guQU4GC.js} +1 -1
- package/dist/client/assets/{use-entitlements-u-J4FrTi.js → use-entitlements-J4XPZF2l.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-BX0PGrG_.js +1 -0
- package/dist/client/assets/{use-file-configs-BbIIeRpu.js → use-file-configs-DngvlIXa.js} +1 -1
- package/dist/client/assets/{use-id-selection-CUD8oDcN.js → use-id-selection-Dkbf-QZH.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CcPQJJTK.js → use-inbox-feed-b7aNeh2-.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CfhQVaOS.js → use-infinite-scroll-BWIp-OKY.js} +1 -1
- package/dist/client/assets/{use-join-requests-CkLvGQO2.js → use-join-requests-CdvnKUpu.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-i0OC0oRI.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-KGdhyspi.js → use-mcp-auth-status-CxxAbIdU.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bh7kEUBS.js → use-mcp-client-CmWEhN6T.js} +10 -10
- package/dist/client/assets/{use-mcp-prompts-BvdRcLVu.js → use-mcp-prompts-RB8yW0_L.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BXarw5nj.js → use-mcp-tools-Bfew76Ae.js} +1 -1
- package/dist/client/assets/{use-mobile-Dc6kWu8K.js → use-mobile-BZ5I1Gts.js} +1 -1
- package/dist/client/assets/use-move-blocks-a-Gpcz1Q.js +1 -0
- package/dist/client/assets/use-navigate-to-agent-CMbT8SLE.js +1 -0
- package/dist/client/assets/use-never-published-Cq663vOp.js +1 -0
- package/dist/client/assets/{use-org-fs-DrGQDt6z.js → use-org-fs-D8fqy59B.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CJN2n862.js → use-org-repo-syncs-D0tdQJ2P.js} +1 -1
- package/dist/client/assets/{use-org-sso-3rJKFGHZ.js → use-org-sso-D-kGbeq_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Dw2wmQuO.js → use-organization-settings-BZz5ibUN.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-BbI14MhH.js +1 -0
- package/dist/client/assets/use-project-scope-3ijTexFj.js +1 -0
- package/dist/client/assets/use-recent-apps-CWPH7SDm.js +1 -0
- package/dist/client/assets/{use-reports-diagnostic-CnV_YMfp.js → use-reports-diagnostic-V-qftvBJ.js} +1 -1
- package/dist/client/assets/use-sandbox-events-CBP-Uwww.js +2 -0
- package/dist/client/assets/{use-secrets-CYyoVB7k.js → use-secrets-CfMZEME2.js} +1 -1
- package/dist/client/assets/use-section-preview-base-DxIpbqPr.js +1 -0
- package/dist/client/assets/{use-sidebar-collapsed-CGsrtxLO.js → use-sidebar-collapsed-Cbxz0vjB.js} +1 -1
- package/dist/client/assets/{use-tags-D570CleN.js → use-tags-DTSxZWpz.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DCDiNKaK.js → use-task-board-analytics-BKNhIlpV.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DUIQmo3-.js → use-task-board-events-MfMFlaj-.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CG0dFrGw.js → use-task-board-item-prs-i0iDRtks.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BB9JhdmM.js → use-task-board-items-6-h_Haer.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-DTmkMV_c.js → use-task-board-prompts-BzepMvGT.js} +1 -1
- package/dist/client/assets/{use-task-metadata-qW9LtgU4.js → use-task-metadata-CkJg1Id-.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CtFiUcL7.js → use-thread-outputs-DegzudvH.js} +1 -1
- package/dist/client/assets/use-view-draft-kind-BQ4N5uEB.js +1 -0
- package/dist/client/assets/{use-voice-input-DyZTYy5g.js → use-voice-input-vD0BpiqU.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-njPYFTao.js +1 -0
- package/dist/client/assets/{useQueries-1XxIGeEN.js → useQueries-D6BmTkII.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CSPS7F0z.js +1 -0
- package/dist/client/assets/{users-I0fvIaz3.js → users-RduqDlHV.js} +1 -1
- package/dist/client/assets/{utils-Pt7-9-Ev.js → utils-CkU_P8Ie.js} +2 -2
- package/dist/client/assets/variant-calendar-1rTVvyAx.js +1 -0
- package/dist/client/assets/{variant-matcher-override-BZrGhjnT.js → variant-matcher-override-B3zGkPXZ.js} +1 -1
- package/dist/client/assets/{view-header-D7Xjp31c.js → view-header-B-Vek7fH.js} +1 -1
- package/dist/client/assets/virtual-mcp-DPJ0M-HO.js +1 -0
- package/dist/client/assets/{watch-sse-pool-B9yUO9oy.js → watch-sse-pool-DqTWfbxM.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +584 -584
- package/package.json +1 -1
- package/dist/client/assets/ReferenceLine-CyROiAPM.js +0 -1
- package/dist/client/assets/ShoppingBag01-ClDrdJV2.js +0 -1
- package/dist/client/assets/agent-app-Bl_mPh_t.js +0 -1
- package/dist/client/assets/agent-assets-B5UWuXnl.js +0 -1
- package/dist/client/assets/agent-automation-C9PBjiVk.js +0 -20
- package/dist/client/assets/agent-automations-CMf5dE3K.js +0 -1
- package/dist/client/assets/agent-calendar-DfZ4ErN1.js +0 -1
- package/dist/client/assets/agent-connect-sources-DwgsD8vQ.js +0 -1
- package/dist/client/assets/agent-deck-DjXPR_Nl.js +0 -1
- package/dist/client/assets/agent-e2e-BRjoGfW2.js +0 -1
- package/dist/client/assets/agent-experiments-CA2mbR8k.js +0 -1
- package/dist/client/assets/agent-file-BQdiAqSO.js +0 -1
- package/dist/client/assets/agent-hosting-D5KChDQU.js +0 -1
- package/dist/client/assets/agent-icon-uDqFfzhf.js +0 -1
- package/dist/client/assets/agent-library-2kWug_zO.js +0 -1
- package/dist/client/assets/agent-library-file-DtPgl6Sc.js +0 -1
- package/dist/client/assets/agent-overview-CXQy1R3G.js +0 -1
- package/dist/client/assets/agent-releases-CaysxAFQ.js +0 -2
- package/dist/client/assets/agent-settings-Bt8gf0xs.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DfcTCTxX.js +0 -2
- package/dist/client/assets/agent-site-editor-content-B47YLbhf.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Ci1e5zpi.js +0 -1
- package/dist/client/assets/agent-view-FTi4q4vz.js +0 -1
- package/dist/client/assets/agent-view-guard-BP5FCFpQ.js +0 -1
- package/dist/client/assets/ai-providers-CQ29Z6f1.js +0 -1
- package/dist/client/assets/api-keys-h9YcYrMI.js +0 -1
- package/dist/client/assets/app-editor-BSqFGCuO.js +0 -1
- package/dist/client/assets/automations-Xmpwvi6F.js +0 -1
- package/dist/client/assets/autosend-D-UTWUhf.js +0 -1
- package/dist/client/assets/block-document-0w5M-3LO.js +0 -3
- package/dist/client/assets/blog-schema-CYWT4exY.js +0 -1
- package/dist/client/assets/category-editor-BRFXJMj8.js +0 -1
- package/dist/client/assets/chat-context-bTdV0PQS.js +0 -39
- package/dist/client/assets/choose-editor-CKJ9YUAD.js +0 -1
- package/dist/client/assets/cms-settings-editor-Bl0s5YWk.js +0 -1
- package/dist/client/assets/cms-store-drafts-B8sdeq2z.js +0 -1
- package/dist/client/assets/collapsible-B2pXVUPn.js +0 -1
- package/dist/client/assets/collection-detail-D-ELQuvL.js +0 -1
- package/dist/client/assets/config-CaohtXWJ.js +0 -1
- package/dist/client/assets/connection-detail-CyQt5Knq.js +0 -1
- package/dist/client/assets/connections-Dfx8FH4D.js +0 -1
- package/dist/client/assets/content-tab-Bd4lKzez.js +0 -25
- package/dist/client/assets/context-DkOsTTFI.js +0 -1
- package/dist/client/assets/discover-Blhzpr1h.js +0 -1
- package/dist/client/assets/experiments-tab-choice-BKIwz3b9.js +0 -1
- package/dist/client/assets/feature-gate-B_FyKX76.js +0 -1
- package/dist/client/assets/file-explorer-mKoJ95H9.js +0 -2
- package/dist/client/assets/general-DQnQVbWU.js +0 -1
- package/dist/client/assets/home-CLDIpUPQ.js +0 -1
- package/dist/client/assets/hosted-reconcile-C7zHteUc.js +0 -1
- package/dist/client/assets/index-CnFz3TOs.js +0 -4
- package/dist/client/assets/index-DO-A5xCQ.css +0 -1
- package/dist/client/assets/index-DPvgRnv7.js +0 -1
- package/dist/client/assets/index-DisDzI9Z.js +0 -1
- package/dist/client/assets/index-MBimNXd5.js +0 -1
- package/dist/client/assets/library-CYKhZ1Xb.js +0 -1
- package/dist/client/assets/mustache-CtUZw69D.js +0 -4
- package/dist/client/assets/named-rule-view-CkgbSbSg.js +0 -1
- package/dist/client/assets/openai-conversation-D4xjY3_1.js +0 -3
- package/dist/client/assets/parse-sections-D2w3wSuP.js +0 -20
- package/dist/client/assets/plan-Da6szJuR.js +0 -1
- package/dist/client/assets/post-calendar-DEqb8d3G.js +0 -1
- package/dist/client/assets/post-editor-B-zzeLVe.js +0 -2
- package/dist/client/assets/preview-tab-DBOLhpj4.js +0 -551
- package/dist/client/assets/project-app-view-etnu6fhD.js +0 -1
- package/dist/client/assets/project-apps-D4MFXbKC.js +0 -1
- package/dist/client/assets/project-reports-B9YT4T_3.js +0 -1
- package/dist/client/assets/project-tasks-DhwbKHKQ.js +0 -1
- package/dist/client/assets/projects-DN5f4v6V.js +0 -1
- package/dist/client/assets/record-editor-DtXYbHpV.js +0 -1
- package/dist/client/assets/redirect-editor-BGoLXzQs.js +0 -1
- package/dist/client/assets/reports-BVe3MPdv.js +0 -1
- package/dist/client/assets/reports-onboarding-hafGLqtC.js +0 -1
- package/dist/client/assets/reports-tab-BGeZEsTL.js +0 -2
- package/dist/client/assets/repositories-B9hLcljS.js +0 -1
- package/dist/client/assets/repositories-DMPvx5Vv.js +0 -1
- package/dist/client/assets/repository-picker-8FkfYDdf.js +0 -1
- package/dist/client/assets/resolve-tab-icon-DO940wY_.js +0 -1
- package/dist/client/assets/review-settings-Bj89Yxea.js +0 -1
- package/dist/client/assets/role-color-Dy-P6oaY.js +0 -1
- package/dist/client/assets/roles-CvbfU6et.js +0 -1
- package/dist/client/assets/route-93-1A9vt.js +0 -1
- package/dist/client/assets/route-BdH_uLpp.js +0 -1
- package/dist/client/assets/route-y8ZhYa0n.js +0 -1
- package/dist/client/assets/search-input-Cvdta6ZJ.js +0 -1
- package/dist/client/assets/section-array-field-AXi3Vg_u.js +0 -1
- package/dist/client/assets/sections-editor-CyIATot1.js +0 -1
- package/dist/client/assets/seo-editor-C0rSQsv3.js +0 -1
- package/dist/client/assets/settings-tab-DFF8W9c5.js +0 -1
- package/dist/client/assets/shell-layout-CU0v0Q3J.js +0 -1
- package/dist/client/assets/site-draft-actions-D4mgl3Il.js +0 -3
- package/dist/client/assets/site-draft-view-BlOBzJMo.js +0 -1
- package/dist/client/assets/site-editor-BoWcMF8-.js +0 -1
- package/dist/client/assets/skills-CPsP4uSN.js +0 -1
- package/dist/client/assets/suggestion-UmoyYDA6.js +0 -2
- package/dist/client/assets/synced-repos-MPQrTxDL.js +0 -1
- package/dist/client/assets/taskboard-analytics-BCgYqiKL.js +0 -1
- package/dist/client/assets/tasks-D2QsX8U7.js +0 -1
- package/dist/client/assets/thread-analytics-DEw5nqD5.js +0 -1
- package/dist/client/assets/thread-route-0xQXgTvr.js +0 -1
- package/dist/client/assets/use-apply-named-rule-V-RgXu1D.js +0 -1
- package/dist/client/assets/use-ask-in-chat-CIVcbye6.js +0 -1
- package/dist/client/assets/use-autosave-CCiDACSS.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-Cbqo1QTy.js +0 -1
- package/dist/client/assets/use-chat-layout-state-CGYfM8sf.js +0 -1
- package/dist/client/assets/use-connection-DnLlCwu6.js +0 -1
- package/dist/client/assets/use-content-sync-D9eluVVW.js +0 -1
- package/dist/client/assets/use-decopilot-events-B2tjImS_.js +0 -1
- package/dist/client/assets/use-delete-connection-DpEMQiOo.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-BxKgK3r2.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-DyYS88nS.js +0 -1
- package/dist/client/assets/use-move-blocks-D35xWi_f.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-BNznjjAZ.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-BNwJJKFa.js +0 -1
- package/dist/client/assets/use-project-scope-BbUTPXSS.js +0 -1
- package/dist/client/assets/use-recent-apps-BkGr3MbC.js +0 -1
- package/dist/client/assets/use-sandbox-events-C8uDi6Yt.js +0 -2
- package/dist/client/assets/use-section-preview-base-DqcwcHAy.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BuWYzJlw.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BofrdpH6.js +0 -1
- package/dist/client/assets/variant-calendar-WNfoLO6H.js +0 -1
- package/dist/client/assets/virtual-mcp-CSkG36xb.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,b as j,r as _,j as f,m as B,by as at,t as se,b1 as Oe,a4 as ot,ha as lt,i as ct,K as ut,bR as ht,h as De,o as pt}from"./index-DVvmeJMJ.js";import{u as dt,t as Be,E as ue,A as ft,v as gt,Y as P,Z as mt,_ as kt,H as xt,I as D,$ as ve,a0 as bt,d as wt,a1 as Se,a2 as yt,a3 as G,N as Fe,a4 as he,b as qe,a5 as pe,a6 as Tt,a7 as vt,s as St,a8 as Mt,e as Et,f as At}from"./usage-stats-Dhf-DrML.js";import{T as C,n as Rt,i as _t,E as $t}from"./editor-classes-XhTpecj4.js";import{a as Ct,e as Ue,s as It,S as Lt}from"./suggestion-UmoyYDA6.js";import{B as zt}from"./index-DlxA0Tmo.js";import{aY as Pt,aj as jt,ak as Nt,am as Ht,Y as Ot,bn as Dt,b0 as Bt}from"./agent-icon-uDqFfzhf.js";import{i as Ft}from"./SwitchHorizontal01-C42vJfgE.js";import{s as qt}from"./Trash01-BAWUFhrC.js";import{k as Ut,a as Zt}from"./use-org-fs-DrGQDt6z.js";import{E as Me,i as Ze,b as Gt,c as Kt,d as Ge,A as Wt,e as Qt,f as Xt,g as Vt,j as Yt}from"./markdown-DY1gkJzE.js";import{s as Jt,T as en}from"./index-qsOMiawp.js";import{f as tn,a as nn,c as rn,C as sn,b as Ee}from"./command-C4A_k1m6.js";import{I as an}from"./icon-button-BMTp1-QM.js";function on(t){const e=$.c(30),{editor:n}=t,s=j(),[r,a]=_.useState(!1),[i,l]=_.useState(""),[o,h]=_.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const u=c;let p;e[2]!==n||e[3]!==r?(p=()=>{if(r){a(!1);return}const T=n.getAttributes("link").href;l(typeof T=="string"?T:""),h(!1),a(!0)},e[2]=n,e[3]=r,e[4]=p):p=e[4];const d=p;let g;e[5]!==n?(g=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=g):g=e[6];const x=g;let w;e[7]!==i||e[8]!==n||e[9]!==x?(w=()=>{const T=Rt(i);if(T===""){x();return}if(!_t(T)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:T}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=x,e[10]=w):w=e[10];const b=w;let y;e[11]!==s?(y=s("markdownEditor.link"),e[11]=s,e[12]=y):y=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=f.jsx(Pt,{size:14}),e[13]=v):v=e[13];let M;e[14]!==u||e[15]!==y||e[16]!==d?(M=f.jsx(C,{active:u,label:y,onClick:d,children:v}),e[14]=u,e[15]=y,e[16]=d,e[17]=M):M=e[17];let m;e[18]!==u||e[19]!==b||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==x||e[25]!==s?(m=r&&f.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||a(!1)},children:[f.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:T=>{l(T.target.value),h(!1)},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),b()):T.key==="Escape"&&(T.preventDefault(),a(!1),n.chain().focus().run())},className:B("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")}),f.jsx(C,{active:!1,label:s("markdownEditor.linkApply"),onClick:b,children:f.jsx(at,{size:14})}),u&&f.jsx(C,{active:!1,label:s("markdownEditor.linkRemove"),onClick:x,children:f.jsx(qt,{size:14})})]}),e[18]=u,e[19]=b,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=x,e[25]=s,e[26]=m):m=e[26];let k;return e[27]!==M||e[28]!==m?(k=f.jsxs("div",{className:"relative",children:[M,m]}),e[27]=M,e[28]=m,e[29]=k):k=e[29],k}const ne=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=f.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},Ae=t=>{const e=$.c(2),{children:n}=t;let s;return e[0]!==n?(s=f.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},Ke=[1,2,3],ln=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function cn(t){const e=$.c(20),{editor:n}=t,s=j(),[r,a]=_.useState(null);let i;e[0]!==n?(i={editor:n,selector:un},e[0]=n,e[1]=i):i=e[1];const l=dt(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let h;e[4]!==s?(h=s("markdownEditor.heading2"),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==s?(c=s("markdownEditor.heading3"),e[6]=s,e[7]=c):c=e[7];let u;e[8]!==o||e[9]!==h||e[10]!==c?(u={1:o,2:h,3:c},e[8]=o,e[9]=h,e[10]=c,e[11]=u):u=e[11];const p=u;let d;e[12]!==n||e[13]!==p||e[14]!==r||e[15]!==l||e[16]!==s?(d=r&&f.jsxs(zt,{editor:n,shouldShow:ln,appendTo:r,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[f.jsx(C,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:f.jsx(jt,{size:14})}),f.jsx(C,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:f.jsx(Nt,{size:14})}),f.jsx(C,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:f.jsx(Ht,{size:14})}),f.jsx(C,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:f.jsx(Ot,{size:14})}),f.jsx(ne,{}),Ke.map((x,w)=>f.jsx(C,{active:l.headings[w]??!1,label:p[x],onClick:()=>n.chain().focus().toggleHeading({level:x}).run(),children:f.jsx(Ae,{children:`H${x}`})},x)),f.jsx(ne,{}),f.jsx(C,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:f.jsx(Ft,{size:14})}),f.jsx(C,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:f.jsx(Ae,{children:"1."})}),f.jsx(C,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:f.jsx(Dt,{size:14})}),f.jsx(ne,{}),f.jsx(on,{editor:n})]}),e[12]=n,e[13]=p,e[14]=r,e[15]=l,e[16]=s,e[17]=d):d=e[17];let g;return e[18]!==d?(g=f.jsx("div",{ref:a,className:"relative z-20",children:d}),e[18]=d,e[19]=g):g=e[19],g}function un(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Ke.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const hn=10,pn=25,dn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function fn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dn[t.type]??""}function gn(){const t=$.c(4),e=j(),{upload:n}=Ut(Me),s=Zt(Me);let r;return t[0]!==s||t[1]!==e||t[2]!==n?(r={uploadFile:async i=>{const l=Ze(i),o=l?hn:pn;if(i.size>o*1024*1024)return se.error(e("markdownEditor.fileTooLarge",{name:i.name,max:String(o)})),null;const h=l?Gt:Kt,c=`${crypto.randomUUID()}${fn(i)}`;try{return await n.mutateAsync({dir:h,files:[new File([i],c,{type:i.type})]}),s(`${h}/${c}`)}catch{return se.error(e("markdownEditor.uploadFailed",{name:i.name})),null}}},t[0]=s,t[1]=e,t[2]=n,t[3]=r):r=t[3],r}const X=new Be("uploadSlots"),mn=ue.create({name:"uploadSlots",addProseMirrorPlugins(){return[new ft({key:X,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(X);if(!t.docChanged&&!n)return e;const s=new Map;for(const[r,a]of e)s.set(r,t.mapping.map(a));if(n){const[r,a]=n;a===null?s.delete(r):s.set(r,a)}return s}}})]}});function ie(t,e,n){return t.setMeta(X,[e,n])}function kn(t,e){return X.getState(t)?.get(e)}function xn(t,e,n,s,r){const{schema:a}=t.state,i=a.nodes[n];if(!i)return;const l=i.create(s),o=t.state.selection.to===e,h=t.state.doc.resolve(e),c=h.parent.textBetween(Math.max(0,h.parentOffset-1),h.parentOffset,void 0,""),u=()=>a.text(" "),p=l.isInline?[...c&&!/\s/.test(c)?[u()]:[],l,u()]:l,d=t.state.tr.replaceWith(e,e,p);let g=e,x=e;d.mapping.maps.at(-1)?.forEach((M,m,k,T)=>{g=k,x=T});let w;d.doc.nodesBetween(g,x,(M,m)=>{M===l&&(w=m+M.nodeSize)});let b=w??x;w!==void 0&&l.isInline&&(b+=1);const y=a.nodes.paragraph;w!==void 0&&l.isBlock&&y&&(d.doc.resolve(w).nodeAfter?.isTextblock||d.insert(w,y.create()),b=w+1);const v=gt.near(d.doc.resolve(b));o&&d.setSelection(v),r&&ie(d,r,v.to),t.dispatch(d)}function bn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function wn(t=!0){const e=j(),{uploadFile:n}=gn(),s=_.useRef(n);s.current=n;const[r,a]=_.useState(0),i=_.useRef(0),l=u=>{i.current+=u,a(i.current)},o=(u,p,d)=>{if(!t||p.length===0)return!1;l(p.length);const g=Symbol("upload");return u.dispatch(ie(u.state.tr,g,d)),(async()=>{for(const x of p)try{const w=await s.current(x);if(!w||u.isDestroyed)continue;const b=Ze(x);xn(u,kn(u.state,g)??u.state.selection.to,b?"image":"attachment",b?{src:w,alt:x.name}:{href:w,name:x.name},g)}catch{se.error(e("markdownEditor.uploadFailed",{name:x.name}))}finally{l(-1)}u.isDestroyed||u.dispatch(ie(u.state.tr,g,null))})(),!0};return{pending:r,uploading:()=>i.current>0,uploadInto:o,handlePaste:(u,p)=>{const d=bn(p.clipboardData);return d.length===0?!1:(p.stopPropagation(),o(u,d,u.state.selection.to))},handleDrop:(u,p,d,g)=>{if(g)return!1;const x=Array.from(p.dataTransfer?.files??[]);if(x.length===0)return!1;const w=u.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return w===void 0?!1:(p.stopPropagation(),o(u,x,w))}}}function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O=de();function We(t){O=t}var N={exec:()=>null};function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var yn=(()=>{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)}}>`)},Tn=/^(?:[ \t]*(?:\n|$))+/,vn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Sn=/^ {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+|$)/,Mn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,fe).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(),En=S(Qe).replace(/bull/g,fe).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(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,An=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rn=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_n=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fe).getRegex(),ee="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",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$n=S("^ {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",ke).replace("tag",ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ve=S(ge).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",ee).getRegex(),Cn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ve).getRegex(),xe={blockquote:Cn,code:vn,def:Rn,fences:Sn,heading:Mn,hr:K,html:$n,lheading:Xe,list:_n,newline:Tn,paragraph:Ve,table:N,text:An},Re=S("^ *([^\\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",ee).getRegex(),In={...xe,lheading:En,table:Re,paragraph:S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Re).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",ee).getRegex()},Ln={...xe,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).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:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(ge).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
1
|
+
import{c as $,b as j,r as _,j as f,m as B,bu as at,t as se,b2 as Oe,a4 as ot,hi as lt,i as ct,K as ut,c7 as ht,h as De,o as pt}from"./index-CWKxkTwy.js";import{u as dt,t as Be,f as ue,A as ft,v as gt,Y as P,Z as mt,_ as kt,H as xt,I as D,$ as ve,a0 as bt,e as wt,a1 as Se,a2 as yt,a3 as G,N as Fe,a4 as he,c as qe,a5 as pe,a6 as Tt,a7 as vt,s as St,a8 as Mt,a as At,E as Et}from"./usage-stats-DT9jvl-J.js";import{T as C,n as Rt,i as _t,E as $t}from"./editor-classes-Cb5f4sl2.js";import{a as Ct,e as Ue,s as It,S as Lt}from"./suggestion-CppSMZxc.js";import{B as zt}from"./index-Tvs593C1.js";import{aX as Pt,aA as jt,aB as Nt,aD as Ht,a0 as Ot,bm as Dt,a$ as Bt}from"./agent-icon-BwEytdmh.js";import{i as Ft}from"./SwitchHorizontal01-CP6L8rlm.js";import{s as qt}from"./Trash01-Dt7pyOwE.js";import{k as Ut,a as Zt}from"./use-org-fs-D8fqy59B.js";import{E as Me,i as Ze,b as Gt,c as Kt,d as Ge,A as Wt,e as Qt,f as Xt,g as Vt,j as Yt}from"./markdown-DiEygcQw.js";import{s as Jt,T as en}from"./index-C1fc6W9Q.js";import{f as tn,a as nn,c as rn,C as sn,b as Ae}from"./command-BOSLOC8n.js";import{I as an}from"./icon-button-CadQrI05.js";function on(t){const e=$.c(30),{editor:n}=t,s=j(),[r,a]=_.useState(!1),[i,l]=_.useState(""),[o,h]=_.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const u=c;let p;e[2]!==n||e[3]!==r?(p=()=>{if(r){a(!1);return}const T=n.getAttributes("link").href;l(typeof T=="string"?T:""),h(!1),a(!0)},e[2]=n,e[3]=r,e[4]=p):p=e[4];const d=p;let g;e[5]!==n?(g=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=g):g=e[6];const x=g;let w;e[7]!==i||e[8]!==n||e[9]!==x?(w=()=>{const T=Rt(i);if(T===""){x();return}if(!_t(T)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:T}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=x,e[10]=w):w=e[10];const b=w;let y;e[11]!==s?(y=s("markdownEditor.link"),e[11]=s,e[12]=y):y=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=f.jsx(Pt,{size:14}),e[13]=v):v=e[13];let M;e[14]!==u||e[15]!==y||e[16]!==d?(M=f.jsx(C,{active:u,label:y,onClick:d,children:v}),e[14]=u,e[15]=y,e[16]=d,e[17]=M):M=e[17];let m;e[18]!==u||e[19]!==b||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==x||e[25]!==s?(m=r&&f.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||a(!1)},children:[f.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:T=>{l(T.target.value),h(!1)},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),b()):T.key==="Escape"&&(T.preventDefault(),a(!1),n.chain().focus().run())},className:B("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")}),f.jsx(C,{active:!1,label:s("markdownEditor.linkApply"),onClick:b,children:f.jsx(at,{size:14})}),u&&f.jsx(C,{active:!1,label:s("markdownEditor.linkRemove"),onClick:x,children:f.jsx(qt,{size:14})})]}),e[18]=u,e[19]=b,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=x,e[25]=s,e[26]=m):m=e[26];let k;return e[27]!==M||e[28]!==m?(k=f.jsxs("div",{className:"relative",children:[M,m]}),e[27]=M,e[28]=m,e[29]=k):k=e[29],k}const ne=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=f.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},Ee=t=>{const e=$.c(2),{children:n}=t;let s;return e[0]!==n?(s=f.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},Ke=[1,2,3],ln=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function cn(t){const e=$.c(20),{editor:n}=t,s=j(),[r,a]=_.useState(null);let i;e[0]!==n?(i={editor:n,selector:un},e[0]=n,e[1]=i):i=e[1];const l=dt(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let h;e[4]!==s?(h=s("markdownEditor.heading2"),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==s?(c=s("markdownEditor.heading3"),e[6]=s,e[7]=c):c=e[7];let u;e[8]!==o||e[9]!==h||e[10]!==c?(u={1:o,2:h,3:c},e[8]=o,e[9]=h,e[10]=c,e[11]=u):u=e[11];const p=u;let d;e[12]!==n||e[13]!==p||e[14]!==r||e[15]!==l||e[16]!==s?(d=r&&f.jsxs(zt,{editor:n,shouldShow:ln,appendTo:r,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[f.jsx(C,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:f.jsx(jt,{size:14})}),f.jsx(C,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:f.jsx(Nt,{size:14})}),f.jsx(C,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:f.jsx(Ht,{size:14})}),f.jsx(C,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:f.jsx(Ot,{size:14})}),f.jsx(ne,{}),Ke.map((x,w)=>f.jsx(C,{active:l.headings[w]??!1,label:p[x],onClick:()=>n.chain().focus().toggleHeading({level:x}).run(),children:f.jsx(Ee,{children:`H${x}`})},x)),f.jsx(ne,{}),f.jsx(C,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:f.jsx(Ft,{size:14})}),f.jsx(C,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:f.jsx(Ee,{children:"1."})}),f.jsx(C,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:f.jsx(Dt,{size:14})}),f.jsx(ne,{}),f.jsx(on,{editor:n})]}),e[12]=n,e[13]=p,e[14]=r,e[15]=l,e[16]=s,e[17]=d):d=e[17];let g;return e[18]!==d?(g=f.jsx("div",{ref:a,className:"relative z-20",children:d}),e[18]=d,e[19]=g):g=e[19],g}function un(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Ke.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const hn=10,pn=25,dn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function fn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dn[t.type]??""}function gn(){const t=$.c(4),e=j(),{upload:n}=Ut(Me),s=Zt(Me);let r;return t[0]!==s||t[1]!==e||t[2]!==n?(r={uploadFile:async i=>{const l=Ze(i),o=l?hn:pn;if(i.size>o*1024*1024)return se.error(e("markdownEditor.fileTooLarge",{name:i.name,max:String(o)})),null;const h=l?Gt:Kt,c=`${crypto.randomUUID()}${fn(i)}`;try{return await n.mutateAsync({dir:h,files:[new File([i],c,{type:i.type})]}),s(`${h}/${c}`)}catch{return se.error(e("markdownEditor.uploadFailed",{name:i.name})),null}}},t[0]=s,t[1]=e,t[2]=n,t[3]=r):r=t[3],r}const X=new Be("uploadSlots"),mn=ue.create({name:"uploadSlots",addProseMirrorPlugins(){return[new ft({key:X,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(X);if(!t.docChanged&&!n)return e;const s=new Map;for(const[r,a]of e)s.set(r,t.mapping.map(a));if(n){const[r,a]=n;a===null?s.delete(r):s.set(r,a)}return s}}})]}});function ie(t,e,n){return t.setMeta(X,[e,n])}function kn(t,e){return X.getState(t)?.get(e)}function xn(t,e,n,s,r){const{schema:a}=t.state,i=a.nodes[n];if(!i)return;const l=i.create(s),o=t.state.selection.to===e,h=t.state.doc.resolve(e),c=h.parent.textBetween(Math.max(0,h.parentOffset-1),h.parentOffset,void 0,""),u=()=>a.text(" "),p=l.isInline?[...c&&!/\s/.test(c)?[u()]:[],l,u()]:l,d=t.state.tr.replaceWith(e,e,p);let g=e,x=e;d.mapping.maps.at(-1)?.forEach((M,m,k,T)=>{g=k,x=T});let w;d.doc.nodesBetween(g,x,(M,m)=>{M===l&&(w=m+M.nodeSize)});let b=w??x;w!==void 0&&l.isInline&&(b+=1);const y=a.nodes.paragraph;w!==void 0&&l.isBlock&&y&&(d.doc.resolve(w).nodeAfter?.isTextblock||d.insert(w,y.create()),b=w+1);const v=gt.near(d.doc.resolve(b));o&&d.setSelection(v),r&&ie(d,r,v.to),t.dispatch(d)}function bn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function wn(t=!0){const e=j(),{uploadFile:n}=gn(),s=_.useRef(n);s.current=n;const[r,a]=_.useState(0),i=_.useRef(0),l=u=>{i.current+=u,a(i.current)},o=(u,p,d)=>{if(!t||p.length===0)return!1;l(p.length);const g=Symbol("upload");return u.dispatch(ie(u.state.tr,g,d)),(async()=>{for(const x of p)try{const w=await s.current(x);if(!w||u.isDestroyed)continue;const b=Ze(x);xn(u,kn(u.state,g)??u.state.selection.to,b?"image":"attachment",b?{src:w,alt:x.name}:{href:w,name:x.name},g)}catch{se.error(e("markdownEditor.uploadFailed",{name:x.name}))}finally{l(-1)}u.isDestroyed||u.dispatch(ie(u.state.tr,g,null))})(),!0};return{pending:r,uploading:()=>i.current>0,uploadInto:o,handlePaste:(u,p)=>{const d=bn(p.clipboardData);return d.length===0?!1:(p.stopPropagation(),o(u,d,u.state.selection.to))},handleDrop:(u,p,d,g)=>{if(g)return!1;const x=Array.from(p.dataTransfer?.files??[]);if(x.length===0)return!1;const w=u.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return w===void 0?!1:(p.stopPropagation(),o(u,x,w))}}}function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O=de();function We(t){O=t}var N={exec:()=>null};function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var yn=(()=>{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)}}>`)},Tn=/^(?:[ \t]*(?:\n|$))+/,vn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Sn=/^ {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+|$)/,Mn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,fe).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(),An=S(Qe).replace(/bull/g,fe).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(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,En=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rn=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_n=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fe).getRegex(),ee="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",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$n=S("^ {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",ke).replace("tag",ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ve=S(ge).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",ee).getRegex(),Cn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ve).getRegex(),xe={blockquote:Cn,code:vn,def:Rn,fences:Sn,heading:Mn,hr:K,html:$n,lheading:Xe,list:_n,newline:Tn,paragraph:Ve,table:N,text:En},Re=S("^ *([^\\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",ee).getRegex(),In={...xe,lheading:An,table:Re,paragraph:S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Re).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",ee).getRegex()},Ln={...xe,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).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:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(ge).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ye=/^( {2,}|\\)\n(?!\s*$)/,jn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,te=/[\s\p{P}\p{S}]/u,be=/[^\s\p{P}\p{S}]/u,Nn=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,te).getRegex(),Je=/(?!~)[\p{P}\p{S}]/u,Hn=/(?!~)[\s\p{P}\p{S}]/u,On=/(?:[^\s\p{P}\p{S}]|~)/u,Dn=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",yn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),et=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bn=S(et,"u").replace(/punct/g,F).getRegex(),Fn=S(et,"u").replace(/punct/g,Je).getRegex(),tt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",qn=S(tt,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Un=S(tt,"gu").replace(/notPunctSpace/g,On).replace(/punctSpace/g,Hn).replace(/punct/g,Je).getRegex(),Zn=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Gn=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,F).getRegex(),Kn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Wn=S(Kn,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Qn=S(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),Xn=S(/^<(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(),Vn=S(ke).replace("(?:-->|$)","-->").getRegex(),Yn=S("^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",Vn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),V=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Jn=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",V).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nt=S(/^!?\[(label)\]\[(ref)\]/).replace("label",V).replace("ref",me).getRegex(),rt=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),er=S("reflink|nolink(?!\\()","g").replace("reflink",nt).replace("nolink",rt).getRegex(),_e=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,we={_backpedal:N,anyPunctuation:Qn,autolink:Xn,blockSkip:Dn,br:Ye,code:Pn,del:N,delLDelim:N,delRDelim:N,emStrongLDelim:Bn,emStrongRDelimAst:qn,emStrongRDelimUnd:Zn,escape:zn,link:Jn,nolink:rt,punctuation:Nn,reflink:nt,reflinkSearch:er,tag:Yn,text:jn,url:N},tr={...we,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",V).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V).getRegex()},ae={...we,emStrongRDelimAst:Un,emStrongLDelim:Fn,delLDelim:Gn,delRDelim:Wn,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_e).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:S(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",_e).getRegex()},nr={...ae,br:S(Ye).replace("{2,}","*").getRegex(),text:S(ae.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},W={normal:xe,gfm:In,pedantic:Ln},q={normal:we,gfm:ae,breaks:nr,pedantic:tr},rr={"&":"&","<":"<",">":">",'"':""","'":"'"},$e=t=>rr[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,$e)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,$e);return t}function Ce(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function Ie(t,e){let n=t.replace(R.findPipe,(a,i,l)=>{let o=!1,h=i;for(;--h>=0&&l[h]==="\\";)o=!o;return o?"|":" |"}),s=n.split(R.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(R.slashPipe,"|");return s}function U(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function sr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function ir(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let a=4-n%4;s+=" ".repeat(a),n+=a}else s+=r,n++;return s}function Le(t,e,n,s,r){let a=e.href,i=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}function ar(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
3
3
|
`).map(a=>{let i=a.match(n.other.beginningSpace);if(i===null)return a;let[l]=i;return l.length>=r.length?a.slice(r.length):a}).join(`
|
|
4
4
|
`)}var Y=class{options;rules;lexer;constructor(t){this.options=t||O}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:U(n,`
|
|
@@ -56,14 +56,14 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
56
56
|
${t}</tr>
|
|
57
57
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
58
58
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),r=Ce(t);if(r===null)return s;t=r;let a='<a href="'+t+'"';return e&&(a+=' title="'+z(e)+'"'),a+=">"+s+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Ce(t);if(r===null)return z(n);t=r;let a=`<img src="${t}" alt="${z(n)}"`;return e&&(a+=` title="${z(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},ye=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},L=class le{options;renderer;textRenderer;constructor(e){this.options=e||O,this.options.renderer=this.options.renderer||new J,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ye}static parse(e,n){return new le(n).parse(e)}static parseInline(e,n){return new le(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let i=r,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){n+=l||"";continue}}let a=r;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let a=e[r];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=l||"";continue}}let i=a;switch(i.type){case"escape":{s+=n.text(i);break}case"html":{s+=n.html(i);break}case"link":{s+=n.link(i);break}case"image":{s+=n.image(i);break}case"checkbox":{s+=n.checkbox(i);break}case"strong":{s+=n.strong(i);break}case"em":{s+=n.em(i);break}case"codespan":{s+=n.codespan(i);break}case"br":{s+=n.br(i);break}case"del":{s+=n.del(i);break}case"text":{s+=n.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},Z=class{options;block;constructor(t){this.options=t||O}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?I.lex:I.lexInline}provideParser(t=this.block){return t?L.parse:L.parseInline}},or=class{defaults=de();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=L;Renderer=J;TextRenderer=ye;Lexer=I;Tokenizer=Y;Hooks=Z;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let a of r.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of r.rows)for(let i of a)n=n.concat(this.walkTokens(i.tokens,e));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let i=r[a].flat(1/0);n=n.concat(this.walkTokens(i,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=e.renderers[r.name];a?e.renderers[r.name]=function(...i){let l=r.renderer.apply(this,i);return l===!1&&(l=a.apply(this,i)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[r.level];a?a.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new J(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,l=n.renderer[i],o=r[i];r[i]=(...h)=>{let c=l.apply(r,h);return c===!1&&(c=o.apply(r,h)),c||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Y(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,l=n.tokenizer[i],o=r[i];r[i]=(...h)=>{let c=l.apply(r,h);return c===!1&&(c=o.apply(r,h)),c}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Z;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,l=n.hooks[i],o=r[i];Z.passThroughHooks.has(a)?r[i]=h=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await l.call(r,h);return o.call(r,u)})();let c=l.call(r,h);return o.call(r,c)}:r[i]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await l.apply(r,h);return u===!1&&(u=await o.apply(r,h)),u})();let c=l.apply(r,h);return c===!1&&(c=o.apply(r,h)),c}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(i){let l=[];return l.push(a.call(this,i)),r&&(l=l.concat(r.call(this,i))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return I.lex(t,e??this.defaults)}parser(t,e){return L.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let i=r.hooks?await r.hooks.preprocess(e):e,l=await(r.hooks?await r.hooks.provideLexer(t):t?I.lex:I.lexInline)(i,r),o=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(o,r.walkTokens));let h=await(r.hooks?await r.hooks.provideParser(t):t?L.parse:L.parseInline)(o,r);return r.hooks?await r.hooks.postprocess(h):h})().catch(a);try{r.hooks&&(e=r.hooks.preprocess(e));let i=(r.hooks?r.hooks.provideLexer(t):t?I.lex:I.lexInline)(e,r);r.hooks&&(i=r.hooks.processAllTokens(i)),r.walkTokens&&this.walkTokens(i,r.walkTokens);let l=(r.hooks?r.hooks.provideParser(t):t?L.parse:L.parseInline)(i,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(i){return a(i)}}}onError(t,e){return n=>{if(n.message+=`
|
|
59
|
-
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},H=new or;function
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},H=new or;function A(t,e){return H.parse(t,e)}A.options=A.setOptions=function(t){return H.setOptions(t),A.defaults=H.defaults,We(A.defaults),A};A.getDefaults=de;A.defaults=O;A.use=function(...t){return H.use(...t),A.defaults=H.defaults,We(A.defaults),A};A.walkTokens=function(t,e){return H.walkTokens(t,e)};A.parseInline=H.parseInline;A.Parser=L;A.parser=L.parse;A.Renderer=J;A.TextRenderer=ye;A.Lexer=I;A.lexer=I.lex;A.Tokenizer=Y;A.Hooks=Z;A.parse=A;A.options;A.setOptions;A.use;A.walkTokens;A.parseInline;L.parse;I.lex;const lr=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function cr(t){return t.flatMap((e,n)=>{var s;if(e.type==="space"||((s=t[n+1])===null||s===void 0?void 0:s.type)==="space")return[e];const r=(e.raw||"").match(lr);return r?[{...e,raw:(e.raw||"").slice(0,-r[0].length)},{type:"space",raw:r[0]}]:[e]})}function ur(t,e){const n=e.split(`
|
|
60
60
|
`).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
|
|
61
|
-
`);return n.slice(0,n.length-1)}function hr(t,e){const n=[];return Array.from(t.entries()).forEach(([s,r])=>{if(!e){n.push(s);return}(e.marks||[]).find(a=>a.type===s&&G(a.attrs,r.attrs))||n.push(s)}),n}function pr(t,e){const n=[];return Array.from(e.entries()).forEach(([s,r])=>{const a=t.get(s);(!a||!G(a.attrs,r.attrs))&&n.push({type:s,mark:r})}),n}function dr(t,e,n,s){const r=!n,a=n&&(!n.marks||n.marks.length===0),i=n&&n.marks&&!s(e,new Map(n.marks.map(o=>[o.type,o]))),l=[];return(r||a||i)&&(n&&n.marks?Array.from(t.entries()).reverse().forEach(([o,h])=>{n.marks.find(c=>c.type===o&&G(c.attrs,h.attrs))||l.push(o)}):(r||a)&&l.push(...Array.from(t.keys()).reverse())),l}function fr(t,e){let n="";return Array.from(t.keys()).reverse().forEach(s=>{const r=e(s,t.get(s));r&&(n=r+n)}),t.clear(),n}function gr(t,e,n){let s="";return Array.from(t.entries()).forEach(([r,a])=>{const i=n(r,a);i&&(s+=i),e.set(r,a)}),s}function re(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function Q(t,e){return typeof t!="string"?"json":e}const mr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),kr=/<\/?([a-zA-Z][\w-]*)/g;function xr(t){const e=[];let n;for(;(n=kr.exec(t))!==null;)e.push(n[1].toLowerCase());return e}function br(t){const e=t.toLowerCase();return e.includes("-")?!1:!mr.has(e)}function wr(t,e){return xr(t).some(n=>br(n)?!e.has(n):!1)}var ze=class{constructor(t){var e,n,s,r,a;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t?.marked)!==null&&e!==void 0?e:
|
|
61
|
+
`);return n.slice(0,n.length-1)}function hr(t,e){const n=[];return Array.from(t.entries()).forEach(([s,r])=>{if(!e){n.push(s);return}(e.marks||[]).find(a=>a.type===s&&G(a.attrs,r.attrs))||n.push(s)}),n}function pr(t,e){const n=[];return Array.from(e.entries()).forEach(([s,r])=>{const a=t.get(s);(!a||!G(a.attrs,r.attrs))&&n.push({type:s,mark:r})}),n}function dr(t,e,n,s){const r=!n,a=n&&(!n.marks||n.marks.length===0),i=n&&n.marks&&!s(e,new Map(n.marks.map(o=>[o.type,o]))),l=[];return(r||a||i)&&(n&&n.marks?Array.from(t.entries()).reverse().forEach(([o,h])=>{n.marks.find(c=>c.type===o&&G(c.attrs,h.attrs))||l.push(o)}):(r||a)&&l.push(...Array.from(t.keys()).reverse())),l}function fr(t,e){let n="";return Array.from(t.keys()).reverse().forEach(s=>{const r=e(s,t.get(s));r&&(n=r+n)}),t.clear(),n}function gr(t,e,n){let s="";return Array.from(t.entries()).forEach(([r,a])=>{const i=n(r,a);i&&(s+=i),e.set(r,a)}),s}function re(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function Q(t,e){return typeof t!="string"?"json":e}const mr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),kr=/<\/?([a-zA-Z][\w-]*)/g;function xr(t){const e=[];let n;for(;(n=kr.exec(t))!==null;)e.push(n[1].toLowerCase());return e}function br(t){const e=t.toLowerCase();return e.includes("-")?!1:!mr.has(e)}function wr(t,e){return xr(t).some(n=>br(n)?!e.has(n):!1)}var ze=class{constructor(t){var e,n,s,r,a;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t?.marked)!==null&&e!==void 0?e:A,this.indentStyle=(n=t==null||(s=t.indentation)===null||s===void 0?void 0:s.style)!==null&&n!==void 0?n:"space",this.indentSize=(r=t==null||(a=t.indentation)===null||a===void 0?void 0:a.size)!==null&&r!==void 0?r:2,this.baseExtensions=t?.extensions||[],t?.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t?.extensions&&(this.baseExtensions=t.extensions,mt(kt(t.extensions)).forEach(i=>this.registerExtension(i)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,n;this.extensions.push(t);const s=xt(D(t,"code")),r=t.name;s&&this.codeTypes.add(r),this.extensionRanks.has(r)||this.extensionRanks.set(r,this.extensionRanks.size);const a=D(t,"markdownTokenName")||r,i=D(t,"parseMarkdown"),l=D(t,"renderMarkdown"),o=D(t,"markdownTokenizer"),h=(e=D(t,"markdownOptions"))!==null&&e!==void 0?e:null,c={tokenName:a,nodeName:r,parseMarkdown:i,renderMarkdown:l,isIndenting:(n=h?.indentsContent)!==null&&n!==void 0?n:!1,htmlReopen:h?.htmlReopen,tokenizer:o};if(a&&i){const u=this.registry.get(a)||[];u.push(c),this.registry.set(a,u)}if(l){const u=this.nodeTypeRegistry.get(r)||[];u.push(c),this.nodeTypeRegistry.set(r,u)}o&&this.hasMarked()&&this.registerTokenizer(o)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!==null&&e!==void 0?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:s="inline",tokenize:r}=t,a=this.createTokenizerHelpers.bind(this),i=this.createLexer.bind(this);let l;n?l=typeof n=="function"?n:h=>h.indexOf(n):l=h=>{const c=r(h,[],this.createTokenizerHelpers(this.createLexer()));return c&&c.raw?h.indexOf(c.raw):-1};const o={name:e,level:s,start:l,tokenizer(h,c){const u=this.lexer?a(this.lexer):a(i()),p=r(h,c,u);if(p&&p.type)return{...p,type:p.type||e,raw:p.raw||"",tokens:p.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[o]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const n=this.getHandlersForNodeType(t);return n.length>0?n[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{const s=n.lex(t);return{type:"doc",content:this.parseTokens(s,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const n=e?cr(t):t,s=n.reduce((i,l,o)=>(l.type!=="space"&&i.push(o),i),[]);let r=-1,a=0;return n.flatMap((i,l)=>{for(;a<s.length&&s[a]<l;)r=s[a],a+=1;if(e&&i.type==="space"){var o;const c=(o=s[a])!==null&&o!==void 0?o:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,c)}const h=this.parseToken(i,e);return h===null?[]:Array.isArray(h)?h:[h]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const s=this.countParagraphSeparators(t.raw||"");if(s===0)return[];const r=Math.max(s-(e===-1||n===-1?0:1),0);return Array.from({length:r},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
|
|
62
62
|
`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),s=this.createParseHelpers();if(n.find(r=>{if(!r.parseMarkdown)return!1;const a=r.parseMarkdown(t,s),i=this.normalizeParseResult(a);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>re(l).isTask),n=t.items.some(l=>!re(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const s=[];let r=[],a=null;for(let l=0;l<t.items.length;l+=1){const o=t.items[l],{isTask:h,checked:c,indentLevel:u}=re(o);let p=o;if(h){const g=(o.raw||o.text||"").split(`
|
|
63
63
|
`),x=g[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),w=x?x[2]:"";let b=[];if(g.length>1&&g.slice(1).join(`
|
|
64
64
|
`).trim()){const y=g.slice(1),v=y.filter(M=>M.trim());if(v.length>0){const M=Math.min(...v.map(k=>k.length-k.trimStart().length)),m=y.map(k=>k.trim()?k.slice(M):"").join(`
|
|
65
65
|
`).trim();m&&(b=this.markedInstance.lexer(`${m}
|
|
66
|
-
`))}}p={type:"taskItem",raw:"",mainContent:w,indentLevel:u,checked:c??!1,text:w,tokens:this.tokenizeInline(w),nestedTokens:b}}const d=h?"taskList":"list";a!==d?(r.length>0&&s.push({type:a,items:r}),r=[p],a=d):r.push(p)}r.length>0&&s.push({type:a,items:r});const i=[];for(let l=0;l<s.length;l+=1){const o=s[l],h={...t,type:o.type,items:o.items},c=this.parseToken(h);c&&(Array.isArray(c)?i.push(...c):i.push(c))}return i.length>0?i:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const r=s.parseMarkdown(t,n),a=this.normalizeParseResult(r);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const s={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete s.attrs,s},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let i=0;i<t.length;i+=1){const l=t[i];if(l.type==="text")e.push({type:"text",text:ve(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,s;const o=((n=(s=l.raw)!==null&&s!==void 0?s:l.text)!==null&&n!==void 0?n:"").toString(),h=/^<\/[\s]*[\w-]+/i.test(o),c=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!h&&c&&!/\/>$/.test(o)){const p=c[1],d=this.escapeRegex(p),g=new RegExp(`^<\\/\\s*${d}\\b`,"i");let x=-1;const w=[o];for(let b=i+1;b<t.length;b+=1){var r,a;const y=t[b],v=((r=(a=y.raw)!==null&&a!==void 0?a:y.text)!==null&&r!==void 0?r:"").toString();if(w.push(v),y.type==="html"&&g.test(v)){x=b;break}}if(x!==-1){const b=w.join(""),y={type:"html",raw:b,text:b,block:!1},v=this.parseHTMLToken(y);if(v){const M=this.normalizeParseResult(v);Array.isArray(M)?e.push(...M):M&&e.push(M)}i=x;continue}}const u=this.parseHTMLToken(l);if(u){const p=this.normalizeParseResult(u);Array.isArray(p)?e.push(...p):p&&e.push(p)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const h=this.createParseHelpers(),c=o.parseMarkdown(l,h);if(this.isMarkResult(c)){const u=this.applyMarkToContent(c.mark,c.content,c.attrs);e.push(...u)}else{const u=this.normalizeParseResult(c);Array.isArray(u)?e.push(...u):u&&e.push(u)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let i=e.length-1;i>0;i-=1){const l=e[i],o=e[i-1];if(l.type==="text"&&o.type==="text"){const h=l.marks||[],c=o.marks||[];bt(h,c)&&(o.text=(o.text||"")+(l.text||""),e.splice(i,1))}}return e}applyMarkToContent(t,e,n){return e.map(s=>{if(s.type==="text"){const r=s.marks||[],a=n?{type:t,attrs:n}:{type:t};return{...s,marks:[...r,a]}}return{...s,content:s.content?this.applyMarkToContent(t,s.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:ve(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=wt(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const s=this.toInlineContent(n.content);return s.length>0?s:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=Se(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return wr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=Se(this.baseExtensions),n=s=>{const r=s?.parseDOM;Array.isArray(r)&&r.forEach(a=>{if(typeof a?.tag=="string"){const i=a.tag.match(/^[a-zA-Z][\w-]*/);i&&t.add(i[0].toLowerCase())}})};Object.values(e.nodes).forEach(s=>n(s.spec)),Object.values(e.marks).forEach(s=>n(s.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(s=>this.codeTypes.has(typeof s=="string"?s:s.type))?t:this.escapeMarkdownSyntax(yt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,s=0,r={}){var a;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const i=this.getHandlerForToken(t.type);if(!i)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(c,u)=>{const p=i.isIndenting?s+1:s;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,u||"",n,p):this.renderNodes(c,t,u||"",n,p)},renderChild:(c,u)=>{const p=i.isIndenting?s+1:s;return this.renderNodeToMarkdown(c,t,u,p)},indent:c=>this.indentString+c,wrapInBlock:ur},h={index:n,level:s,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...r}};return((a=i.renderMarkdown)===null||a===void 0?void 0:a.call(i,t,o,h))||""}renderNodes(t,e,n="",s=0,r=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,r):t.type?this.renderNodeToMarkdown(t,e,s,r):""}renderNodesWithMarkBoundaries(t,e,n="",s=0){const r=[],a=new Map,i=new Set,l=new Map;return t.forEach((o,h)=>{const c=h<t.length-1?t[h+1]:null;if(o.type)if(o.type==="text"){let u=this.encodeTextForMarkdown(o.text||"",o,e);const p=new Map((o.marks||[]).map(m=>[m.type,m])),d=this.getMarksToOpenForSerialization(a,p,c),g=hr(p,c),x=g.filter(m=>a.has(m)),w=x.length>0&&d.length>0;let b="";if(g.length>0&&!w){const m=u.match(/(\s+)$/);m&&(b=m[1],u=u.slice(0,-b.length))}w||g.slice().reverse().forEach(m=>{if(!a.has(m))return;const k=p.get(m),T=this.getMarkClosing(m,k,l.get(m));T&&(u+=T),a.has(m)&&(a.delete(m),l.delete(m))});let y="";if(d.length>0){const m=u.match(/^(\s+)/);m&&(y=m[1],u=u.slice(y.length))}d.forEach(({type:m,mark:k})=>{const T=i.has(m)?"html":"markdown",A=this.getMarkOpening(m,k,T);A&&(u=A+u),l.set(m,T),i.delete(m)}),w||d.slice().reverse().forEach(({type:m,mark:k})=>{a.set(m,k)}),u=y+u;let v;if(w){const m=new Set((c?.marks||[]).map(A=>A.type));d.forEach(({type:A})=>{m.has(A)&&this.getHtmlReopenTags(A)&&i.add(A)});const k=Array.from(a.keys()),T=x.slice().sort((A,it)=>k.indexOf(it)-k.indexOf(A));v=[...d.map(A=>A.type),...T]}else v=dr(a,p,c,this.markSetsEqual.bind(this));let M="";if(v.length>0){const m=u.match(/(\s+)$/);m&&(M=m[1],u=u.slice(0,-M.length))}v.forEach(m=>{var k;const T=(k=a.get(m))!==null&&k!==void 0?k:p.get(m),A=this.getMarkClosing(m,T,l.get(m));A&&(u+=A),a.delete(m),l.delete(m)}),u+=M,u+=b,r.push(u)}else{const u=new Set((o.marks||[]).map(b=>b.type)),p=new Map,d=new Map;a.forEach((b,y)=>{if(u.has(y)){var v;p.set(y,b),d.set(y,(v=l.get(y))!==null&&v!==void 0?v:"markdown")}});const g=fr(a,(b,y)=>this.getMarkClosing(b,y,l.get(b)));l.clear();const x=this.renderNodeToMarkdown(o,e,h,s),w=o.type==="hardBreak"?"":gr(p,a,(b,y)=>{var v;const M=(v=d.get(b))!==null&&v!==void 0?v:"markdown";return l.set(b,M),this.getMarkOpening(b,y,M)});r.push(g+x+w)}}),r.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.open)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:c=>c,wrapInBlock:(c,u)=>c+u},{index:0,level:0,parentType:"text",meta:{}}),h=o.indexOf(i);return h>=0?o.substring(0,h):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.close)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:u=>u,wrapInBlock:(u,p)=>u+p},{index:0,level:0,parentType:"text",meta:{}}),h=o.indexOf(i),c=h+33;return h>=0?o.substring(c):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,s])=>{const r=e.get(n);return r&&G(s.attrs,r.attrs)})}getMarksToOpenForSerialization(t,e,n){const s=pr(t,e);if(s.length<=1)return s;const r=n?.marks||[],a=(h,c)=>r.some(u=>u.type===h&&G(u.attrs,c)),i=(h,c)=>{var u,p;const d=(u=this.extensionRanks.get(h.type))!==null&&u!==void 0?u:Number.MAX_SAFE_INTEGER,g=(p=this.extensionRanks.get(c.type))!==null&&p!==void 0?p:Number.MAX_SAFE_INTEGER;return d!==g?g-d:h.type.localeCompare(c.type)},l=s.filter(h=>!a(h.type,h.mark.attrs)).sort(i),o=s.filter(h=>a(h.type,h.mark.attrs)).sort(i);return[...l,...o]}};const yr=ue.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(Q(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(Q(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(Q(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return P.insertContentAt(t,s,n)}}},addStorage(){return{manager:new ze({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new ze({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||Q(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function Tr(t){const e=$.c(13),{node:n,selected:s,editor:r,deleteNode:a}=t,i=j(),l=typeof n.attrs.href=="string"?n.attrs.href:"",o=typeof n.attrs.name=="string"?n.attrs.name:"",h=s&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let c;e[0]!==h?(c=B(Wt,"select-none",h),e[0]=h,e[1]=c):c=e[1];let u;e[2]!==a||e[3]!==r.isEditable||e[4]!==i?(u=r.isEditable&&f.jsx("button",{type:"button","aria-label":i("markdownEditor.removeFile"),onMouseDown:vr,onClick:a,className:"shrink-0 rounded-lg p-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:f.jsx(Oe,{size:14})}),e[2]=a,e[3]=r.isEditable,e[4]=i,e[5]=u):u=e[5];let p;e[6]!==l||e[7]!==o||e[8]!==u?(p=f.jsx(Qt,{href:l,name:o,children:u}),e[6]=l,e[7]=o,e[8]=u,e[9]=p):p=e[9];let d;return e[10]!==c||e[11]!==p?(d=f.jsx(pe,{as:"span",className:c,children:p}),e[10]=c,e[11]=p,e[12]=d):d=e[12],d}function vr(t){return t.preventDefault()}function Sr(t){return t.replace(/([[\]])/g,"\\$1")}const Mr=Fe.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]",getAttrs:t=>Ge(t.getAttribute("href")??"")?null:!1}]},renderHTML({HTMLAttributes:t,node:e}){return["a",qe(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${Sr(n)}](${e})`},addNodeView(){return he(Tr)}});function Er(t){const e=$.c(6),{node:n,selected:s}=t,r=typeof n.attrs.name=="string"?n.attrs.name:"";let a;e[0]!==n.attrs.id||e[1]!==s?(a=B("select-none",Vt(typeof n.attrs.id=="string"?n.attrs.id:null),s&&"ring-2 ring-ring"),e[0]=n.attrs.id,e[1]=s,e[2]=a):a=e[2];let i;return e[3]!==r||e[4]!==a?(i=f.jsxs(pe,{as:"span","data-testid":"mention-chip",className:a,children:["@",r]}),e[3]=r,e[4]=a,e[5]=i):i=e[5],i}const Ar=Fe.create({name:"mention",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-mention-id"),renderHTML:t=>t.id?{"data-mention-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-mention-name"),renderHTML:t=>t.name?{"data-mention-name":t.name}:{}}}},parseHTML(){return[{tag:"span[data-mention-id]"}]},renderHTML({HTMLAttributes:t,node:e}){return["span",qe(t),`@${typeof e.attrs.name=="string"?e.attrs.name:""}`]},renderMarkdown:t=>{const e=typeof t.attrs?.id=="string"?t.attrs.id:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return e?Xt(e,n):`@${n}`},addNodeView(){return he(Er)}}),Rr="studio.mention-members.",ce=new Map;function Pe(t){const e=ce.get(t);if(e)return e;try{const n=localStorage.getItem(t);if(!n)return;const s=JSON.parse(n);if(!Array.isArray(s))return;const r=s.filter(a=>!!a&&typeof a.id=="string"&&typeof a.name=="string");return ce.set(t,r),r}catch{return}}function _r(t,e){ce.set(t,e);try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function $r(t,e){if(!t?.length)return e;const n=new Map(t.map(s=>[s.id,s]));return e.map(s=>{const r=n.get(s.id);return r&&r.name===s.name&&r.email===s.email&&r.image===s.image?r:s})}function Cr(t){return t.map(e=>({id:e.userId,name:e.user?.name?.trim()||e.user?.email?.trim()||"",email:e.user?.email??"",image:e.user?.image??null})).filter(e=>!!e.name).sort((e,n)=>e.name.localeCompare(n.name))}function Ir(t){const e=$.c(17),{locator:n}=ot(),s=lt(),r=`${Rr}${n}`;let a;e[0]!==n?(a=ut.mentionMembers(n),e[0]=n,e[1]=a):a=e[1];let i;e[2]!==r?(i=()=>Pe(r),e[2]=r,e[3]=i):i=e[3];let l;e[4]!==s||e[5]!==r?(l=async()=>{const d=await s.organization.listMembers(),g=$r(Pe(r),Cr(d?.data?.members??[]));return _r(r,g),g},e[4]=s,e[5]=r,e[6]=l):l=e[6];let o;e[7]!==t||e[8]!==a||e[9]!==i||e[10]!==l?(o={queryKey:a,enabled:t,staleTime:0,placeholderData:i,queryFn:l},e[7]=t,e[8]=a,e[9]=i,e[10]=l,e[11]=o):o=e[11];const h=ct(o);let c;e[12]!==h.data?(c=h.data??[],e[12]=h.data,e[13]=c):c=e[13];const u=h.isFetching&&!h.data;let p;return e[14]!==c||e[15]!==u?(p={members:c,loading:u},e[14]=c,e[15]=u,e[16]=p):p=e[16],p}const je={query:"",range:null,rect:null,editor:null};class Lr{state=je;listeners=new Set;dismissal=null;latched=!1;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.state;set(e){this.state=e;for(const n of this.listeners)n()}close(){this.latched=!1,this.set(je)}}const Te=new Be("markdownEditorMention");function zr(t,e,n){t.chain().focus().insertContentAt(e,[{type:"mention",attrs:{id:n.id,name:n.name}},{type:"text",text:" "}]).run(),Ue(t.view,Te)}function Pr(t,e,n){const s=Math.min(e+n,t.content.size);return e>=s?"":t.textBetween(e,s,"","")}function st(t,e){const n=e.getSnapshot().range??void 0;n&&n.to>n.from&&(e.dismissal={from:n.from,text:t.state.doc.textBetween(n.from,n.to,"")}),Ue(t.view,Te)}function jr(t){return ue.create({name:"mentionSuggestion",addProseMirrorPlugins(){const e={editor:this.editor,char:"@",pluginKey:Te,allowedPrefixes:[" ",`
|
|
67
|
-
`],allow:({state:n,range:s})=>{const r=t.dismissal;return r?s.from===r.from&&Pr(n.doc,r.from,r.text.length)===r.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(st(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Ct(e)]}})}const Ne=256,Nr=40,He=280,Hr=140,Or=[];function Dr(t){const e=$.c(5),{store:n,agents:s}=t,r=s===void 0?Or:s,a=_.useSyncExternalStore(n.subscribe,n.getSnapshot),i=a.range!==null;let l;return e[0]!==r||e[1]!==i||e[2]!==a||e[3]!==n?(l=i?f.jsx(Br,{store:n,state:a,agents:r}):null,e[0]=r,e[1]=i,e[2]=a,e[3]=n,e[4]=l):l=e[4],l}function Br({store:t,state:e,agents:n}){const s=j(),{members:r,loading:a}=Ir(!0),[i,l]=_.useState(e.query),[o,h]=_.useState(null),c=Fr(e.editor),u=c.getBoundingClientRect(),p=c===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):u,d=e.rect?.()??new DOMRect(0,0,0,0),g=p.bottom-d.bottom,x=g<He&&d.top-p.top>g,w=(x?d.top-p.top:g)-8,b=Math.min(He,Math.max(w,Hr))-Nr,y={position:"absolute",width:Ne,left:Math.min(d.left,p.right-Ne-8)-u.left,...x?{bottom:u.bottom-d.top+6}:{top:d.bottom-u.top+6}},v=()=>{e.editor&&st(e.editor,t),t.close()},M=k=>{const T=k.relatedTarget;if((!T||e.editor?.view.dom.contains(T)===!0)&&t.latched){o?.focus();return}v()},m=k=>{!e.editor||!e.range||(zr(e.editor,e.range,k),t.close())};return ht.createPortal(f.jsx("div",{style:y,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg bg-popover shadow-soft",children:f.jsxs(tn,{onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),v(),e.editor?.commands.focus())},children:[f.jsx(nn,{ref:h,autoFocus:!0,onFocus:()=>{t.latched=!0},value:i,onValueChange:l,placeholder:s("markdownEditor.mentionSearch"),onBlur:M}),f.jsxs(rn,{style:{maxHeight:b},children:[a?f.jsx("div",{className:"flex items-center justify-center py-6",children:f.jsx(De,{size:"sm"})}):f.jsx(sn,{children:s("markdownEditor.mentionEmpty")}),n.map(k=>f.jsxs(
|
|
66
|
+
`))}}p={type:"taskItem",raw:"",mainContent:w,indentLevel:u,checked:c??!1,text:w,tokens:this.tokenizeInline(w),nestedTokens:b}}const d=h?"taskList":"list";a!==d?(r.length>0&&s.push({type:a,items:r}),r=[p],a=d):r.push(p)}r.length>0&&s.push({type:a,items:r});const i=[];for(let l=0;l<s.length;l+=1){const o=s[l],h={...t,type:o.type,items:o.items},c=this.parseToken(h);c&&(Array.isArray(c)?i.push(...c):i.push(c))}return i.length>0?i:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const r=s.parseMarkdown(t,n),a=this.normalizeParseResult(r);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const s={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete s.attrs,s},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let i=0;i<t.length;i+=1){const l=t[i];if(l.type==="text")e.push({type:"text",text:ve(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,s;const o=((n=(s=l.raw)!==null&&s!==void 0?s:l.text)!==null&&n!==void 0?n:"").toString(),h=/^<\/[\s]*[\w-]+/i.test(o),c=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!h&&c&&!/\/>$/.test(o)){const p=c[1],d=this.escapeRegex(p),g=new RegExp(`^<\\/\\s*${d}\\b`,"i");let x=-1;const w=[o];for(let b=i+1;b<t.length;b+=1){var r,a;const y=t[b],v=((r=(a=y.raw)!==null&&a!==void 0?a:y.text)!==null&&r!==void 0?r:"").toString();if(w.push(v),y.type==="html"&&g.test(v)){x=b;break}}if(x!==-1){const b=w.join(""),y={type:"html",raw:b,text:b,block:!1},v=this.parseHTMLToken(y);if(v){const M=this.normalizeParseResult(v);Array.isArray(M)?e.push(...M):M&&e.push(M)}i=x;continue}}const u=this.parseHTMLToken(l);if(u){const p=this.normalizeParseResult(u);Array.isArray(p)?e.push(...p):p&&e.push(p)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const h=this.createParseHelpers(),c=o.parseMarkdown(l,h);if(this.isMarkResult(c)){const u=this.applyMarkToContent(c.mark,c.content,c.attrs);e.push(...u)}else{const u=this.normalizeParseResult(c);Array.isArray(u)?e.push(...u):u&&e.push(u)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let i=e.length-1;i>0;i-=1){const l=e[i],o=e[i-1];if(l.type==="text"&&o.type==="text"){const h=l.marks||[],c=o.marks||[];bt(h,c)&&(o.text=(o.text||"")+(l.text||""),e.splice(i,1))}}return e}applyMarkToContent(t,e,n){return e.map(s=>{if(s.type==="text"){const r=s.marks||[],a=n?{type:t,attrs:n}:{type:t};return{...s,marks:[...r,a]}}return{...s,content:s.content?this.applyMarkToContent(t,s.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:ve(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=wt(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const s=this.toInlineContent(n.content);return s.length>0?s:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=Se(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return wr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=Se(this.baseExtensions),n=s=>{const r=s?.parseDOM;Array.isArray(r)&&r.forEach(a=>{if(typeof a?.tag=="string"){const i=a.tag.match(/^[a-zA-Z][\w-]*/);i&&t.add(i[0].toLowerCase())}})};Object.values(e.nodes).forEach(s=>n(s.spec)),Object.values(e.marks).forEach(s=>n(s.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(s=>this.codeTypes.has(typeof s=="string"?s:s.type))?t:this.escapeMarkdownSyntax(yt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,s=0,r={}){var a;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const i=this.getHandlerForToken(t.type);if(!i)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(c,u)=>{const p=i.isIndenting?s+1:s;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,u||"",n,p):this.renderNodes(c,t,u||"",n,p)},renderChild:(c,u)=>{const p=i.isIndenting?s+1:s;return this.renderNodeToMarkdown(c,t,u,p)},indent:c=>this.indentString+c,wrapInBlock:ur},h={index:n,level:s,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...r}};return((a=i.renderMarkdown)===null||a===void 0?void 0:a.call(i,t,o,h))||""}renderNodes(t,e,n="",s=0,r=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,r):t.type?this.renderNodeToMarkdown(t,e,s,r):""}renderNodesWithMarkBoundaries(t,e,n="",s=0){const r=[],a=new Map,i=new Set,l=new Map;return t.forEach((o,h)=>{const c=h<t.length-1?t[h+1]:null;if(o.type)if(o.type==="text"){let u=this.encodeTextForMarkdown(o.text||"",o,e);const p=new Map((o.marks||[]).map(m=>[m.type,m])),d=this.getMarksToOpenForSerialization(a,p,c),g=hr(p,c),x=g.filter(m=>a.has(m)),w=x.length>0&&d.length>0;let b="";if(g.length>0&&!w){const m=u.match(/(\s+)$/);m&&(b=m[1],u=u.slice(0,-b.length))}w||g.slice().reverse().forEach(m=>{if(!a.has(m))return;const k=p.get(m),T=this.getMarkClosing(m,k,l.get(m));T&&(u+=T),a.has(m)&&(a.delete(m),l.delete(m))});let y="";if(d.length>0){const m=u.match(/^(\s+)/);m&&(y=m[1],u=u.slice(y.length))}d.forEach(({type:m,mark:k})=>{const T=i.has(m)?"html":"markdown",E=this.getMarkOpening(m,k,T);E&&(u=E+u),l.set(m,T),i.delete(m)}),w||d.slice().reverse().forEach(({type:m,mark:k})=>{a.set(m,k)}),u=y+u;let v;if(w){const m=new Set((c?.marks||[]).map(E=>E.type));d.forEach(({type:E})=>{m.has(E)&&this.getHtmlReopenTags(E)&&i.add(E)});const k=Array.from(a.keys()),T=x.slice().sort((E,it)=>k.indexOf(it)-k.indexOf(E));v=[...d.map(E=>E.type),...T]}else v=dr(a,p,c,this.markSetsEqual.bind(this));let M="";if(v.length>0){const m=u.match(/(\s+)$/);m&&(M=m[1],u=u.slice(0,-M.length))}v.forEach(m=>{var k;const T=(k=a.get(m))!==null&&k!==void 0?k:p.get(m),E=this.getMarkClosing(m,T,l.get(m));E&&(u+=E),a.delete(m),l.delete(m)}),u+=M,u+=b,r.push(u)}else{const u=new Set((o.marks||[]).map(b=>b.type)),p=new Map,d=new Map;a.forEach((b,y)=>{if(u.has(y)){var v;p.set(y,b),d.set(y,(v=l.get(y))!==null&&v!==void 0?v:"markdown")}});const g=fr(a,(b,y)=>this.getMarkClosing(b,y,l.get(b)));l.clear();const x=this.renderNodeToMarkdown(o,e,h,s),w=o.type==="hardBreak"?"":gr(p,a,(b,y)=>{var v;const M=(v=d.get(b))!==null&&v!==void 0?v:"markdown";return l.set(b,M),this.getMarkOpening(b,y,M)});r.push(g+x+w)}}),r.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.open)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:c=>c,wrapInBlock:(c,u)=>c+u},{index:0,level:0,parentType:"text",meta:{}}),h=o.indexOf(i);return h>=0?o.substring(0,h):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var s;return((s=this.getHtmlReopenTags(t))===null||s===void 0?void 0:s.close)||""}const r=this.getHandlersForNodeType(t),a=r.length>0?r[0]:void 0;if(!a||!a.renderMarkdown)return"";const i="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:i}]};try{const o=a.renderMarkdown(l,{renderChildren:()=>i,renderChild:()=>i,indent:u=>u,wrapInBlock:(u,p)=>u+p},{index:0,level:0,parentType:"text",meta:{}}),h=o.indexOf(i),c=h+33;return h>=0?o.substring(c):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,s])=>{const r=e.get(n);return r&&G(s.attrs,r.attrs)})}getMarksToOpenForSerialization(t,e,n){const s=pr(t,e);if(s.length<=1)return s;const r=n?.marks||[],a=(h,c)=>r.some(u=>u.type===h&&G(u.attrs,c)),i=(h,c)=>{var u,p;const d=(u=this.extensionRanks.get(h.type))!==null&&u!==void 0?u:Number.MAX_SAFE_INTEGER,g=(p=this.extensionRanks.get(c.type))!==null&&p!==void 0?p:Number.MAX_SAFE_INTEGER;return d!==g?g-d:h.type.localeCompare(c.type)},l=s.filter(h=>!a(h.type,h.mark.attrs)).sort(i),o=s.filter(h=>a(h.type,h.mark.attrs)).sort(i);return[...l,...o]}};const yr=ue.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(Q(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(Q(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(Q(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return P.insertContentAt(t,s,n)}}},addStorage(){return{manager:new ze({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new ze({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||Q(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function Tr(t){const e=$.c(13),{node:n,selected:s,editor:r,deleteNode:a}=t,i=j(),l=typeof n.attrs.href=="string"?n.attrs.href:"",o=typeof n.attrs.name=="string"?n.attrs.name:"",h=s&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let c;e[0]!==h?(c=B(Wt,"select-none",h),e[0]=h,e[1]=c):c=e[1];let u;e[2]!==a||e[3]!==r.isEditable||e[4]!==i?(u=r.isEditable&&f.jsx("button",{type:"button","aria-label":i("markdownEditor.removeFile"),onMouseDown:vr,onClick:a,className:"shrink-0 rounded-lg p-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:f.jsx(Oe,{size:14})}),e[2]=a,e[3]=r.isEditable,e[4]=i,e[5]=u):u=e[5];let p;e[6]!==l||e[7]!==o||e[8]!==u?(p=f.jsx(Qt,{href:l,name:o,children:u}),e[6]=l,e[7]=o,e[8]=u,e[9]=p):p=e[9];let d;return e[10]!==c||e[11]!==p?(d=f.jsx(pe,{as:"span",className:c,children:p}),e[10]=c,e[11]=p,e[12]=d):d=e[12],d}function vr(t){return t.preventDefault()}function Sr(t){return t.replace(/([[\]])/g,"\\$1")}const Mr=Fe.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]",getAttrs:t=>Ge(t.getAttribute("href")??"")?null:!1}]},renderHTML({HTMLAttributes:t,node:e}){return["a",qe(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${Sr(n)}](${e})`},addNodeView(){return he(Tr)}});function Ar(t){const e=$.c(6),{node:n,selected:s}=t,r=typeof n.attrs.name=="string"?n.attrs.name:"";let a;e[0]!==n.attrs.id||e[1]!==s?(a=B("select-none",Vt(typeof n.attrs.id=="string"?n.attrs.id:null),s&&"ring-2 ring-ring"),e[0]=n.attrs.id,e[1]=s,e[2]=a):a=e[2];let i;return e[3]!==r||e[4]!==a?(i=f.jsxs(pe,{as:"span","data-testid":"mention-chip",className:a,children:["@",r]}),e[3]=r,e[4]=a,e[5]=i):i=e[5],i}const Er=Fe.create({name:"mention",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-mention-id"),renderHTML:t=>t.id?{"data-mention-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-mention-name"),renderHTML:t=>t.name?{"data-mention-name":t.name}:{}}}},parseHTML(){return[{tag:"span[data-mention-id]"}]},renderHTML({HTMLAttributes:t,node:e}){return["span",qe(t),`@${typeof e.attrs.name=="string"?e.attrs.name:""}`]},renderMarkdown:t=>{const e=typeof t.attrs?.id=="string"?t.attrs.id:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return e?Xt(e,n):`@${n}`},addNodeView(){return he(Ar)}}),Rr="studio.mention-members.",ce=new Map;function Pe(t){const e=ce.get(t);if(e)return e;try{const n=localStorage.getItem(t);if(!n)return;const s=JSON.parse(n);if(!Array.isArray(s))return;const r=s.filter(a=>!!a&&typeof a.id=="string"&&typeof a.name=="string");return ce.set(t,r),r}catch{return}}function _r(t,e){ce.set(t,e);try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function $r(t,e){if(!t?.length)return e;const n=new Map(t.map(s=>[s.id,s]));return e.map(s=>{const r=n.get(s.id);return r&&r.name===s.name&&r.email===s.email&&r.image===s.image?r:s})}function Cr(t){return t.map(e=>({id:e.userId,name:e.user?.name?.trim()||e.user?.email?.trim()||"",email:e.user?.email??"",image:e.user?.image??null})).filter(e=>!!e.name).sort((e,n)=>e.name.localeCompare(n.name))}function Ir(t){const e=$.c(17),{locator:n}=ot(),s=lt(),r=`${Rr}${n}`;let a;e[0]!==n?(a=ut.mentionMembers(n),e[0]=n,e[1]=a):a=e[1];let i;e[2]!==r?(i=()=>Pe(r),e[2]=r,e[3]=i):i=e[3];let l;e[4]!==s||e[5]!==r?(l=async()=>{const d=await s.organization.listMembers(),g=$r(Pe(r),Cr(d?.data?.members??[]));return _r(r,g),g},e[4]=s,e[5]=r,e[6]=l):l=e[6];let o;e[7]!==t||e[8]!==a||e[9]!==i||e[10]!==l?(o={queryKey:a,enabled:t,staleTime:0,placeholderData:i,queryFn:l},e[7]=t,e[8]=a,e[9]=i,e[10]=l,e[11]=o):o=e[11];const h=ct(o);let c;e[12]!==h.data?(c=h.data??[],e[12]=h.data,e[13]=c):c=e[13];const u=h.isFetching&&!h.data;let p;return e[14]!==c||e[15]!==u?(p={members:c,loading:u},e[14]=c,e[15]=u,e[16]=p):p=e[16],p}const je={query:"",range:null,rect:null,editor:null};class Lr{state=je;listeners=new Set;dismissal=null;latched=!1;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.state;set(e){this.state=e;for(const n of this.listeners)n()}close(){this.latched=!1,this.set(je)}}const Te=new Be("markdownEditorMention");function zr(t,e,n){t.chain().focus().insertContentAt(e,[{type:"mention",attrs:{id:n.id,name:n.name}},{type:"text",text:" "}]).run(),Ue(t.view,Te)}function Pr(t,e,n){const s=Math.min(e+n,t.content.size);return e>=s?"":t.textBetween(e,s,"","")}function st(t,e){const n=e.getSnapshot().range??void 0;n&&n.to>n.from&&(e.dismissal={from:n.from,text:t.state.doc.textBetween(n.from,n.to,"")}),Ue(t.view,Te)}function jr(t){return ue.create({name:"mentionSuggestion",addProseMirrorPlugins(){const e={editor:this.editor,char:"@",pluginKey:Te,allowedPrefixes:[" ",`
|
|
67
|
+
`],allow:({state:n,range:s})=>{const r=t.dismissal;return r?s.from===r.from&&Pr(n.doc,r.from,r.text.length)===r.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(st(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Ct(e)]}})}const Ne=256,Nr=40,He=280,Hr=140,Or=[];function Dr(t){const e=$.c(5),{store:n,agents:s}=t,r=s===void 0?Or:s,a=_.useSyncExternalStore(n.subscribe,n.getSnapshot),i=a.range!==null;let l;return e[0]!==r||e[1]!==i||e[2]!==a||e[3]!==n?(l=i?f.jsx(Br,{store:n,state:a,agents:r}):null,e[0]=r,e[1]=i,e[2]=a,e[3]=n,e[4]=l):l=e[4],l}function Br({store:t,state:e,agents:n}){const s=j(),{members:r,loading:a}=Ir(!0),[i,l]=_.useState(e.query),[o,h]=_.useState(null),c=Fr(e.editor),u=c.getBoundingClientRect(),p=c===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):u,d=e.rect?.()??new DOMRect(0,0,0,0),g=p.bottom-d.bottom,x=g<He&&d.top-p.top>g,w=(x?d.top-p.top:g)-8,b=Math.min(He,Math.max(w,Hr))-Nr,y={position:"absolute",width:Ne,left:Math.min(d.left,p.right-Ne-8)-u.left,...x?{bottom:u.bottom-d.top+6}:{top:d.bottom-u.top+6}},v=()=>{e.editor&&st(e.editor,t),t.close()},M=k=>{const T=k.relatedTarget;if((!T||e.editor?.view.dom.contains(T)===!0)&&t.latched){o?.focus();return}v()},m=k=>{!e.editor||!e.range||(zr(e.editor,e.range,k),t.close())};return ht.createPortal(f.jsx("div",{style:y,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg bg-popover shadow-soft",children:f.jsxs(tn,{onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),v(),e.editor?.commands.focus())},children:[f.jsx(nn,{ref:h,autoFocus:!0,onFocus:()=>{t.latched=!0},value:i,onValueChange:l,placeholder:s("markdownEditor.mentionSearch"),onBlur:M}),f.jsxs(rn,{style:{maxHeight:b},children:[a?f.jsx("div",{className:"flex items-center justify-center py-6",children:f.jsx(De,{size:"sm"})}):f.jsx(sn,{children:s("markdownEditor.mentionEmpty")}),n.map(k=>f.jsxs(Ae,{value:k.name,onSelect:()=>m(k),onMouseDown:T=>T.preventDefault(),className:"gap-2",children:[k.icon,f.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.name})]},k.id)),r.map(k=>f.jsxs(Ae,{value:`${k.name} ${k.email}`,onSelect:()=>m(k),onMouseDown:T=>T.preventDefault(),className:"gap-2",children:[f.jsx(pt,{url:k.image??void 0,fallback:k.name??"?",shape:"circle",size:"xs"}),f.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.name})]},k.id))]})]})}),c)}function Fr(t){const e=t?.view.dom.closest('[role="dialog"]');return e instanceof HTMLElement?e:document.body}function qr(t){const e=$.c(16),{node:n,selected:s,editor:r,deleteNode:a}=t,i=j(),l=typeof n.attrs.src=="string"?n.attrs.src:"",o=typeof n.attrs.alt=="string"?n.attrs.alt:"";let h;e[0]!==o||e[1]!==i?(h=o||i("markdownEditor.imageAltFallback"),e[0]=o,e[1]=i,e[2]=h):h=e[2];const c=s&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let u;e[3]!==c?(u=B("max-h-[420px] max-w-full rounded-lg border border-border object-contain",c),e[3]=c,e[4]=u):u=e[4];let p;e[5]!==l||e[6]!==h||e[7]!==u?(p=f.jsx("img",{src:l,alt:h,draggable:!1,className:u}),e[5]=l,e[6]=h,e[7]=u,e[8]=p):p=e[8];let d;e[9]!==a||e[10]!==r.isEditable||e[11]!==i?(d=r.isEditable&&f.jsx("button",{type:"button","aria-label":i("markdownEditor.removeImage"),onMouseDown:Ur,onClick:a,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-lg bg-card text-muted-foreground opacity-0 shadow-edge transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:f.jsx(Oe,{size:14})}),e[9]=a,e[10]=r.isEditable,e[11]=i,e[12]=d):d=e[12];let g;return e[13]!==p||e[14]!==d?(g=f.jsxs(pe,{className:"group/image relative my-3 w-fit max-w-full",children:[p,d]}),e[13]=p,e[14]=d,e[15]=g):g=e[15],g}function Ur(t){return t.preventDefault()}const Zr=Jt.extend({addNodeView(){return he(qr)}}).configure({inline:!1,allowBase64:!1}),Gr={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},Kr=Tt.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";if(Ge(n))return e.createNode("attachment",{href:n,name:t.text??""});const s=Yt(n);return s?e.createNode("mention",{id:s,name:(t.text??"").replace(/^@/,"")}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function Wr(t="",e){return[St.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),Kr.configure(Gr),It.configure({placeholder:t}),en,vt,Mt.configure({nested:!0}),Zr,Mr,mn,Er,...e?[jr(e)]:[],yr.configure({markedOptions:{breaks:!0}})]}const Qr=/^(\s*)([-*+]|\d+[.)])\s+\S/,Xr=/^\s*(```|~~~)/,Vr=/^\s+(?![-*+>#]|\d+[.)]\s)\S/;function Yr(t){const e=[];let n=!1,s=!1;for(const r of t.split(`
|
|
68
68
|
`)){if(Xr.test(r)){n=!n,s=!1,e.push(r);continue}if(n){e.push(r);continue}if(Qr.test(r)){s=!0,e.push(r);continue}if(!r.trim()){s=!1,e.push(r);continue}if(s&&Vr.test(r)){e[e.length-1]=`${e[e.length-1]} ${r.trim()}`;continue}s=!1,e.push(r)}return e.join(`
|
|
69
|
-
`)}function Jr(t){const e=$.c(12),{onFiles:n,disabled:s}=t,r=j(),a=_.useRef(null);let i;e[0]!==r?(i=r("markdownEditor.attachFile"),e[0]=r,e[1]=i):i=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>a.current?.click(),o=f.jsx(Bt,{size:16}),e[2]=l,e[3]=o):(l=e[2],o=e[3]);let h;e[4]!==s||e[5]!==i?(h=f.jsx(an,{type:"button",label:i,disabled:s,onClick:l,children:o}),e[4]=s,e[5]=i,e[6]=h):h=e[6];let c;e[7]!==n?(c=f.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",onChange:p=>{const d=Array.from(p.target.files??[]);p.target.value="",d.length>0&&n(d)}}),e[7]=n,e[8]=c):c=e[8];let u;return e[9]!==h||e[10]!==c?(u=f.jsxs(f.Fragment,{children:[h,c]}),e[9]=h,e[10]=c,e[11]=u):u=e[11],u}function es(t){const e=$.c(6),{pending:n}=t,s=j();if(n===0)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=f.jsx(De,{className:"size-3"}),e[0]=r):r=e[0];let a;e[1]!==n||e[2]!==s?(a=n===1?s("markdownEditor.uploading"):s("markdownEditor.uploadingCount",{count:String(n)}),e[1]=n,e[2]=s,e[3]=a):a=e[3];let i;return e[4]!==a?(i=f.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[r,a]}),e[4]=a,e[5]=i):i=e[5],i}const ts=["outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-3 [&_p]:leading-[1.5]","[&_h1]:my-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-[1.5] [&_h1]:text-foreground","[&_h2]:my-3 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-[1.5] [&_h2]:text-foreground","[&_h3]:my-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-[1.5] [&_h3]:text-foreground","[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-sm","[&_pre_code]:bg-transparent [&_pre_code]:p-0",$t,"[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold [&_strong]:text-foreground","[&_table]:my-3 [&_table]:w-full [&_table]:table-fixed [&_table]:border-collapse","[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold","[&_td]:border [&_td]:border-border [&_td]:p-2 [&_td]:align-top","[&_th>p]:my-0 [&_td>p]:my-0","[&_ul[data-type=taskList]]:my-3 [&_ul[data-type=taskList]]:list-none [&_ul[data-type=taskList]]:pl-0","[&_li[data-type=taskItem]]:flex [&_li[data-type=taskItem]]:items-start [&_li[data-type=taskItem]]:gap-2","[&_li[data-type=taskItem]>label]:mt-1 [&_li[data-type=taskItem]>label]:shrink-0","[&_li[data-type=taskItem]>div]:min-w-0 [&_li[data-type=taskItem]>div>p]:my-0"].join(" "),ns=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function rs(t){const e=$.c(10),{editor:n,mentions:s}=t,r=s.items;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["markdown-editor-mentions"],e[0]=a):a=e[0];let i;e[1]!==r?(i=h=>{const{query:c}=h,u=c.trim().toLowerCase();return Promise.resolve(u?r.filter(p=>`${p.name} ${p.title??""}`.toLowerCase().includes(u)):r)},e[1]=r,e[2]=i):i=e[2];let l;e[3]!==n?(l=h=>{const{range:c,item:u}=h;n.chain().focus().insertContentAt(c,[{type:"text",text:`@${u.name}`,marks:u.href?[{type:"link",attrs:{href:u.href}}]:void 0},{type:"text",text:" "}]).run()},e[3]=n,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==s.emptyLabel||e[7]!==i||e[8]!==l?(o=f.jsx(Lt,{editor:n,char:"@",pluginKey:"markdownMentionMenu",queryKey:a,queryFn:i,emptyLabel:s.emptyLabel,renderItem:ss,onSelect:l}),e[5]=n,e[6]=s.emptyLabel,e[7]=i,e[8]=l,e[9]=o):o=e[9],o}function ss(t){return f.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsx("span",{className:"truncate font-medium",children:t.title??t.name}),t.description&&f.jsx("span",{className:"line-clamp-1 text-xs text-muted-foreground",children:t.description})]})}function xs({defaultValue:t,onChange:e,placeholder:n,editable:s=!0,attachments:r=!0,mentions:a,inline:i=!1}){const l=wn(r),[o]=_.useState(()=>new Lr),h=_.useRef(e);h.current=e;const c=
|
|
69
|
+
`)}function Jr(t){const e=$.c(12),{onFiles:n,disabled:s}=t,r=j(),a=_.useRef(null);let i;e[0]!==r?(i=r("markdownEditor.attachFile"),e[0]=r,e[1]=i):i=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>a.current?.click(),o=f.jsx(Bt,{size:16}),e[2]=l,e[3]=o):(l=e[2],o=e[3]);let h;e[4]!==s||e[5]!==i?(h=f.jsx(an,{type:"button",label:i,disabled:s,onClick:l,children:o}),e[4]=s,e[5]=i,e[6]=h):h=e[6];let c;e[7]!==n?(c=f.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",onChange:p=>{const d=Array.from(p.target.files??[]);p.target.value="",d.length>0&&n(d)}}),e[7]=n,e[8]=c):c=e[8];let u;return e[9]!==h||e[10]!==c?(u=f.jsxs(f.Fragment,{children:[h,c]}),e[9]=h,e[10]=c,e[11]=u):u=e[11],u}function es(t){const e=$.c(6),{pending:n}=t,s=j();if(n===0)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=f.jsx(De,{className:"size-3"}),e[0]=r):r=e[0];let a;e[1]!==n||e[2]!==s?(a=n===1?s("markdownEditor.uploading"):s("markdownEditor.uploadingCount",{count:String(n)}),e[1]=n,e[2]=s,e[3]=a):a=e[3];let i;return e[4]!==a?(i=f.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[r,a]}),e[4]=a,e[5]=i):i=e[5],i}const ts=["outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-3 [&_p]:leading-[1.5]","[&_h1]:my-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-[1.5] [&_h1]:text-foreground","[&_h2]:my-3 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-[1.5] [&_h2]:text-foreground","[&_h3]:my-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-[1.5] [&_h3]:text-foreground","[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-sm","[&_pre_code]:bg-transparent [&_pre_code]:p-0",$t,"[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold [&_strong]:text-foreground","[&_table]:my-3 [&_table]:w-full [&_table]:table-fixed [&_table]:border-collapse","[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold","[&_td]:border [&_td]:border-border [&_td]:p-2 [&_td]:align-top","[&_th>p]:my-0 [&_td>p]:my-0","[&_ul[data-type=taskList]]:my-3 [&_ul[data-type=taskList]]:list-none [&_ul[data-type=taskList]]:pl-0","[&_li[data-type=taskItem]]:flex [&_li[data-type=taskItem]]:items-start [&_li[data-type=taskItem]]:gap-2","[&_li[data-type=taskItem]>label]:mt-1 [&_li[data-type=taskItem]>label]:shrink-0","[&_li[data-type=taskItem]>div]:min-w-0 [&_li[data-type=taskItem]>div>p]:my-0"].join(" "),ns=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function rs(t){const e=$.c(10),{editor:n,mentions:s}=t,r=s.items;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["markdown-editor-mentions"],e[0]=a):a=e[0];let i;e[1]!==r?(i=h=>{const{query:c}=h,u=c.trim().toLowerCase();return Promise.resolve(u?r.filter(p=>`${p.name} ${p.title??""}`.toLowerCase().includes(u)):r)},e[1]=r,e[2]=i):i=e[2];let l;e[3]!==n?(l=h=>{const{range:c,item:u}=h;n.chain().focus().insertContentAt(c,[{type:"text",text:`@${u.name}`,marks:u.href?[{type:"link",attrs:{href:u.href}}]:void 0},{type:"text",text:" "}]).run()},e[3]=n,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==s.emptyLabel||e[7]!==i||e[8]!==l?(o=f.jsx(Lt,{editor:n,char:"@",pluginKey:"markdownMentionMenu",queryKey:a,queryFn:i,emptyLabel:s.emptyLabel,renderItem:ss,onSelect:l}),e[5]=n,e[6]=s.emptyLabel,e[7]=i,e[8]=l,e[9]=o):o=e[9],o}function ss(t){return f.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsx("span",{className:"truncate font-medium",children:t.title??t.name}),t.description&&f.jsx("span",{className:"line-clamp-1 text-xs text-muted-foreground",children:t.description})]})}function xs({defaultValue:t,onChange:e,placeholder:n,editable:s=!0,attachments:r=!0,mentions:a,inline:i=!1}){const l=wn(r),[o]=_.useState(()=>new Lr),h=_.useRef(e);h.current=e;const c=At({extensions:Wr(n,a?void 0:o),content:Yr(t),contentType:"markdown",editable:s,autofocus:i?"end":!1,editorProps:{attributes:{role:"textbox","aria-label":n??"","aria-multiline":"true",class:B(ts,!i&&"min-h-[200px] sm:min-h-[320px]",ns)},handlePaste:l.handlePaste,handleDrop:l.handleDrop},onUpdate:({editor:u,transaction:p})=>{p.docChanged&&h.current(u.getMarkdown())}});return c?f.jsxs("div",{className:"flex flex-col",children:[f.jsx(cn,{editor:c}),!a&&f.jsx(Dr,{store:o}),f.jsx(Et,{editor:c,className:B(i?"text-sm text-foreground":"text-base text-muted-foreground")}),s&&a&&f.jsx(rs,{editor:c,mentions:a}),f.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground empty:mt-0",children:[s&&a?.hint&&f.jsx("span",{children:a.hint}),s&&r&&f.jsx(Jr,{onFiles:u=>l.uploadInto(c.view,u,c.state.selection.to)}),f.jsx(es,{pending:l.pending})]})]}):null}export{Jr as A,Lr as M,mn as U,Er as a,yr as b,Zr as c,Mr as d,Te as e,Dr as f,es as g,xs as h,jr as m,wn as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as I,a4 as A,aS as le,m as R,j as r,R as ae,r as L,b as $,t as z,h as H,w as U,x as V,v as Q,D as W,d as X,E as G,aT as ne,B as Y}from"./index-CWKxkTwy.js";import{n as oe}from"./ArrowUp-AwRcCsuH.js";import{d as ie,b as Z,f as ce,u as de,T as me,A as ue,n as fe,o as pe,c as xe,p as he,q as ge,t as be,L as je}from"./chat-context-D8Eje7xK.js";import{s as ye,g as J,d as ve}from"./tool-namespace-c-MaHIy3.js";import{b as F,T as we,a as Ne,c as Ce}from"./tooltip-mM1fQXaq.js";import{e as Se,b as Te,a as Pe,D as ke}from"./drawer-B9PFQFcy.js";import{C as Ee}from"./collection-search-CC2QUXh2.js";import{u as De}from"./use-mobile-BZ5I1Gts.js";import{u as Me}from"./use-mcp-client-CmWEhN6T.js";import{u as _e,g as Be}from"./use-mcp-prompts-RB8yW0_L.js";import{h as Ie,P as Le}from"./usage-stats-DT9jvl-J.js";import{T as Re,c as Oe,b as $e,d as Ae,H as Fe}from"./input-1NX4JUHA.js";import{u as ze,a as He,S as Ge,M as q}from"./pair-DbwVEDlq.js";import{u as qe,i as Ke}from"./thread-intent-0TjSPqLd.js";import{b as Ue}from"./use-view-draft-kind-BQ4N5uEB.js";import{N as Ve}from"./index-C9E0iqgh.js";import{i as Qe}from"./LinkBroken01-DjOOxf0e.js";import{f as ee}from"./agent-icon-BwEytdmh.js";import{d as We}from"./use-entitlements-J4XPZF2l.js";import{u as Xe}from"./use-deco-credits-DlgC2mIc.js";import{F as Ye}from"./feature-paywall-BiIzjBeB.js";import{i as Ze}from"./AlertCircle-Bj2NuHQY.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Je="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=I.c(46),{item:l,onSelect:a,isLoading:s,isDisabled:n,variant:m}=t,o=m===void 0?"pill":m,{prompt:i}=l;let d;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=J(i._meta);d=i.title??ve(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=d}else d=e[3];const c=d,f=i.description||null;if(o==="card"){let P;e[4]!==a||e[5]!==i?(P=()=>a(i),e[4]=a,e[5]=i,e[6]=P):P=e[6];const M=n||s,_=s&&"bg-accent/40",k=(n||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==_||e[8]!==k?(E=R(Je,"hover:bg-accent text-foreground",_,k),e[7]=_,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let N;e[12]!==s?(N=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=N):N=e[13];let x;e[14]!==h||e[15]!==N?(x=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,N]}),e[14]=h,e[15]=N,e[16]=x):x=e[16];let D;e[17]!==f?(D=f&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=D):D=e[18];let B;return e[19]!==x||e[20]!==D||e[21]!==P||e[22]!==M||e[23]!==E?(B=r.jsxs("button",{type:"button",onClick:P,disabled:M,className:E,children:[x,D]}),e[19]=x,e[20]=D,e[21]=P,e[22]=M,e[23]=E,e[24]=B):B=e[24],B}let u;e[25]!==a||e[26]!==i?(u=()=>a(i),e[25]=a,e[26]=i,e[27]=u):u=e[27];const g=n||s,p=s&&"bg-muted/50",w=(n||s)&&"cursor-not-allowed opacity-50";let b;e[28]!==p||e[29]!==w?(b=R(te,"hover:bg-accent hover:text-foreground",p,w),e[28]=p,e[29]=w,e[30]=b):b=e[30];let y;e[31]!==c?(y=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=y):y=e[32];let C;e[33]!==s?(C=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let v;e[35]!==u||e[36]!==g||e[37]!==b||e[38]!==y||e[39]!==C?(v=r.jsx(we,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:u,disabled:g,className:b,children:[y,C]})}),e[35]=u,e[36]=g,e[37]=b,e[38]=y,e[39]=C,e[40]=v):v=e[40];const S=f??c;let j;e[41]!==S?(j=r.jsx(Ne,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:S})}),e[41]=S,e[42]=j):j=e[42];let T;return e[43]!==v||e[44]!==j?(T=r.jsxs(Ce,{delayDuration:400,children:[v,j]}),e[43]=v,e[44]=j,e[45]=T):T=e[45],T}function et(t){const e=I.c(61),{items:l,open:a,onOpenChange:s,onSelect:n,loadingPrompt:m}=t,o=$(),[i,d]=L.useState(""),c=!!m;let f;e[0]!==l||e[1]!==i?(f=i.trim()?l.filter(h=>{const N=i.toLowerCase();return h.prompt.name.toLowerCase().includes(N)||(h.prompt.title??"").toLowerCase().includes(N)||(h.prompt.description??"").toLowerCase().includes(N)}):l,e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f,g=De();let p;e[3]!==u.length||e[4]!==i||e[5]!==o?(p=u.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=u.length,e[4]=i,e[5]=o,e[6]=p):p=e[6];let w;if(e[7]!==u||e[8]!==c||e[9]!==m?.name||e[10]!==s||e[11]!==n){let h;e[13]!==c||e[14]!==m?.name||e[15]!==s||e[16]!==n?(h=N=>r.jsx(se,{item:N,variant:"card",onSelect:x=>{s(!1),n(x)},isLoading:m?.name===N.prompt.name,isDisabled:c&&m?.name!==N.prompt.name},N.prompt.name),e[13]=c,e[14]=m?.name,e[15]=s,e[16]=n,e[17]=h):h=e[17],w=u.map(h),e[7]=u,e[8]=c,e[9]=m?.name,e[10]=s,e[11]=n,e[12]=w}else w=e[12];let b;e[18]!==p||e[19]!==w?(b=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[p,w]})}),e[18]=p,e[19]=w,e[20]=b):b=e[20];const y=b;let C;e[21]!==o?(C=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=C):C=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=h=>{h.key==="Escape"&&d("")},e[23]=v):v=e[23];let S;e[24]!==i||e[25]!==C?(S=r.jsx(Ee,{value:i,onChange:d,placeholder:C,onKeyDown:v}),e[24]=i,e[25]=C,e[26]=S):S=e[26];const j=S;if(g){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let N;e[29]!==h?(N=r.jsx(Se,{className:"sr-only",children:r.jsx(Te,{children:h})}),e[29]=h,e[30]=N):N=e[30];let x;e[31]!==o?(x=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=x):x=e[32];let D;e[33]!==x?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:x})}),e[33]=x,e[34]=D):D=e[34];let B;e[35]!==y||e[36]!==j||e[37]!==D||e[38]!==N?(B=r.jsxs(Pe,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[N,D,j,y]}),e[35]=y,e[36]=j,e[37]=D,e[38]=N,e[39]=B):B=e[39];let O;return e[40]!==s||e[41]!==a||e[42]!==B?(O=r.jsx(F,{delayDuration:400,children:r.jsx(ke,{open:a,onOpenChange:s,children:B})}),e[40]=s,e[41]=a,e[42]=B,e[43]=O):O=e[43],O}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(U,{className:"sr-only",children:r.jsx(V,{children:T})}),e[46]=T,e[47]=P):P=e[47];let M;e[48]!==o?(M=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=M):M=e[49];let _;e[50]!==M?(_=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:M})}),e[50]=M,e[51]=_):_=e[51];let k;e[52]!==y||e[53]!==j||e[54]!==_||e[55]!==P?(k=r.jsxs(Q,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,_,j,y]}),e[52]=y,e[53]=j,e[54]=_,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==a||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(W,{open:a,onOpenChange:s,children:k})}),e[57]=s,e[58]=a,e[59]=k,e[60]=E):E=e[60],E}function tt(t){const e=I.c(30),{items:l,onSelect:a,loadingPrompt:s,className:n}=t,m=$(),[o,i]=L.useState(!1);if(l.length===0)return null;let d,c,f,u,g;if(e[0]!==n||e[1]!==l||e[2]!==s||e[3]!==a||e[4]!==m){const y=l.slice(0,K),C=l.slice(K),v=!!s;let S;e[10]!==v||e[11]!==s?.name||e[12]!==a?(S=T=>r.jsx(se,{item:T,onSelect:a,isLoading:s?.name===T.prompt.name,isDisabled:v&&s?.name!==T.prompt.name},T.prompt.name),e[10]=v,e[11]=s?.name,e[12]=a,e[13]=S):S=e[13];const j=y.map(S);d=F,g=400,e[14]!==n?(c=R("w-full flex flex-wrap gap-2 justify-center",n),e[14]=n,e[15]=c):c=e[15],f=j,u=C.length>0&&r.jsx("button",{type:"button",disabled:v,onClick:()=>i(!0),className:R(te,"hover:bg-accent hover:text-foreground",v&&"opacity-50 cursor-not-allowed"),children:m("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=n,e[1]=l,e[2]=s,e[3]=a,e[4]=m,e[5]=d,e[6]=c,e[7]=f,e[8]=u,e[9]=g}else d=e[5],c=e[6],f=e[7],u=e[8],g=e[9];let p;e[16]!==c||e[17]!==f||e[18]!==u?(p=r.jsxs("div",{className:c,children:[f,u]}),e[16]=c,e[17]=f,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==a?(w=r.jsx(et,{items:l,open:o,onOpenChange:i,onSelect:a,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=a,e[24]=w):w=e[24];let b;return e[25]!==d||e[26]!==g||e[27]!==p||e[28]!==w?(b=r.jsxs(d,{delayDuration:g,children:[p,w]}),e[25]=d,e[26]=g,e[27]=p,e[28]=w,e[29]=b):b=e[29],b}function st(){return null}function rt(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 lt(t){const e=I.c(31),{connectionId:l}=t,a=$(),{sendMessage:s}=Z(),{org:n}=A();let m;e[0]!==l||e[1]!==n.id||e[2]!==n.slug?(m={connectionId:l,orgId:n.id,orgSlug:n.slug},e[0]=l,e[1]=n.id,e[2]=n.slug,e[3]=m):m=e[3];const o=Me(m);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:d}=_e(i);let c;e[6]!==d?.prompts?(c=d?.prompts??[],e[6]=d?.prompts,e[7]=c):c=e[7];const f=c;let u;e[8]!==f?(u=f.map(at),e[8]=f,e[9]=u):u=e[9];const g=u;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={stage:"idle"},e[10]=p):p=e[10];const[w,b]=L.useReducer(rt,p),[y,C]=L.useState(null);let v;e[11]!==o||e[12]!==s||e[13]!==a?(v=async(x,D)=>{if(!o){z.error(a("chat.iceBreakers.mcpClientNotAvailable")),b({type:"RESET"});return}try{const B=await Be(o,x.name,D);b({type:"RESET"});const O={type:"doc",content:[{type:"paragraph",content:[Ie({id:x.name,name:ye(x.name,J(x._meta)),metadata:B.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(O)}catch(B){console.error("[ice-breakers] Failed to fetch prompt:",B),z.error(a("chat.iceBreakers.failedToLoadPrompt")),b({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=a,e[14]=v):v=e[14];const S=v;let j;e[15]!==S?(j=async x=>{if(x.arguments&&x.arguments.length>0){b({type:"SELECT_PROMPT",prompt:x}),C(x);return}b({type:"START_LOADING",prompt:x}),await S(x)},e[15]=S,e[16]=j):j=e[16];const T=j;let P;e[17]!==y||e[18]!==S?(P=async x=>{y&&(b({type:"START_LOADING",prompt:y,arguments:x}),C(null),await S(y,x))},e[17]=y,e[18]=S,e[19]=P):P=e[19];const M=P;if(g.length===0)return null;const _=w.stage==="loading"?w.prompt:null;let k;e[20]!==T||e[21]!==g||e[22]!==_?(k=r.jsx(tt,{items:g,onSelect:T,loadingPrompt:_}),e[20]=T,e[21]=g,e[22]=_,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{C(null),b({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==y||e[26]!==M?(h=r.jsx(Le,{prompt:y,setPrompt:E,onSubmit:M}),e[25]=y,e[26]=M,e[27]=h):h=e[27];let N;return e[28]!==k||e[29]!==h?(N=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=N):N=e[30],N}function at(t){return{prompt:t}}function nt(t){const e=I.c(13),{className:l}=t,{selectedVirtualMcp:a}=ie(),{org:s}=A();let n;e[0]!==s.id?(n=le(s.id),e[0]=s.id,e[1]=n):n=e[1];const m=n.id,o=a?.id??m;let i;e[2]!==l?(i=R("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const d=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(st,{}),e[4]=c):c=e[4];let f;e[5]!==o?(f=r.jsx(lt,{connectionId:o}),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==d||e[8]!==f?(u=r.jsx(ae,{fallback:null,children:r.jsx(L.Suspense,{fallback:c,children:f},d)}),e[7]=d,e[8]=f,e[9]=u):u=e[9];let g;return e[10]!==i||e[11]!==u?(g=r.jsx("div",{className:i,children:u}),e[10]=i,e[11]=u,e[12]=g):g=e[12],g}function ot(t){let e=0;for(const l of t)for(const a of l.parts??[]){const s=a;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function it(){const t=I.c(11),{openPanel:e}=Ue(),l=qe(),a=ce()?.messages??[],s=de(),n=s?.taskId??null,m=s?.currentBranch;let o;t[0]!==m?(o=Ke(m),t[0]=m,t[1]=o):o=t[1];const i=o;let d;t[2]!==a?(d=ot(a),t[2]=a,t[3]=d):d=t[3];const c=d,f=L.useRef(null),u=L.useRef(null);let g,p;t[4]!==i||t[5]!==c||t[6]!==l||t[7]!==e||t[8]!==n?(g=()=>{if(!c||!n)return;const w=`${n}:${c}`;u.current!==w&&(u.current=w,l?.refreshThreadMetadata(n)),f.current!==n&&(f.current=n,i||e("site-editor"))},p=[c,n,e,l,i],t[4]=i,t[5]=c,t[6]=l,t[7]=e,t[8]=n,t[9]=g,t[10]=p):(g=t[9],p=t[10]),L.useEffect(g,p)}function re(t){return`deco-credits-empty-dismissed:${t}`}function zt(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function ct(){const t=I.c(56),e=$(),{org:l}=A(),a=We("credits"),s=X(),{decoKeyId:n}=Xe(),[m,o]=L.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const d=i;let c,f;if(t[2]!==m||t[3]!==l.id?(c=()=>{m&&G("credits_empty_state_shown",{organization_id:l.id})},f=[m,l.id],t[2]=m,t[3]=l.id,t[4]=c,t[5]=f):(c=t[4],f=t[5]),L.useEffect(c,f),!m)return null;if(!a){let x;t[6]!==e?(x=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=x):x=t[7];let D;t[8]!==x?(D={title:x},t[8]=x,t[9]=D):D=t[9];let B;return t[10]!==d||t[11]!==D?(B=r.jsx(Ye,{feature:"chat",copy:D,onDismiss:d}),t[10]=d,t[11]=D,t[12]=B):B=t[12],B}let u;t[13]!==d?(u=x=>!x&&d(),t[13]=d,t[14]=u):u=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.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]=g):g=t[15];let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=p):p=t[16];let w;t[17]!==e?(w=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=w):w=t[18];let b;t[19]!==w?(b=r.jsx(V,{className:"text-lg font-semibold",children:w}),t[19]=w,t[20]=b):b=t[20];let y;t[21]!==e?(y=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=y):y=t[22];let C;t[23]!==y?(C=r.jsx(ne,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:y}),t[23]=y,t[24]=C):C=t[24];let v;t[25]!==b||t[26]!==C?(v=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[g,r.jsxs(U,{className:"relative gap-3",children:[p,r.jsxs("div",{className:"text-center",children:[b,C]})]})]}),t[25]=b,t[26]=C,t[27]=v):v=t[27];let S;t[28]!==n||t[29]!==d?(S=n&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Re,{source:"empty_state",onDone:d})}),t[28]=n,t[29]=d,t[30]=S):S=t[30];let j;t[31]!==d||t[32]!==s||t[33]!==l.slug?(j=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),d()},t[31]=d,t[32]=s,t[33]=l.slug,t[34]=j):j=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let M;t[38]!==j||t[39]!==T?(M=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:j,children:[T,P]}),t[38]=j,t[39]=T,t[40]=M):M=t[40];let _;t[41]!==e?(_=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=_):_=t[42];let k;t[43]!==d||t[44]!==_?(k=r.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:d,children:_}),t[43]=d,t[44]=_,t[45]=k):k=t[45];let E;t[46]!==M||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[M,k]}),t[46]=M,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==v||t[50]!==S||t[51]!==E?(h=r.jsxs(Q,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:dt,children:[v,S,E]}),t[49]=v,t[50]=S,t[51]=E,t[52]=h):h=t[52];let N;return t[53]!==h||t[54]!==u?(N=r.jsx(W,{open:!0,onOpenChange:u,children:h}),t[53]=h,t[54]=u,t[55]=N):N=t[55],N}function dt(t){return t.preventDefault()}function mt(t){const e=I.c(6),{balanceDollars:l}=t;let a;e[0]!==l?(a=l.toFixed(2),e[0]=l,e[1]=a):a=e[1];const s=a;let n,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=R("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"),m=r.jsx(ee,{size:13,className:"text-success"}),e[2]=n,e[3]=m):(n=e[2],m=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:n,children:[m,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function ut(){const t=I.c(8),{org:e}=A(),l=X();let a;t[0]!==l||t[1]!==e.slug?(a=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=a):a=t[2];let s,n,m;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=R("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"),n=r.jsx(Ze,{size:13,className:"text-warning"}),m=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=n,t[5]=m):(s=t[3],n=t[4],m=t[5]);let o;return t[6]!==a?(o=r.jsxs("button",{type:"button",onClick:a,className:s,children:[n,m]}),t[6]=a,t[7]=o):o=t[7],o}function ft(t){const e=I.c(7),{scrollRef:l,sentinelRef:a,hasMoreOlder:s,isFetchingOlder:n,fetchOlderMessages:m}=t;let o,i;e[0]!==m||e[1]!==s||e[2]!==n||e[3]!==l||e[4]!==a?(o=()=>{const d=a.current,c=l.current;if(!d||!c||!s)return;const f=new IntersectionObserver(async u=>{if(!u[0]?.isIntersecting||n||!s)return;const p=c.scrollHeight,w=c.scrollTop;await m(),requestAnimationFrame(()=>{const b=c.scrollHeight;c.scrollTop=w+(b-p)})},{root:c,rootMargin:"200px 0px 0px 0px"});return f.observe(d),()=>f.disconnect()},i=[l,a,s,n,m],e[0]=m,e[1]=s,e[2]=n,e[3]=l,e[4]=a,e[5]=o,e[6]=i):(o=e[5],i=e[6]),L.useEffect(o,i)}function pt(t){const e=I.c(5),{className:l,children:a}=t;let s;e[0]!==l?(s=R("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let n;return e[2]!==a||e[3]!==s?(n=r.jsx("div",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=n):n=e[4],n}function xt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-1 min-h-0 overflow-y-auto isolate",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}function ht(t){const e=I.c(2),{children:l}=t;let a;return e[0]!==l?(a=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=a):a=e[1],a}function gt(){const t=$(),{messages:e,status:l,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n,isRunInProgress:m}=Z(),{taskId:o}=xe();it();const i=he(o??""),d=ge(i),c=d.size===0?e:e.filter(j=>!d.has(j.id)),f=be(c,l==="submitted"||l==="streaming"||m),u=f.visible,g=ze(u),p=g.at(-1),b=Ae()*Fe+16,y=L.useRef(null),C=L.useRef(null);ft({scrollRef:y,sentinelRef:C,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n});const v=He({initial:!1}),S=j=>{y.current=j,v.scrollRef(j)};return r.jsx(je.Provider,{value:f,children:r.jsx(Ge,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:r.jsxs("div",{ref:v.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),g.slice(0,-1).map((j,T)=>r.jsx(q,{pair:j,isLastPair:!1,status:T===g.length-1?l:void 0},`pair-${j.user?.id??j.assistant?.id}`))]}),p&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:p,isLastPair:!0,status:l},`pair-${p.user?.id??p.assistant?.id}`)})]})}),!v.isAtBottom&&r.jsx(Y,{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-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{v.scrollToBottom()},children:r.jsx(oe,{size:14})})]})})})}function bt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}const Ht=Object.assign(pt,{Main:xt,Messages:gt,EmptyState:ht,Footer:bt,Input:$e,Provider:pe,StreamHost:fe,ActiveTaskStreamSource:ue,ThreadlessStreamSource:me,IceBreakers:nt,NoAiProviderEmptyState:Ve,CreditsEmptyState:ct,CreditsEyebrow:mt,NoCreditsEyebrow:ut,CreditsExhaustedBanner:Oe});export{Ht as C,zt as w};
|