@inkeep/open-knowledge 0.37.1 → 0.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/{acp-harness-probe-BaXcmDE0.mjs → acp-harness-probe-ClDt6gNK.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/assets/skills/write-skill/SKILL.md +1 -1
  5. package/dist/cli.mjs +62 -63
  6. package/dist/constants-zp3SYKm9.mjs +2 -0
  7. package/dist/{git-handle-Dn9o6II0.mjs → git-handle-BNHoFrny.mjs} +2 -2
  8. package/dist/git-handle-CBwvOa-O.mjs +1 -0
  9. package/dist/index.d.mts +12 -1
  10. package/dist/index.mjs +1 -1
  11. package/dist/init-BNYoh7KV.mjs +643 -0
  12. package/dist/init-DrifsVXP.mjs +1 -0
  13. package/dist/{launch-json-removal-BNpNXmQG.mjs → launch-json-removal-CtOdn-GL.mjs} +2 -2
  14. package/dist/loader-CCTHhh7w.mjs +1 -0
  15. package/dist/{loader-Cz_WhlON.mjs → loader-krAY0cUj.mjs} +2 -2
  16. package/dist/{open-browser-BTGfTWF8.mjs → open-browser-B_uMbUW5.mjs} +2 -2
  17. package/dist/preview-BxYtUpm_.mjs +1 -0
  18. package/dist/{preview-DJt8zOrQ.mjs → preview-D68n7-B_.mjs} +2 -2
  19. package/dist/public/assets/{ActivityModeContent-fBC0Voik.js → ActivityModeContent-Cgqa56C2.js} +1 -1
  20. package/dist/public/assets/{AgentDiffPane-ChHaUBEu.js → AgentDiffPane-BnvGYsRG.js} +1 -1
  21. package/dist/public/assets/{AgentThreadClientBinder-BMUA20Qq.js → AgentThreadClientBinder-Dzf4FbOU.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-0TqZTWBW.js → CodeMirrorPropInput-Cx9FW420.js} +3 -3
  23. package/dist/public/assets/{DocumentContext-BcosLIs9.js → DocumentContext-Dog3N-Wc.js} +17 -17
  24. package/dist/public/assets/{EnableSyncConfirmDialog-Bo_sKBNs.js → EnableSyncConfirmDialog-DtYm7V_O.js} +1 -1
  25. package/dist/public/assets/{GraphPanel-CpJnEgaj.js → GraphPanel-CvqA9xnU.js} +1 -1
  26. package/dist/public/assets/{ManagedArtifactProperties-Cq1ODSN4.js → ManagedArtifactProperties-67a94DaU.js} +1 -1
  27. package/dist/public/assets/{McpConsentDialogBody-hjXtWWhb.js → McpConsentDialogBody-KLslh1LR.js} +1 -1
  28. package/dist/public/assets/{MermaidDocEditor-Bxza5rNh.js → MermaidDocEditor-DH7WRAfL.js} +1 -1
  29. package/dist/public/assets/{PropertyPanel-BoUU2Tf8.js → PropertyPanel-BoKsESSi.js} +1 -1
  30. package/dist/public/assets/{ReportBugDialogBody-CYIt3IGK.js → ReportBugDialogBody-Dg8V3ei2.js} +1 -1
  31. package/dist/public/assets/SettingsDialogBody-Olkuc1ix.js +7 -0
  32. package/dist/public/assets/{ShareBranchSwitchDialog-BDTs1Q1p.js → ShareBranchSwitchDialog-l3OatXNl.js} +1 -1
  33. package/dist/public/assets/ShareReceiveDialog-DuvJdcqg.js +1 -0
  34. package/dist/public/assets/{ShareReceiveMissDialog-Dh6JMbsb.js → ShareReceiveMissDialog-DLNWM2Pm.js} +1 -1
  35. package/dist/public/assets/{SkillEditorActions-NiL9cPXX.js → SkillEditorActions-B5cWxK9p.js} +1 -1
  36. package/dist/public/assets/{SourceEditor-DAvUlAy0.js → SourceEditor-yoaSx3d8.js} +1 -1
  37. package/dist/public/assets/{TerminalPanel-OeXRTBwe.js → TerminalPanel-D3vyvoTf.js} +1 -1
  38. package/dist/public/assets/TerminalSessionsHost-D500Eh7g.js +2 -0
  39. package/dist/public/assets/{TerminalWindowApp-CH4As48E.js → TerminalWindowApp-aWCNBKLz.js} +1 -1
  40. package/dist/public/assets/{ThreadView-BsUfIPqU.js → ThreadView-nnZWrgGO.js} +1 -1
  41. package/dist/public/assets/{TimelineDiffPane-DsFAdXX4.js → TimelineDiffPane-B7O4osuT.js} +1 -1
  42. package/dist/public/assets/{agent-diff-store-CmFPaGyV.js → agent-diff-store-DuUxJBjU.js} +1 -1
  43. package/dist/public/assets/{agent-visibility-BKHfJySh.js → agent-visibility-D2Mr5Jzk.js} +1 -1
  44. package/dist/public/assets/{auth-state-cache-CnAAGiPA.js → auth-state-cache-CEBkZrQO.js} +7 -7
  45. package/dist/public/assets/{config-provider-DMJrhWUp.js → config-provider-pXCSDe7I.js} +2 -2
  46. package/dist/public/assets/dist-CAKhzFlX.js +124 -0
  47. package/dist/public/assets/{dist-CJUUFO9W.js → dist-DZ_OIHsD.js} +1 -1
  48. package/dist/public/assets/{dist-D6R8vG-1.js → dist-zc03OoUp.js} +2 -2
  49. package/dist/public/assets/{doc-hash-sxvnKnL5.js → doc-hash-D8EI7kHA.js} +1 -1
  50. package/dist/public/assets/{documents-events-Bd2Tt95I.js → documents-events-BTDcCELc.js} +1 -1
  51. package/dist/public/assets/{file-tree-adapter-Cl9Gep-E.js → file-tree-adapter-BJqJ74LH.js} +1 -1
  52. package/dist/public/assets/index-CSsXSr5h.js +1995 -0
  53. package/dist/public/assets/{keyboard-shortcuts-ziymY5lY.js → keyboard-shortcuts-g08DUgcY.js} +1 -1
  54. package/dist/public/assets/{lint-config-client-B4tvFSj6.js → lint-config-client-BcxnEgHO.js} +1 -1
  55. package/dist/public/assets/{navigation-targets-CdngrI3e.js → navigation-targets-DUt4VF6E.js} +1 -1
  56. package/dist/public/assets/{open-managed-artifact-tab-CLJdEdvs.js → open-managed-artifact-tab-CRLFq4-B.js} +1 -1
  57. package/dist/public/assets/{pending-receive-nav-store-pcoVj0T5.js → pending-receive-nav-store-C4eKkzcx.js} +1 -1
  58. package/dist/public/assets/{prop-types-DIMZw1aA.js → prop-types-CBBOToAL.js} +1 -1
  59. package/dist/public/assets/{receive-store-CnAYtEWn.js → receive-store-nuIidOiz.js} +1 -1
  60. package/dist/public/assets/{selection-context-BLlRaGhH.js → selection-context-DgIDY04o.js} +1 -1
  61. package/dist/public/assets/{skill-actions-D_uHXMrN.js → skill-actions-DzaHqGRg.js} +1 -1
  62. package/dist/public/assets/{skills-api-CMDs_cbJ.js → skills-api-BOe6s3mN.js} +1 -1
  63. package/dist/public/assets/{src-DPcWwhgv.js → src-gANoUa2-.js} +1 -1
  64. package/dist/public/assets/{target-navigation-intent-BojcuU7o.js → target-navigation-intent-DzXHO48d.js} +1 -1
  65. package/dist/public/assets/{telemetry-impl-CDBAVJb9.js → telemetry-impl-ClWP6_iI.js} +1 -1
  66. package/dist/public/assets/{telemetry-startup-CZwQc5d3.js → telemetry-startup-D0otGNQT.js} +1 -1
  67. package/dist/public/assets/{terminal-launch-events-fYxl8byx.js → terminal-launch-events-BcKnMQ0G.js} +1 -1
  68. package/dist/public/assets/{terminal-telemetry-YHplv3Gm.js → terminal-telemetry-B-c91nRO.js} +1 -1
  69. package/dist/public/assets/{typing-burst-detector-rg4heHQj.js → typing-burst-detector-B_jwquxb.js} +1 -1
  70. package/dist/public/assets/{use-activity-panel-DXQ7UC10.js → use-activity-panel-Ds1FSy22.js} +1 -1
  71. package/dist/public/assets/{use-apply-config-color-theme-Bb_FV0b5.js → use-apply-config-color-theme-CTTOdBYC.js} +1 -1
  72. package/dist/public/assets/{use-collab-url-xyz-Nyoe.js → use-collab-url-DJN-Eh99.js} +1 -1
  73. package/dist/public/assets/{use-live-xterm-theme-qqv_COHj.js → use-live-xterm-theme-BVrjqV4f.js} +1 -1
  74. package/dist/public/assets/{use-terminal-enabled-CoqSHX6g.js → use-terminal-enabled-WZKABQLf.js} +1 -1
  75. package/dist/public/assets/{use-timeline-entry-diff-vDsLY3JP.js → use-timeline-entry-diff-DD8d8a6p.js} +1 -1
  76. package/dist/public/assets/{use-workspace--VMy_KL1.js → use-workspace-CqL9iZdQ.js} +1 -1
  77. package/dist/public/assets/{workspace-paths-0CCDk_CH.js → workspace-paths-d9KyFHx6.js} +1 -1
  78. package/dist/public/index.html +33 -33
  79. package/dist/{repair-launch-json-QySpBNGz.mjs → repair-launch-json-CPspoDoE.mjs} +2 -2
  80. package/dist/{repair-mcp-configs-BnLNbEPY.mjs → repair-mcp-configs-B7h34RyI.mjs} +2 -2
  81. package/dist/{repair-skills-my6e7ABJ.mjs → repair-skills-D1jVj8Pl.mjs} +2 -2
  82. package/dist/repair-skills-DMbkWuC1.mjs +1 -0
  83. package/dist/server-lock-3eYo5zvq.mjs +1 -0
  84. package/dist/{server-lock-BCKlDt3u.mjs → server-lock-DfCsjalw.mjs} +2 -2
  85. package/dist/src-C3dnLRq0.mjs +3262 -0
  86. package/dist/src-CCYJZLwU.mjs +1 -0
  87. package/dist/{src-CB6BqwdE.mjs → src-CXOotH7J.mjs} +109 -109
  88. package/dist/src-C_CS0zOu.mjs +21 -0
  89. package/dist/{start-BzmMNHPk.mjs → start-CRVuj6qE.mjs} +2 -2
  90. package/dist/start-Cz9TSEAH.mjs +1 -0
  91. package/dist/{write-project-skill-BIiTrHhN.mjs → write-project-skill-BPhp1SGM.mjs} +4 -4
  92. package/package.json +5 -5
  93. package/dist/constants-BtC4Ad17.mjs +0 -2
  94. package/dist/git-handle-CeDCG6sj.mjs +0 -1
  95. package/dist/init-B-c_JFb0.mjs +0 -1
  96. package/dist/init-CCXK-jEf.mjs +0 -643
  97. package/dist/loader-Cc0XghVD.mjs +0 -1
  98. package/dist/preview-BS1Ouf2D.mjs +0 -1
  99. package/dist/public/assets/SettingsDialogBody-Ya-LreoD.js +0 -7
  100. package/dist/public/assets/ShareReceiveDialog-B2mln2_V.js +0 -1
  101. package/dist/public/assets/TerminalSessionsHost-uEP7qR5I.js +0 -2
  102. package/dist/public/assets/dist-CG58rUCC.js +0 -113
  103. package/dist/public/assets/index-CD3OM1Xi.js +0 -1995
  104. package/dist/repair-skills-ZB7QzRgz.mjs +0 -1
  105. package/dist/server-lock-BrjnkHOv.mjs +0 -1
  106. package/dist/src-5hx6F-Ql.mjs +0 -3262
  107. package/dist/src-B1d5f35Y.mjs +0 -21
  108. package/dist/src-BuzTw3li.mjs +0 -1
  109. package/dist/start-DkuS68HX.mjs +0 -1
@@ -545,7 +545,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
545
545
  `)},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=v4(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:h4({...i,attributes:(i.attributes??[]).map(b4)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=F4(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},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=v4(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&&!g4.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function v4(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}={${y4(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function y4(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function b4(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:y4(e.value)}}:e}function x4(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function S4(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 C4(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>w4(t)?e:`\\${e}`)}function w4(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 T4=``,E4=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function D4(e){return e.replace(E4,e=>EJ(e)?T4+e.slice(1):e)}function O4(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
546
546
  ]|$)`};return delete t._compiled,t});let i;try{i=e.safe(D4(t),n)}finally{e.unsafe=r}return i=i.replaceAll(T4,`\\&`),C4(P4(i,n))}var k4=1,A4=2;function j4(e){if(Number.isNaN(e))return`ws`;let t=d(e);return t===k4?`ws`:t===A4?`punct`:`other`}function M4(e,t,n){let r=j4(t),i=j4(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 N4(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
547
547
  `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function P4(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)&&N4(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+=M4(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function F4(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);I4(i.charCodeAt(i.length-1),s,r)&&(o=L4(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return I4(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+L4(c)),o}function I4(e,t,n){return!(d(t)!==k4||n===`_`&&d(e)===void 0)}function L4(e){return`&#x${e.toString(16).toUpperCase()};`}function R4(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!B4(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 z4(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=F4(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function B4(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 V4(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 H4=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=_C(e.extensions),this.handlers=Q4(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?gQ({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=$4(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Q2({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=$2({toMarkdownHandlers:_4})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return o4(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?s4(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?j$(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 c4(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},U4=c$();function W4(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 G4(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 K4(e,t){return e.attrs.sourceDirty||G4(e)?!0:t?t.isDiverged(e.toJSON()):!1}function q4(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 J4(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 Y4(e,t){if(e.length===0)return J4({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return J4({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:[Y4(n.children,t)]}}return J4({type:`inlineCode`,value:X4(e)},t)}function X4(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=X4(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Z4=Rd;function Q4(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=cF(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=cF(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=f4(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&&kJ(t.raw)!==null&&EJ(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=kJ(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=lF(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=lF(r.highlight)),r.comment&&(i.comment=lF(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=cF(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=lF(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=lF(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=cF(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=cF(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=cF(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=U4.getOrWildcard(o),c=W4(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=f4(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=GJ(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&&Z4.has(l)&&n.jsxComponent&&U4.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&&zd.has(l)&&n.jsxComponent&&U4.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&&Vd.has(l)&&n.jsxComponent&&U4.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&&Hd.has(l)&&n.jsxComponent&&U4.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:V4(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=cF(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 $4(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=mF(`paragraph`)),i.blockquote&&(n.blockquote=mF(`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=mF(`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=mF(`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&&q4(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=mF(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:IZ(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!K4(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:U4.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:U4,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=hF(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=hF(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return Y4(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]=hF(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=hF(`mark`)),a.comment&&(r.comment=hF(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=mF(`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=mF(`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 jJ(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 e3={default:!0,MD013:!1};function t3(e){return e??e3}var n3=`doc`;function r3(e,t){return EV(e,CV({strings:{[n3]:e},config:t})[n3]??[])}function i3(e,t){let n=CV({strings:{[n3]:e},config:t})[n3]??[],r=e.split(`
548
- `),i=a3(t);return n.map(e=>s3(e,r,o3(e,i)))}function a3(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 o3(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 s3(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?[c3(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 c3(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 l3=Ju([M(),F([`error`,`warning`]),ed(A(),Vu())]),u3=[{id:`markdownlint`,sliceSchema:P({enabled:M(),rules:ed(A(),l3)}),defaultSlice:{enabled:!1,rules:e3},async lint(e,t){return i3(e,t3(t.rules))},fix(e,t){return r3(e,t3(t.rules))}}],d3={enabled:!0,plugins:Object.fromEntries(u3.map(e=>[e.id,e.defaultSlice]))},f3=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function p3(e){return f3.has(e)}function m3(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??e3}}}}var h3=Object.fromEntries(u3.map(e=>[e.id,e.sliceSchema])),g3=P({effective:P({enabled:M(),plugins:P(h3)}),configFile:A().nullable().optional(),configProblems:N(A()).optional()}),_3=Ju([M(),ed(A(),Vu())]);P({ruleId:A().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Ju([_3,zu()])});var v3=P({line:j(),character:j()}),y3=P({start:v3,end:v3}),b3=P({range:y3,severity:F([`error`,`warning`,`info`,`hint`]),source:A(),code:A(),message:A(),fixes:N(P({range:y3,newText:A()})).optional()}),x3=P({files:N(P({file:A(),diagnostics:N(b3)})),fileCount:j(),errorCount:j(),warningCount:j(),warnings:N(A())});P({docName:hX,summary:_X,...gX}).loose();var S3=P({file:A(),fixedCount:j(),diagnostics:N(b3),errorCount:j(),warningCount:j(),warning:A().optional()}),C3=[{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}]}],w3=(()=>{let e=new Map;for(let t of C3){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function T3(e){return w3.get(e.toUpperCase())??null}function E3(e,t){let n=T3(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))T3(t)===n&&(r={key:t,value:i});return r}var D3=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],O3=[[`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 k3(e){for(let[t,n]of O3)if(e.tags.includes(t))return n;return`Style`}async function A3(e,t,n){if(!t.enabled)return[];let r=[];for(let i of u3){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}var j3=/\p{M}+/gu,M3=/[^\p{L}\p{N}]+/gu,N3=/^-+|-+$/g;function P3(e){return e.trim().normalize(`NFKD`).replace(j3,``).toLowerCase().replace(M3,`-`).replace(N3,``)}function F3(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function I3(e,t){let n=P3(e);return n?F3(n,t):``}function L3(e,t){let n=P3(e);return t?`#${n}-${P3(t)}`:`#${n}`}var R3=new Set([`img`,`video`,`audio`,`mark`]),z3=new Map(o$.flatMap(e=>e.surface===`compat`&&R3.has(e.rendersAs)?[[e.name,e]]:[]));function B3(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 V3(e){let t=e.name;if(!t||!R3.has(t))return null;let n=B3(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function H3(e){let t=e.name;if(!t)return null;let n=z3.get(t);if(!n)return null;let r=B3(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 U3=(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:L3(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},W3=(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:L3(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},G3=(e,t)=>{let n=t,r=V3(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=H3(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)},K3=(e,t)=>{let n=t,r=V3(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=H3(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)},q3=(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)]},J3=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function Y3(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(Y3).join(``):``}var X3={wikiLink:U3,wikiLinkEmbed:W3,mdxJsxFlowElement:G3,mdxJsxTextElement:K3,rawMdxFallback:q3,mark:J3,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:Y3(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:Y3(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)}},Z3=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Q3=/\bexpression\s*\(/i,$3=1e4;function e6(e){return!(e.length>$3||Z3.test(e)||Q3.test(e))}function t6(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!Jq(e.split(/\s+/)[0]??``))return!1}return!0}var n6={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},r6=new Set([`href`,`src`]),i6=Me(`<>`),a6=()=>e=>{T(e,`element`,e=>{let t=n6[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`?w1(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(r6.has(e))if(t===`<>`||t===i6)r=``;else{let e=w1(t);r=e===t?t:Me(e)}else r=w1(t);r!==t&&(n[e]=r)}})},o6=()=>e=>{T(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`&&!Jq(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`&&!Jq(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!Jq(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!t6(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!t6(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!Jq(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!e6(r)&&delete n.style})};function s6(e){let t=le().use(ke,{handlers:X3}).use(a6).use(o6).use(CH),n=t.runSync(e);return String(t.stringify(n))}function c6(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(l6(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(l6(e.slice(r),r>0,!1)),n.join(``)}function l6(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 u6=/\r?\n|\r/,d6=(e,t)=>{let n=c6(String(t.value));if(!u6.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(u6),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 f6(e){let t=le().use(xe).use(IF,[`yaml`]).use(u2).use(ue).use(Y2).use(_1).use(D2).use(M1).use(ke,{handlers:{...X3,text:d6}}).use(a6).use(o6).use(CH);return String(t.processSync(h1(j1(e))))}NL(),QI(),$I();var p6=`frontmatter`,m6=[`text`,`number`,`boolean`,`date`,`list`,`object`];F(m6);var h6=Ju([A(),j(),M()]),g6=Td(()=>Ju([h6.transform(e=>String(e)),ed(A(),_6),N(g6)])),_6=Td(()=>Ju([A(),j(),M(),N(g6),ed(A(),_6)])),v6=/^\d{4}-\d{2}-\d{2}$/;function y6(e){return typeof e==`string`&&v6.test(e)}function b6(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:y6(e)?`date`:`text`}function x6(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(x6(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:x6(r);return t}return e}var S6=Ad(x6,ed(A(),_6)),C6=ed(A(),Ju([_6,zu()]));function w6(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function T6(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!T6(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!T6(e[r],t[r]))return!1;return!0}return!1}P({docName:hX,summary:_X,content:A().optional(),...gX}).loose(),P({docName:hX,summary:_X,markdown:A(),position:F([`append`,`prepend`,`replace`]).optional(),extension:F(oq).optional(),...gX}).loose(),P({docName:hX,summary:_X,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...gX}).loose(),P({docName:hX,connectionId:A().min(1),scope:F([`last`,`session`,`file`,`count`]).optional(),count:j().int().positive().optional(),...gX}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var E6=P({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),D6=Xu(`kind`,[P({kind:I(`inline`),content:A()}),P({kind:I(`truncated`),byteLength:j().int().nonnegative(),hint:A()})]),O6=P({kind:I(`content-divergence`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),divergenceType:A().optional(),currentState:D6.optional(),hint:A().optional()}).loose(),k6=P({type:I(`orphan`),parentCandidates:N(A()),message:A()}).loose(),A6=P({kind:I(`disk-edit-reconciled`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),mergeOutcome:A().optional(),hint:A().optional()}).loose(),j6=Xu(`kind`,[O6,A6]),M6=N(Xu(`kind`,[O6,A6,P({kind:I(`mermaid-parse-error`),fenceIndex:j().int().positive(),fenceFirstLine:A(),message:A(),line:j().int().positive().optional()}).loose(),P({kind:I(`lint-violation`),source:A(),code:A(),message:A(),severity:F([`error`,`warning`,`info`,`hint`]),line:j().int().positive(),column:j().int().positive()}).loose()])).min(1),N6=N(P({href:A(),resolvedTo:A().nullable(),reason:F([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());P({timestamp:A().min(1),summary:E6.optional(),warning:j6.optional(),warnings:M6.optional()}).loose(),P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:N(k6).optional(),summary:E6.optional(),warning:j6.optional(),warnings:M6.optional(),brokenLinks:N6}).loose(),P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:E6.optional(),warning:j6.optional(),warnings:M6.optional(),brokenLinks:N6}).loose(),P({docName:A().min(1),scope:F([`last`,`session`,`count`]),undone:M()}).loose(),P({docName:hX,patch:ed(A(),Ju([_6,zu()])),types:ed(A(),F(m6)).optional(),summary:_X,...gX}).loose(),P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),appliedKeys:N(A()),summary:E6.optional(),warning:j6.optional(),warnings:M6.optional(),brokenLinks:N6}).loose(),P({entries:N(P({level:F([`info`,`warn`,`error`]),message:A().max(hK),event:A().optional(),fields:ed(A(),Vu()).optional(),ts:j().optional(),sourceId:A().optional(),lineNumber:j().optional()}).loose()).max(100),droppedSinceLastFlush:j().int().min(0).optional()}).loose(),P({accepted:j().int().min(0)}).loose();var P6=P({status:A().min(1),reason:A()}).loose(),F6=P({docName:A().min(1),content:A(),lifecycle:P6.nullable()}).loose(),I6=P({kind:F([`document`,`asset`,`folder`,`file`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:M().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:F([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:N(A().min(1)).optional(),hasChildren:M().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)`}),L6=P({documents:N(I6),truncated:M().optional()}).loose(),R6=P({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),z6=P({docName:A().min(1),backlinks:N(R6)}).loose(),B6=P({counts:ed(A().min(1),j().int().nonnegative())}).loose(),V6=Xu(`kind`,[P({kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),P({kind:I(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),H6=P({docName:A().min(1),forwardLinks:N(V6)}).loose(),U6=Xu(`kind`,[P({id:A().min(1),kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:N(A()).nullable()}).loose(),P({id:A().min(1),kind:I(`external`),url:A().min(1),label:A()}).loose()]),W6=P({source:A().min(1),target:A().min(1)}).loose(),G6=P({nodes:N(U6),links:N(W6)}).loose(),K6=P({ts:j().int().min(0),url:A(),method:A(),ua:A().optional(),origin:A().optional(),referer:A().optional(),host:A().optional(),remote:A().optional(),secChUa:A().optional(),secChUaMobile:A().optional(),secChUaPlatform:A().optional(),secFetchSite:A().optional(),secFetchDest:A().optional(),secFetchMode:A().optional(),secFetchUser:A().optional()}).loose(),q6=P({app:Ju([I(`cursor`),I(`codex`),I(`claude`),zu()]),signals_fired:N(A())}).loose();P({entries:N(K6),count:j().int().min(0),detection:q6}).loose(),P({writers:N(P({id:A().min(1),name:A().optional(),email:A().optional()}).loose()).optional(),summary:_X,...gX}).loose(),P({checkpointRef:A().min(1)}).loose();var J6=P({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:N(A()),summaries:N(A()).optional()}).loose();P({entries:N(P({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:F([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:N(J6),checkpoint:Vu().nullable(),parentSha:A().nullable().optional()}).loose()),total:j().int().nonnegative().optional(),truncated:M().optional(),hasMore:M().optional()}).loose(),P({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose();var Y6=P({contentDir:A().min(1),pathSeparator:F([`/`,`\\`]),symlinkResolved:M()}).loose();N(Xu(`source`,[P({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:I(`flat`)}).loose(),P({docName:A().min(1),timestamp:A().min(1),source:I(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var X6=P({domain:A().min(1),title:A().optional(),description:A().optional(),siteName:A().optional(),faviconDataUri:A().optional()}).loose();P({url:A()}).loose();var Z6=Xu(`ok`,[P({ok:I(!0),metadata:X6}).loose(),P({ok:I(!1),reason:A()}).loose()]),Q6=P({orphans:N(P({docName:A().min(1),title:A()}).loose())}).loose(),$6=P({hubs:N(P({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),e8=P({source:A().min(1),title:A(),snippet:A().nullable()}).loose();P({deadLinks:N(P({target:A().min(1),sources:N(e8)}).loose())}).loose(),P({target:P({docName:A().min(1),title:A(),aliases:N(A())}).loose(),mentions:N(P({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:M()}).loose(),P({projectPath:A().min(1)}).loose();var t8=F([`not-a-git-worktree`,`init-failed`]);Xu(`ok`,[P({ok:I(!0),projectPath:A().min(1)}).loose(),P({ok:I(!1),reason:t8,message:A().min(1)}).loose()]),P({host:A().min(1).optional()}).loose(),P({key:A().min(1)}).loose(),P({keyPresent:M()}).loose(),P({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),P({authenticated:M()}).loose(),P({}).loose();var n8=P({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),r8=P({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:N(n8)}).loose(),i8=P({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),a8=P({sessionAlive:M(),agent:i8.nullable(),files:N(r8)}).loose(),o8=P({diff:A(),before:A(),after:A(),generatedAt:j().int().min(0)}).loose();P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose();var s8=P({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:F([`idle`,`writing`]),ts:j().int().min(0)}).loose();P({presence:ed(A().min(1),s8)}).loose();var c8=P({sessionId:A().min(1),agentType:A().min(1),ts:j().int().min(0),insertedChars:j().int().min(0),deletedChars:j().int().min(0)}).loose();P({effects:N(P({"doc.name":A().min(1),entries:N(c8)}).loose())}).loose(),ed(A().min(1),M()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),P({path:A().min(1,`path must be non-empty`)}).loose(),P({}).loose();var l8=P({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),u8=P({fromPath:A().min(1),toPath:A().min(1)}).loose();P({}).loose(),P({path:A().min(1),...gX,summary:_X}).loose();var d8=P({docName:A().min(1)}).loose();P({path:A().min(1),...gX,summary:_X}).loose();var f8=P({path:A().min(1)}).loose();P({kind:F([`file`,`folder`]),path:A().min(1),...gX,summary:_X}).loose();var p8=P({kind:F([`file`,`folder`]),path:A().min(1),duplicatedDocNames:N(A().min(1))}).loose(),m8=P({pages:N(P({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1),icon:A().min(1).max(2048).optional()}).loose())}).loose(),h8=P({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),g8=P({docName:A().min(1),headings:N(h8)}).loose(),_8=P({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();P({kind:F([`file`,`folder`,`asset`]),fromPath:A().min(1),toPath:A().min(1),...gX,summary:_X}).loose();var v8=P({renamed:N(l8),renamedAssets:N(u8),rewrittenDocs:N(_8).optional(),summary:E6.optional()}).loose();P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...gX}).loose();var y8=P({deletedDocNames:N(A().min(1))}).loose();P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...gX,summary:_X}).loose();var b8=P({deletedDocNames:N(A().min(1))}).loose();P({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:_X,...gX}).loose(),P({restoredFrom:A().min(1),timestamp:A().min(1),summary:E6.optional(),warning:O6.optional(),warnings:M6.optional()}).loose();var x8=F([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),S8=P({label:A().min(1),webUrl:vu().nullable()}).loose(),C8=Xu(`checkStatus`,[P({checkStatus:I(`allowed`)}).loose(),P({checkStatus:I(`denied`),deniedReason:F([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),P({checkStatus:I(`unknown`),unknownError:F([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),w8=F([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);P({state:x8,lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:M(),syncEnabled:M(),identityUnresolved:M(),remote:S8.nullable().optional(),pushError:A().optional(),pushErrorCode:w8.optional(),pullError:A().optional(),pullErrorCode:w8.optional(),pausedReason:A().optional(),pushPermission:C8.optional()}).loose(),P({op:F([`sync`,`push`,`pull`]).optional()}).loose(),P({op:F([`sync`,`push`,`pull`])}).loose(),P({conflicts:N(P({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),P({file:A().min(1),strategy:F([`mine`,`theirs`,`content`,`delete`]),content:A().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`]}),P({}).loose(),P({file:A().min(1),base:A(),ours:A(),theirs:A(),kind:F([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:A().nullable()}).loose(),P({plan:Dd(e=>e!==void 0,{message:`plan is required`})}).loose(),P({plan:Dd(e=>e!==void 0,{message:`plan is required`})}).loose(),P({result:Dd(e=>e!==void 0,{message:`result is required`})}).loose();var T8=P({path:A().min(1),summary:A().min(1)}).loose(),E8=P({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose();P({packs:N(P({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:N(T8),entryCounts:E8}).loose())}).loose(),P({noOpen:M().optional(),out:A().min(1).optional()}).loose();var D8=P({reason:F([`unsupported-platform`,`spawn-error`]),message:A()}).loose();Xu(`status`,[P({status:I(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),P({status:I(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:D8.optional()}).loose(),P({status:I(`failed`),buildError:A()}).loose(),P({status:I(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]);var O8=F(pq);Ku({schema:I(1),targets:N(O8).default([])}),P({tags:N(P({name:A().min(1),count:j().int().nonnegative(),isLeaf:M()}).loose())}).loose();var k8=P({docName:A().min(1),title:A(),matchingTags:N(A().min(1)),snippet:A().nullable()}).loose();P({name:A().min(1),docs:N(k8)}).loose(),P({folder:Vu(),frontmatter_local:ed(A(),Vu()).nullable()}).loose(),P({path:A(),frontmatter:ed(A(),Vu()).optional()}).loose(),P({applied:Vu()}).loose();var A8=ed(A(),Vu()).meta({description:`Free-form frontmatter map embedded in template payloads.`});P({template:P({name:A().min(1),folder:A(),scope:F([`local`,`inherited`]),path:A().min(1),frontmatter:A8,body:A()}).strict()}).strict();var j8=P({templates:N(P({name:A().min(1),title:A().optional(),description:A().optional(),path:A().min(1),source_folder:A()}).strict()),truncated:M()}).strict();P({folder:A(),name:A(),body:A().optional(),frontmatter:A8.optional(),...gX,summary:_X}).strict(),P({path:A().min(1),created:M(),warnings:N(A())}).strict(),P({sourcePath:A().min(1),targetFolder:A(),name:A().optional(),title:A().optional(),deleteSource:M().optional(),...gX,summary:_X}).strict(),P({path:A().min(1),created:M(),warnings:N(A())}).strict(),P({existed:M(),path:A().min(1)}).strict(),P({fromFolder:A(),fromName:A(),toFolder:A(),toName:A(),body:A().optional(),frontmatter:A8.optional(),...gX,summary:_X}).strict(),P({from:A().min(1),to:A().min(1),committed:M()}).strict();var M8=F(JK),N8=/^[a-z0-9-]+$/,P8=/^[A-Za-z0-9_-]+$/,F8=P({name:A(),description:A()}).strict();P({skill:P({name:A().min(1),scope:M8,path:A().min(1),frontmatter:F8,body:A(),files:N(P({path:A().min(1),text:A().nullable()})).optional(),managed:M().optional()}).strict()}).strict();var I8=P({skills:N(P({name:A().min(1),description:A().optional(),scope:M8,path:A().min(1),absolutePath:A().min(1).optional(),installed:M(),hosts:N(A()),installedVersion:A().optional(),bundledVersion:A().optional(),updateAvailable:M().optional(),managed:M().optional()}).strict()),truncated:M()}).strict();P({scope:M8.default(`project`),name:A(),body:A().optional(),frontmatter:F8,...gX,summary:_X}).strict(),P({path:A().min(1),created:M(),warnings:N(A())}).strict(),P({scope:M8.default(`project`),name:A(),...gX,summary:_X}).strict(),P({name:A().min(1),version:A().min(1),previousVersion:A().optional(),checkpointRef:A().optional()}).strict(),P({existed:M(),path:A().min(1)}).strict(),P({scope:M8.default(`project`),fromName:A(),toName:A(),body:A().optional(),frontmatter:F8.optional(),...gX,summary:_X}).strict(),P({from:A().min(1),to:A().min(1),committed:M()}).strict();var L8=F([`reference`,`script`]);P({scope:M8.default(`project`),name:A(),path:A().min(1),content:A(),...gX,summary:_X}).strict(),P({path:A().min(1),created:M(),kind:L8,content:M()}).strict(),P({path:A().min(1),kind:L8,text:A()}).strict(),P({path:A().min(1),existed:M(),kind:L8}).strict(),P({scope:M8.default(`project`),name:A(),targets:N(O8).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...gX,summary:_X}).strict(),P({name:A().min(1),hosts:N(A()),scripts:M(),warnings:N(A()),warningCodes:N(F([`no-targets`,`scripts-present`]))}).strict(),P({scope:M8.default(`project`),name:A()}).strict(),P({name:A().min(1),uninstalled:M()}).strict();var R8=P({targets:N(O8),configured:M()}).strict();P({targets:N(O8)}).strict(),P({targets:N(O8),reprojected:N(P({name:A(),hosts:N(A())}).strict()),bundleHosts:N(A()),removedFrom:N(A())}).strict(),P({scope:M8.default(`project`),name:A(),version:A().regex(/^[0-9a-f]{40}$/i),...gX,summary:_X}).strict(),P({name:A().min(1),version:A(),restoredFiles:N(A()),warnings:N(A())}).strict(),P({query:A().optional(),intent:F([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:F([`navigation`,`relevance`]).optional(),scopes:N(F([`page`,`folder`,`content`,`file`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional(),semantic:M().optional(),source:F([`omnibar`,`mcp`,`http`]).optional()}).loose();var z8=P({kind:F([`page`,`folder`,`content`,`file`]),path:A().min(1),title:A(),score:j(),signals:ed(A(),Vu()),snippet:A().optional()}).loose(),B8=P({capable:M(),applied:M(),coverage:P({embedded:j().int().nonnegative(),total:j().int().nonnegative()})}).loose();P({enabled:M(),keyPresent:M(),keySource:F([`file`,`env`]).nullable(),keyHint:A().nullable(),ready:M(),capable:M(),embedded:j().int().nonnegative(),total:j().int().nonnegative()}).loose(),P({query:A(),intent:F([`autocomplete`,`full_text`,`omnibar`]),results:N(z8),elapsedMs:j().nonnegative(),semantic:B8.optional(),truncated:M().optional(),ready:M().optional()}).loose();var V8=P({version:A().min(1),recordedAt:A().min(1)}).loose();P({currentVersion:A().min(1),targets:ed(A(),V8.nullable())}).loose();var H8=`server-info`,U8=`branch-switched`,W8=`disk-ack`,G8=`config-validation-rejected`,K8=`config-ignore-nested-error`,q8=F([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),J8=P({v:I(1),ch:I(H8),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),Y8=P({v:I(1),ch:I(U8),seq:j(),branch:A().min(1)}).loose(),X8=P({v:I(1),ch:q8,seq:j()}).loose(),Z8=P({v:I(1),ch:I(W8),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),Q8=P({v:I(1),ch:I(G8),seq:j(),docName:A().min(1),error:tp}).loose(),$8=P({v:I(1),ch:I(K8),seq:j(),path:A().min(1),error:A().min(1)}).loose();function e5(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 t5(e){if(typeof e!=`string`||e.length===0)return e;let t=NQ(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(OQ(e)){let t=e5(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=TQ(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var n5=`https://api.github.com/repos/inkeep/open-knowledge`;async function r5(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(n5,{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 i5(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 lK.default;var a5=P({path:N(Ju([A(),j()])),message:A(),issueCode:A()});Xu(`code`,[P({code:I(`SCHEMA_INVALID`),issues:N(a5)}),P({code:I(`WRITE_ERROR`),detail:A()})]);function o5(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function s5(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 c5={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function l5(e){if(e.trim()===``)return{doc:new xr({}),map:{}};let t;try{t=Mi(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new xr({}),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=S6.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 u5(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function d5(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=$e(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(u5(n)){let r=e.createNode(n),i=Xe(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function f5(e){return e===``?``:`---\n${e.endsWith(`
548
+ `),i=a3(t);return n.map(e=>s3(e,r,o3(e,i)))}function a3(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 o3(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 s3(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?[c3(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 c3(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 l3=Ju([M(),F([`error`,`warning`]),ed(A(),Vu())]),u3=[{id:`markdownlint`,sliceSchema:P({enabled:M(),rules:ed(A(),l3)}),defaultSlice:{enabled:!1,rules:e3},async lint(e,t){return i3(e,t3(t.rules))},fix(e,t){return r3(e,t3(t.rules))}}],d3={enabled:!0,plugins:Object.fromEntries(u3.map(e=>[e.id,e.defaultSlice]))},f3=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function p3(e){return f3.has(e)}function m3(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??e3}}}}var h3=Object.fromEntries(u3.map(e=>[e.id,e.sliceSchema])),g3=P({effective:P({enabled:M(),plugins:P(h3)}),configFile:A().nullable().optional(),configProblems:N(A()).optional()}),_3=Ju([M(),ed(A(),Vu())]);P({ruleId:A().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Ju([_3,zu()])});var v3=P({line:j(),character:j()}),y3=P({start:v3,end:v3}),b3=P({range:y3,severity:F([`error`,`warning`,`info`,`hint`]),source:A(),code:A(),message:A(),fixes:N(P({range:y3,newText:A()})).optional()}),x3=P({files:N(P({file:A(),diagnostics:N(b3)})),fileCount:j(),errorCount:j(),warningCount:j(),warnings:N(A())});P({docName:hX,summary:_X,...gX}).loose();var S3=P({file:A(),fixedCount:j(),diagnostics:N(b3),errorCount:j(),warningCount:j(),warning:A().optional()}),C3=[{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}]}],w3=(()=>{let e=new Map;for(let t of C3){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function T3(e){return w3.get(e.toUpperCase())??null}function E3(e,t){let n=T3(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))T3(t)===n&&(r={key:t,value:i});return r}var D3=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],O3=[[`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 k3(e){for(let[t,n]of O3)if(e.tags.includes(t))return n;return`Style`}async function A3(e,t,n){if(!t.enabled)return[];let r=[];for(let i of u3){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}var j3=/\p{M}+/gu,M3=/[^\p{L}\p{N}]+/gu,N3=/^-+|-+$/g;function P3(e){return e.trim().normalize(`NFKD`).replace(j3,``).toLowerCase().replace(M3,`-`).replace(N3,``)}function F3(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function I3(e,t){let n=P3(e);return n?F3(n,t):``}function L3(e,t){let n=P3(e);return t?`#${n}-${P3(t)}`:`#${n}`}var R3=new Set([`img`,`video`,`audio`,`mark`]),z3=new Map(o$.flatMap(e=>e.surface===`compat`&&R3.has(e.rendersAs)?[[e.name,e]]:[]));function B3(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 V3(e){let t=e.name;if(!t||!R3.has(t))return null;let n=B3(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function H3(e){let t=e.name;if(!t)return null;let n=z3.get(t);if(!n)return null;let r=B3(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 U3=(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:L3(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},W3=(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:L3(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},G3=(e,t)=>{let n=t,r=V3(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=H3(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)},K3=(e,t)=>{let n=t,r=V3(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=H3(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)},q3=(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)]},J3=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function Y3(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(Y3).join(``):``}var X3={wikiLink:U3,wikiLinkEmbed:W3,mdxJsxFlowElement:G3,mdxJsxTextElement:K3,rawMdxFallback:q3,mark:J3,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:Y3(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:Y3(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)}},Z3=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Q3=/\bexpression\s*\(/i,$3=1e4;function e6(e){return!(e.length>$3||Z3.test(e)||Q3.test(e))}function t6(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!Jq(e.split(/\s+/)[0]??``))return!1}return!0}var n6={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},r6=new Set([`href`,`src`]),i6=Me(`<>`),a6=()=>e=>{T(e,`element`,e=>{let t=n6[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`?w1(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(r6.has(e))if(t===`<>`||t===i6)r=``;else{let e=w1(t);r=e===t?t:Me(e)}else r=w1(t);r!==t&&(n[e]=r)}})},o6=()=>e=>{T(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`&&!Jq(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`&&!Jq(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!Jq(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!t6(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!t6(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!Jq(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!e6(r)&&delete n.style})};function s6(e){let t=le().use(ke,{handlers:X3}).use(a6).use(o6).use(CH),n=t.runSync(e);return String(t.stringify(n))}function c6(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(l6(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(l6(e.slice(r),r>0,!1)),n.join(``)}function l6(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 u6=/\r?\n|\r/,d6=(e,t)=>{let n=c6(String(t.value));if(!u6.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(u6),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 f6(e){let t=le().use(xe).use(IF,[`yaml`]).use(u2).use(ue).use(Y2).use(_1).use(D2).use(M1).use(ke,{handlers:{...X3,text:d6}}).use(a6).use(o6).use(CH);return String(t.processSync(h1(j1(e))))}NL(),QI(),$I();var p6=`frontmatter`,m6=[`text`,`number`,`boolean`,`date`,`list`,`object`];F(m6);var h6=Ju([A(),j(),M()]),g6=Td(()=>Ju([h6.transform(e=>String(e)),ed(A(),_6),N(g6)])),_6=Td(()=>Ju([A(),j(),M(),N(g6),ed(A(),_6)])),v6=/^\d{4}-\d{2}-\d{2}$/;function y6(e){return typeof e==`string`&&v6.test(e)}function b6(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:y6(e)?`date`:`text`}function x6(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(x6(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:x6(r);return t}return e}var S6=Ad(x6,ed(A(),_6)),C6=ed(A(),Ju([_6,zu()]));function w6(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function T6(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!T6(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!T6(e[r],t[r]))return!1;return!0}return!1}P({docName:hX,summary:_X,content:A().optional(),...gX}).loose(),P({docName:hX,summary:_X,markdown:A(),position:F([`append`,`prepend`,`replace`]).optional(),extension:F(oq).optional(),...gX}).loose(),P({docName:hX,summary:_X,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...gX}).loose(),P({docName:hX,connectionId:A().min(1),scope:F([`last`,`session`,`file`,`count`]).optional(),count:j().int().positive().optional(),...gX}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var E6=P({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),D6=Xu(`kind`,[P({kind:I(`inline`),content:A()}),P({kind:I(`truncated`),byteLength:j().int().nonnegative(),hint:A()})]),O6=P({kind:I(`content-divergence`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),divergenceType:A().optional(),currentState:D6.optional(),hint:A().optional()}).loose(),k6=P({type:I(`orphan`),parentCandidates:N(A()),message:A()}).loose(),A6=P({kind:I(`disk-edit-reconciled`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),mergeOutcome:A().optional(),hint:A().optional()}).loose(),j6=Xu(`kind`,[O6,A6]),M6=N(Xu(`kind`,[O6,A6,P({kind:I(`mermaid-parse-error`),fenceIndex:j().int().positive(),fenceFirstLine:A(),message:A(),line:j().int().positive().optional()}).loose(),P({kind:I(`lint-violation`),source:A(),code:A(),message:A(),severity:F([`error`,`warning`,`info`,`hint`]),line:j().int().positive(),column:j().int().positive()}).loose()])).min(1),N6=N(P({href:A(),resolvedTo:A().nullable(),reason:F([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());P({timestamp:A().min(1),summary:E6.optional(),warning:j6.optional(),warnings:M6.optional()}).loose(),P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:N(k6).optional(),summary:E6.optional(),warning:j6.optional(),warnings:M6.optional(),brokenLinks:N6}).loose(),P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:E6.optional(),warning:j6.optional(),warnings:M6.optional(),brokenLinks:N6}).loose(),P({docName:A().min(1),scope:F([`last`,`session`,`count`]),undone:M()}).loose(),P({docName:hX,patch:ed(A(),Ju([_6,zu()])),types:ed(A(),F(m6)).optional(),summary:_X,...gX}).loose(),P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),appliedKeys:N(A()),summary:E6.optional(),warning:j6.optional(),warnings:M6.optional(),brokenLinks:N6}).loose(),P({entries:N(P({level:F([`info`,`warn`,`error`]),message:A().max(hK),event:A().optional(),fields:ed(A(),Vu()).optional(),ts:j().optional(),sourceId:A().optional(),lineNumber:j().optional()}).loose()).max(100),droppedSinceLastFlush:j().int().min(0).optional()}).loose(),P({accepted:j().int().min(0)}).loose();var P6=P({status:A().min(1),reason:A()}).loose(),F6=P({docName:A().min(1),content:A(),lifecycle:P6.nullable()}).loose(),I6=P({kind:F([`document`,`asset`,`folder`,`file`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:M().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:F([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:N(A().min(1)).optional(),hasChildren:M().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)`}),L6=P({documents:N(I6),truncated:M().optional()}).loose(),R6=P({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),z6=P({docName:A().min(1),backlinks:N(R6)}).loose(),B6=P({counts:ed(A().min(1),j().int().nonnegative())}).loose(),V6=Xu(`kind`,[P({kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),P({kind:I(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),H6=P({docName:A().min(1),forwardLinks:N(V6)}).loose(),U6=Xu(`kind`,[P({id:A().min(1),kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:N(A()).nullable()}).loose(),P({id:A().min(1),kind:I(`external`),url:A().min(1),label:A()}).loose()]),W6=P({source:A().min(1),target:A().min(1)}).loose(),G6=P({nodes:N(U6),links:N(W6)}).loose(),K6=P({ts:j().int().min(0),url:A(),method:A(),ua:A().optional(),origin:A().optional(),referer:A().optional(),host:A().optional(),remote:A().optional(),secChUa:A().optional(),secChUaMobile:A().optional(),secChUaPlatform:A().optional(),secFetchSite:A().optional(),secFetchDest:A().optional(),secFetchMode:A().optional(),secFetchUser:A().optional()}).loose(),q6=P({app:Ju([I(`cursor`),I(`codex`),I(`claude`),zu()]),signals_fired:N(A())}).loose();P({entries:N(K6),count:j().int().min(0),detection:q6}).loose(),P({writers:N(P({id:A().min(1),name:A().optional(),email:A().optional()}).loose()).optional(),summary:_X,...gX}).loose(),P({checkpointRef:A().min(1)}).loose();var J6=P({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:N(A()),summaries:N(A()).optional()}).loose();P({entries:N(P({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:F([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:N(J6),checkpoint:Vu().nullable(),parentSha:A().nullable().optional()}).loose()),total:j().int().nonnegative().optional(),truncated:M().optional(),hasMore:M().optional()}).loose(),P({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose();var Y6=P({contentDir:A().min(1),pathSeparator:F([`/`,`\\`]),symlinkResolved:M()}).loose();N(Xu(`source`,[P({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:I(`flat`)}).loose(),P({docName:A().min(1),timestamp:A().min(1),source:I(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var X6=P({domain:A().min(1),title:A().optional(),description:A().optional(),siteName:A().optional(),faviconDataUri:A().optional()}).loose();P({url:A()}).loose();var Z6=Xu(`ok`,[P({ok:I(!0),metadata:X6}).loose(),P({ok:I(!1),reason:A()}).loose()]),Q6=P({orphans:N(P({docName:A().min(1),title:A()}).loose())}).loose(),$6=P({hubs:N(P({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),e8=P({source:A().min(1),title:A(),snippet:A().nullable()}).loose();P({deadLinks:N(P({target:A().min(1),sources:N(e8)}).loose())}).loose(),P({target:P({docName:A().min(1),title:A(),aliases:N(A())}).loose(),mentions:N(P({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:M()}).loose(),P({projectPath:A().min(1)}).loose();var t8=F([`not-a-git-worktree`,`init-failed`]);Xu(`ok`,[P({ok:I(!0),projectPath:A().min(1)}).loose(),P({ok:I(!1),reason:t8,message:A().min(1)}).loose()]),P({host:A().min(1).optional()}).loose(),P({host:A().min(1).optional(),token:A().min(1)}).loose(),P({host:A(),login:A()}).loose(),P({key:A().min(1)}).loose(),P({keyPresent:M()}).loose(),P({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),P({authenticated:M()}).loose(),P({}).loose();var n8=P({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),r8=P({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:N(n8)}).loose(),i8=P({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),a8=P({sessionAlive:M(),agent:i8.nullable(),files:N(r8)}).loose(),o8=P({diff:A(),before:A(),after:A(),generatedAt:j().int().min(0)}).loose();P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose(),P({}).loose();var s8=P({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:F([`idle`,`writing`]),ts:j().int().min(0)}).loose();P({presence:ed(A().min(1),s8)}).loose();var c8=P({sessionId:A().min(1),agentType:A().min(1),ts:j().int().min(0),insertedChars:j().int().min(0),deletedChars:j().int().min(0)}).loose();P({effects:N(P({"doc.name":A().min(1),entries:N(c8)}).loose())}).loose(),ed(A().min(1),M()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),P({path:A().min(1,`path must be non-empty`)}).loose(),P({}).loose();var l8=P({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),u8=P({fromPath:A().min(1),toPath:A().min(1)}).loose();P({}).loose(),P({path:A().min(1),...gX,summary:_X}).loose();var d8=P({docName:A().min(1)}).loose();P({path:A().min(1),...gX,summary:_X}).loose();var f8=P({path:A().min(1)}).loose();P({kind:F([`file`,`folder`]),path:A().min(1),...gX,summary:_X}).loose();var p8=P({kind:F([`file`,`folder`]),path:A().min(1),duplicatedDocNames:N(A().min(1))}).loose(),m8=P({pages:N(P({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1),icon:A().min(1).max(2048).optional()}).loose())}).loose(),h8=P({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),g8=P({docName:A().min(1),headings:N(h8)}).loose(),_8=P({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();P({kind:F([`file`,`folder`,`asset`]),fromPath:A().min(1),toPath:A().min(1),...gX,summary:_X}).loose();var v8=P({renamed:N(l8),renamedAssets:N(u8),rewrittenDocs:N(_8).optional(),summary:E6.optional()}).loose();P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...gX}).loose();var y8=P({deletedDocNames:N(A().min(1))}).loose();P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...gX,summary:_X}).loose();var b8=P({deletedDocNames:N(A().min(1))}).loose();P({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:_X,...gX}).loose(),P({restoredFrom:A().min(1),timestamp:A().min(1),summary:E6.optional(),warning:O6.optional(),warnings:M6.optional()}).loose();var x8=F([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),S8=P({label:A().min(1),webUrl:vu().nullable()}).loose(),C8=Xu(`checkStatus`,[P({checkStatus:I(`allowed`)}).loose(),P({checkStatus:I(`denied`),deniedReason:F([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`])}).loose(),P({checkStatus:I(`unknown`),unknownError:F([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),w8=F([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);P({state:x8,lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:M(),syncEnabled:M(),identityUnresolved:M(),remote:S8.nullable().optional(),pushError:A().optional(),pushErrorCode:w8.optional(),pullError:A().optional(),pullErrorCode:w8.optional(),pausedReason:A().optional(),pushPermission:C8.optional()}).loose(),P({op:F([`sync`,`push`,`pull`]).optional()}).loose(),P({op:F([`sync`,`push`,`pull`])}).loose(),P({conflicts:N(P({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),P({file:A().min(1),strategy:F([`mine`,`theirs`,`content`,`delete`]),content:A().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`]}),P({}).loose(),P({file:A().min(1),base:A(),ours:A(),theirs:A(),kind:F([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:A().nullable()}).loose(),P({plan:Dd(e=>e!==void 0,{message:`plan is required`})}).loose(),P({plan:Dd(e=>e!==void 0,{message:`plan is required`})}).loose(),P({result:Dd(e=>e!==void 0,{message:`result is required`})}).loose();var T8=P({path:A().min(1),summary:A().min(1)}).loose(),E8=P({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose();P({packs:N(P({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:N(T8),entryCounts:E8}).loose())}).loose(),P({noOpen:M().optional(),out:A().min(1).optional()}).loose();var D8=P({reason:F([`unsupported-platform`,`spawn-error`]),message:A()}).loose();Xu(`status`,[P({status:I(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),P({status:I(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:D8.optional()}).loose(),P({status:I(`failed`),buildError:A()}).loose(),P({status:I(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]);var O8=F(pq);Ku({schema:I(1),targets:N(O8).default([])}),P({tags:N(P({name:A().min(1),count:j().int().nonnegative(),isLeaf:M()}).loose())}).loose();var k8=P({docName:A().min(1),title:A(),matchingTags:N(A().min(1)),snippet:A().nullable()}).loose();P({name:A().min(1),docs:N(k8)}).loose(),P({folder:Vu(),frontmatter_local:ed(A(),Vu()).nullable()}).loose(),P({path:A(),frontmatter:ed(A(),Vu()).optional()}).loose(),P({applied:Vu()}).loose();var A8=ed(A(),Vu()).meta({description:`Free-form frontmatter map embedded in template payloads.`});P({template:P({name:A().min(1),folder:A(),scope:F([`local`,`inherited`]),path:A().min(1),frontmatter:A8,body:A()}).strict()}).strict();var j8=P({templates:N(P({name:A().min(1),title:A().optional(),description:A().optional(),path:A().min(1),source_folder:A()}).strict()),truncated:M()}).strict();P({folder:A(),name:A(),body:A().optional(),frontmatter:A8.optional(),...gX,summary:_X}).strict(),P({path:A().min(1),created:M(),warnings:N(A())}).strict(),P({sourcePath:A().min(1),targetFolder:A(),name:A().optional(),title:A().optional(),deleteSource:M().optional(),...gX,summary:_X}).strict(),P({path:A().min(1),created:M(),warnings:N(A())}).strict(),P({existed:M(),path:A().min(1)}).strict(),P({fromFolder:A(),fromName:A(),toFolder:A(),toName:A(),body:A().optional(),frontmatter:A8.optional(),...gX,summary:_X}).strict(),P({from:A().min(1),to:A().min(1),committed:M()}).strict();var M8=F(JK),N8=/^[a-z0-9-]+$/,P8=/^[A-Za-z0-9_-]+$/,F8=P({name:A(),description:A()}).strict();P({skill:P({name:A().min(1),scope:M8,path:A().min(1),frontmatter:F8,body:A(),files:N(P({path:A().min(1),text:A().nullable()})).optional(),managed:M().optional()}).strict()}).strict();var I8=P({skills:N(P({name:A().min(1),description:A().optional(),scope:M8,path:A().min(1),absolutePath:A().min(1).optional(),installed:M(),hosts:N(A()),installedVersion:A().optional(),bundledVersion:A().optional(),updateAvailable:M().optional(),managed:M().optional()}).strict()),truncated:M()}).strict();P({scope:M8.default(`project`),name:A(),body:A().optional(),frontmatter:F8,...gX,summary:_X}).strict(),P({path:A().min(1),created:M(),warnings:N(A())}).strict(),P({scope:M8.default(`project`),name:A(),...gX,summary:_X}).strict(),P({name:A().min(1),version:A().min(1),previousVersion:A().optional(),checkpointRef:A().optional()}).strict(),P({existed:M(),path:A().min(1)}).strict(),P({scope:M8.default(`project`),fromName:A(),toName:A(),body:A().optional(),frontmatter:F8.optional(),...gX,summary:_X}).strict(),P({from:A().min(1),to:A().min(1),committed:M()}).strict();var L8=F([`reference`,`script`]);P({scope:M8.default(`project`),name:A(),path:A().min(1),content:A(),...gX,summary:_X}).strict(),P({path:A().min(1),created:M(),kind:L8,content:M()}).strict(),P({path:A().min(1),kind:L8,text:A()}).strict(),P({path:A().min(1),existed:M(),kind:L8}).strict(),P({scope:M8.default(`project`),name:A(),targets:N(O8).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...gX,summary:_X}).strict(),P({name:A().min(1),hosts:N(A()),scripts:M(),warnings:N(A()),warningCodes:N(F([`no-targets`,`scripts-present`]))}).strict(),P({scope:M8.default(`project`),name:A()}).strict(),P({name:A().min(1),uninstalled:M()}).strict();var R8=P({targets:N(O8),configured:M()}).strict();P({targets:N(O8)}).strict(),P({targets:N(O8),reprojected:N(P({name:A(),hosts:N(A())}).strict()),bundleHosts:N(A()),removedFrom:N(A())}).strict(),P({scope:M8.default(`project`),name:A(),version:A().regex(/^[0-9a-f]{40}$/i),...gX,summary:_X}).strict(),P({name:A().min(1),version:A(),restoredFiles:N(A()),warnings:N(A())}).strict(),P({query:A().optional(),intent:F([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:F([`navigation`,`relevance`]).optional(),scopes:N(F([`page`,`folder`,`content`,`file`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional(),semantic:M().optional(),source:F([`omnibar`,`mcp`,`http`]).optional()}).loose();var z8=P({kind:F([`page`,`folder`,`content`,`file`]),path:A().min(1),title:A(),score:j(),signals:ed(A(),Vu()),snippet:A().optional()}).loose(),B8=P({capable:M(),applied:M(),coverage:P({embedded:j().int().nonnegative(),total:j().int().nonnegative()})}).loose();P({enabled:M(),keyPresent:M(),keySource:F([`file`,`env`]).nullable(),keyHint:A().nullable(),ready:M(),capable:M(),embedded:j().int().nonnegative(),total:j().int().nonnegative()}).loose(),P({query:A(),intent:F([`autocomplete`,`full_text`,`omnibar`]),results:N(z8),elapsedMs:j().nonnegative(),semantic:B8.optional(),truncated:M().optional(),ready:M().optional()}).loose();var V8=P({version:A().min(1),recordedAt:A().min(1)}).loose();P({currentVersion:A().min(1),targets:ed(A(),V8.nullable())}).loose();var H8=`server-info`,U8=`branch-switched`,W8=`disk-ack`,G8=`config-validation-rejected`,K8=`config-ignore-nested-error`,q8=F([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),J8=P({v:I(1),ch:I(H8),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),Y8=P({v:I(1),ch:I(U8),seq:j(),branch:A().min(1)}).loose(),X8=P({v:I(1),ch:q8,seq:j()}).loose(),Z8=P({v:I(1),ch:I(W8),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),Q8=P({v:I(1),ch:I(G8),seq:j(),docName:A().min(1),error:tp}).loose(),$8=P({v:I(1),ch:I(K8),seq:j(),path:A().min(1),error:A().min(1)}).loose();function e5(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 t5(e){if(typeof e!=`string`||e.length===0)return e;let t=NQ(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(OQ(e)){let t=e5(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=TQ(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var n5=`https://api.github.com/repos/inkeep/open-knowledge`;async function r5(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(n5,{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 i5(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 lK.default;var a5=P({path:N(Ju([A(),j()])),message:A(),issueCode:A()});Xu(`code`,[P({code:I(`SCHEMA_INVALID`),issues:N(a5)}),P({code:I(`WRITE_ERROR`),detail:A()})]);function o5(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function s5(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 c5={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function l5(e){if(e.trim()===``)return{doc:new xr({}),map:{}};let t;try{t=Mi(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new xr({}),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=S6.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 u5(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function d5(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=$e(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(u5(n)){let r=e.createNode(n),i=Xe(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function f5(e){return e===``?``:`---\n${e.endsWith(`
549
549
  `)?e.slice(0,-1):e}\n---\n`}var p5=65536;function m5(e){let t=e.match(Nq);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function h5(e){if(e.trim()===``)return{doc:new xr({}),map:{}};let t;try{t=Mi(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new xr({}),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=S6.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 g5(e){return e===``?{doc:new xr({}),map:{}}:h5(Lq(e))}function _5(e){let{fenced:t}=m5(e),{map:n,parseError:r}=g5(t);return{map:n??{},parseError:r}}function v5(e){let{fenced:t}=m5(e);if(t===``)return[];let{doc:n,map:r}=g5(t);return r===null?[]:S5(n)}function y5(e){return typeof e==`object`&&!!e&&`key`in e}function b5(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 x5(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 S5(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!y5(e))continue;let t=b5(e);t!==null&&n.push(t)}return n}function C5(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function w5(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:f5(e.toString(c5))}function T5(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:p5}:null}function E5(e){let t=w5(e),n=T5(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function D5(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:p6}};let{doc:n,map:r}=g5(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{C5(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=_6.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,d5(n,n.get(e,!0),t.data))}return E5(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function O5(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:p6}};let{doc:i,map:a}=g5(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=>y5(e)&&b5(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>y5(e)&&e!==s&&b5(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return x5(s,n),E5(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function k5(e,t){let{doc:n,map:r}=g5(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=S5(n);if(a.length!==t.length||!A5(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(y5),r=[];for(let n of t){let i=e.findIndex(e=>b5(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,E5(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function A5(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 j5(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:p6}:null}function M5(e,t,n){let r=j5(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=g5(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=_6.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 C5(i),i.setIn(t,d5(i,i.getIn(t,!0),o.data)),E5(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function N5(e,t){let n=j5(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=g5(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),E5(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function P5(e,t){if(t.length===0){let t=e.contents;return Xe(t)?t:null}let n=e.getIn(t,!0);return Xe(n)?n:null}function F5(e,t,n,r={}){let i=j5(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:p6}};let{doc:o,map:s}=g5(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=P5(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>y5(e)&&b5(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>y5(e)&&e!==l&&b5(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return x5(l,n),E5(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function I5(e,t,n){if(t.length===0)return k5(e,n);let r=j5(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=g5(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Xe(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(!y5(e))continue;let t=b5(e);t!==null&&s.push(t)}if(s.length!==n.length||!A5(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(y5),t=[];for(let r of n){let i=e.findIndex(e=>b5(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,E5(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function L5(e,t,n){let r=j5(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=g5(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!$e(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(!R5(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]),E5(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function R5(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 z5=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function B5(e){return{ok:!1,error:e}}function V5(e){return{ok:!0,...e}}function H5(e){return{ok:!0,...e}}function U5(e){return{ok:!0,...e}}function W5(e){return{ok:!0,...e}}function G5(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 ${p5}-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 K5(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(!T6(e.map[n],t.map[n]))return!1;return!0}var q5=5;function J5(e){let t=e.toString();return{snapshot:Y5(t),raw:t}}function Y5(e){let{map:t,parseError:n}=_5(e);return{map:t,keys:v5(e),parseError:n}}function X5(e){return e.startsWith(`---`)}function Z5(e){let t=e.document,n=t.getText(`source`),r=new Set,i=J5(n),a=i.snapshot,o=m5(i.raw).fenced,s=X5(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=J5(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&K5(a,t)){s=X5(i);return}a=t,o=m5(i).fenced,s=X5(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||Q5(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{fenced:t}=m5(n.toString());r=e(t),r.ok&&r.nextFenced!==t&&(n.delete(0,t.length),r.nextFenced!==``&&n.insert(0,r.nextFenced))},z5),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return B5({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return B5({code:`SCHEMA_INVALID`,issues:[{path:[p6],message:`'${p6}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=C6.safeParse(e);if(!t.success)return B5({code:`SCHEMA_INVALID`,issues:t.error.issues.map(o5)});let n=t.data,r=Object.keys(n),i=f(e=>D5(e,n));return i.ok?V5({appliedKeys:r}):B5(G5(i.error))}function m(e,t,n={}){if(c)return B5({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>O5(r,e,t,n));return r.ok?H5({oldKey:e,newKey:t}):B5(G5(r.error))}function h(e){if(c)return B5({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>k5(t,e));return t.ok?U5({orderedKeys:[...e]}):B5(G5(t.error))}function g(e,t){if(c)return B5({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>M5(n,e,t));return n.ok?W5({path:[...e]}):B5(G5(n.error))}function _(e){if(c)return B5({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>N5(t,e));return t.ok?W5({path:[...e]}):B5(G5(t.error))}function v(e,t,n={}){if(c)return B5({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>F5(r,e,t,n));return r.ok?W5({path:[...e]}):B5(G5(r.error))}function y(e,t){if(c)return B5({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>I5(n,e,t));return n.ok?W5({path:[...e]}):B5(G5(n.error))}function b(e,t){if(c)return B5({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>L5(n,e,t));return n.ok?W5({path:[...e]}):B5(G5(n.error))}return{current(){return J5(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 Q5(e,t,n){if(t===0&&n)return!0;let r=t>0?t:q5,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 $5=new lK.default;$5.Match_Threshold=.5;var e7=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,t7=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,n7=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,r7=/^\d+([.)])(?=\s)/,i7=`1`,a7=/\*\*\s*(`[^`]+`)\s*\*\*/g,o7=/^(`{3,}|~{3,})/;function s7(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=o7.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||!t7.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||t7.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 c7(e){return e.slice(0,-1).trimEnd()}var l7=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function u7(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 d7=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,f7=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,p7=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,m7=/<\/?[A-Z]/;function h7(e){let t=!1;for(let n=0;n<e.length;n++)if(m7.test(e[n]??``)){t=!0;break}if(!t)return e;let n=u7(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&&d7.test(s));let l=c&&p7.test(s),u=c&&!l&&f7.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 g7(e){let t=h7(e.replace(/^/,``).replace(/\r/g,``).replace(e7,`$1`).replace(a7,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
550
550
 
551
551
  $2`).replace(/^([#>+-].*|\d+[.)].*|`{3,}.*|~{3,}.*|<\/[A-Z][A-Za-z0-9]*>[ \t]*)\n([^\n])/gm,`$1
@@ -554,4 +554,4 @@ $2`).split(`
554
554
  `)),n=s7(t),r=u7(t);return t.map((e,i)=>{let a=e.trimEnd();if(i>0&&!r.has(i)&&/^[ \t]+\S/.test(a)&&(t[i-1]??``).trim()!==``&&!n7.test(a)&&!l7.test(a.trimStart())){let e=(t[i-1]??``).trimStart();if(!l7.test(e)&&!e.startsWith(`|`))return a.replace(/^[ \t]+/,``)}if(t7.test(a)){let e=a.replace(/\s+/g,``);return n.has(i)&&e.length>1&&e.startsWith(`|`)&&e.endsWith(`|`)?c7(e):e}let o=n7.test(a)?a.replace(/^[ \t]+/,``):a;return n.has(i)&&o.length>1&&o.startsWith(`|`)&&o.endsWith(`|`)&&(o=c7(o)),o.replace(r7,`${i7}$1`)}).join(`
555
555
  `).replace(/\n{3,}/g,`
556
556
 
557
- `).replace(/\n+$/,``)}var _7=/^[a-zA-Z0-9][\w/-]*$/;function v7(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return _7.test(t)}var y7=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function b7(e){return e.startsWith(`#`)?e.slice(1):e}function x7(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function S7(e){if(!e||e.trim()===``)return[];let{map:t}=l5(e);if(!t)return[];let n=x7(t.tags),r=[];for(let e of n){let t=b7(e);_7.test(t)&&r.push(t)}return r}var C7=F(JK),w7=Ku({hosts:N(A()),scope:C7,scripts:M(),installedAt:Vl()});Ku({schema:I(1),skills:ed(A(),w7).default({})});var T7=100,E7=500,D7=450,O7={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},k7=new WeakMap;function A7(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function j7(e){return e.trim().toLowerCase()}var M7=/\.(?:md|mdx)$/;function N7(e,t){if(t!==`page`)return e;let n=e.replace(M7,``);return n.length>0?n:e}function P7(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function F7(e){let t=P7(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 I7(e){let t=yG({schema:O7});return e.length>0&&AG(t,e),t}function L7(e){let t={documents:e};return k7.set(t,I7(e)),t}function R7(e){let t=k7.get(e);if(t)return t;let n=I7(e.documents);return k7.set(e,n),n}function z7(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function B7(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function V7(e,t){let n=j7(t);if(!n)return 0;let r=N7(n,e.kind),i=j7(e.title),a=j7(e.name),o=j7(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 H7=.5;function U7(e,t){let n=V7(e,t);return n<=0?n:pX(e.path)?n*H7:n}var W7=60;function G7(e){return e===`file`?-W7:0}var K7=1e3,q7=50,J7=1,Y7=1,X7=.001;function Z7(e,t,n,r,i){let a=i>0?t/i:0,o=q7>0?n/q7:0,s=r===`file`?-X7:0,c=J7*a+Y7*o+s;return e*K7+c}function Q7(e,t,n,r){return e+t*20+n+G7(r)}function $7(e,t,n,r,i,a){return e===`relevance`?Q7(t,n,r,i):Z7(t,n,r,i,a)}function e9(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function t9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function n9(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 r9(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function i9(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 a9(e,t){return j7(t).length<4?0:+(e===`full_text`)}function o9(e){let{lexical:t,fullText:n}=e.signals;return t>=E7?`lexical`:t===D7&&n<=0?`pathOnly`:`body`}function s9(e){let t=[],n=[],r=[];for(let i of e){let e=o9(i);e===`lexical`?t.length<T7&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function c9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=s9(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 l9(e,t,n={}){let r=n.intent??`omnibar`,i=e9(r,n.ranking),a=A7(n.limit),o=new Set(n.scopes??z7(r)),s=e.documents.filter(e=>B7(e,o)),c=j7(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=oK(R7(e),{term:c,properties:r9(r),boost:i9(r),tolerance:a9(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>B7(e.document,o)).map(e=>[e.document.id,e.score])),d=n9(s),f=new Map;for(let e of s)U7(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)B7(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=t9(f.values(),u);return c9([...f.values()].map(t=>{let n=Math.max(0,U7(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:$7(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 c9(d9({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function u9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function d9(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=t9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,U7(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?$7(o,t,n,s,e.kind,m):Q7(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=u9(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)),_=u9(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 f9(e){return`https://github.com/${e.owner}/${e.repo}.git`}function p9(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var m9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),h9=globalThis;h9[m9]===void 0&&(h9[m9]=rc());var g9=h9[m9],_9=Ku({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(g9,{description:`Recorded skill version for this target.`}),recordedAt:Vl().register(g9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:F([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(g9,{description:`Install-source surface that recorded this entry.`}).optional()}),v9=Ku({enabled:M().register(g9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Vl().register(g9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Ku({schema:I(1).register(g9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ku({"claude-cowork":_9.optional(),"cli-hosts":_9.optional()}).register(g9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:ed(A(),v9).register(g9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var y9=new Set([`(connected)`,`(agent thread)`]);function b9(e){return e!=null&&y9.has(e)}var x9=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 S9(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??C9,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 x9(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 C9(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function w9(){let e=!1,t=``,n=0;return r=>{let i=T9(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 T9(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 E9=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],D9={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},O9={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},k9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function A9(e,t=E9){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function j9(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 M9(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 N9={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function P9(e){return e?N9[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function F9(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 I9(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 L9(e){let[t]=F9(e);return I9(t,45,32)}var R9=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],z9=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],B9=`ok-user-name-v3`,V9=`ok-user-color-v3`;function H9(e){return e[Math.floor(Math.random()*e.length)]}function U9(){return`${H9(R9)} ${H9(z9)}`}function W9(){return H9(k9)}function G9(e){try{return localStorage.getItem(e)}catch{return null}}function K9(e,t){try{localStorage.setItem(e,t)}catch{}}function q9(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=G9(B9),r=G9(V9);return n||(n=U9(),K9(B9,n)),r||(r=W9(),K9(V9,r)),{name:n,color:r,coeditor:e,tabId:t}}function J9(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 Y9(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 iee(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=J9(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function aee(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 oee(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 see(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 cee(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{S3 as $,Ym as $i,_$ as $n,P3 as $r,ZJ as $t,I6 as A,I as Aa,bC as Ai,bK as An,$K as Ar,EX as At,H6 as B,Nb as Bi,T6 as Bn,_5 as Br,j8 as Bt,wq as C,np as Ca,YS as Ci,w9 as Cn,s6 as Cr,Gq as Ct,cq as D,Hf as Da,cC as Di,L9 as Dn,g7 as Dr,VK as Dt,d3 as E,Ff as Ea,EC as Ei,F7 as En,kq as Er,N8 as Et,hq as F,ba as Fa,W as Fi,s5 as Fn,ree as Fr,I8 as Ft,Hq as G,sg as Gi,BK as Gn,JJ as Gr,Y6 as Gt,LZ as H,gx as Hi,I3 as Hn,t5 as Hr,RX as Ht,RK as I,HC as Ii,jq as In,NQ as Ir,P8 as It,$q as J,Hh as Ji,S$ as Jn,dY as Jr,DK as Jt,Uq as K,ug as Ki,VZ as Kn,eY as Kr,lX as Kt,Pq as L,pT as Li,E3 as Ln,Iq as Lr,cY as Lt,F6 as M,A as Ma,nT as Mi,GJ as Mn,nq as Mr,kX as Mt,p8 as N,Ta as Na,ES as Ni,Z9 as Nn,i5 as Nr,O8 as Nt,y8 as O,Cf as Oa,_C as Oi,_q as On,f4 as Or,FX as Ot,dq as P,Da as Pa,rS as Pi,S7 as Pn,vK as Pr,R8 as Pt,g3 as Q,Gm as Qi,x$ as Qn,m3 as Qr,uY as Qt,y7 as R,Xw as Ri,V4 as Rn,ZK as Rr,lY as Rt,x9 as S,ap as Sa,tT as Si,j9 as Sn,f6 as Sr,v8 as St,d8 as T,lf as Ta,TC as Ti,L7 as Tn,PK as Tr,XK as Tt,$6 as U,qh as Ui,q9 as Un,cee as Ur,WJ as Ut,k9 as V,Ib as Vi,r5 as Vn,oee as Vr,b8 as Vt,Y0 as W,H as Wi,UJ as Wn,l9 as Wr,qJ as Wt,Z6 as X,Wm as Xi,m$ as Xn,YJ as Xr,NK as Xt,G6 as Y,V as Yi,C$ as Yn,Fq as Yr,Z5 as Yt,x3 as Z,zm as Zi,h$ as Zn,Vq as Zr,XJ as Zt,GK as _,Pf as _a,zC as _i,uX as _n,Jq as _r,gK as _t,o8 as a,z as aa,qj as ai,p9 as an,b6 as ar,yY as at,UK as b,gf as ba,mT as bi,SY as bn,A3 as br,D3 as bt,z6 as c,Lf as ca,Vj as ci,fK as cn,$9 as cr,vq as ct,Q8 as d,Gd as da,BO as di,A9 as dn,EQ as dr,Cq as dt,Jm as ea,yK as ei,$J as en,b$ as er,qK as et,X8 as f,Hd as fa,KO as fi,QY as fn,YK as fr,pq as ft,xK as g,qd as ga,hw as gi,TY as gn,Yq as gr,LX as gt,uK as h,zd as ha,Mw as hi,CY as hn,b9 as hr,IX as ht,a8 as i,jp as ia,P7 as ii,S9 as in,y$ as ir,lJ as it,L6 as j,P as ja,BC as ji,zK as jn,TQ as jr,TX as jt,q8 as k,mu as ka,yC as ki,k3 as kn,HJ as kr,xX as kt,Y8 as l,Kd as la,DO as li,pK as ln,w6 as lr,Q6 as lt,J8 as m,bf as ma,qw as mi,EY as mn,yq as mr,m8 as mt,O9 as n,Sm as na,L3 as ni,fY as nn,p$ as nr,C3 as nt,mK as o,Pd as oa,zj as oi,iee as on,Qq as or,bY as ot,Z8 as p,Rd as pa,LO as pi,DY as pn,p3 as pr,g8 as pt,sq as q,B as qi,P9 as qn,eq as qr,Y9 as qt,uq as r,R as ra,vY as ri,f9 as rn,v$ as rr,H4 as rt,B6 as s,Vd as sa,Hj as si,aee as sn,lq as sr,xq as st,D9 as t,Bh as ta,Lq as ti,see as tn,g$ as tr,JK as tt,$8 as u,Mf as ua,cO as ui,Aq as un,pX as ur,Sq as ut,HK as v,Nd as va,G as vi,XY as vn,v7 as vr,hK as vt,f8 as w,cf as wa,XS as wi,c$ as wn,HZ as wr,qq as wt,aq as x,Df as xa,qS as xi,xY as xn,iq as xr,uJ as xt,WK as y,wf as ya,gT as yi,wY as yn,OQ as yr,p6 as yt,_7 as z,kx as zi,M9 as zn,v5 as zr,LJ as zt};
557
+ `).replace(/\n+$/,``)}var _7=/^[a-zA-Z0-9][\w/-]*$/;function v7(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return _7.test(t)}var y7=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function b7(e){return e.startsWith(`#`)?e.slice(1):e}function x7(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function S7(e){if(!e||e.trim()===``)return[];let{map:t}=l5(e);if(!t)return[];let n=x7(t.tags),r=[];for(let e of n){let t=b7(e);_7.test(t)&&r.push(t)}return r}var C7=F(JK),w7=Ku({hosts:N(A()),scope:C7,scripts:M(),installedAt:Vl()});Ku({schema:I(1),skills:ed(A(),w7).default({})});var T7=100,E7=500,D7=450,O7={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},k7=new WeakMap;function A7(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function j7(e){return e.trim().toLowerCase()}var M7=/\.(?:md|mdx)$/;function N7(e,t){if(t!==`page`)return e;let n=e.replace(M7,``);return n.length>0?n:e}function P7(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function F7(e){let t=P7(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 I7(e){let t=yG({schema:O7});return e.length>0&&AG(t,e),t}function L7(e){let t={documents:e};return k7.set(t,I7(e)),t}function R7(e){let t=k7.get(e);if(t)return t;let n=I7(e.documents);return k7.set(e,n),n}function z7(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function B7(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function V7(e,t){let n=j7(t);if(!n)return 0;let r=N7(n,e.kind),i=j7(e.title),a=j7(e.name),o=j7(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 H7=.5;function U7(e,t){let n=V7(e,t);return n<=0?n:pX(e.path)?n*H7:n}var W7=60;function G7(e){return e===`file`?-W7:0}var K7=1e3,q7=50,J7=1,Y7=1,X7=.001;function Z7(e,t,n,r,i){let a=i>0?t/i:0,o=q7>0?n/q7:0,s=r===`file`?-X7:0,c=J7*a+Y7*o+s;return e*K7+c}function Q7(e,t,n,r){return e+t*20+n+G7(r)}function $7(e,t,n,r,i,a){return e===`relevance`?Q7(t,n,r,i):Z7(t,n,r,i,a)}function e9(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function t9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function n9(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 r9(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function i9(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 a9(e,t){return j7(t).length<4?0:+(e===`full_text`)}function o9(e){let{lexical:t,fullText:n}=e.signals;return t>=E7?`lexical`:t===D7&&n<=0?`pathOnly`:`body`}function s9(e){let t=[],n=[],r=[];for(let i of e){let e=o9(i);e===`lexical`?t.length<T7&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function c9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=s9(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 l9(e,t,n={}){let r=n.intent??`omnibar`,i=e9(r,n.ranking),a=A7(n.limit),o=new Set(n.scopes??z7(r)),s=e.documents.filter(e=>B7(e,o)),c=j7(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=oK(R7(e),{term:c,properties:r9(r),boost:i9(r),tolerance:a9(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>B7(e.document,o)).map(e=>[e.document.id,e.score])),d=n9(s),f=new Map;for(let e of s)U7(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)B7(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=t9(f.values(),u);return c9([...f.values()].map(t=>{let n=Math.max(0,U7(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:$7(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 c9(d9({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function u9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function d9(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=t9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,U7(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?$7(o,t,n,s,e.kind,m):Q7(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=u9(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)),_=u9(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 f9(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function p9(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var m9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),h9=globalThis;h9[m9]===void 0&&(h9[m9]=rc());var g9=h9[m9],_9=Ku({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(g9,{description:`Recorded skill version for this target.`}),recordedAt:Vl().register(g9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:F([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(g9,{description:`Install-source surface that recorded this entry.`}).optional()}),v9=Ku({enabled:M().register(g9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Vl().register(g9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Ku({schema:I(1).register(g9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ku({"claude-cowork":_9.optional(),"cli-hosts":_9.optional()}).register(g9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:ed(A(),v9).register(g9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var y9=new Set([`(connected)`,`(agent thread)`]);function b9(e){return e!=null&&y9.has(e)}var x9=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 S9(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??C9,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 x9(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 C9(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function w9(){let e=!1,t=``,n=0;return r=>{let i=T9(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 T9(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 E9=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],D9={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},O9={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},k9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function A9(e,t=E9){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function j9(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 M9(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 N9={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function P9(e){return e?N9[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function F9(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 I9(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 L9(e){let[t]=F9(e);return I9(t,45,32)}var R9=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],z9=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],B9=`ok-user-name-v3`,V9=`ok-user-color-v3`;function H9(e){return e[Math.floor(Math.random()*e.length)]}function U9(){return`${H9(R9)} ${H9(z9)}`}function W9(){return H9(k9)}function G9(e){try{return localStorage.getItem(e)}catch{return null}}function K9(e,t){try{localStorage.setItem(e,t)}catch{}}function q9(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=G9(B9),r=G9(V9);return n||(n=U9(),K9(B9,n)),r||(r=W9(),K9(V9,r)),{name:n,color:r,coeditor:e,tabId:t}}function J9(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 Y9(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 iee(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=J9(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function aee(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 oee(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 see(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 cee(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{S3 as $,Ym as $i,_$ as $n,P3 as $r,ZJ as $t,I6 as A,I as Aa,bC as Ai,bK as An,$K as Ar,EX as At,H6 as B,Nb as Bi,T6 as Bn,_5 as Br,j8 as Bt,wq as C,np as Ca,YS as Ci,w9 as Cn,s6 as Cr,Gq as Ct,cq as D,Hf as Da,cC as Di,L9 as Dn,g7 as Dr,VK as Dt,d3 as E,Ff as Ea,EC as Ei,F7 as En,kq as Er,N8 as Et,hq as F,ba as Fa,W as Fi,s5 as Fn,ree as Fr,I8 as Ft,Hq as G,sg as Gi,BK as Gn,JJ as Gr,Y6 as Gt,LZ as H,gx as Hi,I3 as Hn,t5 as Hr,RX as Ht,RK as I,HC as Ii,jq as In,NQ as Ir,P8 as It,$q as J,Hh as Ji,S$ as Jn,dY as Jr,DK as Jt,Uq as K,ug as Ki,VZ as Kn,eY as Kr,lX as Kt,Pq as L,pT as Li,E3 as Ln,Iq as Lr,cY as Lt,F6 as M,A as Ma,nT as Mi,GJ as Mn,nq as Mr,kX as Mt,p8 as N,Ta as Na,ES as Ni,Z9 as Nn,i5 as Nr,O8 as Nt,y8 as O,Cf as Oa,_C as Oi,_q as On,f4 as Or,FX as Ot,dq as P,Da as Pa,rS as Pi,S7 as Pn,vK as Pr,R8 as Pt,g3 as Q,Gm as Qi,x$ as Qn,m3 as Qr,uY as Qt,y7 as R,Xw as Ri,V4 as Rn,ZK as Rr,lY as Rt,x9 as S,ap as Sa,tT as Si,j9 as Sn,f6 as Sr,v8 as St,d8 as T,lf as Ta,TC as Ti,L7 as Tn,PK as Tr,XK as Tt,$6 as U,qh as Ui,q9 as Un,cee as Ur,WJ as Ut,k9 as V,Ib as Vi,r5 as Vn,oee as Vr,b8 as Vt,Y0 as W,H as Wi,UJ as Wn,l9 as Wr,qJ as Wt,Z6 as X,Wm as Xi,m$ as Xn,YJ as Xr,NK as Xt,G6 as Y,V as Yi,C$ as Yn,Fq as Yr,Z5 as Yt,x3 as Z,zm as Zi,h$ as Zn,Vq as Zr,XJ as Zt,GK as _,Pf as _a,zC as _i,uX as _n,Jq as _r,gK as _t,o8 as a,z as aa,qj as ai,p9 as an,b6 as ar,yY as at,UK as b,gf as ba,mT as bi,SY as bn,A3 as br,D3 as bt,z6 as c,Lf as ca,Vj as ci,fK as cn,$9 as cr,vq as ct,Q8 as d,Gd as da,BO as di,A9 as dn,EQ as dr,Cq as dt,Jm as ea,yK as ei,$J as en,b$ as er,qK as et,X8 as f,Hd as fa,KO as fi,QY as fn,YK as fr,pq as ft,xK as g,qd as ga,hw as gi,TY as gn,Yq as gr,LX as gt,uK as h,zd as ha,Mw as hi,CY as hn,b9 as hr,IX as ht,a8 as i,jp as ia,P7 as ii,S9 as in,y$ as ir,lJ as it,L6 as j,P as ja,BC as ji,zK as jn,TQ as jr,TX as jt,q8 as k,mu as ka,yC as ki,k3 as kn,HJ as kr,xX as kt,Y8 as l,Kd as la,DO as li,pK as ln,w6 as lr,Q6 as lt,J8 as m,bf as ma,qw as mi,EY as mn,yq as mr,m8 as mt,O9 as n,Sm as na,L3 as ni,fY as nn,p$ as nr,C3 as nt,mK as o,Pd as oa,zj as oi,iee as on,Qq as or,bY as ot,Z8 as p,Rd as pa,LO as pi,DY as pn,p3 as pr,g8 as pt,sq as q,B as qi,P9 as qn,eq as qr,Y9 as qt,uq as r,R as ra,vY as ri,f9 as rn,v$ as rr,H4 as rt,B6 as s,Vd as sa,Hj as si,aee as sn,lq as sr,xq as st,D9 as t,Bh as ta,Lq as ti,see as tn,g$ as tr,JK as tt,$8 as u,Mf as ua,cO as ui,Aq as un,pX as ur,Sq as ut,HK as v,Nd as va,G as vi,XY as vn,v7 as vr,hK as vt,f8 as w,cf as wa,XS as wi,c$ as wn,HZ as wr,qq as wt,aq as x,Df as xa,qS as xi,xY as xn,iq as xr,uJ as xt,WK as y,wf as ya,gT as yi,wY as yn,OQ as yr,p6 as yt,_7 as z,kx as zi,M9 as zn,v5 as zr,LJ as zt};
@@ -1 +1 @@
1
- import{tt as e}from"./dist-D6R8vG-1.js";var t=/\.(md|mdx)$/i;function n(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function r(e){return n(e).replace(t,``)}function i(e){let r=n(e);return r?t.test(r)?r:`${r}.md`:`untitled.md`}function a(e){let t=r(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function o(t){return e.includes(t)}function s(e){if(e.startsWith(h)||e.startsWith(y)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=g(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function c(e){if(e.startsWith(h)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function l(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function u(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function d(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function f(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function p(e,t,n){if(e===`folder`)return f(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function m(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var h=`#/__asset__/`;function g(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function _(e){if(!e.startsWith(h))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function v(e){return`${h}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var y=`#/__skill-file__/`;function b(e){return`${y}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function x(e){if(!e.startsWith(y))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,s=a.join(`/`);return!r||!i||!s||!o(r)?null:{scope:r,name:i,path:s}}export{d as a,f as c,u as d,x as f,r as h,p as i,b as l,i as m,_ as n,v as o,a as p,s as r,l as s,c as t,m as u};
1
+ import{tt as e}from"./dist-zc03OoUp.js";var t=/\.(md|mdx)$/i;function n(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function r(e){return n(e).replace(t,``)}function i(e){let r=n(e);return r?t.test(r)?r:`${r}.md`:`untitled.md`}function a(e){let t=r(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function o(t){return e.includes(t)}function s(e){if(e.startsWith(h)||e.startsWith(y)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=g(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function c(e){if(e.startsWith(h)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function l(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function u(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function d(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function f(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function p(e,t,n){if(e===`folder`)return f(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function m(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var h=`#/__asset__/`;function g(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function _(e){if(!e.startsWith(h))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function v(e){return`${h}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var y=`#/__skill-file__/`;function b(e){return`${y}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function x(e){if(!e.startsWith(y))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,s=a.join(`/`);return!r||!i||!s||!o(r)?null:{scope:r,name:i,path:s}}export{d as a,f as c,u as d,x as f,r as h,p as i,b as l,i as m,_ as n,v as o,a as p,s as r,l as s,c as t,m as u};
@@ -1 +1 @@
1
- import{k as e}from"./dist-D6R8vG-1.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:branch-changed`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{branch:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:templates-changed`;function u(){window.dispatchEvent(new CustomEvent(l))}function d(e){let t=()=>e();return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:skills-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}export{c as a,d as c,u as i,i as n,a as o,p as r,m as s,s as t};
1
+ import{k as e}from"./dist-zc03OoUp.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:branch-changed`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{branch:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:templates-changed`;function u(){window.dispatchEvent(new CustomEvent(l))}function d(e){let t=()=>e();return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:skills-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}export{c as a,d as c,u as i,i as n,a as o,p as r,m as s,s as t};
@@ -1 +1 @@
1
- import{Ta as e,wa as t}from"./dist-D6R8vG-1.js";import{t as n}from"./file-tree-rename-validation-DzchvQFr.js";import{b as r,i,x as a,y as o}from"./navigation-targets-CdngrI3e.js";import{c as s,o as c,s as l}from"./doc-hash-sxvnKnL5.js";var u=`application/x-open-knowledge-sidebar-item+json`,d={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function f(e){return JSON.stringify(e)}function p(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:s(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:c(e.assetPath)}:{target:i(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:l(e.docName)}}function m(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(u);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!h(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!g(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){return typeof e==`string`&&Object.hasOwn(d,e)}var _=`.md`,v=/\.(md|mdx)$/i;function y(e,n=_){return v.test(e)||t(e)?e:`${e}${n}`}function b(e){return Y(e).replace(v,``)}function x(e,t){let n=Y(e),i=t.find(e=>r(e)&&S(e)===n);if(i)return i.docName;let a=b(n);return t.find(e=>{let t=S(e);return t!==n&&v.test(t)&&b(t)===a})&&v.test(n)?n:a}function S(e){return a(e)?T(e.path):o(e)?e.path:y(e.docName,e.docExt)}function C(e){let t=Y(e).match(v);return t?`.${t[1].toLowerCase()}`:void 0}function w(e){return Y(e)}function T(e){let t=Y(e.trim());return t?`${t}/`:``}function E(e){return e.endsWith(`/`)?w(e):b(e)}function D(e){return e.map(S)}function O(e){return[...e].sort().join(`\0`)}function k(e){return O(D(e))}function A(e,t={}){let n=new Set;for(let r of e){let e=(a(r)||o(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(a(r)){let e=T(r.path);e&&n.add(e)}let i=a(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function j(e){if(!e)return[];let t=Y(e.replace(v,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function M(e,t,n){let i=C(e);if(i)return i;let a=n.find(e=>r(e)&&e.docName===t);return a?a.docExt??_:J(e).includes(`.`)?void 0:_}function N(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!o(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function P(e,t,n){if(C(e))return null;let r=n.find(e=>o(e)&&e.path===t);return r?r.path:J(e).includes(`.`)?t:N(t,n)}function F(e,t){let n=e.kind===`directory`,r=n?w(e.path):x(e.path,t);if(n)return{kind:`folder`,name:Y(J(e.path)).replace(v,``),path:r,treePath:L(e.path,!0)};let i=P(e.path,r,t);if(i)return{kind:`asset`,name:Y(J(i)),path:i,treePath:i};let a=M(e.path,r,t);return{kind:`file`,name:Y(J(e.path)).replace(v,``),path:r,treePath:L(e.path,!1),docExt:a}}function I(e){return e.kind===`directory`?w(e.path):e.path}function L(e,t){return t?T(e):v.test(e)?e:`${e}${_}`}function R(e,t,n){let r=T(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${_}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function z(e,t){return e===`file`?L(t,!1):`${w(t)}/index${_}`}function B(e,t){return t.kind===`root`||t.directoryPath==null?J(e):`${t.directoryPath}${J(e)}`}function V(e,t){if(t)return w(T(e));let n=b(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function H(e,t){let n=w(T(e));return n?`${n}/${t}`:t}function U(e,t,n){e.append(`parentDocName`,H(t,n)),e.append(`placement`,`parent-dir`)}function W(e,t){return(t.path??H(e,t.src)).replace(/^\/+/,``)}function G(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function K(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function q(t,r){let i=n(t).toLowerCase();if(i===``)return null;let a=new Date().toISOString();if(i===`.md`||i===`.mdx`)return{kind:`document`,docName:b(t),docExt:i,modified:a,size:r.size};let o=i.startsWith(`.`)?i.slice(1):i;return{kind:`asset`,path:t,assetExt:o,mediaKind:e(o),modified:a,size:r.size}}function J(e){let t=Y(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function Y(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{O as C,p as D,u as E,m as O,F as S,W as T,I as _,z as a,b,D as c,S as d,K as f,V as g,L as h,B as i,f as k,k as l,G as m,A as n,R as o,T as p,j as r,y as s,U as t,q as u,N as v,E as w,x,w as y};
1
+ import{Ta as e,wa as t}from"./dist-zc03OoUp.js";import{t as n}from"./file-tree-rename-validation-DzchvQFr.js";import{b as r,i,x as a,y as o}from"./navigation-targets-DUt4VF6E.js";import{c as s,o as c,s as l}from"./doc-hash-D8EI7kHA.js";var u=`application/x-open-knowledge-sidebar-item+json`,d={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function f(e){return JSON.stringify(e)}function p(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:s(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:c(e.assetPath)}:{target:i(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:l(e.docName)}}function m(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(u);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!h(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!g(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){return typeof e==`string`&&Object.hasOwn(d,e)}var _=`.md`,v=/\.(md|mdx)$/i;function y(e,n=_){return v.test(e)||t(e)?e:`${e}${n}`}function b(e){return Y(e).replace(v,``)}function x(e,t){let n=Y(e),i=t.find(e=>r(e)&&S(e)===n);if(i)return i.docName;let a=b(n);return t.find(e=>{let t=S(e);return t!==n&&v.test(t)&&b(t)===a})&&v.test(n)?n:a}function S(e){return a(e)?T(e.path):o(e)?e.path:y(e.docName,e.docExt)}function C(e){let t=Y(e).match(v);return t?`.${t[1].toLowerCase()}`:void 0}function w(e){return Y(e)}function T(e){let t=Y(e.trim());return t?`${t}/`:``}function E(e){return e.endsWith(`/`)?w(e):b(e)}function D(e){return e.map(S)}function O(e){return[...e].sort().join(`\0`)}function k(e){return O(D(e))}function A(e,t={}){let n=new Set;for(let r of e){let e=(a(r)||o(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(a(r)){let e=T(r.path);e&&n.add(e)}let i=a(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function j(e){if(!e)return[];let t=Y(e.replace(v,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function M(e,t,n){let i=C(e);if(i)return i;let a=n.find(e=>r(e)&&e.docName===t);return a?a.docExt??_:J(e).includes(`.`)?void 0:_}function N(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!o(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function P(e,t,n){if(C(e))return null;let r=n.find(e=>o(e)&&e.path===t);return r?r.path:J(e).includes(`.`)?t:N(t,n)}function F(e,t){let n=e.kind===`directory`,r=n?w(e.path):x(e.path,t);if(n)return{kind:`folder`,name:Y(J(e.path)).replace(v,``),path:r,treePath:L(e.path,!0)};let i=P(e.path,r,t);if(i)return{kind:`asset`,name:Y(J(i)),path:i,treePath:i};let a=M(e.path,r,t);return{kind:`file`,name:Y(J(e.path)).replace(v,``),path:r,treePath:L(e.path,!1),docExt:a}}function I(e){return e.kind===`directory`?w(e.path):e.path}function L(e,t){return t?T(e):v.test(e)?e:`${e}${_}`}function R(e,t,n){let r=T(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${_}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function z(e,t){return e===`file`?L(t,!1):`${w(t)}/index${_}`}function B(e,t){return t.kind===`root`||t.directoryPath==null?J(e):`${t.directoryPath}${J(e)}`}function V(e,t){if(t)return w(T(e));let n=b(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function H(e,t){let n=w(T(e));return n?`${n}/${t}`:t}function U(e,t,n){e.append(`parentDocName`,H(t,n)),e.append(`placement`,`parent-dir`)}function W(e,t){return(t.path??H(e,t.src)).replace(/^\/+/,``)}function G(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function K(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function q(t,r){let i=n(t).toLowerCase();if(i===``)return null;let a=new Date().toISOString();if(i===`.md`||i===`.mdx`)return{kind:`document`,docName:b(t),docExt:i,modified:a,size:r.size};let o=i.startsWith(`.`)?i.slice(1):i;return{kind:`asset`,path:t,assetExt:o,mediaKind:e(o),modified:a,size:r.size}}function J(e){let t=Y(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function Y(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{O as C,p as D,u as E,m as O,F as S,W as T,I as _,z as a,b,D as c,S as d,K as f,V as g,L as h,B as i,f as k,k as l,G as m,A as n,R as o,T as p,j as r,y as s,U as t,q as u,N as v,E as w,x,w as y};