@inkeep/open-knowledge 0.46.0-beta.17 → 0.46.0-beta.18

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.
Files changed (106) hide show
  1. package/dist/{acp-harness-probe-De8I5GLi.mjs → acp-harness-probe-DHPdyN_q.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-CroVRh60.mjs +2 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/init-58dk1KJ3.mjs +1 -0
  6. package/dist/{init-CpL53GmG.mjs → init-CDz6yU29.mjs} +3 -3
  7. package/dist/{launch-json-removal-A2gRrDY9.mjs → launch-json-removal-BU0Zoece.mjs} +2 -2
  8. package/dist/{loader-Dtp3Zsz2.mjs → loader-Doi6q_yH.mjs} +2 -2
  9. package/dist/loader-DqbMewHF.mjs +1 -0
  10. package/dist/{preview-G09EUZwC.mjs → preview-B6U-Jeig.mjs} +2 -2
  11. package/dist/preview-zmI5mM58.mjs +1 -0
  12. package/dist/public/assets/{ActivityModeContent-BSGDxL9R.js → ActivityModeContent-kan_mI6D.js} +1 -1
  13. package/dist/public/assets/{AgentDiffPane-D7bJvGdp.js → AgentDiffPane-CRpzhMdM.js} +1 -1
  14. package/dist/public/assets/{AgentThreadClientBinder-CaTryHIE.js → AgentThreadClientBinder-P7Do65Nb.js} +1 -1
  15. package/dist/public/assets/{ChangedOutsideBadge-C-Qu_Pl8.js → ChangedOutsideBadge-Ci6_waGe.js} +1 -1
  16. package/dist/public/assets/CodeMirrorPropInput-BTL0CFwi.js +3 -0
  17. package/dist/public/assets/DocumentContext-CCdyI4z5.js +38 -0
  18. package/dist/public/assets/{EditorModeToggle-N6JjLfr-.js → EditorModeToggle-gHNi18XV.js} +1 -1
  19. package/dist/public/assets/{EnableSyncConfirmDialog-Bc_A_XCY.js → EnableSyncConfirmDialog-0H9Ea_Ru.js} +1 -1
  20. package/dist/public/assets/FeedbackForm-DqSMdqPM.js +1 -0
  21. package/dist/public/assets/{GraphPanel-aAVgqxld.js → GraphPanel-CFCC83CO.js} +2 -2
  22. package/dist/public/assets/{ImportSkillDialog-LkmkJ0YU.js → ImportSkillDialog-TBOxO6iW.js} +1 -1
  23. package/dist/public/assets/{LintConfigEditor-9eXwxoS2.js → LintConfigEditor-GFclPUJL.js} +1 -1
  24. package/dist/public/assets/ManagedArtifactProperties-CjoGl0l0.js +1 -0
  25. package/dist/public/assets/ManagedArtifactProperties-DCjdPs0n.js +2 -0
  26. package/dist/public/assets/{McpConsentDialogBody-090py53F.js → McpConsentDialogBody-DA99wtGp.js} +1 -1
  27. package/dist/public/assets/{MermaidDocEditor-C_G_ovY8.js → MermaidDocEditor-Dp_Qn1m6.js} +1 -1
  28. package/dist/public/assets/{ReportBugDialogBody-5eJLreAy.js → ReportBugDialogBody-Bki9osi5.js} +1 -1
  29. package/dist/public/assets/{SchemaConfigEditor-DcJSH6Kd.js → SchemaConfigEditor-CChi4xg-.js} +1 -1
  30. package/dist/public/assets/{SessionsHost-17eNV0Wq.js → SessionsHost-BYagBT85.js} +2 -2
  31. package/dist/public/assets/{SettingsDialogBody-DYeGMO3E.js → SettingsDialogBody-BSVbksKQ.js} +3 -3
  32. package/dist/public/assets/{ShareBranchSwitchDialog-Dm4ZdzUl.js → ShareBranchSwitchDialog-ivZ2cgRA.js} +1 -1
  33. package/dist/public/assets/{ShareReceiveDialog-Cd240Jdo.js → ShareReceiveDialog-DkBZW0qn.js} +1 -1
  34. package/dist/public/assets/{ShareReceiveMissDialog--hmiMg2v.js → ShareReceiveMissDialog-B940MiRk.js} +1 -1
  35. package/dist/public/assets/{SkillEditBanner-DIJcGPhx.js → SkillEditBanner-rJ0nZb-T.js} +1 -1
  36. package/dist/public/assets/{SkillOriginInline-M3Vr6Vl3.js → SkillOriginInline-zcbeWUbe.js} +1 -1
  37. package/dist/public/assets/{SkillToolbarControls-CkezCxAG.js → SkillToolbarControls-CRB8aXBZ.js} +1 -1
  38. package/dist/public/assets/{SourceEditor-D3d3_XjY.js → SourceEditor-Cj7gcj84.js} +1 -1
  39. package/dist/public/assets/{TerminalPanel-DEwu_bZF.js → TerminalPanel-DmFqsT0t.js} +3 -3
  40. package/dist/public/assets/{TerminalWindowApp-CqNlVfBp.js → TerminalWindowApp-GrkDxDRa.js} +1 -1
  41. package/dist/public/assets/{TextDocEditor-4ayETwjy.js → TextDocEditor-4-R2R7Kv.js} +1 -1
  42. package/dist/public/assets/{ThreadView-DcNUIsnx.js → ThreadView-CO6b-1Gb.js} +1 -1
  43. package/dist/public/assets/{TimelineDiffPane-EP2JbHka.js → TimelineDiffPane-C-1Ait-P.js} +1 -1
  44. package/dist/public/assets/{agent-diff-store-NxhFZCYu.js → agent-diff-store-B5wc07Cu.js} +1 -1
  45. package/dist/public/assets/{agent-visibility-BVTKArCQ.js → agent-visibility-BLXHhBH0.js} +1 -1
  46. package/dist/public/assets/{auth-state-cache-DeOaKoC3.js → auth-state-cache-cqskisrf.js} +5 -5
  47. package/dist/public/assets/client-version-DldsUr3b.js +1 -0
  48. package/dist/public/assets/{comment-chips-qxdAVfqd.js → comment-chips-CmMeJM1H.js} +2 -2
  49. package/dist/public/assets/{config-provider-C5VnXykq.js → config-provider-CX41G-W_.js} +2 -2
  50. package/dist/public/assets/{dist-D8RKvolB2.js → dist-F3zr7p-B2.js} +51 -51
  51. package/dist/public/assets/{doc-paths-CBQZMJ5n.js → doc-paths-Du7H1Qdp.js} +1 -1
  52. package/dist/public/assets/{documents-events-CUD1Vtsd.js → documents-events-xt1DYT7P.js} +1 -1
  53. package/dist/public/assets/{file-tree-adapter-CRvIFP_w.js → file-tree-adapter-yXcdd-um.js} +1 -1
  54. package/dist/public/assets/{file-tree-utils-Bz8x8io4.js → file-tree-utils-DXLIH0T7.js} +1 -1
  55. package/dist/public/assets/{folder-config-api-DI42D8Ib.js → folder-config-api-CLSLIZAq.js} +1 -1
  56. package/dist/public/assets/{index-BHF-BkPA.js → index-DYVOPzZ-.js} +14 -14
  57. package/dist/public/assets/{lint-config-client-B3CFuMcz.js → lint-config-client-AdeE6KRn.js} +1 -1
  58. package/dist/public/assets/{markdownlint-rule-browser-taWXhAIu.js → markdownlint-rule-browser-DAMi0Yt_.js} +1 -1
  59. package/dist/public/assets/navigation-targets-CAJ5VD3i.js +1 -0
  60. package/dist/public/assets/{open-managed-artifact-tab-BJBa-17A.js → open-managed-artifact-tab-4rzIRzh9.js} +1 -1
  61. package/dist/public/assets/{pending-receive-nav-store-BZZR-nkd.js → pending-receive-nav-store-BpH6pl0A.js} +1 -1
  62. package/dist/public/assets/{prop-types-UV1Ku4nq.js → prop-types-CEMlW6lS.js} +1 -1
  63. package/dist/public/assets/{receive-store-CqvpoBpo.js → receive-store-Xy0fAFjI.js} +1 -1
  64. package/dist/public/assets/{selection-context-SAJ9lGhe.js → selection-context-DcW41cyL.js} +1 -1
  65. package/dist/public/assets/skill-actions-CrY_sys-.js +2 -0
  66. package/dist/public/assets/{skill-scope-CEk2zosm.js → skill-scope-juymWOGX.js} +1 -1
  67. package/dist/public/assets/{skills-api-DqNFNsgd.js → skills-api-C5-rQPxq.js} +1 -1
  68. package/dist/public/assets/{src-D2I-MNPe.js → src-DbmaHp5n.js} +1 -1
  69. package/dist/public/assets/{tag-pill-input-Dm-oHELs.js → tag-pill-input-oczqVWOZ.js} +1 -1
  70. package/dist/public/assets/{target-navigation-intent-D4NuVWIm.js → target-navigation-intent-CMkQitMi.js} +1 -1
  71. package/dist/public/assets/{terminal-launch-events-DPnh23jk.js → terminal-launch-events-Bo5VXhHl.js} +1 -1
  72. package/dist/public/assets/{terminal-telemetry-C0iAhsN9.js → terminal-telemetry-Bkt5Mcm1.js} +1 -1
  73. package/dist/public/assets/{typing-burst-detector-aQ1X_8Fj.js → typing-burst-detector-CkgjtxUY.js} +3 -3
  74. package/dist/public/assets/{uninstall-D3gX2hi1.js → uninstall-aVjP-H8X.js} +1 -1
  75. package/dist/public/assets/{use-activity-panel-CrUZg0eD.js → use-activity-panel-DERulSoR.js} +1 -1
  76. package/dist/public/assets/{use-apply-config-color-theme-CFZIZmfZ.js → use-apply-config-color-theme-wLo3FNBb.js} +2 -2
  77. package/dist/public/assets/{use-collab-url-DrWInPcY.js → use-collab-url-DlXoMwAG.js} +1 -1
  78. package/dist/public/assets/{use-live-xterm-theme-C7ahxcoU.js → use-live-xterm-theme-Bb1n3JUe.js} +1 -1
  79. package/dist/public/assets/{use-open-skill-BQedNtMG.js → use-open-skill-ByKgvyb3.js} +1 -1
  80. package/dist/public/assets/{use-settings-route-DHvE2hA4.js → use-settings-route-Vg54cEDB.js} +1 -1
  81. package/dist/public/assets/{use-skill-directory-CVAgFkVK.js → use-skill-directory-D23xKHEd.js} +1 -1
  82. package/dist/public/assets/{use-skills-LdaAjRrH.js → use-skills-BQ2imgoS.js} +1 -1
  83. package/dist/public/assets/{use-terminal-enabled-DwK_rPTk.js → use-terminal-enabled-BhS1a4V3.js} +1 -1
  84. package/dist/public/assets/{use-timeline-entry-diff-B5KnaOaD.js → use-timeline-entry-diff-Bzu540p0.js} +4 -4
  85. package/dist/public/assets/{use-workspace-Csf6sHD8.js → use-workspace-C9swsEoH.js} +1 -1
  86. package/dist/public/index.html +41 -41
  87. package/dist/public/uninstall.html +2 -2
  88. package/dist/{repair-launch-json-DZqGZNe1.mjs → repair-launch-json-DwkgTeOV.mjs} +2 -2
  89. package/dist/{repair-mcp-configs-DxrHIXaa.mjs → repair-mcp-configs-BJ56Rxx0.mjs} +2 -2
  90. package/dist/{src-BI2J7o5q.mjs → src-DF3639Eg.mjs} +2 -2
  91. package/dist/start-D5JNGTyb.mjs +1 -0
  92. package/dist/{start-CsoFcJw4.mjs → start-D5pHwOcL.mjs} +2 -2
  93. package/package.json +5 -5
  94. package/dist/constants-BfwnJrO6.mjs +0 -2
  95. package/dist/init-DkRUVy0u.mjs +0 -1
  96. package/dist/loader-Cu1PSU1a.mjs +0 -1
  97. package/dist/preview-CXHa4Isv.mjs +0 -1
  98. package/dist/public/assets/CodeMirrorPropInput-CRKAndsx.js +0 -3
  99. package/dist/public/assets/DocumentContext-COt_qsrp.js +0 -38
  100. package/dist/public/assets/FeedbackForm-CT893Lit.js +0 -1
  101. package/dist/public/assets/ManagedArtifactProperties-Bte_ppBh.js +0 -2
  102. package/dist/public/assets/ManagedArtifactProperties-TmTNhIv4.js +0 -1
  103. package/dist/public/assets/client-version-BhYZd6K_.js +0 -1
  104. package/dist/public/assets/navigation-targets-Cqw8JcW2.js +0 -1
  105. package/dist/public/assets/skill-actions-bjJCqQ6r.js +0 -2
  106. package/dist/start-Cgl1RMlt.mjs +0 -1
@@ -406,7 +406,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
406
406
  `).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of EX)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
407
407
  `),patterns:[...t],lineCount:n}}function OX(e){return DX(e).redacted}var kX=8192,AX=32768,jX=`…[truncated]`;function MX(e){let t=e.trim();if(t.length===0||t[0]!==`{`)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!=`object`||!n||Array.isArray(n))return null;let r=n;return{event:typeof r.event==`string`?r.event:void 0,fields:r}}function NX(e){return e.length<=8192?e:`${e.slice(0,kX-12)}${jX}`}function PX(e,t){return!(e.host===`desktop`&&t.host!==`desktop`||e.singleFileHidden&&t.singleFile||e.requiresTerminalLive&&!t.terminalLive||e.requiresCanExpandAll&&!t.canExpandAll||e.requiresCanCollapseAll&&!t.canCollapseAll||e.requiresActiveDoc&&!t.hasActiveDoc||e.requiresInstallSkill&&!t.showInstallSkill||e.requiresTargetKinds&&!e.requiresTargetKinds.includes(t.activeTargetKind))}var FX=[{id:`navigate-back`,menuActionId:`navigate-back`,labelKey:`back`,keywords:[`previous history`],shortcutId:`navigate-back`,shortcutDesktopOnly:!0,availability:{host:`desktop`},palette:{group:`commands`,visibility:`search-only`},menu:[{section:`view-history`,order:0,platform:`mac`,accelerator:`Cmd+[`},{section:`view-history`,order:0,platform:`other`,accelerator:`Alt+Left`}]},{id:`navigate-forward`,menuActionId:`navigate-forward`,labelKey:`forward`,keywords:[`next history`],shortcutId:`navigate-forward`,shortcutDesktopOnly:!0,availability:{host:`desktop`},palette:{group:`commands`,visibility:`search-only`},menu:[{section:`view-history`,order:1,platform:`mac`,accelerator:`Cmd+]`},{section:`view-history`,order:1,platform:`other`,accelerator:`Alt+Right`}]},{id:`new-file`,menuActionId:`new-doc`,labelKey:`newFile`,keywords:[`create file`],shortcutId:`new-item`,availability:{},palette:{group:`commands`,visibility:`always`},menu:[{section:`file-create`,order:0,accelerator:`CmdOrCtrl+N`}]},{id:`new-folder`,menuActionId:`new-folder`,labelKey:`newFolder`,keywords:[`create folder`],shortcutId:`new-folder`,shortcutDesktopOnly:!0,availability:{},palette:{group:`commands`,visibility:`always`},menu:[{section:`file-create`,order:1,accelerator:`CmdOrCtrl+Shift+N`}]},{id:`open-graph`,labelKey:`openGraph`,keywords:[`graph panel network`],availability:{requiresActiveDoc:!0},palette:{group:`commands`,visibility:`always`}},{id:`initialize-starter-pack`,labelKey:`initializeStarterPack`,keywords:[`scaffold`,`seed`,`pack`,`starter`],availability:{},palette:{group:`commands`,visibility:`always`}},{id:`new-skill`,labelKey:`newSkill`,keywords:[`skill`,`create`,`author`,`new`],availability:{singleFileHidden:!0},palette:{group:`commands`,visibility:`always`}},{id:`new-project`,menuActionId:`new-project`,labelKey:`newProject`,keywords:[`create new project scaffold`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:0,ellipsis:!0}]},{id:`open-folder`,labelKey:`openFolderOnDisk`,keywords:[`project`,`folder`,`disk`],shortcutId:`open-folder`,availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:2,accelerator:`CmdOrCtrl+O`,ellipsis:!0,menuLabelKey:`openFolder`}]},{id:`open-file`,labelKey:`openFileOnDisk`,keywords:[`file`,`markdown`,`single`,`standalone`,`temporary`],shortcutId:`open-file`,availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:3,accelerator:`CmdOrCtrl+Shift+O`,ellipsis:!0,menuLabelKey:`openFile`}]},{id:`open-skills`,labelKey:`openSkills`,keywords:[`skills marketplace explore import discover`],availability:{singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[]},{id:`switch-project`,labelKey:`switchProject`,keywords:[`switch project navigator projects`],shortcutId:`switch-project`,availability:{host:`desktop`,singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:1,accelerator:`CmdOrCtrl+Shift+P`,ellipsis:!0}]},{id:`settings`,labelKey:`settings`,keywords:[`preferences config`],shortcutId:`settings`,availability:{singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`app-settings`,order:0,platform:`mac`,accelerator:`CmdOrCtrl+,`,ellipsis:!0},{section:`file-settings`,order:0,platform:`other`,accelerator:`CmdOrCtrl+,`,ellipsis:!0}]},{id:`install-claude-desktop`,labelKey:`installClaudeDesktop`,keywords:[`claude desktop install cowork`],availability:{requiresInstallSkill:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`help-install`,order:0,ellipsis:!0,menuLabelText:`Install for Claude Chat & Cowork (desktop app)`}]},{id:`report-bug`,menuActionId:`report-bug`,labelKey:`reportBug`,keywords:[`bug report issue feedback problem`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`help-links`,order:1,ellipsis:!0}]},{id:`bug-report-history`,labelKey:`bugReportHistory`,keywords:[`bug report history previous reports past retry resend`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`}},{id:`send-feedback`,menuActionId:`send-feedback`,labelKey:`sendFeedback`,keywords:[`feedback`,`suggestion`,`idea`,`rate`,`survey`,`contact`],availability:{},palette:{group:`project`,visibility:`always`},menu:[{section:`help-links`,order:2,ellipsis:!0}]},{id:`new-from-template`,menuActionId:`new-from-template`,labelKey:`newFromTemplate`,keywords:[`template`,`create`,`new`],availability:{singleFileHidden:!0},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-create`,order:2,ellipsis:!0}]},{id:`rename`,menuActionId:`rename`,labelKey:`rename`,keywords:[`rename`,`file`,`folder`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:1}]},{id:`duplicate`,menuActionId:`duplicate`,labelKey:`duplicate`,keywords:[`duplicate`,`copy`,`file`,`folder`],shortcutId:`file-tree-duplicate`,availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:0,accelerator:`CmdOrCtrl+D`}]},{id:`move-to-trash`,menuActionId:`move-to-trash`,labelKey:`moveToTrash`,keywords:[`delete`,`trash`,`remove`],shortcutId:`file-tree-delete`,availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:2,accelerator:`CmdOrCtrl+Delete`}]},{id:`reveal-in-finder`,menuActionId:`reveal-in-finder`,labelKey:`revealInFinder`,keywords:[`finder`,`reveal`,`show`,`file`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-reveal`,order:0}]},{id:`send-to-ai`,menuActionId:`send-to-ai`,labelKey:`openWithAi`,keywords:[`ai`,`agent`,`handoff`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`project`]},menu:[{section:`file-reveal`,order:1}]},{id:`copy-full-path`,menuActionId:`copy-full-path`,labelKey:`copyFullPath`,keywords:[`copy`,`path`,`absolute`,`full`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-copy-path`,order:0,menuLabelKey:`fullPath`}]},{id:`copy-relative-path`,menuActionId:`copy-relative-path`,labelKey:`copyRelativePath`,keywords:[`copy`,`path`,`relative`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-copy-path`,order:1,menuLabelKey:`relativePath`}]},{id:`close-tab`,menuActionId:`close-active-tab-or-window`,labelKey:`closeTab`,keywords:[`close`,`tab`,`window`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-close`,order:0,platform:`mac`,accelerator:`CmdOrCtrl+W`}]},{id:`new-worktree`,menuActionId:`new-worktree`,labelKey:`newWorktree`,keywords:[`worktree`,`branch`,`new`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-worktree`,order:0,ellipsis:!0}]},{id:`switch-worktree`,menuActionId:`switch-worktree`,labelKey:`switchWorktree`,keywords:[`worktree`,`switch`,`branch`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-worktree`,order:1,ellipsis:!0}]},{id:`toggle-sidebar`,menuActionId:`toggle-sidebar`,labelKey:`sidebarHide`,keywords:[`sidebar`,`files`,`panel`,`toggle`],shortcutId:`toggle-files-sidebar`,stateToggle:{showKey:`sidebarShow`,hideKey:`sidebarHide`,stateField:`sidebarVisible`,defaultVisible:!0},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:0,accelerator:`CmdOrCtrl+Alt+S`}]},{id:`toggle-doc-panel`,menuActionId:`toggle-doc-panel`,labelKey:`docPanelHide`,keywords:[`document`,`panel`,`info`,`toggle`],shortcutId:`toggle-document-panel`,stateToggle:{showKey:`docPanelShow`,hideKey:`docPanelHide`,stateField:`docPanelVisible`,defaultVisible:!0},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:1,accelerator:`CmdOrCtrl+Alt+B`}]},{id:`toggle-terminal`,menuActionId:`toggle-terminal`,labelKey:`terminalShow`,keywords:[`terminal`,`shell`,`console`,`toggle`],shortcutId:`toggle-terminal-panel`,stateToggle:{showKey:`terminalShow`,hideKey:`terminalHide`,stateField:`terminalVisible`,defaultVisible:!1},availability:{host:`desktop`},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:2,accelerator:`CmdOrCtrl+J`}]},{id:`toggle-agent-panel`,menuActionId:`toggle-agent-panel`,labelKey:`agentPanelShow`,keywords:[`agent`,`agents`,`chat`,`ai`,`ask`,`panel`,`toggle`],shortcutId:`toggle-agent-panel`,stateToggle:{showKey:`agentPanelShow`,hideKey:`agentPanelHide`,stateField:`agentPanelVisible`,defaultVisible:!1},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:3,accelerator:`CmdOrCtrl+L`}]},{id:`toggle-show-hidden-files`,menuActionId:`toggle-show-hidden-files`,labelKey:`showHiddenFiles`,keywords:[`hidden`,`dotfiles`,`files`,`show`],checkField:`showHiddenFiles`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:0,accelerator:`CmdOrCtrl+Shift+.`,checkbox:!0}]},{id:`toggle-show-ok-folders`,menuActionId:`toggle-show-ok-folders`,labelKey:`showOkFolders`,keywords:[`ok`,`folders`,`hidden`,`show`],checkField:`showOkFolders`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:1,checkbox:!0}]},{id:`toggle-show-only-markdown-files`,menuActionId:`toggle-show-only-markdown-files`,labelKey:`showOnlyMarkdownFiles`,keywords:[`markdown`,`filter`,`files`,`only`],checkField:`showOnlyMarkdownFiles`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:2,checkbox:!0}]},{id:`toggle-show-skills-section`,menuActionId:`toggle-show-skills-section`,labelKey:`showSkillsSection`,keywords:[`skills`,`section`,`sidebar`,`show`],checkField:`showSkillsSection`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:3,checkbox:!0}]},{id:`expand-all-tree`,menuActionId:`expand-all-tree`,labelKey:`expandAll`,keywords:[`expand`,`tree`,`folders`,`all`],availability:{requiresCanExpandAll:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-tree`,order:0,smartHide:!0}]},{id:`collapse-all-tree`,menuActionId:`collapse-all-tree`,labelKey:`collapseAll`,keywords:[`collapse`,`tree`,`folders`,`all`],availability:{requiresCanCollapseAll:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-tree`,order:1,smartHide:!0}]},{id:`new-terminal`,menuActionId:`new-terminal`,labelKey:`newTerminal`,keywords:[`terminal`,`shell`,`new`,`tab`],availability:{host:`desktop`},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:0}]},{id:`new-terminal-window`,keywords:[],availability:{host:`desktop`},menu:[{section:`terminal`,order:1,menuLabelText:`New Terminal Window`}]},{id:`kill-terminal`,menuActionId:`kill-terminal`,labelKey:`killTerminal`,keywords:[`terminal`,`kill`,`close`,`session`],availability:{host:`desktop`,requiresTerminalLive:!0},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:2}]},{id:`check-for-updates`,labelKey:`checkForUpdates`,keywords:[`update`,`upgrade`,`version`,`check`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`app-updates`,order:0,platform:`mac`,ellipsis:!0},{section:`help-updates`,order:0,platform:`other`,ellipsis:!0}]},{id:`set-up-integrations`,labelKey:`setUpIntegrations`,keywords:[`integrations`,`mcp`,`setup`,`claude`,`configure`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`file-integrations`,order:0,ellipsis:!0}]},{id:`toggle-spell-check`,labelKey:`checkSpelling`,keywords:[`spell`,`spelling`,`check`,`typing`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`edit-spell`,order:0,checkbox:!0}]},{id:`open-github`,labelKey:`openOnGithub`,keywords:[`github`,`source`,`repository`,`code`],availability:{},palette:{group:`app`,visibility:`search-only`},menu:[{section:`help-links`,order:0}]},{id:`uninstall`,keywords:[],availability:{host:`desktop`},menu:[{section:`app-uninstall`,order:0,platform:`mac`,ellipsis:!0,menuLabelText:`Uninstall OpenKnowledge`}]}],IX=new Set([`*`,`_`,"`",`~`,`\\`]),LX=/^\]\([^)]*\)/,RX=512,zX=/^(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d{1,9}[.)][ \t]+)/,BX=32;function VX(e){return e===` `||e===` `||e===`
408
408
  `||e===`\r`||e===`\f`||e===`\v`}function HX(e,t){for(let n=t-1;n>=0;--n){let t=e[n];if(t===`
409
- `)return!0;if(t!==` `&&t!==` `)return!1}return!0}function UX(e,t){let n=e[t];return n===void 0?0:IX.has(n)||n===`[`?1:n===`]`?e[t+1]===`]`?2:LX.exec(e.slice(t,t+RX))?.[0].length??0:HX(e,t)?zX.exec(e.slice(t,t+BX))?.[0].length??0:0}function WX(e,t,{syntaxIn:n}){let r=[];if(t.length===0)return r;let i=n===`haystack`;for(let n=0;n<e.length;n+=1){let a=e[n];if(a===void 0||VX(a)||i&&UX(e,n)>0)continue;let o=n,s=0;for(;o<e.length&&s<t.length;){let n=e[o],r=t[s];if(n===r){o+=1,s+=1;continue}if(VX(r)){s+=1;continue}if(VX(n)){o+=1;continue}let a=i?UX(e,o):UX(t,s);if(a>0){i?o+=a:s+=a;continue}break}s===t.length&&r.push({start:n,end:o})}return r}var GX=`source`;function KX(e){return{ok:!1,error:e}}function qX(e){return{ok:!0,...e}}function JX(){return sf.parse({})}function YX(e,t){let n=e.toString();if(n.length===0)return JX();let r=Au(n);if(r.errors.length>0)return console.warn(`[bindConfigDoc:${t}] Y.Text contains invalid YAML; returning schema defaults. Errors: ${r.errors.map(e=>e.message).join(`; `)}`),JX();let i=r.toJSON()??{},a=sf.safeParse(i);return a.success?a.data:(console.warn(`[bindConfigDoc:${t}] Y.Text content fails schema validation; returning schema defaults. First issue: ${a.error.issues[0]?.message??`(unknown)`}`),JX())}function XX(e,t,n={}){return lf(`config.bind`,{"config.scope":t,"config.transport":`ytext`},()=>ZX(e,t,n))}function ZX(e,t,n){let{ytextKey:r=GX}=n,i=e.document,a=i.getText(r),o=new Set,s=new Set,c=!1,l=!1;function u(){if(c)return;let e=YX(a,t);for(let n of o)try{n(e)}catch(e){console.warn(`[bindConfigDoc:${t}] listener threw:`,e)}}function d(){if(c||(u(),l))return;l=!0;let e=[...s];s.clear();for(let n of e)try{n()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}a.observe(u),e.on(`synced`,d);function f(e){if(c)return KX({code:`WRITE_ERROR`,detail:`ConfigBinding (${t}) has been disposed`});let n=hf(e,t);if(n!==null)return KX(n);let r=Au(a.toString()),o=r.contents!==null&&!Qo(r.contents);if(r.errors.length>0||o){uf(`config.corrupt-ytext-reset`,{"config.scope":t,"config.parse.errorCount":r.errors.length,"config.parse.topLevelNonMap":o});let e=r.errors.length>0?r.errors.map(e=>e.message).join(`; `):`top-level YAML is not a mapping`;console.warn(`[bindConfigDoc:${t}] dropping corrupt Y.Text and re-applying patch onto empty doc. Reason: ${e}`),r=Au(``)}r.contents===null&&(r.contents=r.createNode({}));let s=_f(r,e),l=r.toJSON()??{},u=lf(`config.validate`,{"config.scope":t,"config.validation.layer":`L1`},e=>{let t=sf.safeParse(l);if(e.setAttribute(`config.outcome`,t.success?`success`:`rejected`),!t.success)for(let e of t.error.issues)uf(`config.validation.issue`,{"issue.path":e.path.map(e=>String(e)).join(`.`),"issue.message":e.message});return t});if(!u.success)return KX({code:`SCHEMA_INVALID`,issues:u.error.issues.map(vf)});let d=r.toString();return i.transact(()=>{a.length>0&&a.delete(0,a.length),a.insert(0,d)}),qX({effective:u.data,appliedPaths:s})}return{current(){return YX(a,t)},patch(e){return lf(`config.patch`,{"config.scope":t,"config.transport":`ytext`},t=>{let n=f(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})},subscribe(e){return o.add(e),()=>{o.delete(e)}},hasSynced(){return l},subscribeSynced(e){if(c)return()=>{};if(l){let n=!1;return queueMicrotask(()=>{if(!(n||c))try{e()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}),()=>{n=!0}}return s.add(e),()=>{s.delete(e)}},dispose(){c||(c=!0,a.unobserve(u),e.off(`synced`,d),o.clear(),s.clear())}}}var QX=`source`,$X=800;function eZ(e){return{ok:!1,error:e}}function tZ(e){return{ok:!0,...e}}function nZ(e,t={}){let{ytextKey:n=QX,acceptanceDelayMs:r=$X}=t,i=e.document,a=i.getText(n),o=new Set,s=new Set,c=new Set,l=!1,u=`idle`,d=null;function f(){d!==null&&(clearTimeout(d),d=null)}function p(e){if(!l&&u!==e){u=e;for(let t of c)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] status listener threw:`,e)}}}function m(){if(l)return;let e=a.toString();for(let t of o)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] text listener threw:`,e)}}function h(e){if(!l)for(let t of s)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] rejection listener threw:`,e)}}return a.observe(m),e.on(`synced`,m),{current(){return a.toString()},patch(e){return l?eZ({code:`WRITE_ERROR`,detail:`OkignoreBinding has been disposed`}):(i.transact(()=>{a.length>0&&a.delete(0,a.length),e.length>0&&a.insert(0,e)}),f(),p(`pending`),d=setTimeout(()=>{d=null,!l&&u===`pending`&&p(`accepted`)},r),tZ({text:e}))},subscribe(e){return o.add(e),()=>{o.delete(e)}},subscribeRejection(e){return s.add(e),()=>{s.delete(e)}},subscribeStatus(e){return c.add(e),()=>{c.delete(e)}},status(){return u},notifyRejection(e){l||(f(),p(`rejected`),h({error:e,text:a.toString()}))},dispose(){l||(l=!0,f(),a.unobserve(m),e.off(`synced`,m),o.clear(),s.clear(),c.clear())}}}function rZ(e,t,n){return iZ([e,t,n],[])}function iZ(e,t){if(t.length>0){let n=pf(sf,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=aZ(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>oZ(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=iZ(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function aZ(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function oZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var sZ=2e3;function cZ(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function lZ(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var uZ=`#fafafa`,dZ=`#171717`,fZ=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],pZ=[`.mdx`,`.md`],mZ=`epoch`,hZ=512*1024;function gZ(e,t=hZ){return typeof e==`number`&&Number.isFinite(e)&&e>t}var _Z={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function vZ(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(_Z))if(n.test(e))return t;return null}var yZ=[`incoming`,`outgoing`,`both`];function bZ(e){return yZ.includes(e)}var xZ=`open-knowledge`,SZ=`https://github.com/inkeep/open-knowledge`,CZ=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
409
+ `)return!0;if(t!==` `&&t!==` `)return!1}return!0}function UX(e,t){let n=e[t];return n===void 0?0:IX.has(n)||n===`[`?1:n===`]`?e[t+1]===`]`?2:LX.exec(e.slice(t,t+RX))?.[0].length??0:HX(e,t)?zX.exec(e.slice(t,t+BX))?.[0].length??0:0}function WX(e,t,{syntaxIn:n}){let r=[];if(t.length===0)return r;let i=n===`haystack`;for(let n=0;n<e.length;n+=1){let a=e[n];if(a===void 0||VX(a)||i&&UX(e,n)>0)continue;let o=n,s=0;for(;o<e.length&&s<t.length;){let n=e[o],r=t[s];if(n===r){o+=1,s+=1;continue}if(VX(r)){s+=1;continue}if(VX(n)){o+=1;continue}let a=i?UX(e,o):UX(t,s);if(a>0){i?o+=a:s+=a;continue}break}s===t.length&&r.push({start:n,end:o})}return r}var GX=`source`;function KX(e){return{ok:!1,error:e}}function qX(e){return{ok:!0,...e}}function JX(){return sf.parse({})}function YX(e,t){let n=e.toString();if(n.length===0)return JX();let r=Au(n);if(r.errors.length>0)return console.warn(`[bindConfigDoc:${t}] Y.Text contains invalid YAML; returning schema defaults. Errors: ${r.errors.map(e=>e.message).join(`; `)}`),JX();let i=r.toJSON()??{},a=sf.safeParse(i);return a.success?a.data:(console.warn(`[bindConfigDoc:${t}] Y.Text content fails schema validation; returning schema defaults. First issue: ${a.error.issues[0]?.message??`(unknown)`}`),JX())}function XX(e,t,n={}){return lf(`config.bind`,{"config.scope":t,"config.transport":`ytext`},()=>ZX(e,t,n))}function ZX(e,t,n){let{ytextKey:r=GX}=n,i=e.document,a=i.getText(r),o=new Set,s=new Set,c=!1,l=!1;function u(){if(c)return;let e=YX(a,t);for(let n of o)try{n(e)}catch(e){console.warn(`[bindConfigDoc:${t}] listener threw:`,e)}}function d(){if(c||(u(),l))return;l=!0;let e=[...s];s.clear();for(let n of e)try{n()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}a.observe(u),e.on(`synced`,d);function f(e){if(c)return KX({code:`WRITE_ERROR`,detail:`ConfigBinding (${t}) has been disposed`});let n=hf(e,t);if(n!==null)return KX(n);let r=Au(a.toString()),o=r.contents!==null&&!Qo(r.contents);if(r.errors.length>0||o){uf(`config.corrupt-ytext-reset`,{"config.scope":t,"config.parse.errorCount":r.errors.length,"config.parse.topLevelNonMap":o});let e=r.errors.length>0?r.errors.map(e=>e.message).join(`; `):`top-level YAML is not a mapping`;console.warn(`[bindConfigDoc:${t}] dropping corrupt Y.Text and re-applying patch onto empty doc. Reason: ${e}`),r=Au(``)}r.contents===null&&(r.contents=r.createNode({}));let s=_f(r,e),l=r.toJSON()??{},u=lf(`config.validate`,{"config.scope":t,"config.validation.layer":`L1`},e=>{let t=sf.safeParse(l);if(e.setAttribute(`config.outcome`,t.success?`success`:`rejected`),!t.success)for(let e of t.error.issues)uf(`config.validation.issue`,{"issue.path":e.path.map(e=>String(e)).join(`.`),"issue.message":e.message});return t});if(!u.success)return KX({code:`SCHEMA_INVALID`,issues:u.error.issues.map(vf)});let d=r.toString();return i.transact(()=>{a.length>0&&a.delete(0,a.length),a.insert(0,d)}),qX({effective:u.data,appliedPaths:s})}return{current(){return YX(a,t)},patch(e){return lf(`config.patch`,{"config.scope":t,"config.transport":`ytext`},t=>{let n=f(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})},subscribe(e){return o.add(e),()=>{o.delete(e)}},hasSynced(){return l},subscribeSynced(e){if(c)return()=>{};if(l){let n=!1;return queueMicrotask(()=>{if(!(n||c))try{e()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}),()=>{n=!0}}return s.add(e),()=>{s.delete(e)}},dispose(){c||(c=!0,a.unobserve(u),e.off(`synced`,d),o.clear(),s.clear())}}}var QX=`source`,$X=800;function eZ(e){return{ok:!1,error:e}}function tZ(e){return{ok:!0,...e}}function nZ(e,t={}){let{ytextKey:n=QX,acceptanceDelayMs:r=$X}=t,i=e.document,a=i.getText(n),o=new Set,s=new Set,c=new Set,l=!1,u=`idle`,d=null;function f(){d!==null&&(clearTimeout(d),d=null)}function p(e){if(!l&&u!==e){u=e;for(let t of c)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] status listener threw:`,e)}}}function m(){if(l)return;let e=a.toString();for(let t of o)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] text listener threw:`,e)}}function h(e){if(!l)for(let t of s)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] rejection listener threw:`,e)}}return a.observe(m),e.on(`synced`,m),{current(){return a.toString()},patch(e){return l?eZ({code:`WRITE_ERROR`,detail:`OkignoreBinding has been disposed`}):(i.transact(()=>{a.length>0&&a.delete(0,a.length),e.length>0&&a.insert(0,e)}),f(),p(`pending`),d=setTimeout(()=>{d=null,!l&&u===`pending`&&p(`accepted`)},r),tZ({text:e}))},subscribe(e){return o.add(e),()=>{o.delete(e)}},subscribeRejection(e){return s.add(e),()=>{s.delete(e)}},subscribeStatus(e){return c.add(e),()=>{c.delete(e)}},status(){return u},notifyRejection(e){l||(f(),p(`rejected`),h({error:e,text:a.toString()}))},dispose(){l||(l=!0,f(),a.unobserve(m),e.off(`synced`,m),o.clear(),s.clear(),c.clear())}}}function rZ(e,t,n){return iZ([e,t,n],[])}function iZ(e,t){if(t.length>0){let n=pf(sf,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=aZ(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>oZ(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=iZ(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function aZ(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function oZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var sZ=2e3;function cZ(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function lZ(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var uZ=`#fafafa`,dZ=`#171717`,fZ=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],pZ=[`.mdx`,`.md`],mZ=`epoch`,hZ=512*1024;function gZ(e,t=hZ){return typeof e==`number`&&Number.isFinite(e)&&e>t}var _Z=10*1024*1024,vZ={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function yZ(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(vZ))if(n.test(e))return t;return null}var bZ=[`incoming`,`outgoing`,`both`];function xZ(e){return bZ.includes(e)}var SZ=`open-knowledge`,CZ=`https://github.com/inkeep/open-knowledge`,wZ=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
410
410
  <h3 style="margin:0 0 14px;font-size:15px;font-weight:600">Revenue by region</h3>
411
411
  <div id="bars" style="display:flex;align-items:flex-end;gap:14px;height:170px"></div>
412
412
  <script>
@@ -468,61 +468,61 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
468
468
  out.textContent = '$' + Number(amt.value).toLocaleString();
469
469
  });
470
470
  <\/script>
471
- </div>`}],wZ=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],TZ=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]),EZ=1e4;new Set(TZ.map(e=>e.value));var DZ=IT.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceUnclosedFence:{default:!1,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),OZ=YT.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[sT({find:WT,type:this.type,getAttributes:{sourceDelimiter:`*`}}),sT({find:KT,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),kZ=UT.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[sT({find:RT,type:this.type,getAttributes:{sourceDelimiter:`**`}}),sT({find:BT,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),AZ=Iw.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),jZ=kT.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}});function MZ(e){let t=0;for(let n of e){let e=Number.parseInt(n,10);!Number.isNaN(e)&&e>t&&(t=e)}return String(t+1)}function NZ(e){let t=[];return e.descendants(e=>(e.type.name===`footnoteDefinition`&&t.push(String(e.attrs.identifier??``)),!0)),t}function PZ(e){let t=null;return e.forEach((e,n)=>{e.type.name===`footnoteDefinition`&&(t=n+e.nodeSize)}),t??e.content.size}var FZ=kT.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),IZ=ZT.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),LZ=$T.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),RZ=kT.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function zZ(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var BZ=tE.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=bC(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=zZ(t.src)),[`img`,t]}}),VZ=kT.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),HZ=kT.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),UZ=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],WZ=UZ.map(e=>`${e}:`).join(`|`),GZ=RegExp(`^(?:${WZ}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function KZ(e){let t=e.trim();return t===``?!0:GZ.test(t)}function qZ(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var JZ=new Set(UZ.map(e=>`${e}:`)),YZ=`https://placeholder.invalid`;function XZ(e){try{let t=new URL(e,YZ);return JZ.has(t.protocol.toLowerCase())}catch{return!1}}var ZZ=_O.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:XZ,validate:XZ,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),QZ=kT.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function $Z(e){return e.type.name===`list`&&!e.attrs.ordered}function eQ(e){return e.type.name===`list`&&!!e.attrs.ordered}function tQ(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function nQ(e,t,n,r,i,a,o){let s=uC(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?D_(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return w_(n,a)(e,void 0)?t?w_(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var rQ=kT.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,bC(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:nQ(e,t,n,r,e=>$Z(e)&&!tQ(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:nQ(e,t,n,r,e=>eQ(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:nQ(e,t,n,r,e=>$Z(e)&&tQ(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[uT({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),uT({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new Ow({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Xh(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),iQ=kT.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,bC(t),0]:[`li`,bC(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(bC(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),aQ=rQ,oQ=iQ,sQ=kT.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),cQ=kT.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),lQ=dne.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),uQ=mne.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),dQ=kT.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),fQ=Iw.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),pQ=Gw.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),mQ=kT.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function hQ(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function gQ(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function _Q(e){let{selection:t}=e;return t instanceof K?t.$cursor:null}function vQ(e){let t=_Q(e);if(!t||t.parentOffset!==0)return!1;let n=hQ(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:gQ(t.node(n-1).child(r-1))}function yQ(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function bQ(e){let t=_Q(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=hQ(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=yQ(t,n);return r!==null&&r<n}var xQ=Gw.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!vQ(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return Wg(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!bQ(e.state))return!1;let{state:t,view:n}=e;return Gg(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),SQ=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function CQ(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function wQ(e){let t=CQ(e);return t!==null&&SQ.has(t)}function TQ(e){let t=CQ(e);return t===null?null:SQ.get(t)??null}var EQ=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function DQ(e){EQ.lastIndex=0;let t=e.match(EQ);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=TQ(e);if(t===null)return null;n+=t}return n}var OQ=Iw.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function kQ(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||AQ(n)===r?!0:DQ(e)===t}function AQ(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var jQ=jne.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),MQ=tA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),NQ=Jk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),PQ=Yk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),FQ=kT.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),IQ=/^(?:---|—-|___\s|\*\*\*\s)$/;function LQ(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var RQ=gne.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[cT({find:IQ,type:this.type,getAttributes:e=>({sourceRaw:LQ(e)})})]}}),zQ=Nne.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}}),BQ=/^\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/;function VQ(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function HQ(e){let t=e.match(BQ);if(!t)return null;let n=t[1]?.trim()??``;return n?{type:`wikilink`,raw:t[0],target:n,anchor:VQ(t[2]),alias:VQ(t[3])}:null}function UQ(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var WQ=kT.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:VQ(e.getAttribute(`data-alias`)),anchor:VQ(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:VQ(e.getAttribute(`data-alias`)),anchor:VQ(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=VQ(e.attrs.alias),i=VQ(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},UQ({target:n,alias:r,anchor:i})]}});function GQ(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function KQ(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var qQ=kT.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:VQ(e.getAttribute(`data-alias`)),anchor:VQ(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=VQ(e.attrs.alias),i=VQ(e.attrs.anchor),a=VQ(e.attrs.resolvedSrc),o=GQ(n);if(rd.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},KQ({target:n,alias:r,anchor:i})]}}),JQ=[VZ,cQ,HZ,sQ,WQ,qQ,FQ,aQ,oQ,OZ,kZ,jQ,zQ,uQ,DZ,lQ,LZ,RQ,ZZ,RZ,QZ,IZ,AZ,pQ,OQ,lj.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,underline:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),xQ,MQ.configure({resizable:!0}),Xk,PQ,NQ,BZ.configure({inline:!0}),mQ,bO,fQ,dQ,FZ,jZ];function YQ(e){let t=e.indexOf(`/`);return t===-1?e:e.slice(t+1)}function XQ(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function ZQ(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function QQ(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function $Q(e){let t=encodeURIComponent(QQ(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}function e$(e){return`'${e.replace(/'/g,`'\\''`)}'`}var t$=[`mcp__${xZ}`,`Bash(ok open:*)`],n$=[`delete`,`move`,`share_link`,`install`,`import`].map(e=>`mcp__${xZ}__${e}`),Wne=`-c ${e$(`mcp_servers.${xZ}.default_tools_approval_mode="approve"`)}`;function r$(e){let t={};return e.mcpPreApprove===!0&&(t.enabledMcpjsonServers=[xZ]),e.autoApproveOkTools===!0&&(t.permissions={allow:[...t$],deny:[...n$]}),t.enabledMcpjsonServers===void 0&&t.permissions===void 0?``:`--settings ${e$(JSON.stringify(t))}`}var i$=`\x1B`,a$=`${i$}[200~`,o$=`${i$}[201~`,s$={claude:{bin:`claude`,displayName:`Claude`,docsUrl:`https://docs.claude.com/en/docs/claude-code`,handoffTarget:`claude-code`},codex:{bin:`codex`,displayName:`Codex`,docsUrl:`https://developers.openai.com/codex/cli`,handoffTarget:`codex`,autoApproveArg:Wne},copilot:{bin:`copilot`,displayName:`GitHub Copilot`,docsUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,handoffTarget:`copilot`,promptFlag:`--interactive`},cursor:{bin:`cursor-agent`,displayName:`Cursor`,docsUrl:`https://cursor.com/docs/cli/overview`,handoffTarget:`cursor`},opencode:{bin:`opencode`,displayName:`OpenCode`,docsUrl:`https://opencode.ai/docs`,handoffTarget:`opencode`,promptFlag:`--prompt`},pi:{bin:`pi`,displayName:`Pi`,docsUrl:`https://pi.dev`,handoffTarget:`pi`},antigravity:{bin:`agy`,displayName:`Antigravity`,docsUrl:`https://antigravity.google/docs/cli-getting-started`,handoffTarget:`antigravity`,promptFlag:`--prompt-interactive`},openclaw:{bin:`openclaw`,subcommand:`chat`,displayName:`OpenClaw`,docsUrl:`https://docs.openclaw.ai/cli/tui`,handoffTarget:`openclaw`,promptFlag:`--message`},hermes:{bin:`hermes`,subcommand:`chat`,displayName:`Hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/user-guide/cli`,handoffTarget:`hermes`,startupInjection:{submit:`\r`,readyMarker:`\x1B[?2004h`,settleMs:300,capMs:4e3}}},c$=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];function l$(e,t,n={}){let r=s$[e],i=e===`claude`?r$(n):n.autoApproveOkTools===!0&&r.autoApproveArg?r.autoApproveArg:``,a=i?`${i} `:``,o=r.subcommand?`${r.subcommand} `:``;if(r.startupInjection!=null||t==null||t.length===0)return`${r.bin} ${o}${a}`.trimEnd();let s=r.promptFlag?`${r.promptFlag} `:``;return`${r.bin} ${o}${a}${s}${e$(t)}`}function u$(e){return s$[e].startupInjection}function d$(e,t){let n=u$(e);return n==null||t==null||t.length===0?null:`${a$}${t.replaceAll(i$,``)}${o$}${n.submit}`}var f$=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`),p$=RegExp("[ \\u00a0\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function m$(e){return e.replace(f$,`_`)}function h$(e){return e.replace(p$,`_`)}var g$="This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`.";function _$(e){return`${g$} ${e}`}var v$=`You're running in the terminal of the OpenKnowledge desktop app.`,y$=`You're an agent working inside OpenKnowledge, with its MCP tools available to you.`;function b$(e){return`${y$} ${g$} ${e===null?`Then stop.`:`Read \`${m$(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function x$(e){return`${v$} ${g$} ${e===null?`Then stop.`:`Read \`${m$(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function S$(e,t,n,r=`url`){let i=`Let's work on \`${m$(e)}\` using OpenKnowledge.`;return G$(t?`${i} Open the OK editor in web view.`:i,n,r)}function C$(e,t,n){let r=`Use your open-knowledge-write-skill skill to author the ${t} Open Knowledge skill \`${m$(e)}\`. Edit it with the Open Knowledge tools.`;return n?`${r} Open the OK editor in web view.`:r}function w$(e,t,n,r=`url`){let i=`Let's work on the \`${m$(e)}\` folder using OpenKnowledge.`;return G$(t?`${i} Open the OK editor in web view.`:i,n,r)}function T$(e,t,n=`url`){let r=`Let's work on this project using OpenKnowledge.`;return G$(e?`${r} Open the OK editor in web view.`:r,t,n)}function E$(e,t,n,r,i=`url`){let a=t?`Open the OK editor in web view.`:``,o=e=>a===``?e:e.includes(`
471
+ </div>`}],TZ=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],EZ=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]),DZ=1e4;new Set(EZ.map(e=>e.value));var OZ=IT.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceUnclosedFence:{default:!1,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),kZ=YT.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[sT({find:WT,type:this.type,getAttributes:{sourceDelimiter:`*`}}),sT({find:KT,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),AZ=UT.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[sT({find:RT,type:this.type,getAttributes:{sourceDelimiter:`**`}}),sT({find:BT,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),jZ=Iw.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),MZ=kT.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}});function NZ(e){let t=0;for(let n of e){let e=Number.parseInt(n,10);!Number.isNaN(e)&&e>t&&(t=e)}return String(t+1)}function PZ(e){let t=[];return e.descendants(e=>(e.type.name===`footnoteDefinition`&&t.push(String(e.attrs.identifier??``)),!0)),t}function FZ(e){let t=null;return e.forEach((e,n)=>{e.type.name===`footnoteDefinition`&&(t=n+e.nodeSize)}),t??e.content.size}var IZ=kT.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),LZ=ZT.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),RZ=$T.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),zZ=kT.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function BZ(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var VZ=tE.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=bC(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=BZ(t.src)),[`img`,t]}}),HZ=kT.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),UZ=kT.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),WZ=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],GZ=WZ.map(e=>`${e}:`).join(`|`),KZ=RegExp(`^(?:${GZ}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function qZ(e){let t=e.trim();return t===``?!0:KZ.test(t)}function JZ(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var YZ=new Set(WZ.map(e=>`${e}:`)),XZ=`https://placeholder.invalid`;function ZZ(e){try{let t=new URL(e,XZ);return YZ.has(t.protocol.toLowerCase())}catch{return!1}}var QZ=_O.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:ZZ,validate:ZZ,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),$Z=kT.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function eQ(e){return e.type.name===`list`&&!e.attrs.ordered}function tQ(e){return e.type.name===`list`&&!!e.attrs.ordered}function nQ(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function rQ(e,t,n,r,i,a,o){let s=uC(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?D_(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return w_(n,a)(e,void 0)?t?w_(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var iQ=kT.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,bC(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:rQ(e,t,n,r,e=>eQ(e)&&!nQ(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:rQ(e,t,n,r,e=>tQ(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:rQ(e,t,n,r,e=>eQ(e)&&nQ(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[uT({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),uT({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new Ow({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Xh(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),aQ=kT.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,bC(t),0]:[`li`,bC(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(bC(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),oQ=iQ,sQ=aQ,cQ=kT.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),lQ=kT.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),uQ=dne.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),dQ=mne.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),fQ=kT.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),pQ=Iw.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),mQ=Gw.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),hQ=kT.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function gQ(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function _Q(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function vQ(e){let{selection:t}=e;return t instanceof K?t.$cursor:null}function yQ(e){let t=vQ(e);if(!t||t.parentOffset!==0)return!1;let n=gQ(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:_Q(t.node(n-1).child(r-1))}function bQ(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function xQ(e){let t=vQ(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=gQ(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=bQ(t,n);return r!==null&&r<n}var SQ=Gw.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!yQ(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return Wg(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!xQ(e.state))return!1;let{state:t,view:n}=e;return Gg(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),CQ=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function wQ(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function TQ(e){let t=wQ(e);return t!==null&&CQ.has(t)}function EQ(e){let t=wQ(e);return t===null?null:CQ.get(t)??null}var DQ=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function OQ(e){DQ.lastIndex=0;let t=e.match(DQ);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=EQ(e);if(t===null)return null;n+=t}return n}var kQ=Iw.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function AQ(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||jQ(n)===r?!0:OQ(e)===t}function jQ(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var MQ=jne.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),NQ=tA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),PQ=Jk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),FQ=Yk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),IQ=kT.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),LQ=/^(?:---|—-|___\s|\*\*\*\s)$/;function RQ(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var zQ=gne.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[cT({find:LQ,type:this.type,getAttributes:e=>({sourceRaw:RQ(e)})})]}}),BQ=Nne.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}}),VQ=/^\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/;function HQ(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function UQ(e){let t=e.match(VQ);if(!t)return null;let n=t[1]?.trim()??``;return n?{type:`wikilink`,raw:t[0],target:n,anchor:HQ(t[2]),alias:HQ(t[3])}:null}function WQ(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var GQ=kT.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:HQ(e.getAttribute(`data-alias`)),anchor:HQ(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:HQ(e.getAttribute(`data-alias`)),anchor:HQ(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=HQ(e.attrs.alias),i=HQ(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},WQ({target:n,alias:r,anchor:i})]}});function KQ(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function qQ(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var JQ=kT.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:HQ(e.getAttribute(`data-alias`)),anchor:HQ(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=HQ(e.attrs.alias),i=HQ(e.attrs.anchor),a=HQ(e.attrs.resolvedSrc),o=KQ(n);if(rd.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},qQ({target:n,alias:r,anchor:i})]}}),YQ=[HZ,lQ,UZ,cQ,GQ,JQ,IQ,oQ,sQ,kZ,AZ,MQ,BQ,dQ,OZ,uQ,RZ,zQ,QZ,zZ,$Z,LZ,jZ,mQ,kQ,lj.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,underline:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),SQ,NQ.configure({resizable:!0}),Xk,FQ,PQ,VZ.configure({inline:!0}),hQ,bO,pQ,fQ,IZ,MZ];function XQ(e){let t=e.indexOf(`/`);return t===-1?e:e.slice(t+1)}function ZQ(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function QQ(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function $Q(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function e$(e){let t=encodeURIComponent($Q(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}function t$(e){return`'${e.replace(/'/g,`'\\''`)}'`}var n$=[`mcp__${SZ}`,`Bash(ok open:*)`],Wne=[`delete`,`move`,`share_link`,`install`,`import`].map(e=>`mcp__${SZ}__${e}`),r$=`-c ${t$(`mcp_servers.${SZ}.default_tools_approval_mode="approve"`)}`;function i$(e){let t={};return e.mcpPreApprove===!0&&(t.enabledMcpjsonServers=[SZ]),e.autoApproveOkTools===!0&&(t.permissions={allow:[...n$],deny:[...Wne]}),t.enabledMcpjsonServers===void 0&&t.permissions===void 0?``:`--settings ${t$(JSON.stringify(t))}`}var a$=`\x1B`,o$=`${a$}[200~`,s$=`${a$}[201~`,c$={claude:{bin:`claude`,displayName:`Claude`,docsUrl:`https://docs.claude.com/en/docs/claude-code`,handoffTarget:`claude-code`},codex:{bin:`codex`,displayName:`Codex`,docsUrl:`https://developers.openai.com/codex/cli`,handoffTarget:`codex`,autoApproveArg:r$},copilot:{bin:`copilot`,displayName:`GitHub Copilot`,docsUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,handoffTarget:`copilot`,promptFlag:`--interactive`},cursor:{bin:`cursor-agent`,displayName:`Cursor`,docsUrl:`https://cursor.com/docs/cli/overview`,handoffTarget:`cursor`},opencode:{bin:`opencode`,displayName:`OpenCode`,docsUrl:`https://opencode.ai/docs`,handoffTarget:`opencode`,promptFlag:`--prompt`},pi:{bin:`pi`,displayName:`Pi`,docsUrl:`https://pi.dev`,handoffTarget:`pi`},antigravity:{bin:`agy`,displayName:`Antigravity`,docsUrl:`https://antigravity.google/docs/cli-getting-started`,handoffTarget:`antigravity`,promptFlag:`--prompt-interactive`},openclaw:{bin:`openclaw`,subcommand:`chat`,displayName:`OpenClaw`,docsUrl:`https://docs.openclaw.ai/cli/tui`,handoffTarget:`openclaw`,promptFlag:`--message`},hermes:{bin:`hermes`,subcommand:`chat`,displayName:`Hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/user-guide/cli`,handoffTarget:`hermes`,startupInjection:{submit:`\r`,readyMarker:`\x1B[?2004h`,settleMs:300,capMs:4e3}}},l$=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];function u$(e,t,n={}){let r=c$[e],i=e===`claude`?i$(n):n.autoApproveOkTools===!0&&r.autoApproveArg?r.autoApproveArg:``,a=i?`${i} `:``,o=r.subcommand?`${r.subcommand} `:``;if(r.startupInjection!=null||t==null||t.length===0)return`${r.bin} ${o}${a}`.trimEnd();let s=r.promptFlag?`${r.promptFlag} `:``;return`${r.bin} ${o}${a}${s}${t$(t)}`}function d$(e){return c$[e].startupInjection}function f$(e,t){let n=d$(e);return n==null||t==null||t.length===0?null:`${o$}${t.replaceAll(a$,``)}${s$}${n.submit}`}var p$=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`),m$=RegExp("[ \\u00a0\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function h$(e){return e.replace(p$,`_`)}function g$(e){return e.replace(m$,`_`)}var _$="This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`.";function v$(e){return`${_$} ${e}`}var y$=`You're running in the terminal of the OpenKnowledge desktop app.`,b$=`You're an agent working inside OpenKnowledge, with its MCP tools available to you.`;function x$(e){return`${b$} ${_$} ${e===null?`Then stop.`:`Read \`${h$(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function S$(e){return`${y$} ${_$} ${e===null?`Then stop.`:`Read \`${h$(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function C$(e,t,n,r=`url`){let i=`Let's work on \`${h$(e)}\` using OpenKnowledge.`;return K$(t?`${i} Open the OK editor in web view.`:i,n,r)}function w$(e,t,n){let r=`Use your open-knowledge-write-skill skill to author the ${t} Open Knowledge skill \`${h$(e)}\`. Edit it with the Open Knowledge tools.`;return n?`${r} Open the OK editor in web view.`:r}function T$(e,t,n,r=`url`){let i=`Let's work on the \`${h$(e)}\` folder using OpenKnowledge.`;return K$(t?`${i} Open the OK editor in web view.`:i,n,r)}function E$(e,t,n=`url`){let r=`Let's work on this project using OpenKnowledge.`;return K$(e?`${r} Open the OK editor in web view.`:r,t,n)}function D$(e,t,n,r,i=`url`){let a=t?`Open the OK editor in web view.`:``,o=e=>a===``?e:e.includes(`
472
472
  `)?[e,``,a].join(`
473
473
  `):`${e} ${a}`,s=e=>e.split(`
474
474
  `).map(e=>`> ${e}`).join(`
475
- `),c=r1(r),l=e=>{let t=e.trim();if(n===`existing-repo`){let e=t===``?`Let's work on this project using OpenKnowledge.`:[`Here's what I'd like to do in this OpenKnowledge project:`,``,s(t)].join(`
475
+ `),c=i1(r),l=e=>{let t=e.trim();if(n===`existing-repo`){let e=t===``?`Let's work on this project using OpenKnowledge.`:[`Here's what I'd like to do in this OpenKnowledge project:`,``,s(t)].join(`
476
476
  `);return o(c===``?e:[e,``,c].join(`
477
477
  `))}if(n===`skill`){let e=`Use your open-knowledge-write-skill skill to author it with the Open Knowledge tools.`;return o(t===``?c===``?`Let's create a new Open Knowledge skill. ${e}`:[`Let's create a new Open Knowledge skill. ${e}`,``,c].join(`
478
478
  `):[`I want to create a new Open Knowledge skill. Here's what it should do:`,``,s(t),...c===``?[]:[``,c],``,e].join(`
479
479
  `))}let r=`Scaffold the folders, templates, and AI-readable rules to match, using OpenKnowledge.`;return o(t===``?c===``?`Let's set up a new OpenKnowledge project. ${r}`:[`Let's set up a new OpenKnowledge project. ${r}`,``,c].join(`
480
480
  `):[`I'm setting up a new OpenKnowledge project. Here's what I want to create:`,``,s(t),...c===``?[]:[``,c],``,r].join(`
481
- `))};return l(U$(l,e.trim(),`cursor`,i,O$))}var D$=3072,O$=D$-z$(`${g$} `,`cursor`),k$=100*1024-1024,A$=new TextEncoder;function j$(e,t,n){return n===`terminal`?A$.encode(e$(e)).length:z$(e,t)}function M$(e,t){return e===`terminal`?k$:t}var N$=160,P$=3,F$=` …`;function I$(e){let t=0,n=0;for(let r of e)r==="`"?(n+=1,n>t&&(t=n)):n=0;return t}function L$(e){return"`".repeat(Math.max(I$(e)+1,P$))}function R$(e){let t=e.trimStart(),n=t.indexOf(`
482
- `),r=n===-1?t:t.slice(0,n);return Array.from(r).slice(0,N$).join(``).trimEnd()}function z$(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function B$(e){return`Let's work on the selected passage in @${e} using OpenKnowledge.`}function V$(e){let t=e.trim();return t===``?[]:[`Instruction:`,``,t.split(`
481
+ `))};return l(W$(l,e.trim(),`cursor`,i,k$))}var O$=3072,k$=O$-B$(`${_$} `,`cursor`),A$=100*1024-1024,j$=new TextEncoder;function M$(e,t,n){return n===`terminal`?j$.encode(t$(e)).length:B$(e,t)}function N$(e,t){return e===`terminal`?A$:t}var P$=160,F$=3,I$=` …`;function L$(e){let t=0,n=0;for(let r of e)r==="`"?(n+=1,n>t&&(t=n)):n=0;return t}function R$(e){return"`".repeat(Math.max(L$(e)+1,F$))}function z$(e){let t=e.trimStart(),n=t.indexOf(`
482
+ `),r=n===-1?t:t.slice(0,n);return Array.from(r).slice(0,P$).join(``).trimEnd()}function B$(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function V$(e){return`Let's work on the selected passage in @${e} using OpenKnowledge.`}function H$(e){let t=e.trim();return t===``?[]:[`Instruction:`,``,t.split(`
483
483
  `).map(e=>`> ${e}`).join(`
484
- `),``]}function H$(e,t){let n=V$(t);return n.length===0?e:[e,``,...n].join(`
485
- `).trimEnd()}function U$(e,t,n,r=`url`,i=D$){let a=M$(r,i),o=t=>j$(e(t),n,r)<=a;if(o(t))return t;let s=Array.from(t),c=0,l=s.length;for(;c<l;){let e=Math.ceil((c+l)/2);o(s.slice(0,e).join(``).trimEnd()+F$)?c=e:l=e-1}let u=s.slice(0,c).join(``).trimEnd();return u===``?``:u+F$}function W$(e,t,n){return U$(t=>H$(e,t),t,`cursor`,n,O$)}function G$(e,t,n){return H$(e,W$(e,t??``,n))}function K$(e,t,n){let r=L$(n);return[B$(e),``,...V$(t),`Here is the passage:`,``,r,n,r].join(`
486
- `)}function q$(e,t,n){let r=R$(n),i=L$(r);return[B$(e),``,...V$(t),`The passage begins:`,``,i,r,i,``,`Read the full passage from @${e} via the OpenKnowledge MCP server before editing.`].join(`
487
- `)}function J$(e,t,n,r=`url`){return U$(n,e,t,r)}function Y$(e){let t=h$(e.relativePath),n=e.transport??`url`,r=K$(t,e.instruction,e.selectionMarkdown);return j$(r,e.target,n)<=M$(n,D$)?r:q$(t,J$(e.instruction,e.target,n=>q$(t,n,e.selectionMarkdown),n),e.selectionMarkdown)}function X$(e,t,n){let r=`Let's work on @${e} using OpenKnowledge.`,i=n?`Open the OK editor in web view.`:``,a=t.trim();if(a===``)return i===``?r:`${r} ${i}`;let o=[r,``,a.split(`
484
+ `),``]}function U$(e,t){let n=H$(t);return n.length===0?e:[e,``,...n].join(`
485
+ `).trimEnd()}function W$(e,t,n,r=`url`,i=O$){let a=N$(r,i),o=t=>M$(e(t),n,r)<=a;if(o(t))return t;let s=Array.from(t),c=0,l=s.length;for(;c<l;){let e=Math.ceil((c+l)/2);o(s.slice(0,e).join(``).trimEnd()+I$)?c=e:l=e-1}let u=s.slice(0,c).join(``).trimEnd();return u===``?``:u+I$}function G$(e,t,n){return W$(t=>U$(e,t),t,`cursor`,n,k$)}function K$(e,t,n){return U$(e,G$(e,t??``,n))}function q$(e,t,n){let r=R$(n);return[V$(e),``,...H$(t),`Here is the passage:`,``,r,n,r].join(`
486
+ `)}function J$(e,t,n){let r=z$(n),i=R$(r);return[V$(e),``,...H$(t),`The passage begins:`,``,i,r,i,``,`Read the full passage from @${e} via the OpenKnowledge MCP server before editing.`].join(`
487
+ `)}function Y$(e,t,n,r=`url`){return W$(n,e,t,r)}function X$(e){let t=g$(e.relativePath),n=e.transport??`url`,r=q$(t,e.instruction,e.selectionMarkdown);return M$(r,e.target,n)<=N$(n,O$)?r:J$(t,Y$(e.instruction,e.target,n=>J$(t,n,e.selectionMarkdown),n),e.selectionMarkdown)}function Z$(e,t,n){let r=`Let's work on @${e} using OpenKnowledge.`,i=n?`Open the OK editor in web view.`:``,a=t.trim();if(a===``)return i===``?r:`${r} ${i}`;let o=[r,``,a.split(`
488
488
  `).map(e=>`> ${e}`).join(`
489
489
  `)];return i!==``&&o.push(``,i),o.join(`
490
- `)}function Z$(e,t,n,r,i=`url`){let a=h$(e);return X$(a,J$(t,r,e=>X$(a,e,n),i),n)}var Q$=`Open the OK editor in web view.`;function $$(e){return e.split(`
490
+ `)}function Q$(e,t,n,r,i=`url`){let a=g$(e);return Z$(a,Y$(t,r,e=>Z$(a,e,n),i),n)}var $$=`Open the OK editor in web view.`;function e1(e){return e.split(`
491
491
  `).map(e=>`> ${e}`).join(`
492
- `)}function e1(e){let t=L$(e);return[`Here is the passage:`,``,t,e,t].join(`
493
- `)}function t1(e,t){let n=R$(e),r=L$(n);return[`The passage begins:`,``,r,n,r,``,`Read the full passage from @${t} via the OpenKnowledge MCP server before editing.`].join(`
494
- `)}function n1(e,t,n){return`The selected passage is ${e===t?`line ${e}`:`lines ${e}-${t}`} of @${n}. Read it from @${n} via the OpenKnowledge MCP server before editing.`}function r1(e){let t=e.map(e=>h$(e)).filter(e=>e!==``);return t.length===0?``:[`Also reference:`,``,...t.map(e=>`@${e}`)].join(`
495
- `)}function i1(e){return e.scope===`doc`?`Let's work on @${h$(e.docRelativePath)} using OpenKnowledge.`:e.scope===`folder`?`Let's work on the @${h$(e.folderRelativePath)} folder using OpenKnowledge.`:`Let's work on this project using OpenKnowledge.`}function a1(e,t,n,r,i){let a=t.trim();if(!(a!==``||n!==``||r!==``))return i===``?e:`${e} ${i}`;let o=[e];return a!==``&&o.push($$(a)),n!==``&&o.push(n),r!==``&&o.push(r),i!==``&&o.push(i),o.join(`
496
-
497
- `)}function o1(e,t,n,r,i,a,o){if(e.kind===`lines`)return n1(e.startLine,e.endLine,n);if(e.kind===`anchor`)return t1(e.markdown,n);let s=e1(e.markdown);return j$(a1(t,``,s,r,i),a,o)<=M$(o,D$)?s:t1(e.markdown,n)}function s1(e,t,n,r){let{target:i}=e,a=e.transport??`url`,o=h$(e.docRelativePath),s=`Let's work on @${o} using OpenKnowledge.`,c=o1(t,s,o,n,r,i,a);return a1(s,J$(e.instruction,i,e=>a1(s,e,c,n,r),a),c,n,r)}function c1(e){let{target:t}=e,n=e.autoOpen?Q$:``,r=r1(e.mentions);if(e.scope===`doc`&&e.selection!==void 0)return s1(e,e.selection,r,n);let i=i1(e);return a1(i,J$(e.instruction,t,e=>a1(i,e,``,r,n),e.transport??`url`),``,r,n)}function l1(e){let t=h$(e.relativePath),n=e.ruleAlias===void 0?`${e.source}/${e.code}`:`${e.source}/${e.code} (${e.ruleAlias})`,r=[`Fix this lint problem in @${t} using OpenKnowledge.`,``,`Problem: ${n} at line ${e.line}, column ${e.column}:`,``,$$(e.message.trim())],i=e.lineText??``;if(i.trim()!==``){let t=L$(i);r.push(``,`Line ${e.line} reads:`,``,t,i,t)}return r.push(``,`Edit @${t} via the OpenKnowledge MCP server, then re-lint it to confirm the problem is resolved.`),r.join(`
498
- `)}function u1(e){if(e===null)return[`Fix every problem across this project's documents using OpenKnowledge.`,``,"Run the `audit` tool for the current list of lint violations and broken links, then work file by file — the `lint` tool with `fix: true` clears one document's mechanically-fixable problems at a time — and re-audit until it reports no problems."].join(`
499
- `);let t=h$(e);return[`Fix every problem in @${t} using OpenKnowledge.`,``,`Run the \`audit\` tool scoped to it for the current list of lint violations and broken links, then fix each one — the \`lint\` tool with \`fix: true\` clears the mechanically-fixable ones — and re-audit @${t} until it reports no problems.`].join(`
500
- `)}function d1(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}var f1=new Set([`opencode.json`]);function p1(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:f1.has(e.slice(e.lastIndexOf(`/`)+1))}function m1(e,t){let n=d1(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var h1=P().superRefine(m1).optional(),g1=P().superRefine(m1),_1={agentId:P().optional(),agentName:P().optional(),colorSeed:P().optional(),clientName:P().optional(),clientVersion:P().optional(),label:P().optional()},v1=P().optional(),y1=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;co(`kind`,[R({kind:V(`doc`),docPath:P().min(1)}).loose(),R({kind:V(`folder`),folderPath:P()}).loose()]);var b1=B([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),x1=B([`current`,`stale`,`absent`,`empty`]),S1=co(`ok`,[R({ok:V(!0),shareUrl:P().min(1),sharedUrl:P().min(1),branch:P().min(1),freshness:x1.optional().catch(void 0)}).loose(),R({ok:V(!1),error:b1,branch:P().min(1).optional()}).loose()]),C1=B([`user`,`org`]),w1=R({login:P().min(1),kind:C1,avatarUrl:P().optional()}).loose(),T1=B([`auth-required`,`network`]),E1=co(`ok`,[R({ok:V(!0),owners:L(w1)}).loose(),R({ok:V(!1),error:T1}).loose()]),D1=co(`ok`,[R({ok:V(!0),available:I()}).loose(),R({ok:V(!1),error:T1}).loose()]),O1=B([`public`,`private`]);R({owner:P().min(1),name:P().min(1),visibility:O1,description:P().optional()}).loose();var k1=B([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),A1=co(`ok`,[R({ok:V(!0),ownerLogin:P().min(1),repoName:P().min(1),cloneUrl:P().min(1),defaultBranch:P().min(1)}).loose(),R({ok:V(!1),error:k1}).loose()]);function j1(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var M1=e=>e.refine(j1,`invalid branch name`),N1={shareTargetExists:I(),dirtyConflicts:R({conflicts:I(),files:L(P().min(1))}).loose(),branchIsLocal:I(),shareTargetOnOriginBranch:I().optional()};co(`detached`,[R({detached:V(!1),currentBranch:P().min(1).nullable(),currentHeadSha:no(),...N1}).loose(),R({detached:V(!0),currentBranch:no(),currentHeadSha:P().min(1),...N1}).loose()]),R({branch:M1(P().min(1)),principalId:P().optional(),fastForward:I().optional()}).loose();var P1=B([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);co(`ok`,[R({ok:V(!0)}).loose(),R({ok:V(!1),reason:P1,files:L(P().min(1)).optional(),otherWorktreePath:P().min(1).optional()}).loose()]),B([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),R({branch:M1(P().min(1)),path:P(),kind:B([`doc`,`folder`])}).loose(),co(`verdict`,[R({verdict:V(`on-origin`)}).loose(),R({verdict:V(`renamed`),renamedTo:P().min(1)}).loose(),R({verdict:V(`deleted`)}).loose(),R({verdict:V(`never-on-branch`)}).loose(),R({verdict:V(`changed-locally`)}).loose(),R({verdict:V(`unknown`)}).loose()]).catch({verdict:`unknown`});var F1=R({startedAt:P().min(1),httpListenMs:F().nonnegative().optional(),seedWalkMs:F().nonnegative().optional(),indexesMs:F().nonnegative().optional(),readyMs:F().nonnegative().optional(),fileCount:F().nonnegative().optional()}),I1=R({serverInstanceId:P().min(1),currentBranch:P().min(1).optional(),currentDiskAckSVs:uo(P().min(1),P().min(1)).optional(),boot:F1.optional()}).loose(),L1=R({id:P().min(1),display_name:P().min(1),display_email:P(),source:B([`git-config`,`synthesized`]),created_at:P().min(1)}).loose();R({collabUrl:P().nullable(),previewUrl:P().nullable(),port:F(),singleFile:I().default(!1)}).loose();var R1=B(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded`.split(`.`)),z1=R({type:R1,title:P().min(1),status:F().int().min(400).max(599),instance:P().regex(y1,`instance must be urn:uuid:<uuid>`).optional(),detail:P().optional()}).loose();R({parentDocName:P().min(1),placement:B([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:P().min(1).optional(),agentName:P().min(1).optional()}).loose();var B1=R({src:P().min(1),path:P().min(1).optional(),deduped:I().optional()}).loose();R({url:P().min(1),dir:P().min(1),branch:P().min(1).refine(j1,`invalid branch name`).optional()}).loose(),R({type:V(`error`),problem:z1}).loose();function V1(e){return e.includes("`")?`~`:"`"}function H1(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
501
- `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var U1=/notionvc:/i,W1=()=>e=>{G1(e)&&(K1(e),q1(e))};function G1(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(U1.test(e))return!0}if(t.type===`element`&&G1(t))return!0}return!1}function K1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&K1(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
492
+ `)}function t1(e){let t=R$(e);return[`Here is the passage:`,``,t,e,t].join(`
493
+ `)}function n1(e,t){let n=z$(e),r=R$(n);return[`The passage begins:`,``,r,n,r,``,`Read the full passage from @${t} via the OpenKnowledge MCP server before editing.`].join(`
494
+ `)}function r1(e,t,n){return`The selected passage is ${e===t?`line ${e}`:`lines ${e}-${t}`} of @${n}. Read it from @${n} via the OpenKnowledge MCP server before editing.`}function i1(e){let t=e.map(e=>g$(e)).filter(e=>e!==``);return t.length===0?``:[`Also reference:`,``,...t.map(e=>`@${e}`)].join(`
495
+ `)}function a1(e){return e.scope===`doc`?`Let's work on @${g$(e.docRelativePath)} using OpenKnowledge.`:e.scope===`folder`?`Let's work on the @${g$(e.folderRelativePath)} folder using OpenKnowledge.`:`Let's work on this project using OpenKnowledge.`}function o1(e,t,n,r,i){let a=t.trim();if(!(a!==``||n!==``||r!==``))return i===``?e:`${e} ${i}`;let o=[e];return a!==``&&o.push(e1(a)),n!==``&&o.push(n),r!==``&&o.push(r),i!==``&&o.push(i),o.join(`
496
+
497
+ `)}function s1(e,t,n,r,i,a,o){if(e.kind===`lines`)return r1(e.startLine,e.endLine,n);if(e.kind===`anchor`)return n1(e.markdown,n);let s=t1(e.markdown);return M$(o1(t,``,s,r,i),a,o)<=N$(o,O$)?s:n1(e.markdown,n)}function c1(e,t,n,r){let{target:i}=e,a=e.transport??`url`,o=g$(e.docRelativePath),s=`Let's work on @${o} using OpenKnowledge.`,c=s1(t,s,o,n,r,i,a);return o1(s,Y$(e.instruction,i,e=>o1(s,e,c,n,r),a),c,n,r)}function l1(e){let{target:t}=e,n=e.autoOpen?$$:``,r=i1(e.mentions);if(e.scope===`doc`&&e.selection!==void 0)return c1(e,e.selection,r,n);let i=a1(e);return o1(i,Y$(e.instruction,t,e=>o1(i,e,``,r,n),e.transport??`url`),``,r,n)}function u1(e){let t=g$(e.relativePath),n=e.ruleAlias===void 0?`${e.source}/${e.code}`:`${e.source}/${e.code} (${e.ruleAlias})`,r=[`Fix this lint problem in @${t} using OpenKnowledge.`,``,`Problem: ${n} at line ${e.line}, column ${e.column}:`,``,e1(e.message.trim())],i=e.lineText??``;if(i.trim()!==``){let t=R$(i);r.push(``,`Line ${e.line} reads:`,``,t,i,t)}return r.push(``,`Edit @${t} via the OpenKnowledge MCP server, then re-lint it to confirm the problem is resolved.`),r.join(`
498
+ `)}function d1(e){if(e===null)return[`Fix every problem across this project's documents using OpenKnowledge.`,``,"Run the `audit` tool for the current list of lint violations and broken links, then work file by file — the `lint` tool with `fix: true` clears one document's mechanically-fixable problems at a time — and re-audit until it reports no problems."].join(`
499
+ `);let t=g$(e);return[`Fix every problem in @${t} using OpenKnowledge.`,``,`Run the \`audit\` tool scoped to it for the current list of lint violations and broken links, then fix each one — the \`lint\` tool with \`fix: true\` clears the mechanically-fixable ones — and re-audit @${t} until it reports no problems.`].join(`
500
+ `)}function f1(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}var p1=new Set([`opencode.json`]);function m1(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:p1.has(e.slice(e.lastIndexOf(`/`)+1))}function h1(e,t){let n=f1(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var g1=P().superRefine(h1).optional(),_1=P().superRefine(h1),v1={agentId:P().optional(),agentName:P().optional(),colorSeed:P().optional(),clientName:P().optional(),clientVersion:P().optional(),label:P().optional()},y1=P().optional(),b1=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;co(`kind`,[R({kind:V(`doc`),docPath:P().min(1)}).loose(),R({kind:V(`folder`),folderPath:P()}).loose()]);var x1=B([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),S1=B([`current`,`stale`,`absent`,`empty`]),C1=co(`ok`,[R({ok:V(!0),shareUrl:P().min(1),sharedUrl:P().min(1),branch:P().min(1),freshness:S1.optional().catch(void 0)}).loose(),R({ok:V(!1),error:x1,branch:P().min(1).optional()}).loose()]),w1=B([`user`,`org`]),T1=R({login:P().min(1),kind:w1,avatarUrl:P().optional()}).loose(),E1=B([`auth-required`,`network`]),D1=co(`ok`,[R({ok:V(!0),owners:L(T1)}).loose(),R({ok:V(!1),error:E1}).loose()]),O1=co(`ok`,[R({ok:V(!0),available:I()}).loose(),R({ok:V(!1),error:E1}).loose()]),k1=B([`public`,`private`]);R({owner:P().min(1),name:P().min(1),visibility:k1,description:P().optional()}).loose();var A1=B([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),j1=co(`ok`,[R({ok:V(!0),ownerLogin:P().min(1),repoName:P().min(1),cloneUrl:P().min(1),defaultBranch:P().min(1)}).loose(),R({ok:V(!1),error:A1}).loose()]);function M1(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var N1=e=>e.refine(M1,`invalid branch name`),P1={shareTargetExists:I(),dirtyConflicts:R({conflicts:I(),files:L(P().min(1))}).loose(),branchIsLocal:I(),shareTargetOnOriginBranch:I().optional()};co(`detached`,[R({detached:V(!1),currentBranch:P().min(1).nullable(),currentHeadSha:no(),...P1}).loose(),R({detached:V(!0),currentBranch:no(),currentHeadSha:P().min(1),...P1}).loose()]),R({branch:N1(P().min(1)),principalId:P().optional(),fastForward:I().optional()}).loose();var F1=B([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);co(`ok`,[R({ok:V(!0)}).loose(),R({ok:V(!1),reason:F1,files:L(P().min(1)).optional(),otherWorktreePath:P().min(1).optional()}).loose()]),B([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),R({branch:N1(P().min(1)),path:P(),kind:B([`doc`,`folder`])}).loose(),co(`verdict`,[R({verdict:V(`on-origin`)}).loose(),R({verdict:V(`renamed`),renamedTo:P().min(1)}).loose(),R({verdict:V(`deleted`)}).loose(),R({verdict:V(`never-on-branch`)}).loose(),R({verdict:V(`changed-locally`)}).loose(),R({verdict:V(`unknown`)}).loose()]).catch({verdict:`unknown`});var I1=R({startedAt:P().min(1),httpListenMs:F().nonnegative().optional(),seedWalkMs:F().nonnegative().optional(),indexesMs:F().nonnegative().optional(),readyMs:F().nonnegative().optional(),fileCount:F().nonnegative().optional()}),L1=R({serverInstanceId:P().min(1),currentBranch:P().min(1).optional(),currentDiskAckSVs:uo(P().min(1),P().min(1)).optional(),boot:I1.optional()}).loose(),R1=R({id:P().min(1),display_name:P().min(1),display_email:P(),source:B([`git-config`,`synthesized`]),created_at:P().min(1)}).loose();R({collabUrl:P().nullable(),previewUrl:P().nullable(),port:F(),singleFile:I().default(!1)}).loose();var z1=B(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded`.split(`.`)),B1=R({type:z1,title:P().min(1),status:F().int().min(400).max(599),instance:P().regex(b1,`instance must be urn:uuid:<uuid>`).optional(),detail:P().optional()}).loose();R({parentDocName:P().min(1),placement:B([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:P().min(1).optional(),agentName:P().min(1).optional()}).loose();var V1=R({src:P().min(1),path:P().min(1).optional(),deduped:I().optional()}).loose();R({url:P().min(1),dir:P().min(1),branch:P().min(1).refine(M1,`invalid branch name`).optional()}).loose(),R({type:V(`error`),problem:B1}).loose();function H1(e){return e.includes("`")?`~`:"`"}function U1(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
501
+ `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var W1=/notionvc:/i,G1=()=>e=>{K1(e)&&(q1(e),J1(e))};function K1(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(W1.test(e))return!0}if(t.type===`element`&&K1(t))return!0}return!1}function q1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&q1(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
502
502
  `)){t.push(n);continue}let r=e.split(`
503
- `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function q1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!U1.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&q1(t)}}var J1=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),Y1=()=>e=>{X1(e)};function X1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&X1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return Z1(t)?[]:Q1(t)?t.children:[t]})}}function Z1(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function Q1(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>J1.has(String(e))):!1}var $1=`docs-internal-guid-`;function e0(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var t0=()=>e=>{n0(e)};function n0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&n0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(r0(r)||i0(r)){e0(e,t);continue}t++}}function r0(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith($1)}function i0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var a0=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),o0=()=>e=>{s0(e)};function s0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&s0(t);for(let t of e.children)t.type===`element`&&c0(t)}}function c0(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!a0.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var l0=/^gmail_/,u0=()=>e=>{d0(e)};function d0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&d0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&f0(r,`gmail_quote`)&&(r.tagName=`blockquote`),p0(r),m0(r)){e.children.splice(t,1,...r.children);continue}t++}}function f0(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function p0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!l0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function m0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var h0=()=>e=>{g0(e)};function g0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&g0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(_0(t),[t])})}}function _0(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var v0=[`o:`,`w:`,`m:`,`v:`,`u1:`],y0=/^Mso[A-Z]/,b0=/^\s*\[if\s+[^\]]*\]/,x0=()=>e=>{S0(e)};function S0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&S0(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return b0.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return C0(t)?[]:(w0(t),[t])})}}function C0(e){return v0.some(t=>e.tagName.startsWith(t))}function w0(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!y0.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&y0.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);v0.some(e=>e===`${n}:`)&&delete t[e]}}var T0=/^c-(message_kit__|message__|compose|timestamp)/,E0=()=>e=>{D0(e)};function D0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&D0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return O0(t)?[]:(k0(t),[t])})}}function O0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function k0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!T0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var A0=()=>e=>{j0(e)};function j0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&j0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;M0(r)&&(e.children[t]=P0(r))}}}function M0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>N0(e))}function N0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||N0(e))return!0}return!1}function P0(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>F0(e)).join(`
504
- `)}]}]}}function F0(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=F0(n));return t}var I0=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function L0(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}L0(e)})}function R0(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
505
- `)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`))),R0(e)}function z0(e){D(e,`tableCell`,e=>{e.children.some(e=>!I0.has(e.type))&&(e.children=B0(e.children)),L0(e),R0(e)})}function B0(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
506
- `).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var V0=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},H0=[t0,x0,Y1,u0,W1,A0,h0,E0,o0];function U0(e){D(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function W0(e){D(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}var G0={u:q0(`u`),ins:q0(`ins`)},K0=`okUnderlineForm`;function q0(e){return(t,n)=>{let r={type:`emphasis`,children:t.all(n),data:{[K0]:e}};return t.patch(n,r),r}}function J0(e){let t=e=>{if(!Array.isArray(e.children))return;for(let n of e.children)t(n);let n=[];for(let t of e.children){let e=t.data?.[K0],r=t.children;if((e===`u`||e===`ins`)&&Array.isArray(r)){n.push({type:`html`,value:`<${e}>`}),n.push(...r),n.push({type:`html`,value:`</${e}>`});continue}n.push(t)}e.children=n};t(e)}function Y0(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new V0(e.length,n);let r=le().use(Sj,{fragment:!0});for(let e of H0)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(zN,{handlers:G0});let i=r.parse(e),a=r.runSync(i);return W0(a),J0(a),U0(a),a}function X0(e){return z0(e),String(le().use(ue).use(fP,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function Z0(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var Q0=new Set([`sourceRaw`,`sourceDirty`,`position`]),$0=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),e2={type:`__br__`},t2=/^<br\s*\/?>$/i;function n2(e){let t=s2(e,n2);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:r2(t.content)}:t}function r2(e){let t=[];for(let n of e){let e=i2(n);e.length!==0&&(t.length>0&&t.push(e2),t.push(...e))}return t}function i2(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?r2(e.content):e.content}function a2(e){return e.type===`hardBreak`||e.type===e2.type||e.text!==void 0&&t2.test(e.text.trim())?e2:s2(e,a2)}var o2=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:n2},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:a2}];function s2(e,t){return e.content?{...e,content:e.content.map(t)}:e}function c2(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=l2(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:l2(e.attrs,t)})).sort((e,t)=>d2(e).localeCompare(d2(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>c2(e,t))),n}function l2(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(Q0.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?u2(i,t):i)}return Object.keys(n).length>0?n:null}function u2(e,t){if(Array.isArray(e))return e.map(e=>u2(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=u2(i,t));return n}return e}function d2(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function f2(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function p2(e){let t=[],n=e=>{if(e.type&&$0.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function m2(e){let t=e,n=[];for(let e of o2){let r=d2(t),i=e.canonicalize(t);d2(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function h2(e,t,n={}){let r=m2(e),i=m2(t),a=[...new Set([...r.fired,...i.fired])];if(!Z0(f2(r.normalized),f2(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=p2(r.normalized),s=p2(i.normalized);if(d2(o)!==d2(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=c2(r.normalized,n.ignoreAttrs),l=c2(i.normalized,n.ignoreAttrs);return d2(c)===d2(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:g2(c,l)}}function g2(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(d2(a[e])!==d2(o[e]))return g2(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function _2(e,t,n){return!h2(e,t,{ignoreAttrs:n}).equivalent}var v2=new Set([`src`,`href`,`size`]),y2=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function b2(e){if(Array.isArray(e))return e.map(e=>b2(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))v2.has(n)||(t[n]=b2(r));return t}return e}function x2(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&y2.has(e.attrs.componentName)?b2(e):e.content?{...e,content:e.content.map(x2)}:e}function S2(e){if(Array.isArray(e))return e.map(e=>S2(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=S2(r));return t}return e}function C2(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=C2(t);if(e)return e}}function w2(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=C2(e.parse(r)),o=a?x2(S2(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?_2(n,x2(S2(e))):!1}}}function T2(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&E2(e.value.value,t))continue}let o=D2(e,t);r>=0?n[r]=o:n.push(o)}return n}function E2(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function D2(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function O2(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:T2(t,r),children:n.all(t),data:{}}}var k2=/^[A-Za-z0-9]{20,}$/,A2=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function j2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function M2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return k2.test(n)?n:null}function N2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!j2(t.hostname))return null;let n=M2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&A2.test(r)?r:null}}function P2(e){return N2(e)!==null}function F2(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function I2(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:F2(t.hostname)}var L2=/^[A-Za-z0-9_-]{11}$/;function R2(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function z2(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function B2(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return L2.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return L2.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function V2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!R2(t.hostname))return null;let n=B2(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?z2(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var H2=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],U2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:$u,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],W2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],G2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:ed,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(I2(e.src)||P2(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:$u,hideWhen:e=>typeof e.src==`string`&&(I2(e.src)||P2(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&P2(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(I2(e.src)||P2(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(V2(e.src)!==null||I2(e.src)||P2(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],K2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:td,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],q2=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],J2=[H2[0],H2[1],H2[4],H2[5],H2[6]],Y2=[U2[0],U2[1],U2[7]],X2=[q2[0],q2[1],q2[4],q2[5]],Z2=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],Q2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],$2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],e4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],t4=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],n4=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],r4=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],i4=[r4[0]],a4=[r4[0]],o4=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],s4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],c4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],l4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:nd,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],u4=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],d4=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function f4(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function p4(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function m4(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var h4=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:H2,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>O2(`Callout`,e,t,H2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:U2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>O2(`img`,e,t,U2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:G2,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>O2(`video`,e,t,G2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:K2,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>O2(`audio`,e,t,K2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:l4,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>O2(`Pdf`,e,t,l4)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:c4,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>O2(`File`,e,t,c4)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:W2,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>O2(`Embed`,e,t,W2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:q2,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>O2(`Accordion`,e,t,q2)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:t4,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
507
- <Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>O2(`Tabs`,e,t,t4)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:n4,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>O2(`Tab`,e,t,n4)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:r4,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>O2(`Math`,e,t,r4)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:o4,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:u4,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>O2(`Mirror`,e,t,u4)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:d4,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>O2(`MirrorSource`,e,t,d4)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:J2,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:Y2,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:Q2,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:m4},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:$2,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:m4},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:e4,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:m4},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:s4,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:m4},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:X2,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${f4(n.name)}"`:``,a=n?.id?` id="${f4(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${p4(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:Z2,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${f4(i)}"`):`${a} align="${f4(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:i4,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:a4,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],g4={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>O2(e.attrs.componentName||`*`,e,t)};function _4(){let e=new Map;e.set(`*`,g4);for(let t of h4)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var v4={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function y4(){v4.parseFallback.blockLevel++}function b4(){v4.parseFallback.wholeDoc++}function x4(){v4.parseFallback.wholeDocBudget++}function S4(e){v4.jsxRenderFailure[e]=(v4.jsxRenderFailure[e]??0)+1}function C4(e){v4.jsxAutoConvertFailed[e]=(v4.jsxAutoConvertFailed[e]??0)+1}function w4(e){v4.jsxAutoConvertSucceeded[e]=(v4.jsxAutoConvertSucceeded[e]??0)+1}function T4(e){v4.jsxPropDropped[e]=(v4.jsxPropDropped[e]??0)+1}function E4(e){v4.jsxMoveFailed[e]=(v4.jsxMoveFailed[e]??0)+1}function D4(e){v4.jsxStuckCopyFailed[e]=(v4.jsxStuckCopyFailed[e]??0)+1}function O4(e){v4.jsxStuckDeleteFailed[e]=(v4.jsxStuckDeleteFailed[e]??0)+1}function k4(e){v4.jsxPopoverCloseRestoreFailed[e]=(v4.jsxPopoverCloseRestoreFailed[e]??0)+1}function A4(e){v4.jsxKeyboardDeleteFailed[e]=(v4.jsxKeyboardDeleteFailed[e]??0)+1}function j4(e){v4.blockGripClickSelectFailed[e]=(v4.blockGripClickSelectFailed[e]??0)+1}function M4(e){v4.jsxArrowNodeSelectFailed[e]=(v4.jsxArrowNodeSelectFailed[e]??0)+1}var N4=/^(`{3,}|~{3,})/gm;function P4(e){let t=[],n=null;for(let r of e.matchAll(N4)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function F4(e,t){return t.some(([t,n])=>e>=t&&e<n)}var I4=/`+/g;function L4(e){let t=[];I4.lastIndex=0;for(let n of e.matchAll(I4))t.push({offset:n.index,length:n[0].length});let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let i=e+1;i<t.length;i++){let a=t[i];if(a.length===r.length){n.push([r.offset,a.offset+a.length]),e=i;break}}}return n}var R4=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function z4(e){let t=P4(e),n=[];for(let r of e.matchAll(R4))F4(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
508
- `)}\n\n`:``}var B4=500,V4=1e3;function H4(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return K4(e,t.parse,0,n)}function U4(e){return e.calls>=V4?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=B4}var W4=500;function G4(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,W4),stack:e.stack?.split(`
503
+ `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function J1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!W1.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&J1(t)}}var Y1=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),X1=()=>e=>{Z1(e)};function Z1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&Z1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return Q1(t)?[]:$1(t)?t.children:[t]})}}function Q1(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function $1(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>Y1.has(String(e))):!1}var e0=`docs-internal-guid-`;function t0(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var n0=()=>e=>{r0(e)};function r0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&r0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(i0(r)||a0(r)){t0(e,t);continue}t++}}function i0(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(e0)}function a0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var o0=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),s0=()=>e=>{c0(e)};function c0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&c0(t);for(let t of e.children)t.type===`element`&&l0(t)}}function l0(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!o0.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var u0=/^gmail_/,d0=()=>e=>{f0(e)};function f0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&f0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&p0(r,`gmail_quote`)&&(r.tagName=`blockquote`),m0(r),h0(r)){e.children.splice(t,1,...r.children);continue}t++}}function p0(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function m0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!u0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function h0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var g0=()=>e=>{_0(e)};function _0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&_0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(v0(t),[t])})}}function v0(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var y0=[`o:`,`w:`,`m:`,`v:`,`u1:`],b0=/^Mso[A-Z]/,x0=/^\s*\[if\s+[^\]]*\]/,S0=()=>e=>{C0(e)};function C0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&C0(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return x0.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return w0(t)?[]:(T0(t),[t])})}}function w0(e){return y0.some(t=>e.tagName.startsWith(t))}function T0(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!b0.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&b0.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);y0.some(e=>e===`${n}:`)&&delete t[e]}}var E0=/^c-(message_kit__|message__|compose|timestamp)/,D0=()=>e=>{O0(e)};function O0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&O0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return k0(t)?[]:(A0(t),[t])})}}function k0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function A0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!E0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var j0=()=>e=>{M0(e)};function M0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&M0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;N0(r)&&(e.children[t]=F0(r))}}}function N0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>P0(e))}function P0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||P0(e))return!0}return!1}function F0(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>I0(e)).join(`
504
+ `)}]}]}}function I0(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=I0(n));return t}var L0=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function R0(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}R0(e)})}function z0(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
505
+ `)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`))),z0(e)}function B0(e){D(e,`tableCell`,e=>{e.children.some(e=>!L0.has(e.type))&&(e.children=V0(e.children)),R0(e),z0(e)})}function V0(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
506
+ `).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var H0=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},U0=[n0,S0,X1,d0,G1,j0,g0,D0,s0];function W0(e){D(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function G0(e){D(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}var K0={u:J0(`u`),ins:J0(`ins`)},q0=`okUnderlineForm`;function J0(e){return(t,n)=>{let r={type:`emphasis`,children:t.all(n),data:{[q0]:e}};return t.patch(n,r),r}}function Y0(e){let t=e=>{if(!Array.isArray(e.children))return;for(let n of e.children)t(n);let n=[];for(let t of e.children){let e=t.data?.[q0],r=t.children;if((e===`u`||e===`ins`)&&Array.isArray(r)){n.push({type:`html`,value:`<${e}>`}),n.push(...r),n.push({type:`html`,value:`</${e}>`});continue}n.push(t)}e.children=n};t(e)}function X0(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new H0(e.length,n);let r=le().use(Sj,{fragment:!0});for(let e of U0)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(zN,{handlers:K0});let i=r.parse(e),a=r.runSync(i);return G0(a),Y0(a),W0(a),a}function Z0(e){return B0(e),String(le().use(ue).use(fP,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function Q0(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var $0=new Set([`sourceRaw`,`sourceDirty`,`position`]),e2=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),t2={type:`__br__`},n2=/^<br\s*\/?>$/i;function r2(e){let t=c2(e,r2);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:i2(t.content)}:t}function i2(e){let t=[];for(let n of e){let e=a2(n);e.length!==0&&(t.length>0&&t.push(t2),t.push(...e))}return t}function a2(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?i2(e.content):e.content}function o2(e){return e.type===`hardBreak`||e.type===t2.type||e.text!==void 0&&n2.test(e.text.trim())?t2:c2(e,o2)}var s2=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:r2},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:o2}];function c2(e,t){return e.content?{...e,content:e.content.map(t)}:e}function l2(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=u2(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:u2(e.attrs,t)})).sort((e,t)=>f2(e).localeCompare(f2(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>l2(e,t))),n}function u2(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if($0.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?d2(i,t):i)}return Object.keys(n).length>0?n:null}function d2(e,t){if(Array.isArray(e))return e.map(e=>d2(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=d2(i,t));return n}return e}function f2(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function p2(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function m2(e){let t=[],n=e=>{if(e.type&&e2.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function h2(e){let t=e,n=[];for(let e of s2){let r=f2(t),i=e.canonicalize(t);f2(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function g2(e,t,n={}){let r=h2(e),i=h2(t),a=[...new Set([...r.fired,...i.fired])];if(!Q0(p2(r.normalized),p2(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=m2(r.normalized),s=m2(i.normalized);if(f2(o)!==f2(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=l2(r.normalized,n.ignoreAttrs),l=l2(i.normalized,n.ignoreAttrs);return f2(c)===f2(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:_2(c,l)}}function _2(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(f2(a[e])!==f2(o[e]))return _2(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function v2(e,t,n){return!g2(e,t,{ignoreAttrs:n}).equivalent}var y2=new Set([`src`,`href`,`size`]),b2=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function x2(e){if(Array.isArray(e))return e.map(e=>x2(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))y2.has(n)||(t[n]=x2(r));return t}return e}function S2(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&b2.has(e.attrs.componentName)?x2(e):e.content?{...e,content:e.content.map(S2)}:e}function C2(e){if(Array.isArray(e))return e.map(e=>C2(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=C2(r));return t}return e}function w2(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=w2(t);if(e)return e}}function T2(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=w2(e.parse(r)),o=a?S2(C2(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?v2(n,S2(C2(e))):!1}}}function E2(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&D2(e.value.value,t))continue}let o=O2(e,t);r>=0?n[r]=o:n.push(o)}return n}function D2(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function O2(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function k2(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:E2(t,r),children:n.all(t),data:{}}}var A2=/^[A-Za-z0-9]{20,}$/,j2=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function M2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function N2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return A2.test(n)?n:null}function P2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!M2(t.hostname))return null;let n=N2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&j2.test(r)?r:null}}function F2(e){return P2(e)!==null}function I2(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function L2(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:I2(t.hostname)}var R2=/^[A-Za-z0-9_-]{11}$/;function z2(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function B2(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function V2(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return R2.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return R2.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function H2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!z2(t.hostname))return null;let n=V2(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?B2(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var U2=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],W2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:$u,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],G2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],K2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:ed,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(L2(e.src)||F2(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:$u,hideWhen:e=>typeof e.src==`string`&&(L2(e.src)||F2(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&F2(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(L2(e.src)||F2(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(H2(e.src)!==null||L2(e.src)||F2(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],q2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:td,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],J2=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],Y2=[U2[0],U2[1],U2[4],U2[5],U2[6]],X2=[W2[0],W2[1],W2[7]],Z2=[J2[0],J2[1],J2[4],J2[5]],Q2=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],$2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],e4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],t4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],n4=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],r4=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],i4=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],a4=[i4[0]],o4=[i4[0]],s4=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],c4=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],l4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],u4=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:nd,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],d4=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],f4=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function p4(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function m4(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function h4(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var g4=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:U2,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>k2(`Callout`,e,t,U2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:W2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>k2(`img`,e,t,W2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:K2,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>k2(`video`,e,t,K2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:q2,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>k2(`audio`,e,t,q2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:u4,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>k2(`Pdf`,e,t,u4)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:l4,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>k2(`File`,e,t,l4)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:G2,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>k2(`Embed`,e,t,G2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:J2,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>k2(`Accordion`,e,t,J2)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:n4,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
507
+ <Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>k2(`Tabs`,e,t,n4)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:r4,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>k2(`Tab`,e,t,r4)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:i4,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>k2(`Math`,e,t,i4)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:s4,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:d4,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>k2(`Mirror`,e,t,d4)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:f4,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>k2(`MirrorSource`,e,t,f4)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:Y2,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:X2,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:$2,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:h4},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:e4,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:h4},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:t4,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:h4},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:c4,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:h4},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:Z2,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${p4(n.name)}"`:``,a=n?.id?` id="${p4(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${m4(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:Q2,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${p4(i)}"`):`${a} align="${p4(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:a4,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:o4,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],_4={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>k2(e.attrs.componentName||`*`,e,t)};function v4(){let e=new Map;e.set(`*`,_4);for(let t of g4)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var y4={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function b4(){y4.parseFallback.blockLevel++}function x4(){y4.parseFallback.wholeDoc++}function S4(){y4.parseFallback.wholeDocBudget++}function C4(e){y4.jsxRenderFailure[e]=(y4.jsxRenderFailure[e]??0)+1}function w4(e){y4.jsxAutoConvertFailed[e]=(y4.jsxAutoConvertFailed[e]??0)+1}function T4(e){y4.jsxAutoConvertSucceeded[e]=(y4.jsxAutoConvertSucceeded[e]??0)+1}function E4(e){y4.jsxPropDropped[e]=(y4.jsxPropDropped[e]??0)+1}function D4(e){y4.jsxMoveFailed[e]=(y4.jsxMoveFailed[e]??0)+1}function O4(e){y4.jsxStuckCopyFailed[e]=(y4.jsxStuckCopyFailed[e]??0)+1}function k4(e){y4.jsxStuckDeleteFailed[e]=(y4.jsxStuckDeleteFailed[e]??0)+1}function A4(e){y4.jsxPopoverCloseRestoreFailed[e]=(y4.jsxPopoverCloseRestoreFailed[e]??0)+1}function j4(e){y4.jsxKeyboardDeleteFailed[e]=(y4.jsxKeyboardDeleteFailed[e]??0)+1}function M4(e){y4.blockGripClickSelectFailed[e]=(y4.blockGripClickSelectFailed[e]??0)+1}function N4(e){y4.jsxArrowNodeSelectFailed[e]=(y4.jsxArrowNodeSelectFailed[e]??0)+1}var P4=/^(`{3,}|~{3,})/gm;function F4(e){let t=[],n=null;for(let r of e.matchAll(P4)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function I4(e,t){return t.some(([t,n])=>e>=t&&e<n)}var L4=/`+/g;function R4(e){let t=[];L4.lastIndex=0;for(let n of e.matchAll(L4))t.push({offset:n.index,length:n[0].length});let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let i=e+1;i<t.length;i++){let a=t[i];if(a.length===r.length){n.push([r.offset,a.offset+a.length]),e=i;break}}}return n}var z4=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function B4(e){let t=F4(e),n=[];for(let r of e.matchAll(z4))I4(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
508
+ `)}\n\n`:``}var V4=500,H4=1e3;function U4(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return q4(e,t.parse,0,n)}function W4(e){return e.calls>=H4?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=V4}var G4=500;function K4(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,G4),stack:e.stack?.split(`
509
509
  `).slice(0,4).join(`
510
- `)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,W4)}}function K4(e,t,n,r){if(n>20)return b4(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),n3(e);if(r){if(U4(r))return x4(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),n3(e);r.calls+=1}try{return t(e)}catch(i){let a=q4(i),o=G4(i);if(a===void 0){if(n===0){let n=t3(e,t,i,r);if(n)return n}return b4(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),n3(e)}y4(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=$4(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?K4(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?K4(z4(s)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:c?[{type:`text`,text:c}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){b4();let n=G4(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),n3(e)}}}function q4(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function J4(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function Y4(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var X4=32*1024;function Z4(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(F4(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+X4),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function Q4(e){let t=Z4(e,P4(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=Y4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=Y4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function $4(e,t){let n=Q4(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:J4(e,t)??0,end:Y4(e,t)??e.length}}function e3(e){let t=P4(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;F4(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function t3(e,t,n,r){let i=e3(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&U4(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=z4(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){y4();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function n3(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var r3=``,i3=``,a3=``,o3=``,s3=``,c3=[[r3,``],[i3,``],[a3,``],[o3,``],[s3,``]],l3=/[\uE000-\uE004]/,u3=/[\uE005-\uE009]/;c3.map(([e,t])=>({from:e,to:t}));var d3=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,f3=/<!--[\s\S]*?-->/g,p3=/<\/([a-z][a-z0-9]*)\s*>/g,m3=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,h3=new Set([`img`,`video`,`audio`]),g3=new Set([`mark`,`u`,`ins`]);function _3(e,t,n,r){let i=0,a=0,o=`<${t}`;for(;a<n;){let t=e.indexOf(o,a);if(t===-1||t>=n)break;a=t+o.length;let s=e[t+o.length];if(s!==void 0&&s!==`>`&&s!==`/`&&!/\s/.test(s)||F4(t,r))continue;let c=e.indexOf(`>`,t);c!==-1&&e[c-1]===`/`||i++}return i}var v3=/<\/([A-Z][A-Za-z0-9.]*)>/g;function y3(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function b3(e){let t=new Map,n=new RegExp(v3.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function x3(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function S3(e){let t=[],n=e.indexOf(`>`);for(;n!==-1;)t.push(n),n=e.indexOf(`>`,n+1);return t}var C3=1024;function w3(e,t){if(t[e-1]!==`(`||t[e-2]!==`]`)return!1;let n=e-2,r=0;for(let e=n-1;e>=0&&t[e]===`\\`;e--)r++;if(r%2==1)return!1;let i=!1,a=Math.max(0,n-C3);for(let e=n-1;e>=a;e--){let n=t[e];if(n===`
511
- `||n===`\r`||n==="`")return!1;if(n!==`[`&&n!==`]`)continue;let r=0;for(let n=e-1;n>=0&&t[n]===`\\`;n--)r++;if(r%2!=1){if(n===`]`||t[e+1]===`^`||t[e-1]===`]`)return!1;i=!0;break}}if(!i)return!1;let o=!1,s=-1,c=Math.min(t.length,e+1+C3);for(let n=e+1;n<c;n++){let e=t[n];if(e===`>`){s=n;break}if(e===`<`||e===`\\`||e===`
512
- `||e===`\r`||e===r3||e===i3||e===a3||e===o3||e===s3)return!1;(e===` `||e===` `)&&(o=!0)}return s===-1||!o?!1:t[s+1]===`)`}function T3(e,t,n,r){let i=y3(n,e);if(i>=n.length)return!1;let a=n[i],o=y3(r,e);return a>=(o<r.length?r[o]:t.length)?!1:t[a-1]===`/`}function E3(e){let t=[];for(let n of e.matchAll(/<\/?([A-Z][A-Za-z0-9.]*)/g)){let r=n.index;if(t.length>0){let[e,n]=t[t.length-1];if(r>e&&r<=n)continue}let i=r+n[0].length,a=!1,o=!1,s=!1,c=0,l=-1;for(;i<e.length;){let t=e[i];if(a)t===`'`?a=!1:t===`\\`&&i+1<e.length&&i++;else if(o)t===`"`?o=!1:t===`\\`&&i+1<e.length&&i++;else if(s)t==="`"?s=!1:t===`\\`&&i+1<e.length&&i++;else if(t===`'`)a=!0;else if(t===`"`)o=!0;else if(t==="`")s=!0;else if(t===`{`)c++;else if(t===`}`&&c>0)c--;else if(c===0&&t===`>`){l=i;break}i++}if(l!==-1){if(e.slice(r,l).includes(`
510
+ `)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,G4)}}function q4(e,t,n,r){if(n>20)return x4(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),r3(e);if(r){if(W4(r))return S4(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),r3(e);r.calls+=1}try{return t(e)}catch(i){let a=J4(i),o=K4(i);if(a===void 0){if(n===0){let n=n3(e,t,i,r);if(n)return n}return x4(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),r3(e)}b4(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=e3(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?q4(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?q4(B4(s)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:c?[{type:`text`,text:c}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){x4();let n=K4(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),r3(e)}}}function J4(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function Y4(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function X4(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var Z4=32*1024;function Q4(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(I4(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+Z4),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function $4(e){let t=Q4(e,F4(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=X4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=X4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function e3(e,t){let n=$4(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:Y4(e,t)??0,end:X4(e,t)??e.length}}function t3(e){let t=F4(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;I4(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function n3(e,t,n,r){let i=t3(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&W4(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=B4(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){b4();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function r3(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var i3=``,a3=``,o3=``,s3=``,c3=``,l3=[[i3,``],[a3,``],[o3,``],[s3,``],[c3,``]],u3=/[\uE000-\uE004]/,d3=/[\uE005-\uE009]/;l3.map(([e,t])=>({from:e,to:t}));var f3=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,p3=/<!--[\s\S]*?-->/g,m3=/<\/([a-z][a-z0-9]*)\s*>/g,h3=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,g3=new Set([`img`,`video`,`audio`]),_3=new Set([`mark`,`u`,`ins`]);function v3(e,t,n,r){let i=0,a=0,o=`<${t}`;for(;a<n;){let t=e.indexOf(o,a);if(t===-1||t>=n)break;a=t+o.length;let s=e[t+o.length];if(s!==void 0&&s!==`>`&&s!==`/`&&!/\s/.test(s)||I4(t,r))continue;let c=e.indexOf(`>`,t);c!==-1&&e[c-1]===`/`||i++}return i}var y3=/<\/([A-Z][A-Za-z0-9.]*)>/g;function b3(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function x3(e){let t=new Map,n=new RegExp(y3.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function S3(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function C3(e){let t=[],n=e.indexOf(`>`);for(;n!==-1;)t.push(n),n=e.indexOf(`>`,n+1);return t}var w3=1024;function T3(e,t){if(t[e-1]!==`(`||t[e-2]!==`]`)return!1;let n=e-2,r=0;for(let e=n-1;e>=0&&t[e]===`\\`;e--)r++;if(r%2==1)return!1;let i=!1,a=Math.max(0,n-w3);for(let e=n-1;e>=a;e--){let n=t[e];if(n===`
511
+ `||n===`\r`||n==="`")return!1;if(n!==`[`&&n!==`]`)continue;let r=0;for(let n=e-1;n>=0&&t[n]===`\\`;n--)r++;if(r%2!=1){if(n===`]`||t[e+1]===`^`||t[e-1]===`]`)return!1;i=!0;break}}if(!i)return!1;let o=!1,s=-1,c=Math.min(t.length,e+1+w3);for(let n=e+1;n<c;n++){let e=t[n];if(e===`>`){s=n;break}if(e===`<`||e===`\\`||e===`
512
+ `||e===`\r`||e===i3||e===a3||e===o3||e===s3||e===c3)return!1;(e===` `||e===` `)&&(o=!0)}return s===-1||!o?!1:t[s+1]===`)`}function E3(e,t,n,r){let i=b3(n,e);if(i>=n.length)return!1;let a=n[i],o=b3(r,e);return a>=(o<r.length?r[o]:t.length)?!1:t[a-1]===`/`}function D3(e){let t=[];for(let n of e.matchAll(/<\/?([A-Z][A-Za-z0-9.]*)/g)){let r=n.index;if(t.length>0){let[e,n]=t[t.length-1];if(r>e&&r<=n)continue}let i=r+n[0].length,a=!1,o=!1,s=!1,c=0,l=-1;for(;i<e.length;){let t=e[i];if(a)t===`'`?a=!1:t===`\\`&&i+1<e.length&&i++;else if(o)t===`"`?o=!1:t===`\\`&&i+1<e.length&&i++;else if(s)t==="`"?s=!1:t===`\\`&&i+1<e.length&&i++;else if(t===`'`)a=!0;else if(t===`"`)o=!0;else if(t==="`")s=!0;else if(t===`{`)c++;else if(t===`}`&&c>0)c--;else if(c===0&&t===`>`){l=i;break}i++}if(l!==-1){if(e.slice(r,l).includes(`
513
513
 
514
- `))continue;t.push([r,l])}}return t}function D3(e,t){if(t.length===0)return!1;let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>>1,[a,o]=t[i];if(e<=a)r=i-1;else if(e>o)n=i+1;else return!0}return!1}function O3(e,t,n){let r=Math.min(t.length,n),i=!1,a=0;for(let n=e;n<r;n++){let e=t[n];if(i){e===`"`&&(i=!1),e===`\\`&&n+1<r&&n++;continue}if(e===`"`){i=!0;continue}if(e===`{`){a++;continue}if(e===`}`&&a>0){a--;continue}if(!(a>0)&&e===`>`)return n>0&&t[n-1]===`/`}return!1}function k3(e){let t=e;if(l3.test(t))for(let[e,n]of c3)t=t.replaceAll(e,n);t=t.replace(f3,e=>e.replace(/</g,r3).replace(/>/g,i3)),t=t.replace(d3,(e,t)=>`${r3}${t.replaceAll(`:`,a3).replaceAll(`@`,o3)}${i3}`);let n=new Map,r=[...P4(t),...L4(t)];t=t.replace(p3,(e,i,a)=>{if(g3.has(i)){let o=n.get(i)??0;if(o<_3(t,i,a,r))return n.set(i,o+1),e}return e.replace(/</g,r3).replace(/>/g,i3)}),t=t.replace(m3,(e,t)=>h3.has(t)&&e.endsWith(`/>`)||g3.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,r3).replace(/>/g,i3):e),t=t.replace(/<>/g,`${r3}${i3}`);let i=b3(t),a=x3(t),o=S3(t),s=E3(t);t=t.replace(/</g,(e,n)=>{if(w3(n,t)||D3(n,s))return e;let r=t.slice(n,n+256);if(r[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(r)?e:r3;let c=/^<([a-z][a-z0-9]*)/.exec(r);if(c&&h3.has(c[1])&&T3(n,t,o,a))return e;let l=/^<([a-z][a-z0-9]*)([\s/>])/.exec(r);if(l&&g3.has(l[1])){let i=l[1];return r.startsWith(`<${i}/>`)||t.indexOf(`</${i}>`,n)!==-1?e:r3}let u=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(r);if(!u)return r3;let d=u[1],f=y3(a,n),p=f<a.length?a[f]:t.length;if(O3(n+1+d.length,t,p))return e;let m=i.get(d);return m&&y3(m,n)<m.length?e:r3});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
514
+ `))continue;t.push([r,l])}}return t}function O3(e,t){if(t.length===0)return!1;let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>>1,[a,o]=t[i];if(e<=a)r=i-1;else if(e>o)n=i+1;else return!0}return!1}function k3(e,t,n){let r=Math.min(t.length,n),i=!1,a=0;for(let n=e;n<r;n++){let e=t[n];if(i){e===`"`&&(i=!1),e===`\\`&&n+1<r&&n++;continue}if(e===`"`){i=!0;continue}if(e===`{`){a++;continue}if(e===`}`&&a>0){a--;continue}if(!(a>0)&&e===`>`)return n>0&&t[n-1]===`/`}return!1}function A3(e){let t=e;if(u3.test(t))for(let[e,n]of l3)t=t.replaceAll(e,n);t=t.replace(p3,e=>e.replace(/</g,i3).replace(/>/g,a3)),t=t.replace(f3,(e,t)=>`${i3}${t.replaceAll(`:`,o3).replaceAll(`@`,s3)}${a3}`);let n=new Map,r=[...F4(t),...R4(t)];t=t.replace(m3,(e,i,a)=>{if(_3.has(i)){let o=n.get(i)??0;if(o<v3(t,i,a,r))return n.set(i,o+1),e}return e.replace(/</g,i3).replace(/>/g,a3)}),t=t.replace(h3,(e,t)=>g3.has(t)&&e.endsWith(`/>`)||_3.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,i3).replace(/>/g,a3):e),t=t.replace(/<>/g,`${i3}${a3}`);let i=x3(t),a=S3(t),o=C3(t),s=D3(t);t=t.replace(/</g,(e,n)=>{if(T3(n,t)||O3(n,s))return e;let r=t.slice(n,n+256);if(r[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(r)?e:i3;let c=/^<([a-z][a-z0-9]*)/.exec(r);if(c&&g3.has(c[1])&&E3(n,t,o,a))return e;let l=/^<([a-z][a-z0-9]*)([\s/>])/.exec(r);if(l&&_3.has(l[1])){let i=l[1];return r.startsWith(`<${i}/>`)||t.indexOf(`</${i}>`,n)!==-1?e:i3}let u=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(r);if(!u)return i3;let d=u[1],f=b3(a,n),p=f<a.length?a[f]:t.length;if(k3(n+1+d.length,t,p))return e;let m=i.get(d);return m&&b3(m,n)<m.length?e:i3});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
515
515
  `){let i=t[r+1];if(i===`
516
516
  `||i===`>`){if(e.push(...n),n.length=0,i===`
517
517
  `)for(;t[r+1]===`
518
- `;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=t.split(``);for(let t of e)n[t]=s3;t=n.join(``)}}return t}function A3(e){return l3.test(e)||u3.test(e)}function j3(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&A3(t.value)&&(t.value=M3(t.value)),typeof t.url==`string`&&A3(t.url)&&(t.url=M3(t.url)),typeof t.title==`string`&&A3(t.title)&&(t.title=M3(t.title)),typeof t.alt==`string`&&A3(t.alt)&&(t.alt=M3(t.alt)),typeof t.lang==`string`&&A3(t.lang)&&(t.lang=M3(t.lang)),typeof t.meta==`string`&&A3(t.meta)&&(t.meta=M3(t.meta))})}}function M3(e){let t=e.replaceAll(r3,`<`).replaceAll(i3,`>`).replaceAll(a3,`:`).replaceAll(o3,`@`).replaceAll(s3,`{`);if(u3.test(t))for(let[e,n]of c3)t=t.replaceAll(n,e);return t}var N3=``,P3=``,F3=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function I3(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function L3(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||I3(e,r)%2==1?t:n(t))}function R3(e){return F3.lastIndex=0,e.replace(F3,e=>{let t=e.slice(1,-1);if(t.startsWith(`#`)){let e=t[1]===`x`||t[1]===`X`;return E(t.slice(e?2:1),e?16:10)}let n=f(t);return n===!1?e:n})}function z3(e){return L3(e,F3,e=>`${N3}${e.slice(1,-1)}${P3}`)}var B3=RegExp(`${N3}([^${P3}]+)${P3}`,`g`);function V3(e){if(!e.includes(N3))return{value:e,spans:[]};let t=[],n=``,r=0;B3.lastIndex=0;let i=B3.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=B3.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function H3(){return e=>{D(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(N3)){let{value:n,spans:r}=V3(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`,`lang`,`meta`]){let n=t[e];typeof n==`string`&&n.includes(N3)&&(t[e]=V3(n).value)}})}}var U3=``,W3=/\\</g;function G3(e){return L3(e,W3,e=>`${U3}${e.slice(1)}`)}function K3(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(U3)&&(t.value=t.value.split(U3).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(U3)&&(t[e]=n.split(U3).join(``))}})}}var q3=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),J3={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},Y3=`ok-alert`,X3=RegExp(`(?:^|\\s)${Y3}-(\\w+)(?:\\s|$)`),Z3=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function Q3(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
519
- `,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(Z3);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function $3(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(X3);return n?n[1].toLowerCase():null}function e6(e){return J3[e.toLowerCase()]??null}function t6(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&n6(o[0],s)?o.slice(1):o,position:e.position}}function n6(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function r6(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${Y3}-title`)}function i6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=$3(e);if(!i)return;let a=e6(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=Q3(n,e.position.start.offset),s&&(o=s.title,a||=e6(s.rawType)));let c=a??`note`,l=s&&q3.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=Q3(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!r6(e.children[0]))return;let f=t6(e,c,o,l,d);r.children[t]=f})}}var a6=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,o6={markers:`*`,classPrefix:Y3,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>a6})};function s6(e,t,n){return e[t]===`\\`&&t+1<e.length&&e[t+1]===n}function c6(e,t,n,r){let i=t,a=0;for(;a<r&&i<e.length;)i+=s6(e,i,n[a])?2:1,a+=1;return i}var l6=new Set;function u6(e,t){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return null;let n=t.position.start.offset,r=t.value,i=Math.min(t.position.end?.offset??e.length,n+2*r.length,e.length),a=!1;for(let t=n;t<i;t++)if(e.charCodeAt(t)===92){a=!0;break}if(!a)return l6;let o=null,s=n,c=0;for(;c<r.length&&s<e.length;){if(s6(e,s,r[c]))o===null&&(o=new Set),o.add(c),s+=2;else if(e[s]===r[c])s+=1;else break;c+=1}return o??l6}function d6(e,t,n){if(e===null||e.size===0)return!1;for(let r=0;r<n;r++)if(e.has(t+r))return!0;return!1}function f6(e,t){let n=1,r=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
520
- `?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function p6(e,t,n){return{start:f6(e,t),end:f6(e,n)}}function m6(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return p6(e,c6(e,i,t.value,n),c6(e,i,t.value,r))}var h6=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,g6=/<!--([\s\S]*?)-->/g;function _6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;y6(e,n),D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`%%`)===-1&&i.indexOf(`<!--`)===-1)return;let a=v6(i,u6(n,e));if(a.length===0)return;let o=[],s=0;for(let t of a){if(t.start>s){let r={type:`text`,value:i.slice(s,t.start)},a=m6(n,e,s,t.start);a&&(r.position=a),o.push(r)}let r={type:`comment`,children:[{type:`text`,value:t.body}],data:{sourceForm:t.sourceForm}},a=m6(n,e,t.start,t.end);a&&(r.position=a),o.push(r),s=t.end}if(s<i.length){let t={type:`text`,value:i.slice(s)},r=m6(n,e,s,i.length);r&&(t.position=r),o.push(t)}return r.children.splice(t,1,...o),[g,t+o.length]})}}function v6(e,t){let n=[];h6.lastIndex=0;let r;for(;(r=h6.exec(e))!==null;){if(d6(t,r.index,2)||d6(t,r.index+r[0].length-2,2)){h6.lastIndex=r.index+1;continue}r[1].trim().length!==0&&n.push({start:r.index,end:r.index+r[0].length,body:r[1],sourceForm:`percent`})}g6.lastIndex=0;let i;for(;(i=g6.exec(e))!==null;){if(d6(t,i.index,4)||d6(t,i.index+i[0].length-3,3)){g6.lastIndex=i.index+1;continue}let e=i[1].trim();e!==``&&n.push({start:i.index,end:i.index+i[0].length,body:e,sourceForm:`html`})}n.sort((e,t)=>e.start-t.start);let a=[],o=-1;for(let e of n)e.start<o||(a.push(e),o=e.end);return a}function y6(e,t){let n=e.children,r=0;for(;r<n.length;){let e=n[r];if(e.type===`paragraph`){let i=S6(e);if(i!==null){let a=e.children[0],o,s=()=>(o===void 0&&(o=u6(t,a)),o),c=C6(i);if(c!==null&&!d6(s(),0,2)&&!d6(s(),i.length-2,2)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:c}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,1,e),r+=1;continue}let l=w6(i);if(l!==null&&!d6(s(),i.length-i.trimStart().length,4)&&!d6(s(),i.trimEnd().length-3,3)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:l}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}let a=T6(e);if(a!==null&&!x6(t,e,4,3)){let e={type:`commentBlock`,children:[a],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}let o=E6(e);if(o!==null&&!x6(t,e,2,2)){let e={type:`commentBlock`,children:[o],data:{sourceForm:`percent`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}if(e.type===`paragraph`&&O6(e,t)){let e=r+1;for(;e<n.length;){let r=n[e];if(r.type===`paragraph`&&O6(r,t))break;e+=1}if(e<n.length&&e>r+1){let t={type:`commentBlock`,children:n.slice(r+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,e-r+1,t),r+=1;continue}}r+=1}}function b6(e,t,n,r){return d6(u6(e,t),n,r)}function x6(e,t,n,r){let i=t.children[0],a=t.children[t.children.length-1];if(i.type!==`text`||a.type!==`text`)return!1;let o=i.value.length-i.value.trimStart().length,s=a.value.trimEnd().length-r,c=u6(e,i);return d6(c,o,n)?!0:d6(a===i?c:u6(e,a),s,r)}function S6(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function C6(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function w6(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function T6(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(D6(r,`<!--`)>1||D6(r,`-->`)>0)return null}else if(t===e.children.length-1){if(D6(r,`<!--`)>0||D6(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function E6(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function D6(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function O6(e,t){let n=S6(e);return n===null||n.trim()!==`%%`?!1:!b6(t,e.children[0],n.indexOf(`%%`),2)}var k6=/^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm,A6=/^[ ]{0,3}([-*+]|\d{1,9}[.)])([ \t]|$)/;function j6(e,t){if(t===0)return!1;let n=t-1;for(;n>=0;){let r=n;for(;r>0&&e[r-1]!==`
521
- `;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return A6.test(i)}return!1}function M6(e){if(!e.includes(`</`))return e;let t=P4(e),n=!1,r=e.replace(k6,(r,i,a,o,s)=>F4(s,t)||!j6(e,s)?r:(n=!0,`${a}${o}`));return n?r:e}var N6=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,P6=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,F6=/^\s*<\/details>\s*$/;function I6(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function L6(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function R6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function z6(e){return e.children[0].value??``}function B6(e){if(!R6(e))return null;let t=z6(e).match(N6);if(!t)return null;let{defaultOpen:n,name:r,id:i}=I6(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:L6({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function V6(e,t){let n=e[t];if(!R6(n))return null;let r=z6(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(P6);if(!i)return null;let{defaultOpen:a,name:o,id:s}=I6(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!R6(t))continue;let r=z6(t);if(F6.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function H6(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(R6(e)){let r=B6(e);if(r){t[n]=r,n++;continue}let i=V6(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:L6(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function U6(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&H6(e)})}}var W6=/^<(div|center)(\s[^>]*?)?\s*>$/i,G6=new Set([`center`,`left`,`right`,`justify`]);function K6(e){if(!e)return null;let t=e.match(/\balign\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+))/i);if(!t)return null;let n=(t[1]??t[2]??t[3]??``).toLowerCase();return G6.has(n)?n:null}function q6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function J6(e){return e.children[0].value??``}function Y6(e){if(!q6(e))return null;let t=J6(e).trim().match(W6);if(!t)return null;let n=t[1].toLowerCase(),r=t[2]??``;return{tag:n,align:K6(r)??(n===`center`?`center`:null),sourceAttrs:r}}function X6(e,t,n){let r=new RegExp(String.raw`^\s*</${n}>\s*$`,`i`);for(let i=t+1;i<e.length;i++){let t=e[i];if(!q6(t))continue;let a=J6(t);if(r.test(a))return i;let o=a.trimStart().toLowerCase();if(o.startsWith(`<div`)||o.startsWith(`<center`)||o.includes(`</${n}>`))return null}return null}function Z6(e){let t=e.children,n=0;for(;n<t.length;){let e=Y6(t[n]);if(e!==null){let r=X6(t,n,e.tag);if(r!==null){let i=t[n],a=t[r],o=t.slice(n+1,r),s=i.position,c=a.position,l={type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[...e.align===null?[]:[{type:`mdxJsxAttribute`,name:`align`,value:e.align}],{type:`mdxJsxAttribute`,name:`tag`,value:e.tag},{type:`mdxJsxAttribute`,name:`sourceAttrs`,value:e.sourceAttrs}],children:o,position:s&&c?{start:s.start,end:c.end}:void 0};t.splice(n,r-n+1,l),n++;continue}}n++}}function Q6(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&Z6(e)})}}var $6=`&#x20;`;function e8(e){return e.type===`listItem`&&typeof e.checked==`boolean`}function t8(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];return n?.type===`paragraph`&&(n.children?.length??0)===0}function n8(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];if(n?.type!==`paragraph`||(n.children?.length??0)!==1)return!1;let r=n.children[0];if(r?.type!==`text`||r.value!==$6)return!1;let i=r.data?.entityRefSpans;if(!Array.isArray(i)||i.length!==1)return!1;let a=i[0];return a?.offset===0&&a.length===6&&a.raw===$6}function r8(e){D(e,`listItem`,e=>{if(!e8(e)||!t8(e))return;let t=e.children[0];t.children=[{type:`text`,value:` `,data:{sourceRaw:$6}}]})}function i8(e){D(e,`listItem`,e=>{!e8(e)||!n8(e)||(e.children[0].children=[])})}function a8(){return e=>{i8(e)}}var o8=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function s8(e){return e.type===`strong`||e.type===`emphasis`||e.type===`delete`||e.type===`inlineCode`}function c8(e){return e.type===`text`||e.type===`inlineCode`?e.value.length>0?e.value.charAt(0):null:`children`in e&&Array.isArray(e.children)&&e.children.length>0?c8(e.children[0]):null}function l8(e){if(e.type===`text`||e.type===`inlineCode`)return e.value.length>0?e.value.slice(-1):null;if(`children`in e&&Array.isArray(e.children)&&e.children.length>0){let t=e.children;return l8(t[t.length-1])}return null}function u8(e,t,n){let r={type:`text`,value:e.value.slice(t,n)},i=e.data?.entityRefSpans;if(i?.length){let e=i.filter(e=>e.offset>=t&&e.offset+e.length<=n).map(e=>({...e,offset:e.offset-t}));e.length>0&&(r.data={entityRefSpans:e})}return r}function d8(e,t){let n=e.children,r=new Map,i=e=>{let n=r.get(e);if(n!==void 0)return n;let i=u6(t,e);return r.set(e,i),i},a=0;for(;a<n.length;){let e=n[a];if(e.type!==`text`){a++;continue}let t=e.value,r=-1;for(let o=0;o<=t.length-2;o++){if(t.charCodeAt(o)!==61||t.charCodeAt(o+1)!==61||o>0&&t.charCodeAt(o-1)===61||d6(i(e),o,2))continue;let s;if(o+2<t.length)s=t.charAt(o+2);else{let e=n[a+1];if(!e)continue;s=c8(e)}if(!(s===null||/\s/.test(s))){r=o;break}}if(r===-1){a++;continue}let o=-1,s=-1,c=!1;for(let s=r+3;s<=t.length-2;s++){if(t.charCodeAt(s)!==61||t.charCodeAt(s+1)!==61||d6(i(e),s,2))continue;let r=t.charAt(s-1);if(/[\s=]/.test(r))continue;let c;if(s+2<t.length)c=t.charAt(s+2);else{let e=n[a+1];c=e?e.type===`text`?e.value[0]??null:c8(e):null}if(c!==`=`){o=-2;break}}if(o===-2){a++;continue}for(let e=a+1;e<n.length;e++){let t=n[e];if(t.type===`text`){for(let r=0;r<=t.value.length-2;r++){if(t.value.charCodeAt(r)!==61||t.value.charCodeAt(r+1)!==61||d6(i(t),r,2))continue;let a;if(r>0)a=t.value.charAt(r-1);else{let t=n[e-1];a=l8(t)}if(a===null||/[\s=]/.test(a))continue;let l;if(r+2<t.value.length)l=t.value.charAt(r+2);else{let t=n[e+1];l=t?t.type===`text`?t.value[0]??null:c8(t):null}if(l!==`=`){o=e,s=r,c=!0;break}}if(o>=0)break}else if(!s8(t))break}if(o<0){a++;continue}let l=n[o],u=t.slice(0,r),d=t.slice(r+2),f=l.value.slice(0,s),p=l.value.slice(s+2),m=[];d.length>0&&m.push(u8(e,r+2,t.length));for(let e=a+1;e<o;e++)m.push(n[e]);if(f.length>0&&m.push(u8(l,0,s)),!c){a++;continue}let h={type:`mark`,children:m},g=[];u.length>0&&g.push(u8(e,0,r)),g.push(h),p.length>0&&g.push(u8(l,s+2,l.value.length)),n.splice(a,o-a+1,...g),a+=+(u.length>0)+1}}function f8(e,t){if(`children`in e&&Array.isArray(e.children)){d8(e,t);for(let n of e.children)f8(n,t)}}function p8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`==`)===-1)return;let a=u6(n,e);o8.lastIndex=0;let o=[],s;for(;(s=o8.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(d6(a,e,2)||d6(a,t-2,2)){o8.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,i=r+t[0].length;if(r>l){let t=u8(e,l,r),i=m6(n,e,l,r);i&&(t.position=i),c.push(t)}let a=u8(e,r+2,i-2),o=m6(n,e,r+2,i-2);o&&(a.position=o);let s={type:`mark`,children:[a]},u=m6(n,e,r,i);u&&(s.position=u),c.push(s),l=i}if(l<i.length){let t=u8(e,l,i.length),r=m6(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[g,t+c.length]}),f8(e,n),D(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function m8(){return e=>{D(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=h8(r,e);n.children[t]=i})}}function h8(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];typeof e.alt==`string`&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}var g8=/^( {4}|\t)/;function _8(e){let t=e.split(`
522
- `),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!g8.test(e)))return!1;return n}function v8(e){return e.split(`
518
+ `;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=t.split(``);for(let t of e)n[t]=c3;t=n.join(``)}}return t}function j3(e){return u3.test(e)||d3.test(e)}function M3(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&j3(t.value)&&(t.value=N3(t.value)),typeof t.url==`string`&&j3(t.url)&&(t.url=N3(t.url)),typeof t.title==`string`&&j3(t.title)&&(t.title=N3(t.title)),typeof t.alt==`string`&&j3(t.alt)&&(t.alt=N3(t.alt)),typeof t.lang==`string`&&j3(t.lang)&&(t.lang=N3(t.lang)),typeof t.meta==`string`&&j3(t.meta)&&(t.meta=N3(t.meta))})}}function N3(e){let t=e.replaceAll(i3,`<`).replaceAll(a3,`>`).replaceAll(o3,`:`).replaceAll(s3,`@`).replaceAll(c3,`{`);if(d3.test(t))for(let[e,n]of l3)t=t.replaceAll(n,e);return t}var P3=``,F3=``,I3=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function L3(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function R3(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||L3(e,r)%2==1?t:n(t))}function z3(e){return I3.lastIndex=0,e.replace(I3,e=>{let t=e.slice(1,-1);if(t.startsWith(`#`)){let e=t[1]===`x`||t[1]===`X`;return E(t.slice(e?2:1),e?16:10)}let n=f(t);return n===!1?e:n})}function B3(e){return R3(e,I3,e=>`${P3}${e.slice(1,-1)}${F3}`)}var V3=RegExp(`${P3}([^${F3}]+)${F3}`,`g`);function H3(e){if(!e.includes(P3))return{value:e,spans:[]};let t=[],n=``,r=0;V3.lastIndex=0;let i=V3.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=V3.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function U3(){return e=>{D(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(P3)){let{value:n,spans:r}=H3(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`,`lang`,`meta`]){let n=t[e];typeof n==`string`&&n.includes(P3)&&(t[e]=H3(n).value)}})}}var W3=``,G3=/\\</g;function K3(e){return R3(e,G3,e=>`${W3}${e.slice(1)}`)}function q3(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(W3)&&(t.value=t.value.split(W3).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(W3)&&(t[e]=n.split(W3).join(``))}})}}var J3=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),Y3={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},X3=`ok-alert`,Z3=RegExp(`(?:^|\\s)${X3}-(\\w+)(?:\\s|$)`),Q3=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function $3(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
519
+ `,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(Q3);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function e6(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(Z3);return n?n[1].toLowerCase():null}function t6(e){return Y3[e.toLowerCase()]??null}function n6(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&r6(o[0],s)?o.slice(1):o,position:e.position}}function r6(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function i6(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${X3}-title`)}function a6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=e6(e);if(!i)return;let a=t6(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=$3(n,e.position.start.offset),s&&(o=s.title,a||=t6(s.rawType)));let c=a??`note`,l=s&&J3.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=$3(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!i6(e.children[0]))return;let f=n6(e,c,o,l,d);r.children[t]=f})}}var o6=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,s6={markers:`*`,classPrefix:X3,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>o6})};function c6(e,t,n){return e[t]===`\\`&&t+1<e.length&&e[t+1]===n}function l6(e,t,n,r){let i=t,a=0;for(;a<r&&i<e.length;)i+=c6(e,i,n[a])?2:1,a+=1;return i}var u6=new Set;function d6(e,t){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return null;let n=t.position.start.offset,r=t.value,i=Math.min(t.position.end?.offset??e.length,n+2*r.length,e.length),a=!1;for(let t=n;t<i;t++)if(e.charCodeAt(t)===92){a=!0;break}if(!a)return u6;let o=null,s=n,c=0;for(;c<r.length&&s<e.length;){if(c6(e,s,r[c]))o===null&&(o=new Set),o.add(c),s+=2;else if(e[s]===r[c])s+=1;else break;c+=1}return o??u6}function f6(e,t,n){if(e===null||e.size===0)return!1;for(let r=0;r<n;r++)if(e.has(t+r))return!0;return!1}function p6(e,t){let n=1,r=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
520
+ `?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function m6(e,t,n){return{start:p6(e,t),end:p6(e,n)}}function h6(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return m6(e,l6(e,i,t.value,n),l6(e,i,t.value,r))}var g6=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,_6=/<!--([\s\S]*?)-->/g;function v6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;b6(e,n),D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`%%`)===-1&&i.indexOf(`<!--`)===-1)return;let a=y6(i,d6(n,e));if(a.length===0)return;let o=[],s=0;for(let t of a){if(t.start>s){let r={type:`text`,value:i.slice(s,t.start)},a=h6(n,e,s,t.start);a&&(r.position=a),o.push(r)}let r={type:`comment`,children:[{type:`text`,value:t.body}],data:{sourceForm:t.sourceForm}},a=h6(n,e,t.start,t.end);a&&(r.position=a),o.push(r),s=t.end}if(s<i.length){let t={type:`text`,value:i.slice(s)},r=h6(n,e,s,i.length);r&&(t.position=r),o.push(t)}return r.children.splice(t,1,...o),[g,t+o.length]})}}function y6(e,t){let n=[];g6.lastIndex=0;let r;for(;(r=g6.exec(e))!==null;){if(f6(t,r.index,2)||f6(t,r.index+r[0].length-2,2)){g6.lastIndex=r.index+1;continue}r[1].trim().length!==0&&n.push({start:r.index,end:r.index+r[0].length,body:r[1],sourceForm:`percent`})}_6.lastIndex=0;let i;for(;(i=_6.exec(e))!==null;){if(f6(t,i.index,4)||f6(t,i.index+i[0].length-3,3)){_6.lastIndex=i.index+1;continue}let e=i[1].trim();e!==``&&n.push({start:i.index,end:i.index+i[0].length,body:e,sourceForm:`html`})}n.sort((e,t)=>e.start-t.start);let a=[],o=-1;for(let e of n)e.start<o||(a.push(e),o=e.end);return a}function b6(e,t){let n=e.children,r=0;for(;r<n.length;){let e=n[r];if(e.type===`paragraph`){let i=C6(e);if(i!==null){let a=e.children[0],o,s=()=>(o===void 0&&(o=d6(t,a)),o),c=w6(i);if(c!==null&&!f6(s(),0,2)&&!f6(s(),i.length-2,2)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:c}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,1,e),r+=1;continue}let l=T6(i);if(l!==null&&!f6(s(),i.length-i.trimStart().length,4)&&!f6(s(),i.trimEnd().length-3,3)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:l}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}let a=E6(e);if(a!==null&&!S6(t,e,4,3)){let e={type:`commentBlock`,children:[a],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}let o=D6(e);if(o!==null&&!S6(t,e,2,2)){let e={type:`commentBlock`,children:[o],data:{sourceForm:`percent`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}if(e.type===`paragraph`&&k6(e,t)){let e=r+1;for(;e<n.length;){let r=n[e];if(r.type===`paragraph`&&k6(r,t))break;e+=1}if(e<n.length&&e>r+1){let t={type:`commentBlock`,children:n.slice(r+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,e-r+1,t),r+=1;continue}}r+=1}}function x6(e,t,n,r){return f6(d6(e,t),n,r)}function S6(e,t,n,r){let i=t.children[0],a=t.children[t.children.length-1];if(i.type!==`text`||a.type!==`text`)return!1;let o=i.value.length-i.value.trimStart().length,s=a.value.trimEnd().length-r,c=d6(e,i);return f6(c,o,n)?!0:f6(a===i?c:d6(e,a),s,r)}function C6(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function w6(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function T6(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function E6(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(O6(r,`<!--`)>1||O6(r,`-->`)>0)return null}else if(t===e.children.length-1){if(O6(r,`<!--`)>0||O6(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function D6(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function O6(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function k6(e,t){let n=C6(e);return n===null||n.trim()!==`%%`?!1:!x6(t,e.children[0],n.indexOf(`%%`),2)}var A6=/^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm,j6=/^[ ]{0,3}([-*+]|\d{1,9}[.)])([ \t]|$)/;function M6(e,t){if(t===0)return!1;let n=t-1;for(;n>=0;){let r=n;for(;r>0&&e[r-1]!==`
521
+ `;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return j6.test(i)}return!1}function N6(e){if(!e.includes(`</`))return e;let t=F4(e),n=!1,r=e.replace(A6,(r,i,a,o,s)=>I4(s,t)||!M6(e,s)?r:(n=!0,`${a}${o}`));return n?r:e}var P6=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,F6=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,I6=/^\s*<\/details>\s*$/;function L6(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function R6(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function z6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function B6(e){return e.children[0].value??``}function V6(e){if(!z6(e))return null;let t=B6(e).match(P6);if(!t)return null;let{defaultOpen:n,name:r,id:i}=L6(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:R6({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function H6(e,t){let n=e[t];if(!z6(n))return null;let r=B6(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(F6);if(!i)return null;let{defaultOpen:a,name:o,id:s}=L6(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!z6(t))continue;let r=B6(t);if(I6.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function U6(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(z6(e)){let r=V6(e);if(r){t[n]=r,n++;continue}let i=H6(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:R6(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function W6(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&U6(e)})}}var G6=/^<(div|center)(\s[^>]*?)?\s*>$/i,K6=new Set([`center`,`left`,`right`,`justify`]);function q6(e){if(!e)return null;let t=e.match(/\balign\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+))/i);if(!t)return null;let n=(t[1]??t[2]??t[3]??``).toLowerCase();return K6.has(n)?n:null}function J6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function Y6(e){return e.children[0].value??``}function X6(e){if(!J6(e))return null;let t=Y6(e).trim().match(G6);if(!t)return null;let n=t[1].toLowerCase(),r=t[2]??``;return{tag:n,align:q6(r)??(n===`center`?`center`:null),sourceAttrs:r}}function Z6(e,t,n){let r=new RegExp(String.raw`^\s*</${n}>\s*$`,`i`);for(let i=t+1;i<e.length;i++){let t=e[i];if(!J6(t))continue;let a=Y6(t);if(r.test(a))return i;let o=a.trimStart().toLowerCase();if(o.startsWith(`<div`)||o.startsWith(`<center`)||o.includes(`</${n}>`))return null}return null}function Q6(e){let t=e.children,n=0;for(;n<t.length;){let e=X6(t[n]);if(e!==null){let r=Z6(t,n,e.tag);if(r!==null){let i=t[n],a=t[r],o=t.slice(n+1,r),s=i.position,c=a.position,l={type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[...e.align===null?[]:[{type:`mdxJsxAttribute`,name:`align`,value:e.align}],{type:`mdxJsxAttribute`,name:`tag`,value:e.tag},{type:`mdxJsxAttribute`,name:`sourceAttrs`,value:e.sourceAttrs}],children:o,position:s&&c?{start:s.start,end:c.end}:void 0};t.splice(n,r-n+1,l),n++;continue}}n++}}function $6(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&Q6(e)})}}var e8=`&#x20;`;function t8(e){return e.type===`listItem`&&typeof e.checked==`boolean`}function n8(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];return n?.type===`paragraph`&&(n.children?.length??0)===0}function r8(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];if(n?.type!==`paragraph`||(n.children?.length??0)!==1)return!1;let r=n.children[0];if(r?.type!==`text`||r.value!==e8)return!1;let i=r.data?.entityRefSpans;if(!Array.isArray(i)||i.length!==1)return!1;let a=i[0];return a?.offset===0&&a.length===6&&a.raw===e8}function i8(e){D(e,`listItem`,e=>{if(!t8(e)||!n8(e))return;let t=e.children[0];t.children=[{type:`text`,value:` `,data:{sourceRaw:e8}}]})}function a8(e){D(e,`listItem`,e=>{!t8(e)||!r8(e)||(e.children[0].children=[])})}function o8(){return e=>{a8(e)}}var s8=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function c8(e){return e.type===`strong`||e.type===`emphasis`||e.type===`delete`||e.type===`inlineCode`}function l8(e){return e.type===`text`||e.type===`inlineCode`?e.value.length>0?e.value.charAt(0):null:`children`in e&&Array.isArray(e.children)&&e.children.length>0?l8(e.children[0]):null}function u8(e){if(e.type===`text`||e.type===`inlineCode`)return e.value.length>0?e.value.slice(-1):null;if(`children`in e&&Array.isArray(e.children)&&e.children.length>0){let t=e.children;return u8(t[t.length-1])}return null}function d8(e,t,n){let r={type:`text`,value:e.value.slice(t,n)},i=e.data?.entityRefSpans;if(i?.length){let e=i.filter(e=>e.offset>=t&&e.offset+e.length<=n).map(e=>({...e,offset:e.offset-t}));e.length>0&&(r.data={entityRefSpans:e})}return r}function f8(e,t){let n=e.children,r=new Map,i=e=>{let n=r.get(e);if(n!==void 0)return n;let i=d6(t,e);return r.set(e,i),i},a=0;for(;a<n.length;){let e=n[a];if(e.type!==`text`){a++;continue}let t=e.value,r=-1;for(let o=0;o<=t.length-2;o++){if(t.charCodeAt(o)!==61||t.charCodeAt(o+1)!==61||o>0&&t.charCodeAt(o-1)===61||f6(i(e),o,2))continue;let s;if(o+2<t.length)s=t.charAt(o+2);else{let e=n[a+1];if(!e)continue;s=l8(e)}if(!(s===null||/\s/.test(s))){r=o;break}}if(r===-1){a++;continue}let o=-1,s=-1,c=!1;for(let s=r+3;s<=t.length-2;s++){if(t.charCodeAt(s)!==61||t.charCodeAt(s+1)!==61||f6(i(e),s,2))continue;let r=t.charAt(s-1);if(/[\s=]/.test(r))continue;let c;if(s+2<t.length)c=t.charAt(s+2);else{let e=n[a+1];c=e?e.type===`text`?e.value[0]??null:l8(e):null}if(c!==`=`){o=-2;break}}if(o===-2){a++;continue}for(let e=a+1;e<n.length;e++){let t=n[e];if(t.type===`text`){for(let r=0;r<=t.value.length-2;r++){if(t.value.charCodeAt(r)!==61||t.value.charCodeAt(r+1)!==61||f6(i(t),r,2))continue;let a;if(r>0)a=t.value.charAt(r-1);else{let t=n[e-1];a=u8(t)}if(a===null||/[\s=]/.test(a))continue;let l;if(r+2<t.value.length)l=t.value.charAt(r+2);else{let t=n[e+1];l=t?t.type===`text`?t.value[0]??null:l8(t):null}if(l!==`=`){o=e,s=r,c=!0;break}}if(o>=0)break}else if(!c8(t))break}if(o<0){a++;continue}let l=n[o],u=t.slice(0,r),d=t.slice(r+2),f=l.value.slice(0,s),p=l.value.slice(s+2),m=[];d.length>0&&m.push(d8(e,r+2,t.length));for(let e=a+1;e<o;e++)m.push(n[e]);if(f.length>0&&m.push(d8(l,0,s)),!c){a++;continue}let h={type:`mark`,children:m},g=[];u.length>0&&g.push(d8(e,0,r)),g.push(h),p.length>0&&g.push(d8(l,s+2,l.value.length)),n.splice(a,o-a+1,...g),a+=+(u.length>0)+1}}function p8(e,t){if(`children`in e&&Array.isArray(e.children)){f8(e,t);for(let n of e.children)p8(n,t)}}function m8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`==`)===-1)return;let a=d6(n,e);s8.lastIndex=0;let o=[],s;for(;(s=s8.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(f6(a,e,2)||f6(a,t-2,2)){s8.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,i=r+t[0].length;if(r>l){let t=d8(e,l,r),i=h6(n,e,l,r);i&&(t.position=i),c.push(t)}let a=d8(e,r+2,i-2),o=h6(n,e,r+2,i-2);o&&(a.position=o);let s={type:`mark`,children:[a]},u=h6(n,e,r,i);u&&(s.position=u),c.push(s),l=i}if(l<i.length){let t=d8(e,l,i.length),r=h6(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[g,t+c.length]}),p8(e,n),D(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function h8(){return e=>{D(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=g8(r,e);n.children[t]=i})}}function g8(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];typeof e.alt==`string`&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}var _8=/^( {4}|\t)/;function v8(e){let t=e.split(`
522
+ `),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!_8.test(e)))return!1;return n}function y8(e){return e.split(`
523
523
  `).map(e=>e.length===0?e:e.startsWith(` `)?e.slice(4):e.startsWith(` `)?e.slice(1):e).join(`
524
- `)}function y8(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
525
- `;)a--;if(a===r)return null;let o=t.slice(a,r);if(!g8.test(o))return null;let s=t.slice(a,i);if(!_8(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:v8(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var b8=function(){return(e,t)=>{let n=String(t.value??``);n&&D(e,`paragraph`,(e,t,r)=>{if(!r||r.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=y8(e,n);a&&(r.children[t]=a)})}},x8=3,S8=/^\n+$/;function C8(e){return e.length<x8||!S8.test(e)?0:e.length-2}function w8(e,t){let n=[],r=e.children;for(let e=1;e<r.length;e++){let i=r[e-1],a=r[e],o=i?.position?.end?.offset,s=i?.position?.end?.line,c=a?.position?.start?.offset;if(typeof o!=`number`||typeof c!=`number`||typeof s!=`number`||c<o)continue;let l=C8(t.slice(o,c));if(l===0)continue;let u=[],d=[];for(let e=0;e<l;e++)u.push(s+2+e),d.push(o+2+e);n.push({beforeChildIndex:e,lines:u,offsets:d})}return n}function T8(e,t){let n=w8(e,t);if(n.length===0)return;let r=[],i=0;for(let t=0;t<e.children.length;t++){let a=n[i];if(a&&a.beforeChildIndex===t){for(let e=0;e<a.lines.length;e++)r.push(E8(a.lines[e],a.offsets[e]));i+=1}r.push(e.children[t])}e.children=r}function E8(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function D8(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function O8(){return e=>{D(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=D8(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=D8(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var k8=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function A8(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;k8.lastIndex=0;let a=[],o=0;for(;;){let n=k8.exec(e);if(n===null)break;let s=n[0],c=n[1],l=n.index;if(l>o){let n={type:`text`,value:e.slice(o,l)},r=m6(t,i,o,l);r&&(n.position=r),a.push(n)}let u={type:`text`,value:c},d=m6(t,i,l+1,l+1+c.length);d&&(u.position=d);let f={type:`link`,url:c,title:null,children:[u],data:{sourceStyle:`autolink`}},p=m6(t,i,l,l+s.length);p&&(f.position=p),a.push(f),o=l+s.length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=m6(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}var j8=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function M8(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function N8(e,t,n=!1,r){if(!t)return;let i=e.position;if(!i||typeof i.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let a=i.start.offset,o=i.end?.offset??a;if(a<0||o>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${a} end=${o} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(a,o),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&j8.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[a];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(a,a+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[a],i=t.slice(a,o);if(n===`#`){if(e.data.sourceStyle=`atx`,r?.type===`root`){let n=a;for(;n>0&&t[n-1]!==`
524
+ `)}function b8(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
525
+ `;)a--;if(a===r)return null;let o=t.slice(a,r);if(!_8.test(o))return null;let s=t.slice(a,i);if(!v8(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:y8(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var x8=function(){return(e,t)=>{let n=String(t.value??``);n&&D(e,`paragraph`,(e,t,r)=>{if(!r||r.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=b8(e,n);a&&(r.children[t]=a)})}},S8=3,C8=/^\n+$/;function w8(e){return e.length<S8||!C8.test(e)?0:e.length-2}function T8(e,t){let n=[],r=e.children;for(let e=1;e<r.length;e++){let i=r[e-1],a=r[e],o=i?.position?.end?.offset,s=i?.position?.end?.line,c=a?.position?.start?.offset;if(typeof o!=`number`||typeof c!=`number`||typeof s!=`number`||c<o)continue;let l=w8(t.slice(o,c));if(l===0)continue;let u=[],d=[];for(let e=0;e<l;e++)u.push(s+2+e),d.push(o+2+e);n.push({beforeChildIndex:e,lines:u,offsets:d})}return n}function E8(e,t){let n=T8(e,t);if(n.length===0)return;let r=[],i=0;for(let t=0;t<e.children.length;t++){let a=n[i];if(a&&a.beforeChildIndex===t){for(let e=0;e<a.lines.length;e++)r.push(D8(a.lines[e],a.offsets[e]));i+=1}r.push(e.children[t])}e.children=r}function D8(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function O8(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function k8(){return e=>{D(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=O8(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=O8(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var A8=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function j8(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;A8.lastIndex=0;let a=[],o=0;for(;;){let n=A8.exec(e);if(n===null)break;let s=n[0],c=n[1],l=n.index;if(l>o){let n={type:`text`,value:e.slice(o,l)},r=h6(t,i,o,l);r&&(n.position=r),a.push(n)}let u={type:`text`,value:c},d=h6(t,i,l+1,l+1+c.length);d&&(u.position=d);let f={type:`link`,url:c,title:null,children:[u],data:{sourceStyle:`autolink`}},p=h6(t,i,l,l+s.length);p&&(f.position=p),a.push(f),o=l+s.length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=h6(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}var M8=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function N8(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function P8(e,t,n=!1,r){if(!t)return;let i=e.position;if(!i||typeof i.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let a=i.start.offset,o=i.end?.offset??a;if(a<0||o>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${a} end=${o} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(a,o),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&M8.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[a];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(a,a+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[a],i=t.slice(a,o);if(n===`#`){if(e.data.sourceStyle=`atx`,r?.type===`root`){let n=a;for(;n>0&&t[n-1]!==`
526
526
  `;)n--;let r=t.slice(n,a);r.length>=1&&r.length<=3&&/^ +$/.test(r)&&(e.data.sourceLeadingIndent=r.length)}let n=/^#+( {2,})[^ ]/.exec(i);n&&(e.data.sourceInteriorSpacing=n[1].length);let o=/^.*?[ \t](#+)[ \t]*$/.exec(i);o&&(e.data.sourceTrailingHashes=o[1].length)}else{let t=/\n(=+)[ \t]*$/.exec(i),n=/\n(-+)[ \t]*$/.exec(i),r=t??n;r?(e.data.sourceStyle=`setext`,e.data.sourceUnderlineLength=r[1].length):e.data.sourceStyle=`atx`}break}case`blockquote`:{let n=a;for(;n>0&&t[n-1]!==`
527
527
  `;)n--;let r=!1;for(let e=n;e<a;e++)if(t[e]===`>`){r=!0;break}let i=t.slice(a,o).split(`
528
528
  `),s=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.trim().length===0)continue;if(r&&e>0)break;let n=t.replace(/^ {1,3}/,``);if(n[0]!==`>`){e>0&&t.trimStart()[0]!==`>`&&s.push(`lazy`);continue}if(n.slice(1).trimEnd()!==``)if(n[1]===` `)s.push(1);else{let e=0;for(;n[1+e]===` `;)e++;s.push(e)}}s.length>0&&(e.data.sourceMarkerSpacings=s);break}case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`listItem`:{let n=t.slice(a,o),r=/^(?:([-+*])|(\d{1,9})[.)])( *)/.exec(n);if(!r)break;let s=r[1]?1:(r[2]?.length??0)+1,c=r[3].length;c>=2&&c<=4&&(e.data.sourceMarkerSpacing=c),r[2]&&(e.data.sourceOrdinal=Number.parseInt(r[2],10)),e.checked!=null&&/^\[([xX])\] /.exec(n.slice(s+Math.max(c,1)))?.[1]===`X`&&(e.data.sourceCheckboxChar=`X`);let l=s+(c>=2&&c<=4?c:1),u=a;for(;u>0&&t[u-1]!==`
@@ -532,24 +532,24 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
532
532
  `),r=(e.value??``).split(`
533
533
  `);if(n.length===r.length){let t=[],i=!1,a=!0;for(let e=0;e<n.length;e++){let o=n[e],s=r[e];if(!o.endsWith(s)){a=!1;break}let c=o.slice(0,o.length-s.length);if(!/^[ \t]*$/.test(c)){a=!1;break}t.push(c),c!==(s.length>0?` `:``)&&(i=!0)}a&&i&&(e.data.sourceIndents=t)}}break}case`inlineCode`:{let n=t[a];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;a+r<t.length&&t[a+r]===n;)r++;r>=1&&(e.data.sourceFenceLength=r);let i=t.slice(a+r,o-r),s=e.value??``;i!==s&&i===` ${s} `&&(e.data.sourcePadded=!0)}break}case`inlineMath`:if(t[a]===`$`){let n=0;for(;a+n<t.length&&t[a+n]===`$`;)n++;e.data.sourceDelimiter=`$`.repeat(n)}break;case`thematicBreak`:e.data.sourceRaw=t.slice(a,o);break;case`table`:{let n=t.slice(a,o),r=n.indexOf(`
534
534
  `);if(r===-1)break;let i=n.slice(r+1),s=i.indexOf(`
535
- `),c=s===-1?i:i.slice(0,s),l=c.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),u=[];for(let e of l){let t=e.match(/-/g);u.push(t?t.length:0)}u.some(e=>e>0)&&(e.data.sourceDashCounts=u);{let t=c.trim(),n=M8(t);n.length>0&&n[0]===``&&t.startsWith(`|`)&&n.shift(),n.length>0&&n[n.length-1]===``&&t.endsWith(`|`)&&n.pop();let r=n.every(e=>/^[-: ]+$/.test(e)),i=[];for(let e of n){let t=0;for(;t<e.length&&e[t]===` `;)t++;let n=0;for(;n<e.length-t&&e[e.length-1-n]===` `;)n++;i.push({left:t,right:n})}r&&i.length>0&&(e.data.sourceAlignmentPadding=i)}{let t=n.split(`
535
+ `),c=s===-1?i:i.slice(0,s),l=c.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),u=[];for(let e of l){let t=e.match(/-/g);u.push(t?t.length:0)}u.some(e=>e>0)&&(e.data.sourceDashCounts=u);{let t=c.trim(),n=N8(t);n.length>0&&n[0]===``&&t.startsWith(`|`)&&n.shift(),n.length>0&&n[n.length-1]===``&&t.endsWith(`|`)&&n.pop();let r=n.every(e=>/^[-: ]+$/.test(e)),i=[];for(let e of n){let t=0;for(;t<e.length&&e[t]===` `;)t++;let n=0;for(;n<e.length-t&&e[e.length-1-n]===` `;)n++;i.push({left:t,right:n})}r&&i.length>0&&(e.data.sourceAlignmentPadding=i)}{let t=n.split(`
536
536
  `).filter(e=>e.trim().length>0);if(t.length>=2){let n=t.map(e=>e.trimStart().startsWith(`|`)),r=t.map(e=>/(^|[^\\])\|$/.test(e.trimEnd())),i=n.every(e=>e===n[0]),a=r.every(e=>e===r[0]);if(i&&a){let t=n[0],i=r[0];(!t||!i)&&(e.data.sourceOuterPipes={leading:t,trailing:i})}}}for(let n of e.children??[]){if(n.type!==`tableRow`||!n.position)continue;let e=n.position.start.offset,r=n.position.end.offset;if(typeof e!=`number`||typeof r!=`number`)continue;let i=t.slice(e,r),a=i.indexOf(`
537
- `);a!==-1&&(i=i.slice(0,a));let o=M8(i);o.length>0&&o[0]===``&&i.startsWith(`|`)&&o.shift(),o.length>0&&o[o.length-1]===``&&i.endsWith(`|`)&&o.pop();let s=n.children??[],c=Math.min(s.length,o.length);for(let e=0;e<c;e++){let t=s[e];if(t.type!==`tableCell`)continue;let n=o[e],r=0;for(;r<n.length&&n[r]===` `;)r++;let i=0;for(;i<n.length-r&&n[n.length-1-i]===` `;)i++;t.data||={},t.data.sourcePadding={left:r,right:i}}}break}case`link`:case`linkReference`:if(`children`in e&&e.children.length===0&&(e.data.sourceRaw=t.slice(a,o)),e.type===`link`){let n=t[a];if(n!==`[`&&n!==`<`&&!e.title)e.data.sourceStyle=`gfm-autolink`;else if(n===`[`){let n=t.slice(a,o),r=n.lastIndexOf(`](`);if(r!==-1){let t=r+2;for(;t<n.length&&(n[t]===` `||n[t]===` `);)t++;if(n[t]===`<`&&(e.data.sourceUrlForm=`angle-bracketed`),e.title!==void 0&&e.title!==null&&n[n.length-1]===`)`){let t=n.length-2;for(;t>r+1&&(n[t]===` `||n[t]===` `||n[t]===`
537
+ `);a!==-1&&(i=i.slice(0,a));let o=N8(i);o.length>0&&o[0]===``&&i.startsWith(`|`)&&o.shift(),o.length>0&&o[o.length-1]===``&&i.endsWith(`|`)&&o.pop();let s=n.children??[],c=Math.min(s.length,o.length);for(let e=0;e<c;e++){let t=s[e];if(t.type!==`tableCell`)continue;let n=o[e],r=0;for(;r<n.length&&n[r]===` `;)r++;let i=0;for(;i<n.length-r&&n[n.length-1-i]===` `;)i++;t.data||={},t.data.sourcePadding={left:r,right:i}}}break}case`link`:case`linkReference`:if(`children`in e&&e.children.length===0&&(e.data.sourceRaw=t.slice(a,o)),e.type===`link`){let n=t[a];if(n!==`[`&&n!==`<`&&!e.title)e.data.sourceStyle=`gfm-autolink`;else if(n===`[`){let n=t.slice(a,o),r=n.lastIndexOf(`](`);if(r!==-1){let t=r+2;for(;t<n.length&&(n[t]===` `||n[t]===` `);)t++;if(n[t]===`<`&&(e.data.sourceUrlForm=`angle-bracketed`),e.title!==void 0&&e.title!==null&&n[n.length-1]===`)`){let t=n.length-2;for(;t>r+1&&(n[t]===` `||n[t]===` `||n[t]===`
538
538
  `);)t--;n[t]===`"`?e.data.sourceTitleMarker=`double`:n[t]===`'`?e.data.sourceTitleMarker=`single`:n[t]===`)`&&(e.data.sourceTitleMarker=`paren`)}}}}break;case`definition`:{let n=t.slice(a,o);if(e.data.sourceLayout=n.includes(`
539
- `)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var P8=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function F8(){return new RegExp(P8,`g`)}var I8=F8(),L8=/^[a-zA-Z][\w/-]*$/;function R8(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function z8(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;I8.lastIndex=0;let o=[],s=0;for(;;){let n=I8.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=u&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===u){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&R8(t,i))continue}if(u>s){let n={type:`text`,value:e.slice(s,u)},r=m6(t,i,s,u);r&&(n.position=r),o.push(n)}let d={type:`tag`,value:l},f=m6(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}if(o.length===0)n.push(i);else{if(s<e.length){let n={type:`text`,value:e.slice(s)},r=m6(t,i,s,e.length);r&&(n.position=r),o.push(n)}n.push(...o)}}r&&(e.children=n)}var B8=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.underline.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function V8(e,t){if(!e||typeof e!=`object`)return null;if(typeof e.offset==`number`)return e.offset>=0&&e.offset<=t.length?e.offset:null;let{line:n,column:r}=e;if(typeof n!=`number`||typeof r!=`number`||n<1||r<1)return null;let i=0;for(let e=1;e<n;e++){let e=t.indexOf(`
539
+ `)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var F8=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function I8(){return new RegExp(F8,`g`)}var L8=I8(),R8=/^[a-zA-Z][\w/-]*$/;function z8(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function B8(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;L8.lastIndex=0;let o=[],s=0;for(;;){let n=L8.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=u&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===u){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&z8(t,i))continue}if(u>s){let n={type:`text`,value:e.slice(s,u)},r=h6(t,i,s,u);r&&(n.position=r),o.push(n)}let d={type:`tag`,value:l},f=h6(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}if(o.length===0)n.push(i);else{if(s<e.length){let n={type:`text`,value:e.slice(s)},r=h6(t,i,s,e.length);r&&(n.position=r),o.push(n)}n.push(...o)}}r&&(e.children=n)}var V8=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.underline.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function H8(e,t){if(!e||typeof e!=`object`)return null;if(typeof e.offset==`number`)return e.offset>=0&&e.offset<=t.length?e.offset:null;let{line:n,column:r}=e;if(typeof n!=`number`||typeof r!=`number`||n<1||r<1)return null;let i=0;for(let e=1;e<n;e++){let e=t.indexOf(`
540
540
  `,i);if(e===-1)return null;i=e+1}let a=t.indexOf(`
541
- `,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function H8(e,t){if(!e)return null;let n=V8(e.start,t),r=V8(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function U8(e,t){let n=H8(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function W8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;D(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!B8.has(e.type)){let r=U8(e,n);return i.children[t]=r,g}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(A8(t,n),z8(t,n))}if(N8(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function G8(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function K8(){return e=>{D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=G8(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function q8(e){return e.data?.sourceRaw}function J8(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`?q8(e)===``:!1}function Y8(e){return e.type===`paragraph`?(e.children??[]).every(J8):!1}function X8(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function Z8(e){switch(e.type){case`table`:return X8(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return q8(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return q8(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function Q8(e){let t=[];for(let n of e.children){if(n.type===`table`&&X8(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}Z8(n)||(n.type===`paragraph`&&n.children.length>0&&Y8(n)&&(n.children=[]),t.push(n))}e.children=t}function $8(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var e5=(e,t)=>{if(Y8(e)||$8(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},t5=qI(),n5=fI(),r5=pI();function i5(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===t5)||t.push(t5);let n=e.fromMarkdownExtensions;n.some(e=>e===n5)||n.push(n5);let r=e.toMarkdownExtensions;r.some(e=>e===r5)||r.push(r5)}var a5=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function o5(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=u6(n,e);a5.lastIndex=0;let o=[],s;for(;(s=a5.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(d6(a,e,1)||d6(a,t-1,1)){a5.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,a=r+t[0].length;if(r>l){let t={type:`text`,value:i.slice(l,r)},a=m6(n,e,l,r);a&&(t.position=a),c.push(t)}let o={type:`inlineMath`,value:t[1]},s=m6(n,e,r,a);s&&(o.position=s),c.push(o),l=a}if(l<i.length){let t={type:`text`,value:i.slice(l)},r=m6(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[g,t+c.length]})}}var s5=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]),c5=`<br />`;function l5(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function Gne(e){e.data??={},e.data.sourceRaw=c5,e.data.sourceStyle=`html`}function u5(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var d5=/[ \t]+$/,f5=/^[ \t]*$/;function Kne(e){return e.some(e=>!(u5(e)&&f5.test(e.value)))}function p5(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(l5(n)){Gne(n);break}if(n&&s5.has(n.type)&&`children`in n){let t=n.children;if(p5(t,!0),t.length===0){e.pop();continue}}if(!t&&u5(n)&&d5.test(n.value)){let t=n.value.replace(d5,``);if(t.length>0){n.value=t;continue}if(Kne(e.slice(0,-1))){e.pop();continue}if(e.every(e=>u5(e)&&f5.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var qne=new Set([`paragraph`,`heading`,`tableCell`]);function Jne(e){let t=e=>{if(qne.has(e.type)&&`children`in e&&p5(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var m5={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function Yne(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===m5)||e.toMarkdownExtensions.push(m5)}var Xne=new Set([`u`,`ins`]);function Zne(){return e=>{D(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name===null||!Xne.has(e.name)||(e.attributes??[]).length>0)return;let r={type:`underline`,children:e.children??[],data:{sourceForm:e.name===`ins`?`ins`:`u`}};return e.position&&(r.position=e.position),n.children.splice(t,1,r),t+1})}}var h5=/(?<!\uE102)<br[ \t]*\/?>/g,Qne=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function $ne(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;h5.lastIndex=0;let a=[],o=0;for(;;){let n=h5.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=m6(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=m6(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=m6(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function g5(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,e=>{if(Qne.has(e.type))return g;let t=e;Array.isArray(t.children)&&$ne(e,n)})}}var _5=33,v5=91,y5=93,b5=124,x5=35,ere={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===v5?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===v5?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===x5?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===b5?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===b5?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===y5?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===y5?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},tre={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===_5?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===v5?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===v5?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===x5?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===b5?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===b5?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===y5?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===y5?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function nre(){return{text:{[v5]:ere,[_5]:tre}}}function rre(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function ire(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function S5(e){return e.stack[e.stack.length-1]}function are(e){let t=S5(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function ore(e){let t=S5(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function sre(e){let t=S5(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function C5(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function cre(e){C5(S5(this)),this.exit(e)}function lre(e){C5(S5(this)),this.exit(e)}var w5={enter:{wikiLink:rre,wikiLinkEmbed:ire},exit:{wikiLinkTarget:are,wikiLinkAnchor:ore,wikiLinkAlias:sre,wikiLink:cre,wikiLinkEmbed:lre}};function T5(e,t){return typeof e==`string`&&e.trim()===t?e:t}var E5={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${T5(t.data?.sourceTarget,n)}`;return r&&(a+=`#${T5(t.data?.sourceAnchor,r)}`),i&&(a+=`|${T5(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},D5=nre();function O5(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===D5)||e.micromarkExtensions.push(D5),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===w5)||e.fromMarkdownExtensions.push(w5),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===E5)||e.toMarkdownExtensions.push(E5)}function ure(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var dre=[{name:`remark-parse`,plugin:ye},{name:`remark-mdx-agnostic`,plugin:i5},{name:`remark-gfm`,plugin:ue},{name:`remark-math`,plugin:fF,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:O5},{name:`remark-github-alerts`,plugin:eF,options:o6},{name:`callout-transformer`,plugin:i6},{name:`restore-from-mdx`,plugin:j3},{name:`void-br-promoter`,plugin:g5},{name:`restore-entity-refs`,plugin:H3},{name:`restore-backslash-escapes`,plugin:K3},{name:`details-accordion-promoter`,plugin:U6},{name:`div-align-promoter`,plugin:Q6},{name:`image-promoter`,plugin:m8},{name:`indented-code-promoter`,plugin:b8},{name:`math-promoter`,plugin:O8},{name:`single-dollar-math-promoter`,plugin:o5},{name:`highlight-promoter`,plugin:p8},{name:`underline-promoter`,plugin:Zne},{name:`mermaid-promoter`,plugin:K8},{name:`comment-promoter`,plugin:_6},{name:`merged-post-parse-walker`,plugin:W8},{name:`empty-task-item-unmint`,plugin:a8},{name:`ensure-non-empty-doc`,plugin:()=>ure}];function fre(e){let t=le();for(let e of dre)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(TP,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function pre(e){let t=le().use(XP,[`yaml`]).use(ue,{tablePipeAlign:!1}).use(fF,{singleDollarTextMath:!1}).use(i5).use(O5).use(Yne).use(fP,{bullet:`-`,fences:!0,rule:`-`,join:[e5],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function k5(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var A5=/^\n+$/,j5=/^\n{2,}$/;function M5(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);A5.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);j5.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function mre(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&A5.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&j5.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function hre(e,t){let{source:n,hadBom:r}=k5(e),i=M6(n),a=new ie(z3(k3(G3(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);T8(s,i);let c=M5(s,i,r),l=t.stringify(s);return c?l.type.create({...l.attrs,sourceDocBoundary:c},l.content,l.marks):l}function gre(e,t){return N5(e,t,!1)}function _re(e,t){return N5(e,t,!0)}function N5(e,t,n){let{source:r,hadBom:i}=k5(e),a=M6(r),o=new ie(z3(k3(G3(a)))),s=t.parse(o);o.value=a;let c=t.runSync(s,o);return n&&T8(c,a),M5(c,a,i),c}function vre(e,t,n){let r=DP(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});r8(r),Jne(r),Q8(r);let i=mre(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function yre(){return!1}function bre(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function xre(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function P5(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!qZ(e))return e;let n=xre(bre(t),e);return n===``||n===`..`||n.startsWith(`../`)?(yre()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var Sre=Object.assign(Ire,{peek:()=>`$`}),Cre=Object.assign(Lre,{peek:()=>`~`}),wre=(()=>{for(let e of r5.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),Tre=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,Ere={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&kQ(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=B5(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=B5(n,t.slice(o),{...r,before:r.before+a})),a}return B5(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=U5(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=U5(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:R5(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(L5(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(R5(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
541
+ `,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function U8(e,t){if(!e)return null;let n=H8(e.start,t),r=H8(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function W8(e,t){let n=U8(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function G8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;D(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!V8.has(e.type)){let r=W8(e,n);return i.children[t]=r,g}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(j8(t,n),B8(t,n))}if(P8(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function K8(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function q8(){return e=>{D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=K8(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function J8(e){return e.data?.sourceRaw}function Y8(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`?J8(e)===``:!1}function X8(e){return e.type===`paragraph`?(e.children??[]).every(Y8):!1}function Z8(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function Q8(e){switch(e.type){case`table`:return Z8(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return J8(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return J8(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function $8(e){let t=[];for(let n of e.children){if(n.type===`table`&&Z8(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}Q8(n)||(n.type===`paragraph`&&n.children.length>0&&X8(n)&&(n.children=[]),t.push(n))}e.children=t}function e5(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var t5=(e,t)=>{if(X8(e)||e5(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},n5=qI(),r5=fI(),i5=pI();function a5(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===n5)||t.push(n5);let n=e.fromMarkdownExtensions;n.some(e=>e===r5)||n.push(r5);let r=e.toMarkdownExtensions;r.some(e=>e===i5)||r.push(i5)}var o5=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function s5(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=d6(n,e);o5.lastIndex=0;let o=[],s;for(;(s=o5.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(f6(a,e,1)||f6(a,t-1,1)){o5.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,a=r+t[0].length;if(r>l){let t={type:`text`,value:i.slice(l,r)},a=h6(n,e,l,r);a&&(t.position=a),c.push(t)}let o={type:`inlineMath`,value:t[1]},s=h6(n,e,r,a);s&&(o.position=s),c.push(o),l=a}if(l<i.length){let t={type:`text`,value:i.slice(l)},r=h6(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[g,t+c.length]})}}var c5=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]),l5=`<br />`;function Gne(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function Kne(e){e.data??={},e.data.sourceRaw=l5,e.data.sourceStyle=`html`}function u5(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var d5=/[ \t]+$/,f5=/^[ \t]*$/;function qne(e){return e.some(e=>!(u5(e)&&f5.test(e.value)))}function p5(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(Gne(n)){Kne(n);break}if(n&&c5.has(n.type)&&`children`in n){let t=n.children;if(p5(t,!0),t.length===0){e.pop();continue}}if(!t&&u5(n)&&d5.test(n.value)){let t=n.value.replace(d5,``);if(t.length>0){n.value=t;continue}if(qne(e.slice(0,-1))){e.pop();continue}if(e.every(e=>u5(e)&&f5.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var Jne=new Set([`paragraph`,`heading`,`tableCell`]);function Yne(e){let t=e=>{if(Jne.has(e.type)&&`children`in e&&p5(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var m5={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function Xne(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===m5)||e.toMarkdownExtensions.push(m5)}var Zne=new Set([`u`,`ins`]);function Qne(){return e=>{D(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name===null||!Zne.has(e.name)||(e.attributes??[]).length>0)return;let r={type:`underline`,children:e.children??[],data:{sourceForm:e.name===`ins`?`ins`:`u`}};return e.position&&(r.position=e.position),n.children.splice(t,1,r),t+1})}}var h5=/(?<!\uE102)<br[ \t]*\/?>/g,$ne=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function ere(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;h5.lastIndex=0;let a=[],o=0;for(;;){let n=h5.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=h6(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=h6(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=h6(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function g5(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,e=>{if($ne.has(e.type))return g;let t=e;Array.isArray(t.children)&&ere(e,n)})}}var _5=33,v5=91,y5=93,b5=124,x5=35,tre={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===v5?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===v5?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===x5?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===b5?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===b5?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===y5?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===y5?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},nre={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===_5?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===v5?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===v5?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===x5?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===b5?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===b5?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===v5?n(t):t===y5?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===y5?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===y5?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function rre(){return{text:{[v5]:tre,[_5]:nre}}}function ire(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function are(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function S5(e){return e.stack[e.stack.length-1]}function ore(e){let t=S5(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function sre(e){let t=S5(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function cre(e){let t=S5(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function C5(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function lre(e){C5(S5(this)),this.exit(e)}function ure(e){C5(S5(this)),this.exit(e)}var w5={enter:{wikiLink:ire,wikiLinkEmbed:are},exit:{wikiLinkTarget:ore,wikiLinkAnchor:sre,wikiLinkAlias:cre,wikiLink:lre,wikiLinkEmbed:ure}};function T5(e,t){return typeof e==`string`&&e.trim()===t?e:t}var E5={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${T5(t.data?.sourceTarget,n)}`;return r&&(a+=`#${T5(t.data?.sourceAnchor,r)}`),i&&(a+=`|${T5(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},D5=rre();function O5(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===D5)||e.micromarkExtensions.push(D5),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===w5)||e.fromMarkdownExtensions.push(w5),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===E5)||e.toMarkdownExtensions.push(E5)}function dre(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var fre=[{name:`remark-parse`,plugin:ye},{name:`remark-mdx-agnostic`,plugin:a5},{name:`remark-gfm`,plugin:ue},{name:`remark-math`,plugin:fF,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:O5},{name:`remark-github-alerts`,plugin:eF,options:s6},{name:`callout-transformer`,plugin:a6},{name:`restore-from-mdx`,plugin:M3},{name:`void-br-promoter`,plugin:g5},{name:`restore-entity-refs`,plugin:U3},{name:`restore-backslash-escapes`,plugin:q3},{name:`details-accordion-promoter`,plugin:W6},{name:`div-align-promoter`,plugin:$6},{name:`image-promoter`,plugin:h8},{name:`indented-code-promoter`,plugin:x8},{name:`math-promoter`,plugin:k8},{name:`single-dollar-math-promoter`,plugin:s5},{name:`highlight-promoter`,plugin:m8},{name:`underline-promoter`,plugin:Qne},{name:`mermaid-promoter`,plugin:q8},{name:`comment-promoter`,plugin:v6},{name:`merged-post-parse-walker`,plugin:G8},{name:`empty-task-item-unmint`,plugin:o8},{name:`ensure-non-empty-doc`,plugin:()=>dre}];function pre(e){let t=le();for(let e of fre)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(TP,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function mre(e){let t=le().use(XP,[`yaml`]).use(ue,{tablePipeAlign:!1}).use(fF,{singleDollarTextMath:!1}).use(a5).use(O5).use(Xne).use(fP,{bullet:`-`,fences:!0,rule:`-`,join:[t5],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function k5(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var A5=/^\n+$/,j5=/^\n{2,}$/;function M5(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);A5.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);j5.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function hre(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&A5.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&j5.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function gre(e,t){let{source:n,hadBom:r}=k5(e),i=N6(n),a=new ie(B3(A3(K3(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);E8(s,i);let c=M5(s,i,r),l=t.stringify(s);return c?l.type.create({...l.attrs,sourceDocBoundary:c},l.content,l.marks):l}function _re(e,t){return N5(e,t,!1)}function vre(e,t){return N5(e,t,!0)}function N5(e,t,n){let{source:r,hadBom:i}=k5(e),a=N6(r),o=new ie(B3(A3(K3(a)))),s=t.parse(o);o.value=a;let c=t.runSync(s,o);return n&&E8(c,a),M5(c,a,i),c}function yre(e,t,n){let r=DP(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});i8(r),Yne(r),$8(r);let i=hre(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function bre(){return!1}function xre(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function Sre(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function P5(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!JZ(e))return e;let n=Sre(xre(t),e);return n===``||n===`..`||n.startsWith(`../`)?(bre()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var Cre=Object.assign(Lre,{peek:()=>`$`}),wre=Object.assign(Rre,{peek:()=>`~`}),Tre=(()=>{for(let e of i5.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),Ere=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,Dre={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&AQ(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=B5(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=B5(n,t.slice(o),{...r,before:r.before+a})),a}return B5(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=U5(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=U5(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:R5(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(L5(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(R5(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
542
542
  `:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(R5(d)),e()}if(e.title){let t=i===`multiline`?`
543
543
  `:` `;l+=s.move(L5(e.title,a,t))}return o(),l},thematicBreak(e){return e.data?.sourceRaw??`---`},break(e,t,n){let r=e.data?.sourceRaw;return typeof r==`string`&&r.length>0?r:n.stack.includes(`tableCell`)||n.stack.includes(`okAtxHeading`)?`<br />`:e.data?.sourceStyle===`backslash`?`\\
544
544
  `:`
545
545
  `},code(e,t){let n=e.value??``;if(e.data?.sourceStyle===`indented`){let t=n.split(`
546
546
  `),r=e.data.sourceIndents;return Array.isArray(r)&&r.length===t.length?t.map((e,t)=>`${r[t]??(e.length>0?` `:``)}${e}`).join(`
547
547
  `):t.map(e=>e.length>0?` ${e}`:e).join(`
548
- `)}let r=e.data?.sourceFenceChar===`~`?`~`:"`",i=H1(r,n,e.data?.sourceFenceLength??3),a=e.data?.sourceClosingFenceLength,o=typeof a==`number`&&a>i?a:i,s=e.data?.sourceFenceIndent,c=typeof s==`number`&&s>=1&&s<=3?` `.repeat(s):``,l=e.data?.sourceInfoPadding,u=r.repeat(i),d=e.lang??``,f=d&&typeof l==`number`&&l>=1?` `.repeat(l):``,p=e.meta?` ${e.meta}`:``;if(e.data?.sourceUnclosedFence===!0&&t?.type===`root`&&t.children[t.children.length-1]===e){let e=`${u}${f}${d}${p}${n.length>0?`\n${n}`:``}`;return c?e.split(`
548
+ `)}let r=e.data?.sourceFenceChar===`~`?`~`:"`",i=U1(r,n,e.data?.sourceFenceLength??3),a=e.data?.sourceClosingFenceLength,o=typeof a==`number`&&a>i?a:i,s=e.data?.sourceFenceIndent,c=typeof s==`number`&&s>=1&&s<=3?` `.repeat(s):``,l=e.data?.sourceInfoPadding,u=r.repeat(i),d=e.lang??``,f=d&&typeof l==`number`&&l>=1?` `.repeat(l):``,p=e.meta?` ${e.meta}`:``;if(e.data?.sourceUnclosedFence===!0&&t?.type===`root`&&t.children[t.children.length-1]===e){let e=`${u}${f}${d}${p}${n.length>0?`\n${n}`:``}`;return c?e.split(`
549
549
  `).map(e=>e.length>0?`${c}${e}`:e).join(`
550
550
  `):e}let m=`${u}${f}${d}${p}\n${n}\n${r.repeat(o)}`;return c?m.split(`
551
551
  `).map(e=>e.length>0?`${c}${e}`:e).join(`
552
- `):m},inlineCode(e,t,n){let r=e.value??``,i=e.data?.sourceFenceChar===`~`?`~`:"`",a=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,o=i==="`"?"`":`~`,s=a;for(;RegExp(`(^|[^${o}])${o.repeat(s)}([^${o}]|$)`).test(r);)s+=1;let c=i.repeat(s);/[^ \r\n]/.test(r)&&(e.data?.sourcePadded===!0||/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||r.startsWith(i)||r.endsWith(i))&&(r=` ${r} `);let l=`${c}${r}${c}`;return n.stack.includes(`tableCell`)?l.replace(/\|/g,`\\$&`):l},inlineMath:Sre,delete:Cre,heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
552
+ `):m},inlineCode(e,t,n){let r=e.value??``,i=e.data?.sourceFenceChar===`~`?`~`:"`",a=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,o=i==="`"?"`":`~`,s=a;for(;RegExp(`(^|[^${o}])${o.repeat(s)}([^${o}]|$)`).test(r);)s+=1;let c=i.repeat(s);/[^ \r\n]/.test(r)&&(e.data?.sourcePadded===!0||/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||r.startsWith(i)||r.endsWith(i))&&(r=` ${r} `);let l=`${c}${r}${c}`;return n.stack.includes(`tableCell`)?l.replace(/\|/g,`\\$&`):l},inlineMath:Cre,delete:wre,heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
553
553
  `,after:`
554
554
  `}),i=e.data?.sourceUnderlineLength,o=typeof i==`number`&&i>=1?i:Math.max(t.length,3);return`${t}\n${(a===1?`=`:`-`).repeat(o)}`}let o=e.data?.sourceLeadingIndent,s=typeof o==`number`&&o>=1&&o<=3?` `.repeat(o):``,c=e.data?.sourceInteriorSpacing,l=typeof c==`number`&&c>=2?` `.repeat(c):` `,u=`#`.repeat(a),d=n.enter(`okAtxHeading`),f=n.containerPhrasing(e,{...r,before:`${u} `,after:`
555
555
  `});d();let p=e.data?.sourceTrailingHashes;if(typeof p==`number`&&p>0){let e=`#`.repeat(p);return f?`${s}${u}${l}${f} ${e}`:`${s}${u} ${e}`}return f?`${s}${u}${l}${f}`:`${s}${u}`},list(e,t,n,r){let i=n.options.bullet||`-`,a=!!e.ordered,o=n.bulletCurrent,s=n.bulletLastUsed;if(!a){let t=e.data?.bulletMarker;(t===`-`||t===`*`||t===`+`)&&(n.bulletCurrent=t)}let c=e.children||[],l=[],u=a?e.data?.listMarkerDelimiter??`.`:null,d=e.start??1;for(let t=0;t<c.length;t++){let o=c[t],s=o.data?.sourceOrdinal,f=typeof s==`number`&&s>=0?s:d+t,p=a?`${f}${u}`:e.data?.bulletMarker??i,m=o.data?.sourceMarkerSpacing,h=typeof m==`number`&&m>=2&&m<=4?m:1,g=` `.repeat(h),_=p;o.checked===!0?_+=`${g}[${o.data?.sourceCheckboxChar===`X`?`X`:`x`}]`:o.checked===!1&&(_+=`${g}[ ]`);let v=o.data?.sourceContinuationIndent,y=p.length+h,b=typeof v==`number`&&v>=y&&v<=y+3?v:y,x=` `.repeat(b),S=o.checked===null||o.checked===void 0?g:` `,C=o.children??[],w=C[0]?.type===`list`,T;if(w){let e=o.checked!==null&&o.checked!==void 0,t=n.containerFlow({...o,children:[C[0]]},r),i=C.slice(1),a=i.length?n.containerFlow({...o,children:i},r):``,s=t.split(`
@@ -563,19 +563,19 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
563
563
 
564
564
  `:`
565
565
  `;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length);if(f===0)return console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:s.length})),``;let p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
566
- `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=F5(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:wre({...i,attributes:(i.attributes??[]).map(Dre)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=U5(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},underline(e,t,n,r){let i=e.data?.sourceForm===`ins`?`<ins>`:`<u>`,a=e.data?.sourceForm===`ins`?`</ins>`:`</u>`,o=n.createTracker(r),s=n.enter(`underline`),c=o.move(i);return c+=n.containerPhrasing(e,{before:c,after:a,...o.current()}),c+=o.move(a),s(),c},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=F5(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!Tre.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function F5(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${I5(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function I5(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Dre(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:I5(e.value)}}:e}function L5(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function R5(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function Ore(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>kre(t)?e:`\\${e}`)}function kre(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}var z5=``,Are=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function jre(e){return e.replace(Are,e=>wQ(e)?z5+e.slice(1):e)}function B5(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
567
- ]|$)`};return delete t._compiled,t});let i;try{i=e.safe(jre(t),n)}finally{e.unsafe=r}return i=i.replaceAll(z5,`\\&`),Ore(Fre(i,n))}var V5=1,Mre=2;function H5(e){if(Number.isNaN(e))return`ws`;let t=m(e);return t===V5?`ws`:t===Mre?`punct`:`other`}function Nre(e,t,n){let r=H5(t),i=H5(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function Pre(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
568
- `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function Fre(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Pre(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=Nre(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function U5(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);W5(i.charCodeAt(i.length-1),s,r)&&(o=G5(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return W5(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+G5(c)),o}function W5(e,t,n){return!(m(t)!==V5||n===`_`&&m(e)===void 0)}function G5(e){return`&#x${e.toString(16).toUpperCase()};`}function Ire(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!Rre(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function Lre(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=U5(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function Rre(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function K5(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var zre=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=AC(e.extensions),this.handlers=Gre(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?w2({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=Kre(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=fre({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=pre({toMarkdownHandlers:Ere})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return hre(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?gre(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?_re(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?H4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return vre(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},q5=_4();function Bre(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function Vre(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function Hre(e,t){return e.attrs.sourceDirty||Vre(e)?!0:t?t.isDiverged(e.toJSON()):!1}function Ure(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function J5(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function Y5(e,t){if(e.length===0)return J5({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return J5({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[Y5(n.children,t)]}}return J5({type:`inlineCode`,value:X5(e)},t)}function X5(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=X5(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Wre=rd;function Gre(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=SP(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=SP(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=P5(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&DQ(t.raw)!==null&&wQ(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=DQ(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=CP(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=CP(r.highlight)),r.underline&&(i.underline=CP(r.underline,e=>({sourceForm:e.data?.sourceForm===`ins`?`ins`:`u`}))),r.comment&&(i.comment=CP(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=SP(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=CP(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=CP(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=SP(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=SP(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=SP(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=q5.getOrWildcard(o),c=Bre(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=P5(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=GQ(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&Wre.has(l)&&n.jsxComponent&&q5.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&id.has(l)&&n.jsxComponent&&q5.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&od.has(l)&&n.jsxComponent&&q5.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&sd.has(l)&&n.jsxComponent&&q5.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:K5(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=SP(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function Kre(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=OP(`paragraph`)),i.blockquote&&(n.blockquote=OP(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=OP(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=OP(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Ure(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=OP(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:B0(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!Hre(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:q5.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:q5,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=kP(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=kP(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return Y5(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=kP(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=kP(`mark`)),a.underline&&(r.underline=kP(`underline`,e=>({data:{sourceForm:e.attrs.sourceForm===`ins`?`ins`:`u`}}))),a.comment&&(r.comment=kP(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=OP(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=OP(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return kQ(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var Z5={default:!0,MD013:!1};function Q5(e){return e??Z5}function qre(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of pZ)if(n.endsWith(e))return t.slice(0,-e.length);return t}function Jre(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,VV.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();pZ.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=qre(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}var $5=/[*?[\]{}()+@!|]/;function Yre(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||$5.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function e7(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,VV.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!$5.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!$5.test(r)&&!$5.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!$5.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!$5.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!$5.test(t))return{kind:`name-anywhere`,name:t}}return $5.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function Xre(e){let t=e7(e);if(t.kind!==`pattern`)return[t];let n=Yre(e);if(n!==null){let e=n.map(e7);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function Zre(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...Xre(i))}return{includes:n,excludes:r}}function t7(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!Jre(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var n7={"draft-06":`http://json-schema.org/draft-06/schema#`,"draft-07":`http://json-schema.org/draft-07/schema#`,"2019-09":`https://json-schema.org/draft/2019-09/schema`,"2020-12":`https://json-schema.org/draft/2020-12/schema`},Qre=Object.keys(n7),$re=`draft-07`,eie=new Map(Qre.map(e=>[r7(n7[e]),e]));function r7(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function tie(e){let t=e.$schema;return t===void 0?$re:typeof t==`string`?eie.get(r7(t))??null:null}var i7=new Map;function nie(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function rie(e){let t=i7.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new zV.default(n);break;case`2019-09`:r=new RV.default(n);break;case`draft-06`:case`draft-07`:r=new LV.default(n);break;default:return nie(e)}return(0,BV.default)(r),i7.set(e,r),r}function iie(e){let{$schema:t,...n}=e;return n}function aie(e,t){let n=rie(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(iie(t))}var a7=new Map,oie=256;function sie(e){let t=JSON.stringify(e),n=a7.get(t);if(n!==void 0)return n;let r=null,i=tie(e);if(i!==null)try{r=aie(i,e)}catch{r=null}return a7.size>=oie&&a7.clear(),a7.set(t,r),r}function cie(e){let t=new Map;if(!vp.test(e))return{data:{},keyLines:t};let{frontmatter:n}=bp(e),r=Sp(n);if(r.trim()===``)return{data:{},keyLines:t};let i=Au(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(Qo(i.contents))for(let e of i.contents.items){let n=e.key;if(!es(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function lie(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function uie(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function die(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function fie(e,t){if(t.length===0)return[];let{data:n,keyLines:r}=cie(e),i=e.split(`
569
- `),a=e=>({start:{line:e,character:0},end:{line:e,character:i[e]?.length??0}}),o=[];for(let{schema:e}of t){let t=sie(e);if(t&&!t(n))for(let e of t.errors??[]){let t=e.keyword,i=0,s;if(t===`required`&&e.instancePath===``)s=`Frontmatter property "${String(e.params.missingProperty??``)}" is required`;else if(e.instancePath===``)s=`Frontmatter ${e.message??`violates "${t}"`}`;else{let a=uie(e.instancePath);a!==null&&(i=r.get(a)??0);let o=die(e.instancePath);if(t===`enum`){let t=e.params.allowedValues??[],r=a!==null&&o===a?n[a]:void 0;s=`Frontmatter property "${o}" must be one of: ${t.map(String).join(`, `)}${lie(r)}`}else s=`Frontmatter property "${o}" ${e.message??`violates "${t}"`}`}o.push({range:a(i),severity:`warning`,source:`frontmatter`,code:t,message:s})}}return o}var o7=`doc`;function pie(e,t){return PG(e,jG({strings:{[o7]:e},config:t})[o7]??[])}function mie(e,t){let n=jG({strings:{[o7]:e},config:t})[o7]??[],r=e.split(`
570
- `),i=hie(t);return n.map(e=>_ie(e,r,gie(e,i)))}function hie(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function gie(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function _ie(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[vie(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function vie(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var yie=so([I(),B(Ad),uo(P(),io())]),bie={id:`markdownlint`,sliceSchema:R({enabled:I(),rules:uo(P(),yie)}),defaultSlice:{enabled:!1,rules:Z5},async lint(e,t){return mie(e,Q5(t.rules))},fix(e,t){return pie(e,Q5(t.rules))}},xie=R({appliesTo:so([P(),L(P())]).optional(),file:P(),enabled:I().optional(),key:P().optional(),schema:uo(P(),io()).optional()}),s7=[bie,{id:`frontmatter`,sliceSchema:R({enabled:I(),schemas:L(xie)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return fie(e,t7(t.schemas,n.docName))}}],Sie={enabled:!0,plugins:Object.fromEntries(s7.map(e=>[e.id,e.defaultSlice]))},Cie=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function wie(e){return Cie.has(e)}function Tie(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??Z5},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]}}}}var Eie=Object.fromEntries(s7.map(e=>[e.id,e.sliceSchema])),Die=R({effective:R({enabled:I(),plugins:R(Eie)}),configFile:P().nullable().optional(),configProblems:L(P()).optional()}),Oie=so([I(),uo(P(),io())]);R({ruleId:P().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:so([Oie,no()])}),R({file:P().min(1).max(512),delete:V(!0).optional(),field:P().min(1).max(256).optional(),parentPath:L(so([P().min(1).max(256),R({items:V(!0)}).strict()])).max(8).optional(),removeField:V(!0).optional(),renameTo:P().min(1).max(256).optional(),constraint:R({type:B([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:L(so([P(),F(),I()])).nullable().optional(),itemsEnum:L(so([P(),F(),I()])).nullable().optional(),itemsType:B([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:P().nullable().optional(),format:P().nullable().optional(),description:P().max(2048).nullable().optional(),required:I().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var kie=R({schemas:L(P()),truncated:I()}).strict(),c7=R({line:F(),character:F()}),l7=R({start:c7,end:c7}),u7=R({range:l7,severity:B([`error`,`warning`,`info`,`hint`]),source:P(),code:P(),message:P(),fixes:L(R({range:l7,newText:P()})).optional()});R({files:L(R({file:P(),diagnostics:L(u7),warnings:L(P()).optional()})),fileCount:F(),errorCount:F(),warningCount:F(),warnings:L(P())});var Aie=u7.extend({linkTarget:P().optional()}),jie=R({files:L(R({file:P(),diagnostics:L(Aie)})),fileCount:F(),errorCount:F(),warningCount:F(),warnings:L(P())}),d7=R({errorCount:F().int().nonnegative(),warningCount:F().int().nonnegative()}),Mie=R({files:L(R({file:P(),lint:d7,links:d7})),fileCount:F().int().nonnegative(),errorCount:F().int().nonnegative(),warningCount:F().int().nonnegative(),warnings:L(P())});R({docName:h1,summary:v1,..._1}).loose();var Nie=R({file:P(),fixedCount:F(),diagnostics:L(u7),errorCount:F(),warningCount:F(),warning:P().optional()});function Pie(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function Fie(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:Pie(e)&&t.endsWith(`.json`)}var f7=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],Iie=(()=>{let e=new Map;for(let t of f7){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function p7(e){return Iie.get(e.toUpperCase())??null}function Lie(e,t){let n=p7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))p7(t)===n&&(r={key:t,value:i});return r}var Rie=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],zie=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function Bie(e){for(let[t,n]of zie)if(e.tags.includes(t))return n;return`Style`}function Vie(e){let t={lint:{errorCount:0,warningCount:0},links:{errorCount:0,warningCount:0}};for(let n of e){let e=n.source===`links`?t.links:t.lint;n.severity===`error`?e.errorCount+=1:e.warningCount+=1}return t}async function Hie(e,t,n){if(!t.enabled)return[];let r=[];for(let i of s7){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}var Uie=/\p{M}+/gu,Wie=/[^\p{L}\p{N}]+/gu,Gie=/^-+|-+$/g;function m7(e){return e.trim().normalize(`NFKD`).replace(Uie,``).toLowerCase().replace(Wie,`-`).replace(Gie,``)}function Kie(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function h7(e,t){let n=m7(e);return n?Kie(n,t):``}function g7(e,t){let n=m7(e);return t?`#${n}-${m7(t)}`:`#${n}`}var _7=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),qie=new Map(h4.flatMap(e=>e.surface===`compat`&&_7.has(e.rendersAs)?[[e.name,e]]:[]));function v7(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function y7(e){let t=e.name;if(!t||!_7.has(t))return null;let n=v7(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function b7(e){let t=e.name;if(!t)return null;let n=qie.get(t);if(!n)return null;let r=v7(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var Jie=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:g7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Yie=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:g7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Xie=(e,t)=>{let n=t,r=y7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=b7(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Zie=(e,t)=>{let n=t,r=y7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=b7(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Qie=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},$ie=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},eae=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function x7(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(x7).join(``):``}var S7={wikiLink:Jie,wikiLinkEmbed:Yie,mdxJsxFlowElement:Xie,mdxJsxTextElement:Zie,rawMdxFallback:Qie,mark:$ie,underline:eae,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:x7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:x7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},tae=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,nae=/\bexpression\s*\(/i,rae=1e4;function iae(e){return!(e.length>rae||tae.test(e)||nae.test(e))}function C7(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!KZ(e.split(/\s+/)[0]??``))return!1}return!0}var aae={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},oae=new Set([`href`,`src`]),sae=ke(`<>`),w7=()=>e=>{D(e,`element`,e=>{let t=aae[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?R3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(oae.has(e))if(t===`<>`||t===sae)r=``;else{let e=R3(t);r=e===t?t:ke(e)}else r=R3(t);r!==t&&(n[e]=r)}})},T7=()=>e=>{D(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!KZ(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!KZ(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!KZ(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!C7(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!C7(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!KZ(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!iae(r)&&delete n.style})};function cae(e){let t=le().use(Ee,{handlers:S7}).use(w7).use(T7).use(jK),n=t.runSync(e);return String(t.stringify(n))}function lae(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(E7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(E7(e.slice(r),r>0,!1)),n.join(``)}function E7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var D7=/\r?\n|\r/,uae=(e,t)=>{let n=lae(String(t.value));if(!D7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(D7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function dae(e){let t=le().use(ye).use(XP,[`yaml`]).use(i5).use(ue).use(O5).use(j3).use(g5).use(K3).use(Ee,{handlers:{...S7,text:uae}}).use(w7).use(T7).use(jK);return String(t.processSync(k3(G3(e))))}qI(),fI(),pI(),R({docName:h1,summary:v1,content:P().optional(),..._1}).loose(),R({docName:h1,summary:v1,markdown:P(),position:B([`append`,`prepend`,`replace`]).optional(),extension:B(pZ).optional(),..._1}).loose(),R({docName:h1,summary:v1,find:P().min(1),replace:P(),offset:F().int().nonnegative().optional(),..._1}).loose(),R({docName:h1,connectionId:P().min(1),scope:B([`last`,`session`,`file`,`count`]).optional(),count:F().int().positive().optional(),..._1}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var O7=R({value:P(),truncatedFrom:F().int().nonnegative().optional(),hint:P().optional()}).loose(),fae=co(`kind`,[R({kind:V(`inline`),content:P()}),R({kind:V(`truncated`),byteLength:F().int().nonnegative(),hint:P()})]),k7=R({kind:V(`content-divergence`),intendedBytes:F().int().nonnegative(),actualBytes:F().int().nonnegative(),byteDelta:F().int(),divergenceType:P().optional(),currentState:fae.optional(),hint:P().optional()}).loose(),pae=R({type:V(`orphan`),parentCandidates:L(P()),message:P()}).loose(),A7=R({kind:V(`disk-edit-reconciled`),intendedBytes:F().int().nonnegative(),actualBytes:F().int().nonnegative(),byteDelta:F().int(),mergeOutcome:P().optional(),hint:P().optional()}).loose(),j7=co(`kind`,[k7,A7]),M7=L(co(`kind`,[k7,A7,R({kind:V(`mermaid-parse-error`),fenceIndex:F().int().positive(),fenceFirstLine:P(),message:P(),line:F().int().positive().optional()}).loose(),R({kind:V(`lint-violation`),source:P(),code:P(),message:P(),severity:B([`error`,`warning`,`info`,`hint`]),line:F().int().positive(),column:F().int().positive(),linkTarget:P().optional()}).loose()])).min(1),N7=L(R({href:P(),resolvedTo:P().nullable(),reason:B([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());R({timestamp:P().min(1),summary:O7.optional(),warning:j7.optional(),warnings:M7.optional()}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),hints:L(pae).optional(),summary:O7.optional(),warning:j7.optional(),warnings:M7.optional(),brokenLinks:N7}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),summary:O7.optional(),warning:j7.optional(),warnings:M7.optional(),brokenLinks:N7}).loose(),R({docName:P().min(1),scope:B([`last`,`session`,`count`]),undone:I()}).loose(),R({docs:L(R({docName:g1,markdown:P(),position:B([`append`,`prepend`,`replace`]).optional(),extension:B(pZ).optional(),summary:v1}).loose()).min(1).max(100),..._1}).loose();var mae=R({type:R1,title:P(),detail:P().optional()}).loose(),hae=co(`status`,[R({status:V(`written`),docName:P().min(1),summary:O7.optional(),warnings:M7.optional(),brokenLinks:N7}).loose(),R({status:V(`error`),docName:P().min(1),error:mae}).loose()]);R({timestamp:P().min(1),results:L(hae),written:F().int().nonnegative(),failed:F().int().nonnegative()}).loose(),R({docName:h1,patch:uo(P(),so([Dp,no()])),types:uo(P(),B(wp)).optional(),summary:v1,..._1}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),appliedKeys:L(P()),summary:O7.optional(),warning:j7.optional(),warnings:M7.optional(),brokenLinks:N7}).loose(),R({entries:L(R({level:B([`info`,`warn`,`error`]),message:P().max(kX),event:P().optional(),fields:uo(P(),io()).optional(),ts:F().optional(),sourceId:P().optional(),lineNumber:F().optional()}).loose()).max(100),droppedSinceLastFlush:F().int().min(0).optional()}).loose(),R({accepted:F().int().min(0)}).loose();var gae=R({exact:P().min(1),prefix:P(),suffix:P(),start:F().int().nonnegative(),end:F().int().nonnegative()}),_ae=L(so([P(),F().int().nonnegative()])),vae=co(`kind`,[R({kind:V(`body`)}),R({kind:V(`property`),key:P().min(1),path:_ae.default([])})]).default({kind:`body`}),yae=B([`anchored`,`orphaned`,`resolved`]),P7=R({threadId:P().min(1),docName:P().min(1),target:vae,anchor:gae.nullable(),state:yae,queued:I(),latestComment:P(),createdBy:P().min(1),createdAt:F()}),F7=R({docName:P(),instruction:P(),property:P().nullable(),passage:R({exact:P(),prefix:P(),suffix:P()}).nullable(),anchorLost:I(),passageRepeats:I()}).loose(),I7=R({threadId:P(),ok:V(!0)}),L7=R({threadId:P(),ok:V(!1),error:V(`not-found`)});R({threads:L(P7)}).loose();var bae=R({meta:P7,orphaned:I()}).loose(),xae=R({threadId:P()}).loose();R({meta:P7,payload:F7}).loose();var Sae=R({results:L(so([I7.extend({meta:P7,payload:F7}),L7]))}).loose(),Cae=R({results:L(so([I7.extend({meta:P7}),L7]))}).loose(),wae=R({status:P().min(1),reason:P()}).loose(),Tae=R({docName:P().min(1),content:P(),lifecycle:wae.nullable()}).loose(),R7=R({kind:B([`document`,`asset`,`folder`,`file`]).default(`document`),docName:P().min(1).optional(),docExt:P().min(1).default(`.md`),size:F().int().nonnegative(),modified:P().min(1),isSymlink:I().default(!1),canonicalDocName:P().nullable().default(null),targetPath:P().nullable().default(null),path:P().min(1).optional(),assetExt:P().min(1).optional(),mediaKind:B([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:L(P().min(1)).optional(),hasChildren:I().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Eae=R({documents:L(R7),truncated:I().optional()}).loose(),Dae=R({source:P().min(1),anchor:P().nullable(),title:P(),snippet:P().nullable()}).loose(),Oae=R({docName:P().min(1),backlinks:L(Dae)}).loose(),kae=R({counts:uo(P().min(1),F().int().nonnegative())}).loose();R({counts:uo(P().min(1),F().int().nonnegative())}).loose();var Aae=co(`kind`,[R({kind:V(`doc`),docName:P().min(1),anchor:P().nullable(),title:P(),snippet:P().nullable()}).loose(),R({kind:V(`external`),url:P().min(1),title:P(),snippet:P().nullable()}).loose()]),jae=R({docName:P().min(1),forwardLinks:L(Aae)}).loose(),Mae=co(`kind`,[R({id:P().min(1),kind:V(`doc`),docName:P().min(1),anchor:P().nullable(),label:P(),cluster:P().nullable(),category:P().nullable(),tags:L(P()).nullable()}).loose(),R({id:P().min(1),kind:V(`external`),url:P().min(1),label:P()}).loose()]),Nae=R({source:P().min(1),target:P().min(1)}).loose(),Pae=R({nodes:L(Mae),links:L(Nae)}).loose(),Fae=R({ts:F().int().min(0),url:P(),method:P(),ua:P().optional(),origin:P().optional(),referer:P().optional(),host:P().optional(),remote:P().optional(),secChUa:P().optional(),secChUaMobile:P().optional(),secChUaPlatform:P().optional(),secFetchSite:P().optional(),secFetchDest:P().optional(),secFetchMode:P().optional(),secFetchUser:P().optional()}).loose(),Iae=R({app:so([V(`cursor`),V(`codex`),V(`claude`),no()]),signals_fired:L(P())}).loose();R({entries:L(Fae),count:F().int().min(0),detection:Iae}).loose(),R({writers:L(R({id:P().min(1),name:P().optional(),email:P().optional()}).loose()).optional(),summary:v1,..._1}).loose(),R({checkpointRef:P().min(1)}).loose();var Lae=R({v:F().int().optional(),id:P().min(1),name:P().min(1),colorSeed:P().optional(),docs:L(P()),summaries:L(P()).optional()}).loose();R({entries:L(R({sha:P().min(1),timestamp:P().min(1),author:P(),authorEmail:P(),type:B([`checkpoint`,`wip`,`upstream`,`park`]),message:P(),contributors:L(Lae),checkpoint:io().nullable(),parentSha:P().nullable().optional()}).loose()),total:F().int().nonnegative().optional(),truncated:I().optional(),hasMore:I().optional()}).loose(),R({sha:P().regex(/^[0-9a-f]{40}$/i),content:P(),timestamp:P(),author:P()}).loose();var Rae=R({contentDir:P().min(1),pathSeparator:B([`/`,`\\`]),symlinkResolved:I()}).loose();L(co(`source`,[R({docName:P().min(1),timestamp:P().min(1),size:F().int().nonnegative(),source:V(`flat`)}).loose(),R({docName:P().min(1),timestamp:P().min(1),source:V(`timeline`),sha:P().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var zae=R({domain:P().min(1),title:P().optional(),description:P().optional(),siteName:P().optional(),faviconDataUri:P().optional()}).loose();R({url:P()}).loose();var Bae=co(`ok`,[R({ok:V(!0),metadata:zae}).loose(),R({ok:V(!1),reason:P()}).loose()]),Vae=R({orphans:L(R({docName:P().min(1),title:P()}).loose())}).loose(),Hae=R({hubs:L(R({docName:P().min(1),title:P(),count:F().int().nonnegative()}).loose())}).loose(),Uae=R({source:P().min(1),title:P(),snippet:P().nullable()}).loose();R({deadLinks:L(R({target:P().min(1),sources:L(Uae)}).loose())}).loose(),R({target:R({docName:P().min(1),title:P(),aliases:L(P())}).loose(),mentions:L(R({source:P().min(1),excerpt:P(),offset:F().int().nonnegative()}).loose()),truncated:I()}).loose(),R({projectPath:P().min(1)}).loose();var Wae=B([`not-a-git-worktree`,`init-failed`]);co(`ok`,[R({ok:V(!0),projectPath:P().min(1)}).loose(),R({ok:V(!1),reason:Wae,message:P().min(1)}).loose()]),R({host:P().min(1).optional()}).loose(),R({host:P().min(1).optional(),token:P().min(1)}).loose(),R({host:P(),login:P()}).loose(),R({key:P().min(1)}).loose(),R({keyPresent:I()}).loose();var Gae=B([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),Kae=co(`ok`,[R({ok:V(!0),endpoint:P().min(1),model:P().min(1),dimensions:F().int().positive()}).loose(),R({ok:V(!1),endpoint:P().min(1),model:P().min(1),reason:Gae,status:F().int().optional()}).loose()]);R({name:P().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:P().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),R({authenticated:I()}).loose(),R({channel:B([`login`,`gh-login`]).default(`login`)}).loose(),R({}).loose();var qae=R({stackIndex:F().int().min(0),ts:F().int().min(0),additions:F().int().min(0),deletions:F().int().min(0)}).loose(),Jae=R({docName:P().min(1),additionsTotal:F().int().min(0),deletionsTotal:F().int().min(0),lastTs:F().int().min(0),bursts:L(qae)}).loose(),Yae=R({displayName:P().min(1),color:P().min(1),icon:P().optional(),connectionId:P().min(1)}).loose(),Xae=R({sessionAlive:I(),agent:Yae.nullable(),files:L(Jae)}).loose(),Zae=R({diff:P(),before:P(),after:P(),generatedAt:F().int().min(0)}).loose();R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose();var Qae=R({displayName:P().min(1),icon:P(),color:P().min(1),currentDoc:P().nullable(),mode:B([`idle`,`writing`]),ts:F().int().min(0)}).loose();R({presence:uo(P().min(1),Qae)}).loose();var $ae=R({sessionId:P().min(1),agentType:P().min(1),ts:F().int().min(0),insertedChars:F().int().min(0),deletedChars:F().int().min(0)}).loose();R({effects:L(R({"doc.name":P().min(1),entries:L($ae)}).loose())}).loose(),R({decisions:L(R({ts:F().int().min(0),decision:P().min(1),kind:P().min(1),"doc.name":P().min(1),pathRole:P().min(1)}).loose())}).loose(),uo(P().min(1),I()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),R({path:P().min(1,`path must be non-empty`)}).loose(),R({}).loose();var eoe=R({fromDocName:P().min(1),toDocName:P().min(1)}).loose(),toe=R({fromPath:P().min(1),toPath:P().min(1)}).loose();R({}).loose(),R({path:P().min(1),..._1,summary:v1}).loose();var noe=R({docName:P().min(1)}).loose();R({path:P().min(1),..._1,summary:v1}).loose();var roe=R({path:P().min(1)}).loose();R({kind:B([`file`,`folder`]),path:P().min(1),..._1,summary:v1}).loose();var ioe=R({kind:B([`file`,`folder`]),path:P().min(1),duplicatedDocNames:L(P().min(1))}).loose(),aoe=R({pages:L(R({docName:P().min(1),title:P(),docExt:P().min(1),size:F().int().nonnegative(),modified:P().min(1),icon:P().min(1).max(2048).optional()}).loose())}).loose(),ooe=R({level:F().int().min(1).max(6),text:P(),slug:P()}).loose(),soe=R({docName:P().min(1),headings:L(ooe)}).loose(),coe=R({docName:P().min(1),rewrites:F().int().nonnegative()}).loose();R({kind:B([`file`,`folder`,`asset`]),fromPath:P().min(1),toPath:P().min(1),..._1,summary:v1}).loose();var loe=R({renamed:L(eoe),renamedAssets:L(toe),rewrittenDocs:L(coe).optional(),summary:O7.optional()}).loose();R({kind:B([`file`,`folder`,`asset`]),path:P().min(1),..._1}).loose();var uoe=R({deletedDocNames:L(P().min(1))}).loose();R({kind:B([`file`,`folder`,`asset`]),path:P().min(1),..._1,summary:v1}).loose();var doe=R({deletedDocNames:L(P().min(1))}).loose();R({docName:P().min(1),commitSha:P().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:v1,..._1}).loose(),R({restoredFrom:P().min(1),timestamp:P().min(1),summary:O7.optional(),warning:k7.optional(),warnings:M7.optional()}).loose();var foe=B([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),poe=R({label:P().min(1),webUrl:Fa().nullable()}).loose(),moe=co(`checkStatus`,[R({checkStatus:V(`allowed`)}).loose(),R({checkStatus:V(`denied`),deniedReason:B([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`])}).loose(),R({checkStatus:V(`unknown`),unknownError:B([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),z7=B([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),hoe=B(ju),goe=B([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);R({state:foe,lastSyncUtc:P().nullable(),lastFetchUtc:P().nullable(),lastPushedSha:P().nullable(),ahead:F().int().min(0),behind:F().int().min(0),consecutiveFailures:F().int().min(0),conflictCount:F().int().min(0),hasRemote:I(),syncEnabled:I(),identityUnresolved:I(),remote:poe.nullable().optional(),pushError:P().optional(),pushErrorCode:z7.optional(),pullError:P().optional(),pullErrorCode:z7.optional(),pausedReason:P().optional(),pushPermission:moe.optional(),syncMode:hoe.optional(),lastPullUtc:P().nullable().optional(),lastPullOutcome:goe.nullable().optional()}).loose(),R({op:B([`sync`,`push`,`pull`]).optional()}).loose(),R({op:B([`sync`,`push`,`pull`])}).loose(),R({conflicts:L(R({file:P().min(1),detectedAt:P().min(1),oursSha:P().optional(),theirsSha:P().optional(),baseSha:P().optional()}).loose())}).loose(),R({file:P().min(1),strategy:B([`mine`,`theirs`,`content`,`delete`]),content:P().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),R({}).loose(),R({file:P().min(1),base:P(),ours:P(),theirs:P(),kind:B([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:P().nullable()}).loose(),R({plan:Ro(e=>e!==void 0,{message:`plan is required`})}).loose(),R({plan:Ro(e=>e!==void 0,{message:`plan is required`})}).loose(),R({result:Ro(e=>e!==void 0,{message:`result is required`})}).loose();var _oe=R({path:P().min(1),summary:P().min(1)}).loose(),voe=R({files:F().int().nonnegative(),folders:F().int().nonnegative()}).loose();R({packs:L(R({id:P().min(1),name:P().min(1),description:P().min(1),defaultSubfolder:P().optional(),folders:L(_oe),entryCounts:voe}).loose())}).loose(),R({noOpen:I().optional(),out:P().min(1).optional()}).loose();var yoe=R({reason:B([`unsupported-platform`,`spawn-error`]),message:P()}).loose();co(`status`,[R({status:V(`installed`),outputPath:P(),size:F().int().nonnegative(),sha256:P(),skillVersion:P()}).loose(),R({status:V(`built`),outputPath:P(),size:F().int().nonnegative(),sha256:P(),skillVersion:P(),handoffError:yoe.optional()}).loose(),R({status:V(`failed`),buildError:P()}).loose(),R({status:V(`skip-current`),skillVersion:P(),recordedAt:P().optional()}).loose()]);var B7=B(dp);function boe(e){return e===`agents`||dp.includes(e)}R({tags:L(R({name:P().min(1),count:F().int().nonnegative(),isLeaf:I()}).loose())}).loose();var xoe=R({docName:P().min(1),title:P(),matchingTags:L(P().min(1)),snippet:P().nullable()}).loose();R({name:P().min(1),docs:L(xoe)}).loose(),R({folder:io(),frontmatter_local:uo(P(),io()).nullable()}).loose(),R({path:P(),frontmatter:uo(P(),io()).optional()}).loose(),R({applied:io()}).loose();var V7=uo(P(),io()).meta({description:`Free-form frontmatter map embedded in template payloads.`});R({template:R({name:P().min(1),folder:P(),scope:B([`local`,`inherited`]),path:P().min(1),frontmatter:V7,body:P()}).strict()}).strict();var Soe=R({templates:L(R({name:P().min(1),title:P().optional(),description:P().optional(),path:P().min(1),source_folder:P()}).strict()),truncated:I()}).strict();R({folder:P(),name:P(),body:P().optional(),frontmatter:V7.optional(),..._1,summary:v1}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({sourcePath:P().min(1),targetFolder:P(),name:P().optional(),title:P().optional(),deleteSource:I().optional(),..._1,summary:v1}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({existed:I(),path:P().min(1)}).strict(),R({fromFolder:P(),fromName:P(),toFolder:P(),toName:P(),body:P().optional(),frontmatter:V7.optional(),..._1,summary:v1}).strict(),R({from:P().min(1),to:P().min(1),committed:I()}).strict();var H7=B(zf),Coe=/^[a-z0-9-]+$/,woe=/^[A-Za-z0-9_-]+$/,U7=R({name:P(),description:P()}).strict();R({skill:R({name:P().min(1),scope:H7,path:P().min(1),frontmatter:U7,body:P(),files:L(R({path:P().min(1),text:P().nullable()})).optional(),managed:I().optional()}).strict()}).strict();var Toe=R({source:P().min(1),publisher:P().optional(),skill:P().optional(),marketplaceUrl:P().optional(),importedAt:P().min(1),autoUpdate:I().optional()}).strict(),Eoe=R({skills:L(R({name:P().min(1),description:P().optional(),scope:H7,path:P().min(1),absolutePath:P().min(1).optional(),installed:I(),hosts:L(P()),driftPaths:L(P()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:uo(P(),P()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:L(P()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:L(P()).optional(),installableEditors:L(P()).optional(),linkMode:I().optional(),customPlacements:L(R({path:P(),mode:B([`copy`,`link`])}).strict()).optional(),managed:I().optional(),origin:Toe.optional(),modified:I().optional(),revertable:I().optional()}).strict()),truncated:I()}).strict();R({scope:H7.default(`project`),name:P().meta({description:`Managed skill name to create or update.`}),body:P().optional(),frontmatter:U7,..._1,summary:v1}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({scope:H7.default(`project`),name:P(),dryRun:I().optional(),setAutoUpdate:I().optional(),..._1,summary:v1}).strict(),R({name:P().min(1),updated:I(),source:P().min(1),localBody:P().optional(),upstreamBody:P().optional(),gitTracked:I().optional(),warnings:L(P())}).strict(),R({scope:H7.default(`project`),name:P(),..._1,summary:v1}).strict(),R({name:P().min(1),baselineRef:P().min(1),restoredFiles:L(P()),warnings:L(P())}).strict(),R({existed:I(),path:P().min(1)}).strict(),R({scope:H7.default(`project`),fromName:P(),toName:P(),body:P().optional(),frontmatter:U7.optional(),..._1,summary:v1}).strict(),R({from:P().min(1),to:P().min(1),committed:I()}).strict(),R({name:P(),fromScope:H7,toScope:H7,..._1,summary:v1}).strict(),R({scope:H7,path:P().optional()}).strict(),R({scope:H7,name:P(),toName:P(),..._1,summary:v1}).strict(),R({name:P().min(1)}).strict(),R({name:P(),home:P().min(1)}).strict(),R({docName:P().min(1)}).strict();var W7=B([`reference`,`script`,`file`]);R({scope:H7.default(`project`),name:P(),path:P().min(1),content:P(),..._1,summary:v1}).strict(),R({path:P().min(1),created:I(),kind:W7,content:I()}).strict(),R({scope:H7.default(`project`),name:P(),from:P().min(1),to:P().min(1),..._1,summary:v1}).strict(),R({from:P().min(1),to:P().min(1),fromDocName:P().optional(),toDocName:P().optional()}).strict(),R({path:P().min(1),kind:W7,text:P()}).strict(),R({path:P().min(1),existed:I(),kind:W7}).strict();var G7=so([B7,V(`agents`)]),K7=P().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),q7=so([G7,K7]);R({scope:H7.default(`project`),name:P(),targets:L(G7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:L(q7).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:L(q7).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:B([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:q7.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:I().optional(),setSource:P().min(1).optional(),place:R({dir:P().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:B([`copy`,`link`])}).strict().optional(),convert:R({target:q7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:B([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:R({path:P().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),..._1,summary:v1,fork:R({editor:P().min(1),action:B([`align`,`make-source`,`rename`]),toName:P().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),R({name:P().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:L(P()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:I().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:L(P()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:L(B([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:P().optional(),sourceMovedTo:P().optional()}).strict(),R({scope:H7.default(`project`),name:P().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),R({name:P().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:I().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var Doe=R({targets:L(B7),configured:I(),folders:L(R({scope:H7,host:P(),root:P(),state:B([`own`,`linked`,`linked-parent`,`absent`]),target:P().optional(),drift:V(!0).optional(),expected:P().optional()}).strict()).optional()}).strict();R({folderAction:co(`action`,[R({action:V(`link`),scope:H7,root:P().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:P().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}).strict(),R({action:V(`unlink`),scope:H7,root:P().min(1).meta({description:`The linked folder to materialize back.`}),exclude:L(P().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),R({action:V(`add-root`),scope:H7,root:K7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict()])}).strict(),R({targets:L(B7),reprojected:L(R({name:P(),hosts:L(P())}).strict()),bundleHosts:L(P()),removedFrom:L(P()),folder:R({moved:L(P()),dropped:L(P()),linked:L(P())}).strict().optional()}).strict(),R({scope:H7.default(`project`),name:P(),version:P().regex(/^[0-9a-f]{40}$/i),..._1,summary:v1}).strict(),R({name:P().min(1),version:P(),restoredFiles:L(P()),warnings:L(P())}).strict(),R({query:P().optional(),intent:B([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:B([`navigation`,`relevance`]).optional(),scopes:L(B([`page`,`folder`,`content`,`file`])).optional(),scope:P().optional(),limit:F().int().nonnegative().optional(),semantic:I().optional(),source:B([`omnibar`,`mcp`,`http`]).optional()}).loose();var Ooe=R({kind:B([`page`,`folder`,`content`,`file`]),path:P().min(1),title:P(),score:F(),signals:uo(P(),io()),snippet:P().optional()}).loose(),koe=R({capable:I(),applied:I(),coverage:R({embedded:F().int().nonnegative(),total:F().int().nonnegative()})}).loose();R({enabled:I(),keyPresent:I(),keyNotRequired:I(),keySource:B([`project`,`file`,`env`]).nullable(),keyHint:P().nullable(),ready:I(),capable:I(),embedded:F().int().nonnegative(),total:F().int().nonnegative()}).loose(),R({query:P(),intent:B([`autocomplete`,`full_text`,`omnibar`]),results:L(Ooe),elapsedMs:F().nonnegative(),semantic:koe.optional(),truncated:I().optional(),ready:I().optional()}).loose();var Aoe=R({version:P().min(1),recordedAt:P().min(1)}).loose();R({currentVersion:P().min(1),targets:uo(P(),Aoe.nullable())}).loose(),R({scope:H7.default(`project`),source:P().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:P().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:I().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),..._1,summary:v1}).strict(),R({scope:H7.default(`project`),source:P().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:L(P().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:I().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),..._1,summary:v1}).strict(),R({results:L(R({requested:P(),status:B([`imported`,`already-imported`,`not-found`,`failed`]),name:P().optional(),collisionRenamedFrom:P().optional(),warnings:L(P()),error:P().optional()}).loose()),imported:F(),alreadyImported:F(),failed:F()}).loose();var joe=R({source:P(),ref:P().optional(),contentHash:P(),publisher:P().optional()}).loose();R({name:P().min(1).meta({description:`Managed skill name created or matched.`}),path:P().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:I().meta({description:`True when this request created new source files.`}),alreadyImported:I().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:P().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:joe,warnings:L(P()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose();var Moe=`server-info`,Noe=`branch-switched`,Poe=`disk-ack`,Foe=`config-validation-rejected`,Ioe=`config-ignore-nested-error`,J7=B([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`]),Loe=R({v:V(1),ch:V(Moe),seq:F(),serverInstanceId:P().min(1),currentBranch:P().min(1).optional()}).loose(),Roe=R({v:V(1),ch:V(Noe),seq:F(),branch:P().min(1)}).loose(),zoe=R({v:V(1),ch:J7,seq:F()}).loose(),Boe=R({v:V(1),ch:V(Poe),seq:F(),docName:P().min(1),sv:P().min(1)}).loose(),Voe=R({v:V(1),ch:V(Foe),seq:F(),docName:P().min(1),error:Tf}).loose(),Hoe=R({v:V(1),ch:V(Ioe),seq:F(),path:P().min(1),error:P().min(1)}).loose();function Uoe(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function Woe(e){if(typeof e!=`string`||e.length===0)return e;let t=V2(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(I2(e)){let t=Uoe(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=N2(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var Goe=`https://api.github.com/repos/inkeep/open-knowledge`;async function Koe(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(Goe,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function qoe(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new vX.default;var Joe=R({path:L(so([P(),F()])),message:P(),issueCode:P()});co(`code`,[R({code:V(`SCHEMA_INVALID`),issues:L(Joe)}),R({code:V(`WRITE_ERROR`),detail:P()})]);function Yoe(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function Xoe(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var Y7=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,Zoe=/^---([ \t]*)(?=\r?\n|$)/,X7=e=>e.includes(`\r
566
+ `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=F5(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:Tre({...i,attributes:(i.attributes??[]).map(Ore)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=U5(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},underline(e,t,n,r){let i=e.data?.sourceForm===`ins`?`<ins>`:`<u>`,a=e.data?.sourceForm===`ins`?`</ins>`:`</u>`,o=n.createTracker(r),s=n.enter(`underline`),c=o.move(i);return c+=n.containerPhrasing(e,{before:c,after:a,...o.current()}),c+=o.move(a),s(),c},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=F5(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!Ere.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function F5(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${I5(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function I5(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Ore(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:I5(e.value)}}:e}function L5(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function R5(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function kre(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>Are(t)?e:`\\${e}`)}function Are(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}var z5=``,jre=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Mre(e){return e.replace(jre,e=>TQ(e)?z5+e.slice(1):e)}function B5(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
567
+ ]|$)`};return delete t._compiled,t});let i;try{i=e.safe(Mre(t),n)}finally{e.unsafe=r}return i=i.replaceAll(z5,`\\&`),kre(Ire(i,n))}var V5=1,Nre=2;function H5(e){if(Number.isNaN(e))return`ws`;let t=m(e);return t===V5?`ws`:t===Nre?`punct`:`other`}function Pre(e,t,n){let r=H5(t),i=H5(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function Fre(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
568
+ `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function Ire(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Fre(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=Pre(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function U5(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);W5(i.charCodeAt(i.length-1),s,r)&&(o=G5(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return W5(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+G5(c)),o}function W5(e,t,n){return!(m(t)!==V5||n===`_`&&m(e)===void 0)}function G5(e){return`&#x${e.toString(16).toUpperCase()};`}function Lre(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!zre(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function Rre(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=U5(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function zre(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function K5(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var Bre=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=AC(e.extensions),this.handlers=Kre(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?T2({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=qre(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=pre({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=mre({toMarkdownHandlers:Dre})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return gre(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?_re(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?vre(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?U4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return yre(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},q5=v4();function Vre(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function Hre(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function Ure(e,t){return e.attrs.sourceDirty||Hre(e)?!0:t?t.isDiverged(e.toJSON()):!1}function Wre(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function J5(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function Y5(e,t){if(e.length===0)return J5({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return J5({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[Y5(n.children,t)]}}return J5({type:`inlineCode`,value:X5(e)},t)}function X5(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=X5(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Gre=rd;function Kre(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=SP(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=SP(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=P5(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&OQ(t.raw)!==null&&TQ(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=OQ(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=CP(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=CP(r.highlight)),r.underline&&(i.underline=CP(r.underline,e=>({sourceForm:e.data?.sourceForm===`ins`?`ins`:`u`}))),r.comment&&(i.comment=CP(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=SP(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=CP(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=CP(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=SP(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=SP(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=SP(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=q5.getOrWildcard(o),c=Vre(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=P5(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=KQ(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&Gre.has(l)&&n.jsxComponent&&q5.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&id.has(l)&&n.jsxComponent&&q5.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&od.has(l)&&n.jsxComponent&&q5.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&sd.has(l)&&n.jsxComponent&&q5.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:K5(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=SP(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function qre(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=OP(`paragraph`)),i.blockquote&&(n.blockquote=OP(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=OP(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=OP(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Wre(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=OP(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:V0(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!Ure(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:q5.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:q5,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=kP(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=kP(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return Y5(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=kP(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=kP(`mark`)),a.underline&&(r.underline=kP(`underline`,e=>({data:{sourceForm:e.attrs.sourceForm===`ins`?`ins`:`u`}}))),a.comment&&(r.comment=kP(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=OP(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=OP(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return AQ(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var Z5={default:!0,MD013:!1};function Q5(e){return e??Z5}function Jre(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of pZ)if(n.endsWith(e))return t.slice(0,-e.length);return t}function Yre(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,VV.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();pZ.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=Jre(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}var $5=/[*?[\]{}()+@!|]/;function Xre(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||$5.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function e7(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,VV.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!$5.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!$5.test(r)&&!$5.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!$5.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!$5.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!$5.test(t))return{kind:`name-anywhere`,name:t}}return $5.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function Zre(e){let t=e7(e);if(t.kind!==`pattern`)return[t];let n=Xre(e);if(n!==null){let e=n.map(e7);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function Qre(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...Zre(i))}return{includes:n,excludes:r}}function t7(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!Yre(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var n7={"draft-06":`http://json-schema.org/draft-06/schema#`,"draft-07":`http://json-schema.org/draft-07/schema#`,"2019-09":`https://json-schema.org/draft/2019-09/schema`,"2020-12":`https://json-schema.org/draft/2020-12/schema`},$re=Object.keys(n7),eie=`draft-07`,tie=new Map($re.map(e=>[r7(n7[e]),e]));function r7(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function nie(e){let t=e.$schema;return t===void 0?eie:typeof t==`string`?tie.get(r7(t))??null:null}var i7=new Map;function rie(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function iie(e){let t=i7.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new zV.default(n);break;case`2019-09`:r=new RV.default(n);break;case`draft-06`:case`draft-07`:r=new LV.default(n);break;default:return rie(e)}return(0,BV.default)(r),i7.set(e,r),r}function aie(e){let{$schema:t,...n}=e;return n}function oie(e,t){let n=iie(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(aie(t))}var a7=new Map,sie=256;function cie(e){let t=JSON.stringify(e),n=a7.get(t);if(n!==void 0)return n;let r=null,i=nie(e);if(i!==null)try{r=oie(i,e)}catch{r=null}return a7.size>=sie&&a7.clear(),a7.set(t,r),r}function lie(e){let t=new Map;if(!vp.test(e))return{data:{},keyLines:t};let{frontmatter:n}=bp(e),r=Sp(n);if(r.trim()===``)return{data:{},keyLines:t};let i=Au(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(Qo(i.contents))for(let e of i.contents.items){let n=e.key;if(!es(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function uie(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function die(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function fie(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function pie(e,t){if(t.length===0)return[];let{data:n,keyLines:r}=lie(e),i=e.split(`
569
+ `),a=e=>({start:{line:e,character:0},end:{line:e,character:i[e]?.length??0}}),o=[];for(let{schema:e}of t){let t=cie(e);if(t&&!t(n))for(let e of t.errors??[]){let t=e.keyword,i=0,s;if(t===`required`&&e.instancePath===``)s=`Frontmatter property "${String(e.params.missingProperty??``)}" is required`;else if(e.instancePath===``)s=`Frontmatter ${e.message??`violates "${t}"`}`;else{let a=die(e.instancePath);a!==null&&(i=r.get(a)??0);let o=fie(e.instancePath);if(t===`enum`){let t=e.params.allowedValues??[],r=a!==null&&o===a?n[a]:void 0;s=`Frontmatter property "${o}" must be one of: ${t.map(String).join(`, `)}${uie(r)}`}else s=`Frontmatter property "${o}" ${e.message??`violates "${t}"`}`}o.push({range:a(i),severity:`warning`,source:`frontmatter`,code:t,message:s})}}return o}var o7=`doc`;function mie(e,t){return PG(e,jG({strings:{[o7]:e},config:t})[o7]??[])}function hie(e,t){let n=jG({strings:{[o7]:e},config:t})[o7]??[],r=e.split(`
570
+ `),i=gie(t);return n.map(e=>vie(e,r,_ie(e,i)))}function gie(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function _ie(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function vie(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[yie(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function yie(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var bie=so([I(),B(Ad),uo(P(),io())]),xie={id:`markdownlint`,sliceSchema:R({enabled:I(),rules:uo(P(),bie)}),defaultSlice:{enabled:!1,rules:Z5},async lint(e,t){return hie(e,Q5(t.rules))},fix(e,t){return mie(e,Q5(t.rules))}},Sie=R({appliesTo:so([P(),L(P())]).optional(),file:P(),enabled:I().optional(),key:P().optional(),schema:uo(P(),io()).optional()}),s7=[xie,{id:`frontmatter`,sliceSchema:R({enabled:I(),schemas:L(Sie)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return pie(e,t7(t.schemas,n.docName))}}],Cie={enabled:!0,plugins:Object.fromEntries(s7.map(e=>[e.id,e.defaultSlice]))},wie=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function Tie(e){return wie.has(e)}function Eie(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??Z5},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]}}}}var Die=Object.fromEntries(s7.map(e=>[e.id,e.sliceSchema])),Oie=R({effective:R({enabled:I(),plugins:R(Die)}),configFile:P().nullable().optional(),configProblems:L(P()).optional()}),kie=so([I(),uo(P(),io())]);R({ruleId:P().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:so([kie,no()])}),R({file:P().min(1).max(512),delete:V(!0).optional(),field:P().min(1).max(256).optional(),parentPath:L(so([P().min(1).max(256),R({items:V(!0)}).strict()])).max(8).optional(),removeField:V(!0).optional(),renameTo:P().min(1).max(256).optional(),constraint:R({type:B([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:L(so([P(),F(),I()])).nullable().optional(),itemsEnum:L(so([P(),F(),I()])).nullable().optional(),itemsType:B([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:P().nullable().optional(),format:P().nullable().optional(),description:P().max(2048).nullable().optional(),required:I().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var Aie=R({schemas:L(P()),truncated:I()}).strict(),c7=R({line:F(),character:F()}),l7=R({start:c7,end:c7}),u7=R({range:l7,severity:B([`error`,`warning`,`info`,`hint`]),source:P(),code:P(),message:P(),fixes:L(R({range:l7,newText:P()})).optional()});R({files:L(R({file:P(),diagnostics:L(u7),warnings:L(P()).optional()})),fileCount:F(),errorCount:F(),warningCount:F(),warnings:L(P())});var jie=u7.extend({linkTarget:P().optional()}),Mie=R({files:L(R({file:P(),diagnostics:L(jie)})),fileCount:F(),errorCount:F(),warningCount:F(),warnings:L(P())}),d7=R({errorCount:F().int().nonnegative(),warningCount:F().int().nonnegative()}),Nie=R({files:L(R({file:P(),lint:d7,links:d7})),fileCount:F().int().nonnegative(),errorCount:F().int().nonnegative(),warningCount:F().int().nonnegative(),warnings:L(P())});R({docName:g1,summary:y1,...v1}).loose();var Pie=R({file:P(),fixedCount:F(),diagnostics:L(u7),errorCount:F(),warningCount:F(),warning:P().optional()});function Fie(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function Iie(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:Fie(e)&&t.endsWith(`.json`)}var f7=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],Lie=(()=>{let e=new Map;for(let t of f7){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function p7(e){return Lie.get(e.toUpperCase())??null}function Rie(e,t){let n=p7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))p7(t)===n&&(r={key:t,value:i});return r}var zie=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],Bie=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function Vie(e){for(let[t,n]of Bie)if(e.tags.includes(t))return n;return`Style`}function Hie(e){let t={lint:{errorCount:0,warningCount:0},links:{errorCount:0,warningCount:0}};for(let n of e){let e=n.source===`links`?t.links:t.lint;n.severity===`error`?e.errorCount+=1:e.warningCount+=1}return t}async function Uie(e,t,n){if(!t.enabled)return[];let r=[];for(let i of s7){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}var Wie=/\p{M}+/gu,Gie=/[^\p{L}\p{N}]+/gu,Kie=/^-+|-+$/g;function m7(e){return e.trim().normalize(`NFKD`).replace(Wie,``).toLowerCase().replace(Gie,`-`).replace(Kie,``)}function qie(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function h7(e,t){let n=m7(e);return n?qie(n,t):``}function g7(e,t){let n=m7(e);return t?`#${n}-${m7(t)}`:`#${n}`}var _7=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),Jie=new Map(g4.flatMap(e=>e.surface===`compat`&&_7.has(e.rendersAs)?[[e.name,e]]:[]));function v7(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function y7(e){let t=e.name;if(!t||!_7.has(t))return null;let n=v7(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function b7(e){let t=e.name;if(!t)return null;let n=Jie.get(t);if(!n)return null;let r=v7(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var Yie=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:g7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Xie=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:g7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Zie=(e,t)=>{let n=t,r=y7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=b7(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Qie=(e,t)=>{let n=t,r=y7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=b7(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},$ie=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},eae=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tae=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function x7(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(x7).join(``):``}var S7={wikiLink:Yie,wikiLinkEmbed:Xie,mdxJsxFlowElement:Zie,mdxJsxTextElement:Qie,rawMdxFallback:$ie,mark:eae,underline:tae,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:x7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:x7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},nae=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,rae=/\bexpression\s*\(/i,iae=1e4;function aae(e){return!(e.length>iae||nae.test(e)||rae.test(e))}function C7(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!qZ(e.split(/\s+/)[0]??``))return!1}return!0}var oae={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},sae=new Set([`href`,`src`]),cae=ke(`<>`),w7=()=>e=>{D(e,`element`,e=>{let t=oae[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?z3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(sae.has(e))if(t===`<>`||t===cae)r=``;else{let e=z3(t);r=e===t?t:ke(e)}else r=z3(t);r!==t&&(n[e]=r)}})},T7=()=>e=>{D(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!qZ(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!qZ(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!qZ(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!C7(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!C7(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!qZ(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!aae(r)&&delete n.style})};function lae(e){let t=le().use(Ee,{handlers:S7}).use(w7).use(T7).use(jK),n=t.runSync(e);return String(t.stringify(n))}function uae(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(E7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(E7(e.slice(r),r>0,!1)),n.join(``)}function E7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var D7=/\r?\n|\r/,dae=(e,t)=>{let n=uae(String(t.value));if(!D7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(D7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function fae(e){let t=le().use(ye).use(XP,[`yaml`]).use(a5).use(ue).use(O5).use(M3).use(g5).use(q3).use(Ee,{handlers:{...S7,text:dae}}).use(w7).use(T7).use(jK);return String(t.processSync(A3(K3(e))))}qI(),fI(),pI(),R({docName:g1,summary:y1,content:P().optional(),...v1}).loose(),R({docName:g1,summary:y1,markdown:P(),position:B([`append`,`prepend`,`replace`]).optional(),extension:B(pZ).optional(),...v1}).loose(),R({docName:g1,summary:y1,find:P().min(1),replace:P(),offset:F().int().nonnegative().optional(),...v1}).loose(),R({docName:g1,connectionId:P().min(1),scope:B([`last`,`session`,`file`,`count`]).optional(),count:F().int().positive().optional(),...v1}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var O7=R({value:P(),truncatedFrom:F().int().nonnegative().optional(),hint:P().optional()}).loose(),pae=co(`kind`,[R({kind:V(`inline`),content:P()}),R({kind:V(`truncated`),byteLength:F().int().nonnegative(),hint:P()})]),k7=R({kind:V(`content-divergence`),intendedBytes:F().int().nonnegative(),actualBytes:F().int().nonnegative(),byteDelta:F().int(),divergenceType:P().optional(),currentState:pae.optional(),hint:P().optional()}).loose(),mae=R({type:V(`orphan`),parentCandidates:L(P()),message:P()}).loose(),A7=R({kind:V(`disk-edit-reconciled`),intendedBytes:F().int().nonnegative(),actualBytes:F().int().nonnegative(),byteDelta:F().int(),mergeOutcome:P().optional(),hint:P().optional()}).loose(),j7=co(`kind`,[k7,A7]),M7=L(co(`kind`,[k7,A7,R({kind:V(`mermaid-parse-error`),fenceIndex:F().int().positive(),fenceFirstLine:P(),message:P(),line:F().int().positive().optional()}).loose(),R({kind:V(`lint-violation`),source:P(),code:P(),message:P(),severity:B([`error`,`warning`,`info`,`hint`]),line:F().int().positive(),column:F().int().positive(),linkTarget:P().optional()}).loose()])).min(1),N7=L(R({href:P(),resolvedTo:P().nullable(),reason:B([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());R({timestamp:P().min(1),summary:O7.optional(),warning:j7.optional(),warnings:M7.optional()}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),hints:L(mae).optional(),summary:O7.optional(),warning:j7.optional(),warnings:M7.optional(),brokenLinks:N7}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),summary:O7.optional(),warning:j7.optional(),warnings:M7.optional(),brokenLinks:N7}).loose(),R({docName:P().min(1),scope:B([`last`,`session`,`count`]),undone:I()}).loose(),R({docs:L(R({docName:_1,markdown:P(),position:B([`append`,`prepend`,`replace`]).optional(),extension:B(pZ).optional(),summary:y1}).loose()).min(1).max(100),...v1}).loose();var hae=R({type:z1,title:P(),detail:P().optional()}).loose(),gae=co(`status`,[R({status:V(`written`),docName:P().min(1),summary:O7.optional(),warnings:M7.optional(),brokenLinks:N7}).loose(),R({status:V(`error`),docName:P().min(1),error:hae}).loose()]);R({timestamp:P().min(1),results:L(gae),written:F().int().nonnegative(),failed:F().int().nonnegative()}).loose(),R({docName:g1,patch:uo(P(),so([Dp,no()])),types:uo(P(),B(wp)).optional(),summary:y1,...v1}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),appliedKeys:L(P()),summary:O7.optional(),warning:j7.optional(),warnings:M7.optional(),brokenLinks:N7}).loose(),R({entries:L(R({level:B([`info`,`warn`,`error`]),message:P().max(kX),event:P().optional(),fields:uo(P(),io()).optional(),ts:F().optional(),sourceId:P().optional(),lineNumber:F().optional()}).loose()).max(100),droppedSinceLastFlush:F().int().min(0).optional()}).loose(),R({accepted:F().int().min(0)}).loose();var _ae=R({exact:P().min(1),prefix:P(),suffix:P(),start:F().int().nonnegative(),end:F().int().nonnegative()}),vae=L(so([P(),F().int().nonnegative()])),yae=co(`kind`,[R({kind:V(`body`)}),R({kind:V(`property`),key:P().min(1),path:vae.default([])})]).default({kind:`body`}),bae=B([`anchored`,`orphaned`,`resolved`]),P7=R({threadId:P().min(1),docName:P().min(1),target:yae,anchor:_ae.nullable(),state:bae,queued:I(),latestComment:P(),createdBy:P().min(1),createdAt:F()}),F7=R({docName:P(),instruction:P(),property:P().nullable(),passage:R({exact:P(),prefix:P(),suffix:P()}).nullable(),anchorLost:I(),passageRepeats:I()}).loose(),I7=R({threadId:P(),ok:V(!0)}),L7=R({threadId:P(),ok:V(!1),error:V(`not-found`)});R({threads:L(P7)}).loose();var xae=R({meta:P7,orphaned:I()}).loose(),Sae=R({threadId:P()}).loose();R({meta:P7,payload:F7}).loose();var Cae=R({results:L(so([I7.extend({meta:P7,payload:F7}),L7]))}).loose(),wae=R({results:L(so([I7.extend({meta:P7}),L7]))}).loose(),Tae=R({status:P().min(1),reason:P()}).loose(),Eae=R({docName:P().min(1),content:P(),lifecycle:Tae.nullable()}).loose(),R7=R({kind:B([`document`,`asset`,`folder`,`file`]).default(`document`),docName:P().min(1).optional(),docExt:P().min(1).default(`.md`),size:F().int().nonnegative(),modified:P().min(1),isSymlink:I().default(!1),canonicalDocName:P().nullable().default(null),targetPath:P().nullable().default(null),path:P().min(1).optional(),assetExt:P().min(1).optional(),mediaKind:B([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:L(P().min(1)).optional(),hasChildren:I().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Dae=R({documents:L(R7),truncated:I().optional()}).loose(),Oae=R({source:P().min(1),anchor:P().nullable(),title:P(),snippet:P().nullable()}).loose(),kae=R({docName:P().min(1),backlinks:L(Oae)}).loose(),Aae=R({counts:uo(P().min(1),F().int().nonnegative())}).loose();R({counts:uo(P().min(1),F().int().nonnegative())}).loose();var jae=co(`kind`,[R({kind:V(`doc`),docName:P().min(1),anchor:P().nullable(),title:P(),snippet:P().nullable()}).loose(),R({kind:V(`external`),url:P().min(1),title:P(),snippet:P().nullable()}).loose()]),Mae=R({docName:P().min(1),forwardLinks:L(jae)}).loose(),Nae=co(`kind`,[R({id:P().min(1),kind:V(`doc`),docName:P().min(1),anchor:P().nullable(),label:P(),cluster:P().nullable(),category:P().nullable(),tags:L(P()).nullable()}).loose(),R({id:P().min(1),kind:V(`external`),url:P().min(1),label:P()}).loose()]),Pae=R({source:P().min(1),target:P().min(1)}).loose(),Fae=R({nodes:L(Nae),links:L(Pae)}).loose(),Iae=R({ts:F().int().min(0),url:P(),method:P(),ua:P().optional(),origin:P().optional(),referer:P().optional(),host:P().optional(),remote:P().optional(),secChUa:P().optional(),secChUaMobile:P().optional(),secChUaPlatform:P().optional(),secFetchSite:P().optional(),secFetchDest:P().optional(),secFetchMode:P().optional(),secFetchUser:P().optional()}).loose(),Lae=R({app:so([V(`cursor`),V(`codex`),V(`claude`),no()]),signals_fired:L(P())}).loose();R({entries:L(Iae),count:F().int().min(0),detection:Lae}).loose(),R({writers:L(R({id:P().min(1),name:P().optional(),email:P().optional()}).loose()).optional(),summary:y1,...v1}).loose(),R({checkpointRef:P().min(1)}).loose();var Rae=R({v:F().int().optional(),id:P().min(1),name:P().min(1),colorSeed:P().optional(),docs:L(P()),summaries:L(P()).optional()}).loose();R({entries:L(R({sha:P().min(1),timestamp:P().min(1),author:P(),authorEmail:P(),type:B([`checkpoint`,`wip`,`upstream`,`park`]),message:P(),contributors:L(Rae),checkpoint:io().nullable(),parentSha:P().nullable().optional()}).loose()),total:F().int().nonnegative().optional(),truncated:I().optional(),hasMore:I().optional()}).loose(),R({sha:P().regex(/^[0-9a-f]{40}$/i),content:P(),timestamp:P(),author:P()}).loose();var zae=R({contentDir:P().min(1),pathSeparator:B([`/`,`\\`]),symlinkResolved:I()}).loose();L(co(`source`,[R({docName:P().min(1),timestamp:P().min(1),size:F().int().nonnegative(),source:V(`flat`)}).loose(),R({docName:P().min(1),timestamp:P().min(1),source:V(`timeline`),sha:P().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var Bae=R({domain:P().min(1),title:P().optional(),description:P().optional(),siteName:P().optional(),faviconDataUri:P().optional()}).loose();R({url:P()}).loose();var Vae=co(`ok`,[R({ok:V(!0),metadata:Bae}).loose(),R({ok:V(!1),reason:P()}).loose()]),Hae=R({orphans:L(R({docName:P().min(1),title:P()}).loose())}).loose(),Uae=R({hubs:L(R({docName:P().min(1),title:P(),count:F().int().nonnegative()}).loose())}).loose(),Wae=R({source:P().min(1),title:P(),snippet:P().nullable()}).loose();R({deadLinks:L(R({target:P().min(1),sources:L(Wae)}).loose())}).loose(),R({target:R({docName:P().min(1),title:P(),aliases:L(P())}).loose(),mentions:L(R({source:P().min(1),excerpt:P(),offset:F().int().nonnegative()}).loose()),truncated:I()}).loose(),R({projectPath:P().min(1)}).loose();var Gae=B([`not-a-git-worktree`,`init-failed`]);co(`ok`,[R({ok:V(!0),projectPath:P().min(1)}).loose(),R({ok:V(!1),reason:Gae,message:P().min(1)}).loose()]),R({host:P().min(1).optional()}).loose(),R({host:P().min(1).optional(),token:P().min(1)}).loose(),R({host:P(),login:P()}).loose(),R({key:P().min(1)}).loose(),R({keyPresent:I()}).loose();var Kae=B([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),qae=co(`ok`,[R({ok:V(!0),endpoint:P().min(1),model:P().min(1),dimensions:F().int().positive()}).loose(),R({ok:V(!1),endpoint:P().min(1),model:P().min(1),reason:Kae,status:F().int().optional()}).loose()]);R({name:P().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:P().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),R({authenticated:I()}).loose(),R({channel:B([`login`,`gh-login`]).default(`login`)}).loose(),R({}).loose();var Jae=R({stackIndex:F().int().min(0),ts:F().int().min(0),additions:F().int().min(0),deletions:F().int().min(0)}).loose(),Yae=R({docName:P().min(1),additionsTotal:F().int().min(0),deletionsTotal:F().int().min(0),lastTs:F().int().min(0),bursts:L(Jae)}).loose(),Xae=R({displayName:P().min(1),color:P().min(1),icon:P().optional(),connectionId:P().min(1)}).loose(),Zae=R({sessionAlive:I(),agent:Xae.nullable(),files:L(Yae)}).loose(),Qae=R({diff:P(),before:P(),after:P(),generatedAt:F().int().min(0)}).loose();R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose();var $ae=R({displayName:P().min(1),icon:P(),color:P().min(1),currentDoc:P().nullable(),mode:B([`idle`,`writing`]),ts:F().int().min(0)}).loose();R({presence:uo(P().min(1),$ae)}).loose();var eoe=R({sessionId:P().min(1),agentType:P().min(1),ts:F().int().min(0),insertedChars:F().int().min(0),deletedChars:F().int().min(0)}).loose();R({effects:L(R({"doc.name":P().min(1),entries:L(eoe)}).loose())}).loose(),R({decisions:L(R({ts:F().int().min(0),decision:P().min(1),kind:P().min(1),"doc.name":P().min(1),pathRole:P().min(1)}).loose())}).loose(),uo(P().min(1),I()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),R({path:P().min(1,`path must be non-empty`)}).loose(),R({}).loose();var toe=R({fromDocName:P().min(1),toDocName:P().min(1)}).loose(),noe=R({fromPath:P().min(1),toPath:P().min(1)}).loose();R({}).loose(),R({path:P().min(1),...v1,summary:y1}).loose();var roe=R({docName:P().min(1)}).loose();R({path:P().min(1),...v1,summary:y1}).loose();var ioe=R({path:P().min(1)}).loose();R({kind:B([`file`,`folder`]),path:P().min(1),...v1,summary:y1}).loose();var aoe=R({kind:B([`file`,`folder`]),path:P().min(1),duplicatedDocNames:L(P().min(1))}).loose(),ooe=R({pages:L(R({docName:P().min(1),title:P(),docExt:P().min(1),size:F().int().nonnegative(),modified:P().min(1),icon:P().min(1).max(2048).optional()}).loose())}).loose(),soe=R({level:F().int().min(1).max(6),text:P(),slug:P()}).loose(),coe=R({docName:P().min(1),headings:L(soe)}).loose(),loe=R({docName:P().min(1),rewrites:F().int().nonnegative()}).loose();R({kind:B([`file`,`folder`,`asset`]),fromPath:P().min(1),toPath:P().min(1),...v1,summary:y1}).loose();var uoe=R({renamed:L(toe),renamedAssets:L(noe),rewrittenDocs:L(loe).optional(),summary:O7.optional()}).loose();R({kind:B([`file`,`folder`,`asset`]),path:P().min(1),...v1}).loose();var doe=R({deletedDocNames:L(P().min(1))}).loose();R({kind:B([`file`,`folder`,`asset`]),path:P().min(1),...v1,summary:y1}).loose();var foe=R({deletedDocNames:L(P().min(1))}).loose();R({docName:P().min(1),commitSha:P().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:y1,...v1}).loose(),R({restoredFrom:P().min(1),timestamp:P().min(1),summary:O7.optional(),warning:k7.optional(),warnings:M7.optional()}).loose();var poe=B([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),moe=R({label:P().min(1),webUrl:Fa().nullable()}).loose(),hoe=co(`checkStatus`,[R({checkStatus:V(`allowed`)}).loose(),R({checkStatus:V(`denied`),deniedReason:B([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`])}).loose(),R({checkStatus:V(`unknown`),unknownError:B([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),z7=B([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),goe=B(ju),_oe=B([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);R({state:poe,lastSyncUtc:P().nullable(),lastFetchUtc:P().nullable(),lastPushedSha:P().nullable(),ahead:F().int().min(0),behind:F().int().min(0),consecutiveFailures:F().int().min(0),conflictCount:F().int().min(0),hasRemote:I(),syncEnabled:I(),identityUnresolved:I(),remote:moe.nullable().optional(),pushError:P().optional(),pushErrorCode:z7.optional(),pullError:P().optional(),pullErrorCode:z7.optional(),pausedReason:P().optional(),pushPermission:hoe.optional(),syncMode:goe.optional(),lastPullUtc:P().nullable().optional(),lastPullOutcome:_oe.nullable().optional()}).loose(),R({op:B([`sync`,`push`,`pull`]).optional()}).loose(),R({op:B([`sync`,`push`,`pull`])}).loose(),R({conflicts:L(R({file:P().min(1),detectedAt:P().min(1),oursSha:P().optional(),theirsSha:P().optional(),baseSha:P().optional()}).loose())}).loose(),R({file:P().min(1),strategy:B([`mine`,`theirs`,`content`,`delete`]),content:P().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),R({}).loose(),R({file:P().min(1),base:P(),ours:P(),theirs:P(),kind:B([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:P().nullable()}).loose(),R({plan:Ro(e=>e!==void 0,{message:`plan is required`})}).loose(),R({plan:Ro(e=>e!==void 0,{message:`plan is required`})}).loose(),R({result:Ro(e=>e!==void 0,{message:`result is required`})}).loose();var voe=R({path:P().min(1),summary:P().min(1)}).loose(),yoe=R({files:F().int().nonnegative(),folders:F().int().nonnegative()}).loose();R({packs:L(R({id:P().min(1),name:P().min(1),description:P().min(1),defaultSubfolder:P().optional(),folders:L(voe),entryCounts:yoe}).loose())}).loose(),R({noOpen:I().optional(),out:P().min(1).optional()}).loose();var boe=R({reason:B([`unsupported-platform`,`spawn-error`]),message:P()}).loose();co(`status`,[R({status:V(`installed`),outputPath:P(),size:F().int().nonnegative(),sha256:P(),skillVersion:P()}).loose(),R({status:V(`built`),outputPath:P(),size:F().int().nonnegative(),sha256:P(),skillVersion:P(),handoffError:boe.optional()}).loose(),R({status:V(`failed`),buildError:P()}).loose(),R({status:V(`skip-current`),skillVersion:P(),recordedAt:P().optional()}).loose()]);var B7=B(dp);function xoe(e){return e===`agents`||dp.includes(e)}R({tags:L(R({name:P().min(1),count:F().int().nonnegative(),isLeaf:I()}).loose())}).loose();var Soe=R({docName:P().min(1),title:P(),matchingTags:L(P().min(1)),snippet:P().nullable()}).loose();R({name:P().min(1),docs:L(Soe)}).loose(),R({folder:io(),frontmatter_local:uo(P(),io()).nullable()}).loose(),R({path:P(),frontmatter:uo(P(),io()).optional()}).loose(),R({applied:io()}).loose();var V7=uo(P(),io()).meta({description:`Free-form frontmatter map embedded in template payloads.`});R({template:R({name:P().min(1),folder:P(),scope:B([`local`,`inherited`]),path:P().min(1),frontmatter:V7,body:P()}).strict()}).strict();var Coe=R({templates:L(R({name:P().min(1),title:P().optional(),description:P().optional(),path:P().min(1),source_folder:P()}).strict()),truncated:I()}).strict();R({folder:P(),name:P(),body:P().optional(),frontmatter:V7.optional(),...v1,summary:y1}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({sourcePath:P().min(1),targetFolder:P(),name:P().optional(),title:P().optional(),deleteSource:I().optional(),...v1,summary:y1}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({existed:I(),path:P().min(1)}).strict(),R({fromFolder:P(),fromName:P(),toFolder:P(),toName:P(),body:P().optional(),frontmatter:V7.optional(),...v1,summary:y1}).strict(),R({from:P().min(1),to:P().min(1),committed:I()}).strict();var H7=B(zf),woe=/^[a-z0-9-]+$/,Toe=/^[A-Za-z0-9_-]+$/,U7=R({name:P(),description:P()}).strict();R({skill:R({name:P().min(1),scope:H7,path:P().min(1),frontmatter:U7,body:P(),files:L(R({path:P().min(1),text:P().nullable()})).optional(),managed:I().optional()}).strict()}).strict();var Eoe=R({source:P().min(1),publisher:P().optional(),skill:P().optional(),marketplaceUrl:P().optional(),importedAt:P().min(1),autoUpdate:I().optional()}).strict(),Doe=R({skills:L(R({name:P().min(1),description:P().optional(),scope:H7,path:P().min(1),absolutePath:P().min(1).optional(),installed:I(),hosts:L(P()),driftPaths:L(P()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:uo(P(),P()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:L(P()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:L(P()).optional(),installableEditors:L(P()).optional(),linkMode:I().optional(),customPlacements:L(R({path:P(),mode:B([`copy`,`link`])}).strict()).optional(),managed:I().optional(),origin:Eoe.optional(),modified:I().optional(),revertable:I().optional()}).strict()),truncated:I()}).strict();R({scope:H7.default(`project`),name:P().meta({description:`Managed skill name to create or update.`}),body:P().optional(),frontmatter:U7,...v1,summary:y1}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({scope:H7.default(`project`),name:P(),dryRun:I().optional(),setAutoUpdate:I().optional(),...v1,summary:y1}).strict(),R({name:P().min(1),updated:I(),source:P().min(1),localBody:P().optional(),upstreamBody:P().optional(),gitTracked:I().optional(),warnings:L(P())}).strict(),R({scope:H7.default(`project`),name:P(),...v1,summary:y1}).strict(),R({name:P().min(1),baselineRef:P().min(1),restoredFiles:L(P()),warnings:L(P())}).strict(),R({existed:I(),path:P().min(1)}).strict(),R({scope:H7.default(`project`),fromName:P(),toName:P(),body:P().optional(),frontmatter:U7.optional(),...v1,summary:y1}).strict(),R({from:P().min(1),to:P().min(1),committed:I()}).strict(),R({name:P(),fromScope:H7,toScope:H7,...v1,summary:y1}).strict(),R({scope:H7,path:P().optional()}).strict(),R({scope:H7,name:P(),toName:P(),...v1,summary:y1}).strict(),R({name:P().min(1)}).strict(),R({name:P(),home:P().min(1)}).strict(),R({docName:P().min(1)}).strict();var W7=B([`reference`,`script`,`file`]);R({scope:H7.default(`project`),name:P(),path:P().min(1),content:P(),...v1,summary:y1}).strict(),R({path:P().min(1),created:I(),kind:W7,content:I()}).strict(),R({scope:H7.default(`project`),name:P(),from:P().min(1),to:P().min(1),...v1,summary:y1}).strict(),R({from:P().min(1),to:P().min(1),fromDocName:P().optional(),toDocName:P().optional()}).strict(),R({path:P().min(1),kind:W7,text:P()}).strict(),R({path:P().min(1),existed:I(),kind:W7}).strict();var G7=so([B7,V(`agents`)]),K7=P().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),q7=so([G7,K7]);R({scope:H7.default(`project`),name:P(),targets:L(G7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:L(q7).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:L(q7).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:B([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:q7.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:I().optional(),setSource:P().min(1).optional(),place:R({dir:P().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:B([`copy`,`link`])}).strict().optional(),convert:R({target:q7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:B([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:R({path:P().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...v1,summary:y1,fork:R({editor:P().min(1),action:B([`align`,`make-source`,`rename`]),toName:P().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),R({name:P().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:L(P()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:I().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:L(P()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:L(B([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:P().optional(),sourceMovedTo:P().optional()}).strict(),R({scope:H7.default(`project`),name:P().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),R({name:P().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:I().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var Ooe=R({targets:L(B7),configured:I(),folders:L(R({scope:H7,host:P(),root:P(),state:B([`own`,`linked`,`linked-parent`,`absent`]),target:P().optional(),drift:V(!0).optional(),expected:P().optional()}).strict()).optional()}).strict();R({folderAction:co(`action`,[R({action:V(`link`),scope:H7,root:P().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:P().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}).strict(),R({action:V(`unlink`),scope:H7,root:P().min(1).meta({description:`The linked folder to materialize back.`}),exclude:L(P().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),R({action:V(`add-root`),scope:H7,root:K7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict()])}).strict(),R({targets:L(B7),reprojected:L(R({name:P(),hosts:L(P())}).strict()),bundleHosts:L(P()),removedFrom:L(P()),folder:R({moved:L(P()),dropped:L(P()),linked:L(P())}).strict().optional()}).strict(),R({scope:H7.default(`project`),name:P(),version:P().regex(/^[0-9a-f]{40}$/i),...v1,summary:y1}).strict(),R({name:P().min(1),version:P(),restoredFiles:L(P()),warnings:L(P())}).strict(),R({query:P().optional(),intent:B([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:B([`navigation`,`relevance`]).optional(),scopes:L(B([`page`,`folder`,`content`,`file`])).optional(),scope:P().optional(),limit:F().int().nonnegative().optional(),semantic:I().optional(),source:B([`omnibar`,`mcp`,`http`]).optional()}).loose();var koe=R({kind:B([`page`,`folder`,`content`,`file`]),path:P().min(1),title:P(),score:F(),signals:uo(P(),io()),snippet:P().optional()}).loose(),Aoe=R({capable:I(),applied:I(),coverage:R({embedded:F().int().nonnegative(),total:F().int().nonnegative()})}).loose();R({enabled:I(),keyPresent:I(),keyNotRequired:I(),keySource:B([`project`,`file`,`env`]).nullable(),keyHint:P().nullable(),ready:I(),capable:I(),embedded:F().int().nonnegative(),total:F().int().nonnegative()}).loose(),R({query:P(),intent:B([`autocomplete`,`full_text`,`omnibar`]),results:L(koe),elapsedMs:F().nonnegative(),semantic:Aoe.optional(),truncated:I().optional(),ready:I().optional()}).loose();var joe=R({version:P().min(1),recordedAt:P().min(1)}).loose();R({currentVersion:P().min(1),targets:uo(P(),joe.nullable())}).loose(),R({scope:H7.default(`project`),source:P().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:P().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:I().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),...v1,summary:y1}).strict(),R({scope:H7.default(`project`),source:P().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:L(P().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:I().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),...v1,summary:y1}).strict(),R({results:L(R({requested:P(),status:B([`imported`,`already-imported`,`not-found`,`failed`]),name:P().optional(),collisionRenamedFrom:P().optional(),warnings:L(P()),error:P().optional()}).loose()),imported:F(),alreadyImported:F(),failed:F()}).loose();var Moe=R({source:P(),ref:P().optional(),contentHash:P(),publisher:P().optional()}).loose();R({name:P().min(1).meta({description:`Managed skill name created or matched.`}),path:P().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:I().meta({description:`True when this request created new source files.`}),alreadyImported:I().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:P().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:Moe,warnings:L(P()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose();var Noe=`server-info`,Poe=`branch-switched`,Foe=`disk-ack`,Ioe=`config-validation-rejected`,Loe=`config-ignore-nested-error`,J7=B([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`]),Roe=R({v:V(1),ch:V(Noe),seq:F(),serverInstanceId:P().min(1),currentBranch:P().min(1).optional()}).loose(),zoe=R({v:V(1),ch:V(Poe),seq:F(),branch:P().min(1)}).loose(),Boe=R({v:V(1),ch:J7,seq:F()}).loose(),Voe=R({v:V(1),ch:V(Foe),seq:F(),docName:P().min(1),sv:P().min(1)}).loose(),Hoe=R({v:V(1),ch:V(Ioe),seq:F(),docName:P().min(1),error:Tf}).loose(),Uoe=R({v:V(1),ch:V(Loe),seq:F(),path:P().min(1),error:P().min(1)}).loose();function Woe(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function Goe(e){if(typeof e!=`string`||e.length===0)return e;let t=H2(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(L2(e)){let t=Woe(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=P2(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var Koe=`https://api.github.com/repos/inkeep/open-knowledge`;async function qoe(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(Koe,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function Joe(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new vX.default;var Yoe=R({path:L(so([P(),F()])),message:P(),issueCode:P()});co(`code`,[R({code:V(`SCHEMA_INVALID`),issues:L(Yoe)}),R({code:V(`WRITE_ERROR`),detail:P()})]);function Xoe(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function Zoe(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var Y7=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,Qoe=/^---([ \t]*)(?=\r?\n|$)/,X7=e=>e.includes(`\r
571
571
  `)?`\r
572
572
  `:`
573
- `,Qoe=e=>e.replace(Zoe,`***$1`),Z7=e=>`---${e}${e}---${e}`;function Q7(e,t){let n=xp(e,t);return{md:n,frontmatter:n.slice(0,n.length-t.length)}}function $7(e,t){let{md:n,frontmatter:r}=Q7(e,t),i=bp(n);return i.frontmatter===r&&i.body===t}function e9(e,t,n,r){let{md:i,frontmatter:a}=Q7(t,n);return{md:i,frontmatter:a,body:n,adjusted:r===`none`&&a!==e?`frontmatter`:r}}function $oe(e,t){if($7(e,t))return e9(e,e,t,`none`);let n=Qoe(t);if(n!==t&&$7(e,n))return e9(e,e,n,`body`);if(Y7.test(e)){let n=Z7(X7(e));if($7(n,t))return e9(e,n,t,`frontmatter`)}return e9(e,e,t,`unresolved`)}function ese(e,t){if($7(e,t))return e9(e,e,t,`none`);let n=Z7(X7(e||t));return(e===``||Y7.test(e))&&$7(n,t)?e9(e,n,t,`frontmatter`):e9(e,e,t,`unresolved`)}var t9=65536;function n9(e){let t=e.match(vp);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function tse(e){if(e.trim()===``)return{doc:new bl({}),map:{}};let t;try{t=Au(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new bl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=Mp.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function r9(e){return e===``?{doc:new bl({}),map:{}}:tse(Sp(e))}function i9(e){let{fenced:t}=n9(e),{map:n,parseError:r}=r9(t);return{map:n??{},parseError:r}}function a9(e){let{fenced:t}=n9(e);if(t===``)return[];let{doc:n,map:r}=r9(t);return r===null?[]:l9(n)}function o9(e){return typeof e==`object`&&!!e&&`key`in e}function s9(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function c9(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function l9(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!o9(e))continue;let t=s9(e);t!==null&&n.push(t)}return n}function u9(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function nse(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:Bp(e.toString(Ip))}function rse(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:t9}:null}function d9(e){let t=nse(e),n=rse(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function ise(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:Cp}};let{doc:n,map:r}=r9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{u9(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=Dp.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,zp(n,n.get(e,!0),t.data))}return d9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function ase(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:Cp}};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>o9(e)&&s9(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>o9(e)&&e!==s&&s9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return c9(s,n),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function f9(e,t){let{doc:n,map:r}=r9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=l9(n);if(a.length!==t.length||!p9(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(o9),r=[];for(let n of t){let i=e.findIndex(e=>s9(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,d9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function p9(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function m9(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:Cp}:null}function ose(e,t,n){let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=Dp.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return u9(i),i.setIn(t,zp(i,i.getIn(t,!0),o.data)),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function sse(e,t){let n=m9(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=r9(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),d9(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function cse(e,t){if(t.length===0){let t=e.contents;return Qo(t)?t:null}let n=e.getIn(t,!0);return Qo(n)?n:null}function lse(e,t,n,r={}){let i=m9(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:Cp}};let{doc:o,map:s}=r9(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=cse(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>o9(e)&&s9(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>o9(e)&&e!==l&&s9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return c9(l,n),d9(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function use(e,t,n){if(t.length===0)return f9(e,n);let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Qo(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!o9(e))continue;let t=s9(e);t!==null&&s.push(t)}if(s.length!==n.length||!p9(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(o9),t=[];for(let r of n){let i=e.findIndex(e=>s9(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function dse(e,t,n){let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!ts(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!fse(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function fse(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var pse=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function h9(e){return{ok:!1,error:e}}function mse(e){return{ok:!0,...e}}function hse(e){return{ok:!0,...e}}function gse(e){return{ok:!0,...e}}function g9(e){return{ok:!0,...e}}function _9(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${t9}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function _se(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!Fp(e.map[n],t.map[n]))return!1;return!0}var vse=5;function v9(e){let t=e.toString();return{snapshot:yse(t),raw:t}}function yse(e){let{map:t,parseError:n}=i9(e);return{map:t,keys:a9(e),parseError:n}}function y9(e){return e.startsWith(`---`)}function bse(e){let t=e.document,n=t.getText(`source`),r=new Set,i=v9(n),a=i.snapshot,o=n9(i.raw).fenced,s=y9(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=v9(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&_se(a,t)){s=y9(i);return}a=t,o=n9(i).fenced,s=y9(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||xse(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let t=n.toString(),{fenced:i}=n9(t);if(r=e(i),!r.ok||r.nextFenced===i)return;let a=ese(r.nextFenced,t.slice(i.length)).frontmatter;n.delete(0,i.length),a!==``&&n.insert(0,a)},pse),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return h9({code:`SCHEMA_INVALID`,issues:[{path:[Cp],message:`'${Cp}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=Np.safeParse(e);if(!t.success)return h9({code:`SCHEMA_INVALID`,issues:t.error.issues.map(Yoe)});let n=t.data,r=Object.keys(n),i=f(e=>ise(e,n));return i.ok?mse({appliedKeys:r}):h9(_9(i.error))}function m(e,t,n={}){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>ase(r,e,t,n));return r.ok?hse({oldKey:e,newKey:t}):h9(_9(r.error))}function h(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>f9(t,e));return t.ok?gse({orderedKeys:[...e]}):h9(_9(t.error))}function g(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>ose(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}function _(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>sse(t,e));return t.ok?g9({path:[...e]}):h9(_9(t.error))}function v(e,t,n={}){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>lse(r,e,t,n));return r.ok?g9({path:[...e]}):h9(_9(r.error))}function y(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>use(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}function b(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>dse(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}return{current(){return v9(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function xse(e,t,n){if(t===0&&n)return!0;let r=t>0?t:vse,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var Sse=new vX.default;Sse.Match_Threshold=.5;var Cse=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,b9=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,x9=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,wse=/^\d+([.)])(?=\s)/,Tse=`1`,Ese=/\*\*\s*(`[^`]+`)\s*\*\*/g,Dse=/^(`{3,}|~{3,})/;function Ose(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=Dse.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!b9.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||b9.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function S9(e){return e.slice(0,-1).trimEnd()}var C9=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function w9(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var kse=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Ase=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,jse=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,Mse=/<\/?[A-Z]/;function Nse(e){let t=!1;for(let n=0;n<e.length;n++)if(Mse.test(e[n]??``)){t=!0;break}if(!t)return e;let n=w9(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&kse.test(s));let l=c&&jse.test(s),u=c&&!l&&Ase.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function Pse(e){let t=Nse(e.replace(/^/,``).replace(/\r/g,``).replace(Cse,`$1`).replace(Ese,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
573
+ `,$oe=e=>e.replace(Qoe,`***$1`),Z7=e=>`---${e}${e}---${e}`;function Q7(e,t){let n=xp(e,t);return{md:n,frontmatter:n.slice(0,n.length-t.length)}}function $7(e,t){let{md:n,frontmatter:r}=Q7(e,t),i=bp(n);return i.frontmatter===r&&i.body===t}function e9(e,t,n,r){let{md:i,frontmatter:a}=Q7(t,n);return{md:i,frontmatter:a,body:n,adjusted:r===`none`&&a!==e?`frontmatter`:r}}function ese(e,t){if($7(e,t))return e9(e,e,t,`none`);let n=$oe(t);if(n!==t&&$7(e,n))return e9(e,e,n,`body`);if(Y7.test(e)){let n=Z7(X7(e));if($7(n,t))return e9(e,n,t,`frontmatter`)}return e9(e,e,t,`unresolved`)}function tse(e,t){if($7(e,t))return e9(e,e,t,`none`);let n=Z7(X7(e||t));return(e===``||Y7.test(e))&&$7(n,t)?e9(e,n,t,`frontmatter`):e9(e,e,t,`unresolved`)}var t9=65536;function n9(e){let t=e.match(vp);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function nse(e){if(e.trim()===``)return{doc:new bl({}),map:{}};let t;try{t=Au(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new bl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=Mp.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function r9(e){return e===``?{doc:new bl({}),map:{}}:nse(Sp(e))}function i9(e){let{fenced:t}=n9(e),{map:n,parseError:r}=r9(t);return{map:n??{},parseError:r}}function a9(e){let{fenced:t}=n9(e);if(t===``)return[];let{doc:n,map:r}=r9(t);return r===null?[]:l9(n)}function o9(e){return typeof e==`object`&&!!e&&`key`in e}function s9(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function c9(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function l9(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!o9(e))continue;let t=s9(e);t!==null&&n.push(t)}return n}function u9(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function rse(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:Bp(e.toString(Ip))}function ise(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:t9}:null}function d9(e){let t=rse(e),n=ise(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function ase(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:Cp}};let{doc:n,map:r}=r9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{u9(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=Dp.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,zp(n,n.get(e,!0),t.data))}return d9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function ose(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:Cp}};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>o9(e)&&s9(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>o9(e)&&e!==s&&s9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return c9(s,n),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function f9(e,t){let{doc:n,map:r}=r9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=l9(n);if(a.length!==t.length||!p9(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(o9),r=[];for(let n of t){let i=e.findIndex(e=>s9(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,d9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function p9(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function m9(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:Cp}:null}function sse(e,t,n){let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=Dp.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return u9(i),i.setIn(t,zp(i,i.getIn(t,!0),o.data)),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function cse(e,t){let n=m9(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=r9(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),d9(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function lse(e,t){if(t.length===0){let t=e.contents;return Qo(t)?t:null}let n=e.getIn(t,!0);return Qo(n)?n:null}function use(e,t,n,r={}){let i=m9(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:Cp}};let{doc:o,map:s}=r9(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=lse(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>o9(e)&&s9(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>o9(e)&&e!==l&&s9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return c9(l,n),d9(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function dse(e,t,n){if(t.length===0)return f9(e,n);let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Qo(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!o9(e))continue;let t=s9(e);t!==null&&s.push(t)}if(s.length!==n.length||!p9(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(o9),t=[];for(let r of n){let i=e.findIndex(e=>s9(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function fse(e,t,n){let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!ts(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!pse(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function pse(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var mse=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function h9(e){return{ok:!1,error:e}}function hse(e){return{ok:!0,...e}}function gse(e){return{ok:!0,...e}}function _se(e){return{ok:!0,...e}}function g9(e){return{ok:!0,...e}}function _9(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${t9}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function vse(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!Fp(e.map[n],t.map[n]))return!1;return!0}var yse=5;function v9(e){let t=e.toString();return{snapshot:bse(t),raw:t}}function bse(e){let{map:t,parseError:n}=i9(e);return{map:t,keys:a9(e),parseError:n}}function y9(e){return e.startsWith(`---`)}function xse(e){let t=e.document,n=t.getText(`source`),r=new Set,i=v9(n),a=i.snapshot,o=n9(i.raw).fenced,s=y9(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=v9(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&vse(a,t)){s=y9(i);return}a=t,o=n9(i).fenced,s=y9(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||Sse(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let t=n.toString(),{fenced:i}=n9(t);if(r=e(i),!r.ok||r.nextFenced===i)return;let a=tse(r.nextFenced,t.slice(i.length)).frontmatter;n.delete(0,i.length),a!==``&&n.insert(0,a)},mse),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return h9({code:`SCHEMA_INVALID`,issues:[{path:[Cp],message:`'${Cp}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=Np.safeParse(e);if(!t.success)return h9({code:`SCHEMA_INVALID`,issues:t.error.issues.map(Xoe)});let n=t.data,r=Object.keys(n),i=f(e=>ase(e,n));return i.ok?hse({appliedKeys:r}):h9(_9(i.error))}function m(e,t,n={}){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>ose(r,e,t,n));return r.ok?gse({oldKey:e,newKey:t}):h9(_9(r.error))}function h(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>f9(t,e));return t.ok?_se({orderedKeys:[...e]}):h9(_9(t.error))}function g(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>sse(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}function _(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>cse(t,e));return t.ok?g9({path:[...e]}):h9(_9(t.error))}function v(e,t,n={}){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>use(r,e,t,n));return r.ok?g9({path:[...e]}):h9(_9(r.error))}function y(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>dse(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}function b(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>fse(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}return{current(){return v9(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function Sse(e,t,n){if(t===0&&n)return!0;let r=t>0?t:yse,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var Cse=new vX.default;Cse.Match_Threshold=.5;var wse=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,b9=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,x9=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,Tse=/^\d+([.)])(?=\s)/,Ese=`1`,Dse=/\*\*\s*(`[^`]+`)\s*\*\*/g,Ose=/^(`{3,}|~{3,})/;function kse(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=Ose.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!b9.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||b9.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function S9(e){return e.slice(0,-1).trimEnd()}var C9=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function w9(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var Ase=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,jse=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Mse=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,Nse=/<\/?[A-Z]/;function Pse(e){let t=!1;for(let n=0;n<e.length;n++)if(Nse.test(e[n]??``)){t=!0;break}if(!t)return e;let n=w9(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&Ase.test(s));let l=c&&Mse.test(s),u=c&&!l&&jse.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function Fse(e){let t=Pse(e.replace(/^/,``).replace(/\r/g,``).replace(wse,`$1`).replace(Dse,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
574
574
 
575
575
  $2`).replace(/^([#>+-].*|\d+[.)].*|`{3,}.*|~{3,}.*|<\/[A-Z][A-Za-z0-9]*>[ \t]*)\n([^\n])/gm,`$1
576
576
 
577
577
  $2`).split(`
578
- `)),n=Ose(t),r=w9(t);return t.map((e,i)=>{let a=e.trimEnd();if(i>0&&!r.has(i)&&/^[ \t]+\S/.test(a)&&(t[i-1]??``).trim()!==``&&!x9.test(a)&&!C9.test(a.trimStart())){let e=(t[i-1]??``).trimStart();if(!C9.test(e)&&!e.startsWith(`|`))return a.replace(/^[ \t]+/,``)}if(b9.test(a)){let e=a.replace(/\s+/g,``);return n.has(i)&&e.length>1&&e.startsWith(`|`)&&e.endsWith(`|`)?S9(e):e}let o=x9.test(a)?a.replace(/^[ \t]+/,``):a;return n.has(i)&&o.length>1&&o.startsWith(`|`)&&o.endsWith(`|`)&&(o=S9(o)),o.replace(wse,`${Tse}$1`)}).join(`
578
+ `)),n=kse(t),r=w9(t);return t.map((e,i)=>{let a=e.trimEnd();if(i>0&&!r.has(i)&&/^[ \t]+\S/.test(a)&&(t[i-1]??``).trim()!==``&&!x9.test(a)&&!C9.test(a.trimStart())){let e=(t[i-1]??``).trimStart();if(!C9.test(e)&&!e.startsWith(`|`))return a.replace(/^[ \t]+/,``)}if(b9.test(a)){let e=a.replace(/\s+/g,``);return n.has(i)&&e.length>1&&e.startsWith(`|`)&&e.endsWith(`|`)?S9(e):e}let o=x9.test(a)?a.replace(/^[ \t]+/,``):a;return n.has(i)&&o.length>1&&o.startsWith(`|`)&&o.endsWith(`|`)&&(o=S9(o)),o.replace(Tse,`${Ese}$1`)}).join(`
579
579
  `).replace(/\n{3,}/g,`
580
580
 
581
- `).replace(/\n+$/,``)}function T9(e){return[...e.replace(/^\n+/,``).replace(/\n+$/,``).matchAll(/\n{2,}/g)].map(e=>e[0].length)}function Fse(e,t){let n=T9(e),r=T9(t);return n.length===r.length?r.some((e,t)=>e>(n[t]??0)):!1}var E9=/^[a-zA-Z0-9][\w/-]*$/;function Ise(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return E9.test(t)}var Lse=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function Rse(e){return e.startsWith(`#`)?e.slice(1):e}function zse(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Bse(e){if(!e||e.trim()===``)return[];let{map:t}=Lp(e);if(!t)return[];let n=zse(t.tags),r=[];for(let e of n){let t=Rse(e);E9.test(t)&&r.push(t)}return r}var Vse=B(zf),Hse=z({hosts:L(P()),scope:Vse,scripts:I(),installedAt:ha(),projection:B([`symlink`,`copy`]).optional(),contentHash:P().optional()});z({schema:V(1),skills:uo(P(),Hse).default({})});var Use=100,Wse=500,Gse=450,Kse={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function qse(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var Jse=/\.(?:md|mdx)$/;function Yse(e,t){if(t!==`page`)return e;let n=e.replace(Jse,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Xse(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=OY({schema:Kse});return e.length>0&&zY(t,e),t}function Zse(e){let t={documents:e};return D9.set(t,A9(e)),t}function Qse(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function $se(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function ece(e,t){let n=O9(t);if(!n)return 0;let r=Yse(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var tce=.5;function M9(e,t){let n=ece(e,t);return n<=0?n:p1(e.path)?n*tce:n}var nce=60;function rce(e){return e===`file`?-nce:0}var ice=1e3,N9=50,ace=1,oce=1,sce=.001;function cce(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-sce:0,c=ace*a+oce*o+s;return e*ice+c}function P9(e,t,n,r){return e+t*20+n+rce(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):cce(t,n,r,i,a)}function lce(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function uce(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function dce(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function fce(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function pce(e,t){return O9(t).length<4?0:+(e===`full_text`)}function mce(e){let{lexical:t,fullText:n}=e.signals;return t>=Wse?`lexical`:t===Gse&&n<=0?`pathOnly`:`body`}function hce(e){let t=[],n=[],r=[];for(let i of e){let e=mce(i);e===`lexical`?t.length<Use&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=hce(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function gce(e,t,n={}){let r=n.intent??`omnibar`,i=lce(r,n.ranking),a=qse(n.limit),o=new Set(n.scopes??$se(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=hX(Qse(e),{term:c,properties:dce(r),boost:fce(r),tolerance:pce(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=uce(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(_ce({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function _ce(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function vce(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function yce(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=Xr());var V9=B9[z9],H9=z({version:P().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:ha().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:B([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()}),bce=z({enabled:I().register(V9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:ha().register(V9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});z({schema:V(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:z({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:uo(P(),bce).register(V9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var xce=new Set([`(connected)`,`(agent thread)`]);function Sce(e){return e!=null&&xce.has(e)}var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function Cce(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??wce,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function wce(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function Tce(){let e=!1,t=``,n=0;return r=>{let i=Ece(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Ece(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var Dce=/^(#{1,6})\s+(.+)$/;function Oce(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(Dce);if(!n)return null;let r=n[2].trim(),i=h7(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var kce=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Ace={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},jce={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Mce(e,t=kce){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Nce(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Pce(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Fce={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Ice(e){return e?Fce[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Lce(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Rce(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function zce(e){let[t]=Lce(e);return Rce(t,45,32)}var Bce=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Vce=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Hce(){return`${q9(Bce)} ${q9(Vce)}`}function Uce(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Wce(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Hce(),Y9(G9,n)),r||(r=Uce(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Gce(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Kce(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function qce(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=r<0?n:n.slice(0,r),a=Xf(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Yf(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=Gce(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=Z9(n);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c}:null}function Jce(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Yce(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function Xce(e,t,n=null,r=`.md`){let i=Q9(e);i.pop();let a=Q9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${l}${r}${n?`#${n}`:``}`}function Zce(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{zre as $,Zu as $a,Kh as $i,w4 as $n,NX as $r,$Q as $t,R7 as A,Pp as Aa,NC as Ai,vZ as An,V as Ao,N2 as Ar,woe as At,V0 as B,tp as Ba,Zb as Bi,Lie as Bn,Oce as Br,jie as Bt,roe as C,jf as Ca,sC as Ci,Nce as Cn,Gu as Co,cae as Cr,S1 as Ct,uoe as D,Fp as Da,xC as Di,Zse as Dn,L as Do,Pse as Dr,B7 as Dt,hZ as E,Vf as Ea,zC as Ei,_4 as En,Vo as Eo,MZ as Er,A1 as Et,Lse as F,ep as Fa,bC as Fi,Z9 as Fn,wt as Fo,a9 as Fr,doe as Ft,mZ as G,$u as Ga,Lg as Gi,Wce as Gn,JQ as Gr,c1 as Gt,L8 as H,bp as Ha,Ox as Hi,Pce as Hn,gce as Hr,qQ as Ht,E9 as I,ip as Ia,tw as Ii,Bse as In,i9 as Ir,EZ as It,Bae as J,dd as Ja,yg as Ji,Y0 as Jn,YQ as Jr,bse as Jt,ZZ as K,od as Ka,Bg as Ki,UQ as Kn,e$ as Kr,Kce as Kt,jae as L,Qf as La,ET as Li,Xoe as Ln,Yce as Lr,TZ as Lt,Tae as M,_p as Ma,hT as Mi,PX as Mn,P as Mo,MX as Mr,c$ as Mt,ioe as N,op as Na,RS as Ni,cZ as Nn,kt as No,HQ as Nr,FQ as Nt,xae as O,Ap as Oa,AC as Oi,Xse as On,I as Oo,P5 as Or,Doe as Ot,sZ as P,Wf as Pa,hS as Pi,GQ as Pn,jt as Po,V2 as Pr,Soe as Pt,f7 as Q,kd as Qa,Hh as Qi,C4 as Qn,m7 as Qr,ZQ as Qt,kie as R,qf as Ra,lT as Ri,WX as Rn,Woe as Rr,B1 as Rt,Cae as S,hp as Sa,mT as Si,$oe as Sn,ff as So,dae as Sr,I1 as St,Sie as T,Hf as Ta,RC as Ti,Tce as Tn,B as To,rZ as Tr,E1 as Tt,BZ as U,Gf as Ua,wg as Ui,Koe as Un,t7 as Ur,Rae as Ut,Hae as V,em as Va,ex as Vi,K5 as Vn,OX as Vr,WQ as Vt,VZ as W,Sp as Wa,q as Wi,h7 as Wn,V1 as Wr,Fse as Wt,Nie as X,tf as Xa,Vh as Xi,j4 as Xn,zZ as Xr,XQ as Xt,Die as Y,ef as Ya,K as Yi,Ice as Yn,Zre as Yr,nZ as Yt,Kae as Z,ud as Za,Ih as Zi,M4 as Zn,Tie as Zr,l$ as Zt,FX as _,Lf as _a,QC as _i,l1 as _n,Lu as _o,KZ as _r,cQ as _t,TX as a,W as aa,ZA as ai,qce as an,rf as ao,D4 as ar,Vae as at,DZ as b,Cp as ba,DT as bi,x$ as bn,Wu as bo,I2 as br,GZ as bt,Roe as c,Ff as ca,HO as ci,wX as cn,Hu as co,gZ as cr,soe as ct,zoe as d,Nf as da,sk as di,Z$ as dn,Vu as do,p1 as dr,L1 as dt,Gh as ea,H1 as ei,Xce as en,sd as eo,A4 as er,sQ as et,Boe as f,cp as fa,AO as fi,E$ as fn,kf as fo,P2 as fr,z1 as ft,xX as g,yp as ga,Ow as gi,w$ as gn,Ru as go,qZ as gr,Rie as gt,uZ as h,up as ha,Gw as hi,u1 as hn,Ed as ho,Sce as hr,kX as ht,Zae as i,Dm as ia,aj as ii,yce as in,fd as io,S4 as ir,yZ as it,Eae as j,Bf as ja,$C as ji,Bie as jn,R as jo,qoe as jr,s$ as jt,J7 as k,Uf as ka,MC as ki,zce as kn,ja as ko,VQ as kr,Eoe as kt,Hoe as l,Mf as la,CO as li,NZ as ln,Ld as lo,$9 as lr,aoe as lt,dZ as m,pp as ma,oT as mi,S$ as mn,Ef as mo,bZ as mr,AX as mt,jce as n,vh as na,_$ as ni,vce as nn,Vd as no,k4 as nr,y$ as nt,kae as o,nm as oa,ej as oi,Jce as on,Ju as oo,O4 as or,CZ as ot,Loe as p,lp as pa,QO as pi,T$ as pn,Qu as po,wie as pr,bae as pt,Pae as q,sf as qa,G as qi,lZ as qn,u$ as qr,XX as qt,Xae as r,U as ra,k9 as ri,Cce as rn,id as ro,T4 as rr,SZ as rt,Oae as s,sp as sa,$A as si,CX as sn,Gd as so,XZ as sr,wZ as st,Ace as t,_g as ta,g7 as ti,d$ as tn,rd as to,E4 as tr,v$ as tt,Voe as u,Pf as ua,tk as ui,Mce as un,Jd as uo,Fie as ur,Sae as ut,fZ as v,zf as va,kT as vi,Y$ as vn,Bu as vo,boe as vr,loe as vt,noe as w,Xp as wa,cC as wi,Vie as wn,Wd as wo,X0 as wr,D1 as wt,P7 as x,fp as xa,aC as xi,b$ as xn,af as xo,Hie as xr,Coe as xt,U9 as y,mp as ya,AT as yi,C$ as yn,Dd as yo,Ise as yr,UZ as yt,W9 as z,np as za,Vx as zi,PZ as zn,Zce as zr,Mie as zt};
581
+ `).replace(/\n+$/,``)}function T9(e){return[...e.replace(/^\n+/,``).replace(/\n+$/,``).matchAll(/\n{2,}/g)].map(e=>e[0].length)}function Ise(e,t){let n=T9(e),r=T9(t);return n.length===r.length?r.some((e,t)=>e>(n[t]??0)):!1}var E9=/^[a-zA-Z0-9][\w/-]*$/;function Lse(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return E9.test(t)}var Rse=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function zse(e){return e.startsWith(`#`)?e.slice(1):e}function Bse(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Vse(e){if(!e||e.trim()===``)return[];let{map:t}=Lp(e);if(!t)return[];let n=Bse(t.tags),r=[];for(let e of n){let t=zse(e);E9.test(t)&&r.push(t)}return r}var Hse=B(zf),Use=z({hosts:L(P()),scope:Hse,scripts:I(),installedAt:ha(),projection:B([`symlink`,`copy`]).optional(),contentHash:P().optional()});z({schema:V(1),skills:uo(P(),Use).default({})});var Wse=100,Gse=500,Kse=450,qse={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function Jse(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var Yse=/\.(?:md|mdx)$/;function Xse(e,t){if(t!==`page`)return e;let n=e.replace(Yse,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Zse(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=OY({schema:qse});return e.length>0&&zY(t,e),t}function Qse(e){let t={documents:e};return D9.set(t,A9(e)),t}function $se(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function ece(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function tce(e,t){let n=O9(t);if(!n)return 0;let r=Xse(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var nce=.5;function M9(e,t){let n=tce(e,t);return n<=0?n:m1(e.path)?n*nce:n}var rce=60;function ice(e){return e===`file`?-rce:0}var ace=1e3,N9=50,oce=1,sce=1,cce=.001;function lce(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-cce:0,c=oce*a+sce*o+s;return e*ace+c}function P9(e,t,n,r){return e+t*20+n+ice(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):lce(t,n,r,i,a)}function uce(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function dce(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function fce(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function pce(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function mce(e,t){return O9(t).length<4?0:+(e===`full_text`)}function hce(e){let{lexical:t,fullText:n}=e.signals;return t>=Gse?`lexical`:t===Kse&&n<=0?`pathOnly`:`body`}function gce(e){let t=[],n=[],r=[];for(let i of e){let e=hce(i);e===`lexical`?t.length<Wse&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=gce(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function _ce(e,t,n={}){let r=n.intent??`omnibar`,i=uce(r,n.ranking),a=Jse(n.limit),o=new Set(n.scopes??ece(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=hX($se(e),{term:c,properties:fce(r),boost:pce(r),tolerance:mce(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=dce(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(vce({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function vce(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function yce(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function bce(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=Xr());var V9=B9[z9],H9=z({version:P().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:ha().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:B([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()}),xce=z({enabled:I().register(V9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:ha().register(V9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});z({schema:V(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:z({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:uo(P(),xce).register(V9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var Sce=new Set([`(connected)`,`(agent thread)`]);function Cce(e){return e!=null&&Sce.has(e)}var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function wce(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Tce,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function Tce(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function Ece(){let e=!1,t=``,n=0;return r=>{let i=Dce(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Dce(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var Oce=/^(#{1,6})\s+(.+)$/;function kce(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(Oce);if(!n)return null;let r=n[2].trim(),i=h7(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var Ace=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],jce={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Mce={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Nce(e,t=Ace){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Pce(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Fce(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Ice={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Lce(e){return e?Ice[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Rce(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function zce(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Bce(e){let[t]=Rce(e);return zce(t,45,32)}var Vce=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Hce=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Uce(){return`${q9(Vce)} ${q9(Hce)}`}function Wce(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Gce(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Uce(),Y9(G9,n)),r||(r=Wce(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Kce(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function qce(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Jce(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=r<0?n:n.slice(0,r),a=Xf(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Yf(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=Kce(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=Z9(n);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c}:null}function Yce(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Xce(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function Zce(e,t,n=null,r=`.md`){let i=Q9(e);i.pop();let a=Q9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${l}${r}${n?`#${n}`:``}`}function Qce(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{Bre as $,kd as $a,Hh as $i,w4 as $n,m7 as $r,QQ as $t,R7 as A,Uf as Aa,MC as Ai,Bce as An,ja as Ao,HQ as Ar,Toe as At,H0 as B,np as Ba,Vx as Bi,FZ as Bn,Qce as Br,Nie as Bt,ioe as C,hp as Ca,mT as Ci,ese as Cn,ff as Co,fae as Cr,C1 as Ct,doe as D,Vf as Da,zC as Di,v4 as Dn,Vo as Do,NZ as Dr,B7 as Dt,hZ as E,Hf as Ea,RC as Ei,Ece as En,B as Eo,rZ as Er,j1 as Et,Rse as F,Wf as Fa,hS as Fi,KQ as Fn,jt as Fo,H2 as Fr,Coe as Ft,mZ as G,Sp as Ga,q as Gi,h7 as Gn,H1 as Gr,Ise as Gt,R8 as H,em as Ha,ex as Hi,K5 as Hn,OX as Hr,GQ as Ht,E9 as I,ep as Ia,bC as Ii,Z9 as In,wt as Io,a9 as Ir,foe as It,Vae as J,sf as Ja,G as Ji,lZ as Jn,d$ as Jr,XX as Jt,QZ as K,$u as Ka,Lg as Ki,Gce as Kn,YQ as Kr,l1 as Kt,Mae as L,ip as La,tw as Li,Vse as Ln,i9 as Lr,DZ as Lt,Eae as M,Bf as Ma,$C as Mi,Vie as Mn,R as Mo,Joe as Mr,l$ as Mt,aoe as N,_p as Na,hT as Ni,PX as Nn,P as No,MX as Nr,_Z as Nt,Sae as O,Fp as Oa,xC as Oi,Qse as On,L as Oo,Fse as Or,Ooe as Ot,sZ as P,op as Pa,RS as Pi,cZ as Pn,kt as Po,UQ as Pr,IQ as Pt,f7 as Q,ud as Qa,Ih as Qi,N4 as Qn,Eie as Qr,u$ as Qt,Aie as R,Qf as Ra,ET as Ri,Zoe as Rn,Xce as Rr,EZ as Rt,wae as S,fp as Sa,aC as Si,x$ as Sn,af as So,Uie as Sr,L1 as St,Cie as T,Xp as Ta,cC as Ti,Hie as Tn,Wd as To,Z0 as Tr,D1 as Tt,VZ as U,bp as Ua,Ox as Ui,Fce as Un,_ce as Ur,JQ as Ut,Uae as V,tp as Va,Zb as Vi,Rie as Vn,kce as Vr,Mie as Vt,HZ as W,Gf as Wa,wg as Wi,qoe as Wn,t7 as Wr,zae as Wt,Pie as X,ef as Xa,K as Xi,Lce as Xn,Qre as Xr,nZ as Xt,Oie as Y,dd as Ya,yg as Yi,X0 as Yn,XQ as Yr,xse as Yt,qae as Z,tf as Za,Vh as Zi,M4 as Zn,BZ as Zr,ZQ as Zt,FX as _,yp as _a,Ow as _i,T$ as _n,Ru as _o,JZ as _r,lQ as _t,TX as a,Dm as aa,aj as ai,bce as an,fd as ao,C4 as ar,Hae as at,OZ as b,mp as ba,AT as bi,w$ as bn,Dd as bo,Lse as br,KZ as bt,zoe as c,sp as ca,$A as ci,CX as cn,Gd as co,ZZ as cr,coe as ct,Boe as d,Pf as da,tk as di,Nce as dn,Jd as do,Iie as dr,R1 as dt,Kh as ea,NX as ei,e$ as en,Zu as eo,T4 as er,cQ as et,Voe as f,Nf as fa,sk as fi,Q$ as fn,Vu as fo,m1 as fr,B1 as ft,xX as g,up as ga,Gw as gi,d1 as gn,Ed as go,Cce as gr,zie as gt,uZ as h,pp as ha,oT as hi,C$ as hn,Ef as ho,xZ as hr,kX as ht,Qae as i,U as ia,k9 as ii,wce as in,id as io,E4 as ir,bZ as it,Dae as j,Pp as ja,NC as ji,yZ as jn,V as jo,P2 as jr,c$ as jt,J7 as k,Ap as ka,AC as ki,Zse as kn,I as ko,P5 as kr,Doe as kt,Uoe as l,Ff as la,HO as li,wX as ln,Hu as lo,gZ as lr,ooe as lt,dZ as m,lp as ma,QO as mi,E$ as mn,Qu as mo,Tie as mr,AX as mt,Mce as n,_g as na,g7 as ni,f$ as nn,rd as no,D4 as nr,b$ as nt,Aae as o,W as oa,ZA as oi,Jce as on,rf as oo,O4 as or,wZ as ot,Roe as p,cp as pa,AO as pi,D$ as pn,kf as po,F2 as pr,xae as pt,Fae as q,od as qa,Bg as qi,WQ as qn,t$ as qr,qce as qt,Zae as r,vh as ra,v$ as ri,yce as rn,Vd as ro,A4 as rr,CZ as rt,kae as s,nm as sa,ej as si,Yce as sn,Ju as so,k4 as sr,TZ as st,jce as t,Gh as ta,U1 as ti,Zce as tn,sd as to,j4 as tr,y$ as tt,Hoe as u,Mf as ua,CO as ui,PZ as un,Ld as uo,$9 as ur,Cae as ut,fZ as v,Lf as va,QC as vi,u1 as vn,Lu as vo,qZ as vr,uoe as vt,roe as w,jf as wa,sC as wi,Pce as wn,Gu as wo,lae as wr,O1 as wt,P7 as x,Cp as xa,DT as xi,S$ as xn,Wu as xo,L2 as xr,woe as xt,U9 as y,zf as ya,kT as yi,X$ as yn,Bu as yo,xoe as yr,WZ as yt,W9 as z,qf as za,lT as zi,WX as zn,Goe as zr,V1 as zt};