@inkeep/open-knowledge 0.4.0-beta.25 → 0.4.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
- package/dist/cli.mjs +37 -37
- package/dist/constants-CSmwRAFo.mjs +2 -0
- package/dist/{dist-DVNDjpnz.mjs → dist-BaIGvDgD.mjs} +1 -1
- package/dist/{dist-JNaknvi7.mjs → dist-C4qQGc8i.mjs} +8 -8
- package/dist/{dist-Cl_t5NRm.mjs → dist-DoBoUPet.mjs} +17 -16
- package/dist/index.mjs +1 -1
- package/dist/init-Cys0YykC.mjs +1 -0
- package/dist/{init-uWmRmgCA.mjs → init-Djz7BdtL.mjs} +5 -5
- package/dist/{loader-hjhxvSRP.mjs → loader-B64r69-j.mjs} +3 -3
- package/dist/loader-DfRJHcOw.mjs +1 -0
- package/dist/preview-Chj-AjEC.mjs +1 -0
- package/dist/{preview-vq_EvsiP.mjs → preview-nt7uUE2i.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-C-OqZ3Ro.js → ActivityModeContent-EGGl80pX.js} +1 -1
- package/dist/public/assets/{DocumentContext-Ccj8qLzP.js → DocumentContext-Bic6EUm_.js} +1 -1
- package/dist/public/assets/{GraphPanel-BKsp7Crh.js → GraphPanel-B42N4CIV.js} +1 -1
- package/dist/public/assets/{OutlinePanel-DP5j1Wq1.js → OutlinePanel-CJ2DJN7r.js} +1 -1
- package/dist/public/assets/{SettingsDialog-C9FPnh00.js → SettingsDialog-D53RhrjD.js} +2 -2
- package/dist/public/assets/{SourceEditor-mNodigv_.js → SourceEditor-CMwexck1.js} +1 -1
- package/dist/public/assets/config-validation-events-Bosr96x4.js +10 -0
- package/dist/public/assets/{doc-hash-C9Z2AnUu.js → doc-hash-Bg2WkAY_.js} +128 -127
- package/dist/public/assets/{index-BDj01myg.js → index-10HZouza.js} +76 -76
- package/dist/public/assets/index-EvzmrHLW.css +1 -0
- package/dist/public/assets/{target-navigation-intent-FPPCIJIk.js → target-navigation-intent-zW_9xoDt.js} +1 -1
- package/dist/public/assets/{toggle-group-CP96D5oH.js → toggle-group-BMp2XgSC.js} +1 -1
- package/dist/public/assets/{tooltip-qQkwljHf.js → tooltip-CYfWgpPY.js} +1 -1
- package/dist/public/index.html +23 -16
- package/dist/{src-jO7GzWRA.mjs → src-DVGh66ju.mjs} +2 -2
- package/dist/start-CjvYIfQD.mjs +1 -0
- package/dist/{start-BnicFP1K.mjs → start-D6Gr8R62.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-Dlyng5m6.mjs +0 -2
- package/dist/init-BKrp4NZQ.mjs +0 -1
- package/dist/loader-DqxqwNEe.mjs +0 -1
- package/dist/preview-CpmoA4SU.mjs +0 -1
- package/dist/public/assets/config-validation-events-BJEehccy.js +0 -10
- package/dist/public/assets/index-BzPHdvNz.css +0 -1
- package/dist/start-CNyWXmFb.mjs +0 -1
|
@@ -321,28 +321,29 @@ $2`).split(`
|
|
|
321
321
|
`)].join(`
|
|
322
322
|
`);case`REMOVED_KEY`:{let t=e.path.join(`.`),n=[`${e.source?`Removed key at ${e.source.file}:${e.source.line}:${e.source.column}`:`Removed key in configuration`}: ${t}`,e.redirect];if(e.source?.snippet&&e.source.snippet.length>0)for(let t of e.source.snippet.split(`
|
|
323
323
|
`))n.push(` ${t}`);return n.join(`
|
|
324
|
-
`)}case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}const AW=`__system__`,jW=1,MW=`__config__/project`,NW=`__user__/config.yml`,PW=`__local__/project`,FW=`__config__/okignore`,IW=Object.freeze([MW,PW,NW,FW]),LW=`Ov23liqlSd0V1MwR6rhI`,RW=[`incoming`,`outgoing`,`both`];function zW(e){return RW.includes(e)}const BW=`localhost`,VW=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],HW=[`video/mp4`,`video/webm`,`video/ogg`],UW=[`audio/mpeg`,`audio/wav`,`audio/ogg`],WW=[`application/pdf`],GW=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),KW=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),qW=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),JW=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),YW=new Set(`exe.bat.cmd.ps1.com.msi.vbs.js.jse.wsf.wsh.hta.sh.command.csh.ksh.bash.zsh.fish.desktop.action.workflow.html.htm.svg.xml.mhtml.svgz.dmg.pkg.mpkg.scpt.applescript.terminal.prefpane.webloc.inetloc.fileloc.jar.appimage.deb.rpm.msix.appx.ipa.apk.pif.scr.lnk.url`.split(`.`)),XW=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.csv.txt.rtf.json`.split(`.`)),ZW=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus`.split(`.`)),QW=`same-dir`,$W=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),eG=[`png`,`jpg`,`jpeg`],tG=[`mp4`];function nG(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}nG(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,eG,GW),nG(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,tG,KW),nG(`FILE_ATTACHMENT_EXTENSIONS`,[...JW],$W);const rG=new Set(eG),iG=new Set(tG);nG(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...eG,...tG])],ZW);function aG(e){let t=e.toLowerCase().replace(/^\./,``);return rG.has(t)?`image`:iG.has(t)?`video`:null}const oG=Ub.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`}}}}),sG=nx.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[bb({find:Zb,type:this.type,getAttributes:{sourceDelimiter:`*`}}),bb({find:$b,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),cG=Xb.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[bb({find:Gb,type:this.type,getAttributes:{sourceDelimiter:`**`}}),bb({find:qb,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),lG=$y.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),uG=ix.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),dG=ox.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null}}}}),fG=Lb.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),pG=Lb.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),mG=Lb.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),hG=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],gG=hG.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${gG}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);const _G=new Set(hG.map(e=>`${e}:`));function vG(e){try{let t=new URL(e,`https://placeholder.invalid`);return _G.has(t.protocol.toLowerCase())}catch{return!1}}const yG=vx.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:vG,validate:vG,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),bG=Lb.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs,i=r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},i]}});function xG(e){return e.type.name===`list`&&!e.attrs.ordered}function SG(e){return e.type.name===`list`&&!!e.attrs.ordered}function CG(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function wG(e,t,n,r,i,a,o){let s=Pv(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?jf(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o??{}})}}),t(n),!0}return Of(n,a)(e,void 0)?t?Of(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}const TG=Lb.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Wv(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:wG(e,t,n,r,e=>xG(e)&&!CG(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:wG(e,t,n,r,e=>SG(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:wG(e,t,n,r,e=>xG(e)&&CG(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Cb({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Cb({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new Gy({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Uu(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),EG=Lb.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Wv(t),0]:[`li`,Wv(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Wv(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),DG=TG,OG=EG,kG=Lb.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),AG=Lb.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),jG=jC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),MG=FC.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1}}}}),NG=Lb.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),PG=$y.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),FG=Lb.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),IG=Lb.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),LG=Lb.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs,i=t||n;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:i}]}}),RG=$y.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function zG(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r?!0:BG(n)===r}function BG(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const VG=OC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null}}}}),HG=Lb.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),UG=/^(?:---|—-|___\s|\*\*\*\s)$/;function WG(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const GG=RC.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[xb({find:UG,type:this.type,getAttributes:e=>({sourceRaw:WG(e)})})]}});function KG(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function qG(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const JG=Lb.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:KG(e.getAttribute(`data-alias`)),anchor:KG(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:KG(e.getAttribute(`data-alias`)),anchor:KG(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=KG(e.attrs.alias),i=KG(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},qG({target:n,alias:r,anchor:i})]}});function YG(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function XG(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const ZG=[pG,AG,mG,kG,JG,Lb.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:KG(e.getAttribute(`data-alias`)),anchor:KG(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=KG(e.attrs.alias),i=KG(e.attrs.anchor),a=KG(e.attrs.resolvedSrc),o=YG(n);if(GW.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},XG({target:n,alias:r,anchor:i})]}}),HG,DG,OG,sG,cG,MG,oG,jG,dG,GG,yG,fG,bG,uG,lG,RG,fT.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),VG.configure({resizable:!0}),hC,mC,pC,Cx.configure({inline:!0}),LG,xx,PG,NG,IG,FG],QG=/^[a-zA-Z][\w/-]*$/;function $G(e){return e.startsWith(`#`)?e.slice(1):e}function eK(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function tK(e){if(!e||e.trim()===``)return[];let{map:t}=tW(e);if(!t)return[];let n=eK(t.tags),r=[];for(let e of n){let t=$G(e);QG.test(t)?r.push(t):console.warn(`[frontmatter-tags] dropping invalid tag entry: ${JSON.stringify(e)}`)}return r}const nK=A().refine(e=>!e.includes(`..`)&&!e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`\\`),{message:`docName contains unsafe path characters`}).optional(),rK={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},iK=A().optional(),aK=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,oK=N({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:Vs(A().min(1),A().min(1)).optional()}).loose(),sK=N({id:A().min(1),display_name:A().min(1),display_email:A(),source:Us([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),cK=Us(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed`.split(`.`));function lK(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const uK=N({type:cK,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(aK,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose(),dK=N({parentDocName:A().min(1),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose(),fK=N({src:A().min(1),path:A().min(1).optional(),deduped:Ss().optional()}).loose(),pK=N({url:A().min(1),dir:A().min(1)}).loose(),mK=N({type:Gs(`error`),problem:uK}).loose();function hK(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}let o=gK(e,t);r>=0?n[r]=o:n.push(o)}return n}function gK(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function _K(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:hK(t,r),children:n.all(t),data:{}}}const vK=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)"},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)"},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],yK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:VW,autoFocus:!0},{name:`alt`,type:`string`,required:!1,defaultValue:``,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`}],bK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:HW,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`}],xK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:UW,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],SK=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)"},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],CK=[vK[0],vK[1],vK[4],vK[5],vK[6]],wK=[yK[0],yK[1],yK[7]],TK=[SK[0],SK[1],SK[4],SK[5]],EK=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],DK=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],OK=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],kK=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],AK=[kK[0]],jK=[kK[0]],MK=[{name:`chart`,type:`string`,required:!0,autoFocus:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#system-arch-diagram`)"},{name:`theme`,type:`enum`,enumValues:[`default`,`dark`,`forest`,`neutral`],defaultValue:`default`,required:!1,advanced:!0,description:"Mermaid theme — default ships only `default` styling; alternates land alongside theme-switching infrastructure"}],NK=[MK[0]],PK=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],FK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],IK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:WW,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}];function LK(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function RK(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function zK(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}const BK=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:vK,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>_K(`Callout`,e,t,vK)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:yK,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>_K(`img`,e,t,yK)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:bK,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>_K(`video`,e,t,bK)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:xK,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>_K(`audio`,e,t,xK)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:IK,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>_K(`Pdf`,e,t,IK)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:FK,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>_K(`File`,e,t,FK)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:SK,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],serialize:(e,t)=>_K(`Accordion`,e,t,SK)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:kK,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>_K(`Math`,e,t,kK)},{name:`Mermaid`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:MK,icon:`Workflow`,category:`content`,displayName:`Mermaid`,description:`Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie)`,searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:(e,t)=>_K(`Mermaid`,e,t,MK)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:CK,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:wK,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (``) — read-only compat. Preserves `` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:EK,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:zK},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:DK,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:zK},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:OK,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:zK},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:PK,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:zK},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:TK,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${LK(n.name)}"`:``,a=n?.id?` id="${LK(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${RK(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:AK,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:jK,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})},{name:`MermaidFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:NK,icon:`Workflow`,category:`content`,displayName:`Mermaid Fence`,description:"Mermaid diagram via ` ```mermaid ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Mermaid block for the full prop surface (id, theme).",rendersAs:`Mermaid`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})}],VK={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>_K(e.attrs.componentName||`*`,e,t)};function HK(){let e=new Map;e.set(`*`,VK);for(let t of BK)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}function UK(){let e=globalThis;return e.__okYpsCounters||={block:0,inline:0},e.__okYpsCounters}const WK={parseFallback:{blockLevel:0,wholeDoc:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{}};function GK(){WK.parseFallback.blockLevel++}function KK(){WK.parseFallback.wholeDoc++}function qK(){let e=UK();return{parseFallback:{...WK.parseFallback},ypsMismatch:{block:e.block,inline:e.inline},jsxRenderFailure:{...WK.jsxRenderFailure},jsxAutoConvertFailed:{...WK.jsxAutoConvertFailed},jsxAutoConvertSucceeded:{...WK.jsxAutoConvertSucceeded},jsxPropDropped:{...WK.jsxPropDropped},jsxMoveFailed:{...WK.jsxMoveFailed},jsxStuckCopyFailed:{...WK.jsxStuckCopyFailed},jsxStuckDeleteFailed:{...WK.jsxStuckDeleteFailed}}}const JK=/^(`{3,}|~{3,})/gm;function YK(e){let t=[],n=null;for(let r of e.matchAll(JK)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function XK(e,t){return t.some(([t,n])=>e>=t&&e<n)}const ZK=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function QK(e){let t=YK(e),n=[];for(let r of e.matchAll(ZK))XK(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
325
|
-
`)}\n\n`:``}function
|
|
324
|
+
`)}case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}const AW=`__system__`,jW=1,MW=`__config__/project`,NW=`__user__/config.yml`,PW=`__local__/project`,FW=`__config__/okignore`,IW=Object.freeze([MW,PW,NW,FW]),LW=`Ov23liqlSd0V1MwR6rhI`,RW=[`incoming`,`outgoing`,`both`];function zW(e){return RW.includes(e)}const BW=`localhost`,VW=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],HW=[`video/mp4`,`video/webm`,`video/ogg`],UW=[`audio/mpeg`,`audio/wav`,`audio/ogg`],WW=[`application/pdf`],GW=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),KW=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),qW=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),JW=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),YW=new Set(`exe.bat.cmd.ps1.com.msi.vbs.js.jse.wsf.wsh.hta.sh.command.csh.ksh.bash.zsh.fish.desktop.action.workflow.html.htm.svg.xml.mhtml.svgz.dmg.pkg.mpkg.scpt.applescript.terminal.prefpane.webloc.inetloc.fileloc.jar.appimage.deb.rpm.msix.appx.ipa.apk.pif.scr.lnk.url`.split(`.`)),XW=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.csv.txt.rtf.json`.split(`.`)),ZW=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus`.split(`.`)),QW=`same-dir`,$W=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),eG=[`png`,`jpg`,`jpeg`],tG=[`mp4`];function nG(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}nG(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,eG,GW),nG(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,tG,KW),nG(`FILE_ATTACHMENT_EXTENSIONS`,[...JW],$W);const rG=new Set(eG),iG=new Set(tG);nG(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...eG,...tG])],ZW);function aG(e){let t=e.toLowerCase().replace(/^\./,``);return rG.has(t)?`image`:iG.has(t)?`video`:null}const oG=Ub.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`}}}}),sG=nx.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[bb({find:Zb,type:this.type,getAttributes:{sourceDelimiter:`*`}}),bb({find:$b,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),cG=Xb.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[bb({find:Gb,type:this.type,getAttributes:{sourceDelimiter:`**`}}),bb({find:qb,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),lG=$y.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),uG=ix.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),dG=ox.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1}}}}),fG=Lb.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),pG=Lb.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),mG=Lb.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),hG=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],gG=hG.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${gG}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);const _G=new Set(hG.map(e=>`${e}:`));function vG(e){try{let t=new URL(e,`https://placeholder.invalid`);return _G.has(t.protocol.toLowerCase())}catch{return!1}}const yG=vx.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:vG,validate:vG,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),bG=Lb.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs,i=r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},i]}});function xG(e){return e.type.name===`list`&&!e.attrs.ordered}function SG(e){return e.type.name===`list`&&!!e.attrs.ordered}function CG(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function wG(e,t,n,r,i,a,o){let s=Pv(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?jf(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o??{}})}}),t(n),!0}return Of(n,a)(e,void 0)?t?Of(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}const TG=Lb.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Wv(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:wG(e,t,n,r,e=>xG(e)&&!CG(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:wG(e,t,n,r,e=>SG(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:wG(e,t,n,r,e=>xG(e)&&CG(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Cb({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Cb({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new Gy({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Uu(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),EG=Lb.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Wv(t),0]:[`li`,Wv(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Wv(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),DG=TG,OG=EG,kG=Lb.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),AG=Lb.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),jG=jC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),MG=FC.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1}}}}),NG=Lb.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),PG=$y.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),FG=Lb.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),IG=Lb.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),LG=Lb.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs,i=t||n;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:i}]}}),RG=$y.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function zG(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r?!0:BG(n)===r}function BG(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const VG=OC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null}}}}),HG=pC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),UG=mC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),WG=Lb.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),GG=/^(?:---|—-|___\s|\*\*\*\s)$/;function KG(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const qG=RC.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[xb({find:GG,type:this.type,getAttributes:e=>({sourceRaw:KG(e)})})]}});function JG(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function YG(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const XG=Lb.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:JG(e.getAttribute(`data-alias`)),anchor:JG(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:JG(e.getAttribute(`data-alias`)),anchor:JG(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=JG(e.attrs.alias),i=JG(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},YG({target:n,alias:r,anchor:i})]}});function ZG(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function QG(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const $G=[pG,AG,mG,kG,XG,Lb.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:JG(e.getAttribute(`data-alias`)),anchor:JG(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=JG(e.attrs.alias),i=JG(e.attrs.anchor),a=JG(e.attrs.resolvedSrc),o=ZG(n);if(GW.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},QG({target:n,alias:r,anchor:i})]}}),WG,DG,OG,sG,cG,MG,oG,jG,dG,qG,yG,fG,bG,uG,lG,RG,fT.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),VG.configure({resizable:!0}),hC,UG,HG,Cx.configure({inline:!0}),LG,xx,PG,NG,IG,FG],eK=/^[a-zA-Z][\w/-]*$/;function tK(e){return e.startsWith(`#`)?e.slice(1):e}function nK(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function rK(e){if(!e||e.trim()===``)return[];let{map:t}=tW(e);if(!t)return[];let n=nK(t.tags),r=[];for(let e of n){let t=tK(e);eK.test(t)?r.push(t):console.warn(`[frontmatter-tags] dropping invalid tag entry: ${JSON.stringify(e)}`)}return r}const iK=A().refine(e=>!e.includes(`..`)&&!e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`\\`),{message:`docName contains unsafe path characters`}).optional(),aK={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},oK=A().optional(),sK=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,cK=N({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:Vs(A().min(1),A().min(1)).optional()}).loose(),lK=N({id:A().min(1),display_name:A().min(1),display_email:A(),source:Us([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),uK=Us(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed`.split(`.`));function dK(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const fK=N({type:uK,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(sK,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose(),pK=N({parentDocName:A().min(1),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose(),mK=N({src:A().min(1),path:A().min(1).optional(),deduped:Ss().optional()}).loose(),hK=N({url:A().min(1),dir:A().min(1)}).loose(),gK=N({type:Gs(`error`),problem:fK}).loose();function _K(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}let o=vK(e,t);r>=0?n[r]=o:n.push(o)}return n}function vK(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function yK(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:_K(t,r),children:n.all(t),data:{}}}const bK=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)"},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)"},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],xK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:VW,autoFocus:!0},{name:`alt`,type:`string`,required:!1,defaultValue:``,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`}],SK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:HW,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`}],CK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:UW,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],wK=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)"},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],TK=[bK[0],bK[1],bK[4],bK[5],bK[6]],EK=[xK[0],xK[1],xK[7]],DK=[wK[0],wK[1],wK[4],wK[5]],OK=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],kK=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],AK=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],jK=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],MK=[jK[0]],NK=[jK[0]],PK=[{name:`chart`,type:`string`,required:!0,autoFocus:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#system-arch-diagram`)"},{name:`theme`,type:`enum`,enumValues:[`default`,`dark`,`forest`,`neutral`],defaultValue:`default`,required:!1,advanced:!0,description:"Mermaid theme — default ships only `default` styling; alternates land alongside theme-switching infrastructure"}],FK=[PK[0]],IK=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],LK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],RK=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:WW,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}];function zK(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function BK(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function VK(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}const HK=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:bK,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>yK(`Callout`,e,t,bK)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:xK,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>yK(`img`,e,t,xK)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:SK,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>yK(`video`,e,t,SK)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:CK,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>yK(`audio`,e,t,CK)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:RK,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>yK(`Pdf`,e,t,RK)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:LK,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>yK(`File`,e,t,LK)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:wK,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],serialize:(e,t)=>yK(`Accordion`,e,t,wK)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:jK,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>yK(`Math`,e,t,jK)},{name:`Mermaid`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:PK,icon:`Workflow`,category:`content`,displayName:`Mermaid`,description:`Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie)`,searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:(e,t)=>yK(`Mermaid`,e,t,PK)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:TK,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:EK,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (``) — read-only compat. Preserves `` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:OK,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:VK},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:kK,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:VK},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:AK,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:VK},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:IK,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:VK},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:DK,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${zK(n.name)}"`:``,a=n?.id?` id="${zK(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${BK(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:MK,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:NK,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})},{name:`MermaidFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:FK,icon:`Workflow`,category:`content`,displayName:`Mermaid Fence`,description:"Mermaid diagram via ` ```mermaid ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Mermaid block for the full prop surface (id, theme).",rendersAs:`Mermaid`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})}],UK={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>yK(e.attrs.componentName||`*`,e,t)};function WK(){let e=new Map;e.set(`*`,UK);for(let t of HK)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}function GK(){let e=globalThis;return e.__okYpsCounters||={block:0,inline:0},e.__okYpsCounters}const KK={parseFallback:{blockLevel:0,wholeDoc:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{}};function qK(){KK.parseFallback.blockLevel++}function JK(){KK.parseFallback.wholeDoc++}function YK(){let e=GK();return{parseFallback:{...KK.parseFallback},ypsMismatch:{block:e.block,inline:e.inline},jsxRenderFailure:{...KK.jsxRenderFailure},jsxAutoConvertFailed:{...KK.jsxAutoConvertFailed},jsxAutoConvertSucceeded:{...KK.jsxAutoConvertSucceeded},jsxPropDropped:{...KK.jsxPropDropped},jsxMoveFailed:{...KK.jsxMoveFailed},jsxStuckCopyFailed:{...KK.jsxStuckCopyFailed},jsxStuckDeleteFailed:{...KK.jsxStuckDeleteFailed}}}const XK=/^(`{3,}|~{3,})/gm;function ZK(e){let t=[],n=null;for(let r of e.matchAll(XK)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function QK(e,t){return t.some(([t,n])=>e>=t&&e<n)}const $K=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function eq(e){let t=ZK(e),n=[];for(let r of e.matchAll($K))QK(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
325
|
+
`)}\n\n`:``}function tq(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return iq(e,t.parse,0,n)}function nq(e){return e.calls>=1e3?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=500}function rq(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,500),stack:e.stack?.split(`
|
|
326
326
|
`).slice(0,4).join(`
|
|
327
|
-
`)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,500)}}function
|
|
327
|
+
`)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,500)}}function iq(e,t,n,r){if(n>20)return JK(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),pq(e);if(r){if(nq(r))return JK(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),pq(e);r.calls+=1}try{return t(e)}catch(i){let a=aq(i),o=rq(i);if(a===void 0){if(n===0){let n=fq(e,t,i,r);if(n)return n}return JK(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),pq(e)}qK(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=uq(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?iq(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?iq(eq(s)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:c?[{type:`text`,text:c}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){JK();let n=rq(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),pq(e)}}}function aq(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function oq(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function sq(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}function cq(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(QK(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+32768),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function lq(e){let t=cq(e,ZK(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=sq(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=sq(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function uq(e,t){let n=lq(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:oq(e,t)??0,end:sq(e,t)??e.length}}function dq(e){let t=ZK(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;QK(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function fq(e,t,n,r){let i=dq(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&nq(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=eq(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){qK();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function pq(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}const mq=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,hq=/<!--[\s\S]*?-->/g,gq=/<\/([a-z][a-z0-9]*)\s*>/g,_q=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,vq=new Set([`img`,`video`,`audio`]),yq=new Set([`mark`]),bq=/<\/([A-Z][A-Za-z0-9.]*)>/g;function xq(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function Sq(e){let t=new Map,n=new RegExp(bq.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function Cq(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function wq(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function Tq(e){let t=e;t=t.replace(hq,e=>e.replace(/</g,``).replace(/>/g,``)),t=t.replace(mq,(e,t)=>`${t.replaceAll(`:`,``).replaceAll(`@`,``)}`),t=t.replace(gq,(e,t)=>yq.has(t)?e:e.replace(/</g,``).replace(/>/g,``)),t=t.replace(_q,(e,t)=>vq.has(t)&&e.endsWith(`/>`)||yq.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,``).replace(/>/g,``):e),t=t.replace(/<>/g,``);let n=Sq(t),r=Cq(t),i=wq(t);t=t.replace(/</g,(e,a)=>{let o=t.slice(a,a+256);if(o[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(o)?e:``;let s=/^<([a-z][a-z0-9]*)([^>]*)\/>/.exec(o);if(s&&vq.has(s[1]))return e;let c=/^<([a-z][a-z0-9]*)([\s/>])/.exec(o);if(c&&yq.has(c[1])){let n=c[1];return o.startsWith(`<${n}/>`)||t.indexOf(`</${n}>`,a)!==-1?e:``}let l=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(o);if(!l)return``;let u=l[1],d=xq(r,a),f=xq(i,d<r.length?r[d]:t.length);if(f>0){let n=i[f-1];if(n>a){let r=a+l[0].length-1;if(!t.slice(r,n).replace(/"[^"]*"|'[^']*'/g,``).includes(`/`))return e}}let p=n.get(u);return p&&xq(p,a)<p.length?e:``});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
|
|
328
328
|
`){let i=t[r+1];if(i===`
|
|
329
329
|
`||i===`>`){if(e.push(...n),n.length=0,i===`
|
|
330
330
|
`)for(;t[r+1]===`
|
|
331
|
-
`;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=[...t];for(let t of e)n[t]=``;t=n.join(``)}}return t}function
|
|
332
|
-
`,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(jq);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function Nq(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(Aq);return n?n[1].toLowerCase():null}function Pq(e){return Oq[e.toLowerCase()]??null}function Fq(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&Iq(o[0],s)?o.slice(1):o,position:e.position}}function Iq(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function Lq(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${kq}-title`)}function Rq(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;KA(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=Nq(e);if(!i)return;let a=Pq(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=Mq(n,e.position.start.offset),s&&(o=s.title,a||=Pq(s.rawType)));let c=a??`note`,l=s&&Dq.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=Mq(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!Lq(e.children[0]))return;let f=Fq(e,c,o,l,d);r.children[t]=f})}}const zq={markers:`*`,classPrefix:kq,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`})},Bq=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,Vq=/<!--([\s\S]*?)-->/g;function Hq(){return e=>{Wq(e),KA(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`%%`)===-1&&r.indexOf(`<!--`)===-1)return;let i=Uq(r);if(i.length===0)return;let a=[],o=0;for(let e of i){e.start>o&&a.push({type:`text`,value:r.slice(o,e.start)});let t={type:`comment`,children:[{type:`text`,value:e.body}],data:{sourceForm:e.sourceForm}};a.push(t),o=e.end}return o<r.length&&a.push({type:`text`,value:r.slice(o)}),n.children.splice(t,1,...a),[UA,t+a.length]})}}function Uq(e){let t=[];Bq.lastIndex=0;let n;for(;(n=Bq.exec(e))!==null;)n[1].trim().length!==0&&t.push({start:n.index,end:n.index+n[0].length,body:n[1],sourceForm:`percent`});Vq.lastIndex=0;let r;for(;(r=Vq.exec(e))!==null;){let e=r[1].trim();e!==``&&t.push({start:r.index,end:r.index+r[0].length,body:e,sourceForm:`html`})}t.sort((e,t)=>e.start-t.start);let i=[],a=-1;for(let e of t)e.start<a||(i.push(e),a=e.end);return i}function Wq(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(e.type===`paragraph`){let r=Gq(e);if(r!==null){let e=Kq(r);if(e!==null){let r={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:e}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};t.splice(n,1,r),n+=1;continue}let i=qq(r);if(i!==null){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:i}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}}let i=Jq(e);if(i!==null){let e={type:`commentBlock`,children:[i],data:{sourceForm:`html`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}let a=Yq(e);if(a!==null){let e={type:`commentBlock`,children:[a],data:{sourceForm:`percent`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}}if(e.type===`paragraph`&&Zq(e)){let e=n+1;for(;e<t.length;){let n=t[e];if(n.type===`paragraph`&&Zq(n))break;e+=1}if(e<t.length&&e>n+1){let r={type:`commentBlock`,children:t.slice(n+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};t.splice(n,e-n+1,r),n+=1;continue}}n+=1}}function Gq(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function Kq(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function qq(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function Jq(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(Xq(r,`<!--`)>1||Xq(r,`-->`)>0)return null}else if(t===e.children.length-1){if(Xq(r,`<!--`)>0||Xq(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function Yq(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function Xq(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function Zq(e){let t=Gq(e);return t===null?!1:t.trim()===`%%`}const Qq=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,$q=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,eJ=/^\s*<\/details>\s*$/;function tJ(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function nJ(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function rJ(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function iJ(e){return e.children[0].value??``}function aJ(e){if(!rJ(e))return null;let t=iJ(e).match(Qq);if(!t)return null;let{defaultOpen:n,name:r,id:i}=tJ(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:nJ({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function oJ(e,t){let n=e[t];if(!rJ(n))return null;let r=iJ(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match($q);if(!i)return null;let{defaultOpen:a,name:o,id:s}=tJ(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!rJ(t))continue;let r=iJ(t);if(eJ.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function sJ(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(rJ(e)){let r=aJ(e);if(r){t[n]=r,n++;continue}let i=oJ(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:nJ(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function cJ(){return e=>{KA(e,e=>{`children`in e&&Array.isArray(e.children)&&sJ(e)})}}const lJ=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function uJ(){return e=>{KA(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`==`)===-1)return;lJ.lastIndex=0;let i=[],a;for(;(a=lJ.exec(r))!==null;)i.push(a);if(i.length===0)return;let o=[],s=0;for(let e of i){let t=e.index,n=t+e[0].length;if(t>s){let e={type:`text`,value:r.slice(s,t)};o.push(e)}let i={type:`mark`,children:[{type:`text`,value:e[1]}]};o.push(i),s=n}if(s<r.length){let e={type:`text`,value:r.slice(s)};o.push(e)}return n.children.splice(t,1,...o),[UA,t+o.length]}),KA(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function dJ(){return e=>{KA(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=fJ(r,e);n.children[t]=i})}}function fJ(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];e.alt&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}const pJ=/^( {4}|\t)/;function mJ(e){let t=e.split(`
|
|
333
|
-
`),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!
|
|
331
|
+
`;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=[...t];for(let t of e)n[t]=``;t=n.join(``)}}return t}function Eq(e){return e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)}function Dq(){return e=>{KA(e,e=>{let t=e;typeof t.value==`string`&&Eq(t.value)&&(t.value=Oq(t.value)),typeof t.url==`string`&&Eq(t.url)&&(t.url=Oq(t.url)),typeof t.title==`string`&&Eq(t.title)&&(t.title=Oq(t.title)),typeof t.alt==`string`&&Eq(t.alt)&&(t.alt=Oq(t.alt))})}}function Oq(e){return e.replaceAll(``,`<`).replaceAll(``,`>`).replaceAll(``,`:`).replaceAll(``,`@`).replaceAll(``,`{`)}const kq=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function Aq(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function jq(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||Aq(e,r)%2==1?t:n(t))}function Mq(e){return jq(e,kq,e=>`${e.slice(1,-1)}`)}const Nq=RegExp(`([^]+)`,`g`);function Pq(e){if(!e.includes(``))return{value:e,spans:[]};let t=[],n=``,r=0;Nq.lastIndex=0;let i=Nq.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=Nq.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function Fq(){return e=>{KA(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(``)){let{value:n,spans:r}=Pq(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(``)&&(t[e]=Pq(n).value)}})}}const Iq=/\\</g;function Lq(e){return jq(e,Iq,e=>`${e.slice(1)}`)}function Rq(){return e=>{KA(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(``)&&(t.value=t.value.split(``).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(``)&&(t[e]=n.split(``).join(``))}})}}const zq=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),Bq={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},Vq=`ok-alert`,Hq=RegExp(`(?:^|\\s)${Vq}-(\\w+)(?:\\s|$)`),Uq=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function Wq(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
|
|
332
|
+
`,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(Uq);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function Gq(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(Hq);return n?n[1].toLowerCase():null}function Kq(e){return Bq[e.toLowerCase()]??null}function qq(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&Jq(o[0],s)?o.slice(1):o,position:e.position}}function Jq(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function Yq(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${Vq}-title`)}function Xq(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;KA(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=Gq(e);if(!i)return;let a=Kq(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=Wq(n,e.position.start.offset),s&&(o=s.title,a||=Kq(s.rawType)));let c=a??`note`,l=s&&zq.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=Wq(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!Yq(e.children[0]))return;let f=qq(e,c,o,l,d);r.children[t]=f})}}const Zq={markers:`*`,classPrefix:Vq,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`})},Qq=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,$q=/<!--([\s\S]*?)-->/g;function eJ(){return e=>{nJ(e),KA(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`%%`)===-1&&r.indexOf(`<!--`)===-1)return;let i=tJ(r);if(i.length===0)return;let a=[],o=0;for(let e of i){e.start>o&&a.push({type:`text`,value:r.slice(o,e.start)});let t={type:`comment`,children:[{type:`text`,value:e.body}],data:{sourceForm:e.sourceForm}};a.push(t),o=e.end}return o<r.length&&a.push({type:`text`,value:r.slice(o)}),n.children.splice(t,1,...a),[UA,t+a.length]})}}function tJ(e){let t=[];Qq.lastIndex=0;let n;for(;(n=Qq.exec(e))!==null;)n[1].trim().length!==0&&t.push({start:n.index,end:n.index+n[0].length,body:n[1],sourceForm:`percent`});$q.lastIndex=0;let r;for(;(r=$q.exec(e))!==null;){let e=r[1].trim();e!==``&&t.push({start:r.index,end:r.index+r[0].length,body:e,sourceForm:`html`})}t.sort((e,t)=>e.start-t.start);let i=[],a=-1;for(let e of t)e.start<a||(i.push(e),a=e.end);return i}function nJ(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(e.type===`paragraph`){let r=rJ(e);if(r!==null){let e=iJ(r);if(e!==null){let r={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:e}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};t.splice(n,1,r),n+=1;continue}let i=aJ(r);if(i!==null){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:i}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}}let i=oJ(e);if(i!==null){let e={type:`commentBlock`,children:[i],data:{sourceForm:`html`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}let a=sJ(e);if(a!==null){let e={type:`commentBlock`,children:[a],data:{sourceForm:`percent`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}}if(e.type===`paragraph`&&lJ(e)){let e=n+1;for(;e<t.length;){let n=t[e];if(n.type===`paragraph`&&lJ(n))break;e+=1}if(e<t.length&&e>n+1){let r={type:`commentBlock`,children:t.slice(n+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};t.splice(n,e-n+1,r),n+=1;continue}}n+=1}}function rJ(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function iJ(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function aJ(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function oJ(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(cJ(r,`<!--`)>1||cJ(r,`-->`)>0)return null}else if(t===e.children.length-1){if(cJ(r,`<!--`)>0||cJ(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function sJ(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function cJ(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function lJ(e){let t=rJ(e);return t===null?!1:t.trim()===`%%`}const uJ=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,dJ=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,fJ=/^\s*<\/details>\s*$/;function pJ(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function mJ(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function hJ(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function gJ(e){return e.children[0].value??``}function _J(e){if(!hJ(e))return null;let t=gJ(e).match(uJ);if(!t)return null;let{defaultOpen:n,name:r,id:i}=pJ(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:mJ({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function vJ(e,t){let n=e[t];if(!hJ(n))return null;let r=gJ(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(dJ);if(!i)return null;let{defaultOpen:a,name:o,id:s}=pJ(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!hJ(t))continue;let r=gJ(t);if(fJ.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function yJ(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(hJ(e)){let r=_J(e);if(r){t[n]=r,n++;continue}let i=vJ(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:mJ(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function bJ(){return e=>{KA(e,e=>{`children`in e&&Array.isArray(e.children)&&yJ(e)})}}const xJ=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function SJ(){return e=>{KA(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`==`)===-1)return;xJ.lastIndex=0;let i=[],a;for(;(a=xJ.exec(r))!==null;)i.push(a);if(i.length===0)return;let o=[],s=0;for(let e of i){let t=e.index,n=t+e[0].length;if(t>s){let e={type:`text`,value:r.slice(s,t)};o.push(e)}let i={type:`mark`,children:[{type:`text`,value:e[1]}]};o.push(i),s=n}if(s<r.length){let e={type:`text`,value:r.slice(s)};o.push(e)}return n.children.splice(t,1,...o),[UA,t+o.length]}),KA(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function CJ(){return e=>{KA(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=wJ(r,e);n.children[t]=i})}}function wJ(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];e.alt&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}const TJ=/^( {4}|\t)/;function EJ(e){let t=e.split(`
|
|
333
|
+
`),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!TJ.test(e)))return!1;return n}function DJ(e){return e.split(`
|
|
334
334
|
`).map(e=>e.length===0?e:e.startsWith(` `)?e.slice(4):e.startsWith(` `)?e.slice(1):e).join(`
|
|
335
|
-
`)}function
|
|
336
|
-
`;)a--;if(a===r)return null;let o=t.slice(a,r);if(!
|
|
337
|
-
`),s=/^-{3,}\s*$/,c=o.filter(e=>s.test(e));if(c.length===0)return;let l=c.map(e=>({type:`thematicBreak`,data:{sourceRaw:e.replace(/\s+$/,``)}}));if(l.length>0){let e=c[0].length;l[0].position={start:{line:1,column:1,offset:0},end:{line:1,column:e+1,offset:e}}}e.children.splice(0,1,...l)}const
|
|
335
|
+
`)}function OJ(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
|
|
336
|
+
`;)a--;if(a===r)return null;let o=t.slice(a,r);if(!TJ.test(o))return null;let s=t.slice(a,i);if(!EJ(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:DJ(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}const kJ=function(){return(e,t)=>{let n=String(t.value??``);n&&KA(e,`paragraph`,(e,t,r)=>{if(!r||r.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=OJ(e,n);a&&(r.children[t]=a)})}};function AJ(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function jJ(){return e=>{KA(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=AJ(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),KA(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=AJ(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}const MJ=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function NJ(e){let t=[],n=!1;for(let r of e.children){if(r.type!==`text`){t.push(r);continue}let e=r.value;MJ.lastIndex=0;let i=[],a=0;for(;;){let t=MJ.exec(e);if(t===null)break;let r=t[0],o=t[1],s=t.index;s>a&&i.push({type:`text`,value:e.slice(a,s)});let c={type:`link`,url:o,title:null,children:[{type:`text`,value:o}],data:{sourceStyle:`autolink`}};i.push(c),a=s+r.length,n=!0}i.length===0?t.push(r):(a<e.length&&i.push({type:`text`,value:e.slice(a)}),t.push(...i))}n&&(e.children=t)}function PJ(e,t){if(e.children.length===0)return;let n=e.children[0];if(n.type!==`yaml`||(n.value??``).trim()!==``)return;let r=n.position?.start?.offset;if(r!==0)return;let i=n.position?.end?.offset;if(typeof i!=`number`)return;let a=typeof t.value==`string`?t.value:``;if(!a)return;let o=a.slice(r,i).split(`
|
|
337
|
+
`),s=/^-{3,}\s*$/,c=o.filter(e=>s.test(e));if(c.length===0)return;let l=c.map(e=>({type:`thematicBreak`,data:{sourceRaw:e.replace(/\s+$/,``)}}));if(l.length>0){let e=c[0].length;l[0].position={start:{line:1,column:1,offset:0},end:{line:1,column:e+1,offset:e}}}e.children.splice(0,1,...l)}const FJ=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function IJ(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function LJ(e,t,n=!1){if(!t)return;let r=e.position;if(!r||typeof r.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let i=r.start.offset,a=r.end?.offset??i;if(i<0||a>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${i} end=${a} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(i,a),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&FJ.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[i];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(i,i+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[i],r=t.slice(i,a);if(n===`#`){e.data.sourceStyle=`atx`;let t=/^.*?[ \t](#+)[ \t]*$/.exec(r);t&&(e.data.sourceTrailingHashes=t[1].length)}else{let t=/\n(=+)[ \t]*$/.exec(r),n=/\n(-+)[ \t]*$/.exec(r),i=t??n;i?(e.data.sourceStyle=`setext`,e.data.sourceUnderlineLength=i[1].length):e.data.sourceStyle=`atx`}break}case`blockquote`:{let n=i;for(;n>0&&t[n-1]!==`
|
|
338
338
|
`;)n--;let r=!1;for(let e=n;e<i;e++)if(t[e]===`>`){r=!0;break}let o=t.slice(i,a).split(`
|
|
339
339
|
`),s=[];for(let e=0;e<o.length;e++){let t=o[e];if(t.length===0)continue;if(r&&e>0)break;let n=t.replace(/^ {1,3}/,``);if(n[0]!==`>`||n.slice(1).trimEnd()===``)continue;let i=n[1];i===` `||i===` `?s.push(`single`):s.push(`none`)}s.length>0&&(e.data.sourceMarkerSpacings=s);break}case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`code`:{let n=t[i];if(n==="`"||n===`~`){e.data.sourceStyle=`fenced`,e.data.sourceFenceChar=n;let r=0;for(;i+r<t.length&&t[i+r]===n;)r++;r>=3&&(e.data.sourceFenceLength=r)}else e.data.sourceStyle=`indented`;break}case`inlineCode`:{let n=t[i];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;i+r<t.length&&t[i+r]===n;)r++;r>=1&&(e.data.sourceFenceLength=r)}break}case`thematicBreak`:e.data.sourceRaw=t.slice(i,a);break;case`table`:{let n=t.slice(i,a),r=n.indexOf(`
|
|
340
340
|
`);if(r===-1)break;let o=n.slice(r+1),s=o.indexOf(`
|
|
341
|
-
`),c=(s===-1?o:o.slice(0,s)).trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),l=[];for(let e of c){let t=e.match(/-/g);l.push(t?t.length:0)}l.length>0&&l.some(e=>e>0)&&(e.data.sourceDashCounts=l);
|
|
341
|
+
`),c=(s===-1?o:o.slice(0,s)).trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),l=[];for(let e of c){let t=e.match(/-/g);l.push(t?t.length:0)}l.length>0&&l.some(e=>e>0)&&(e.data.sourceDashCounts=l);for(let n of e.children??[]){if(n.type!==`tableRow`||!n.position)continue;let e=n.position.start.offset,r=n.position.end.offset;if(typeof e!=`number`||typeof r!=`number`)continue;let i=t.slice(e,r),a=i.indexOf(`
|
|
342
|
+
`);a!==-1&&(i=i.slice(0,a));let o=IJ(i);o.length>0&&o[0]===``&&i.startsWith(`|`)&&o.shift(),o.length>0&&o[o.length-1]===``&&i.endsWith(`|`)&&o.pop();let s=n.children??[],c=Math.min(s.length,o.length);for(let e=0;e<c;e++){let t=s[e];if(t.type!==`tableCell`)continue;let n=o[e],r=0;for(;r<n.length&&n[r]===` `;)r++;let i=0;for(;i<n.length-r&&n[n.length-1-i]===` `;)i++;t.data||={},t.data.sourcePadding={left:r,right:i}}}break}case`link`:case`linkReference`:if(`children`in e&&e.children.length===0&&(e.data.sourceRaw=t.slice(i,a)),e.type===`link`){let n=t[i];if(n!==`[`&&n!==`<`&&!e.title)e.data.sourceStyle=`gfm-autolink`;else if(n===`[`){let n=t.slice(i,a),r=n.lastIndexOf(`](`);if(r!==-1){let t=r+2;for(;t<n.length&&(n[t]===` `||n[t]===` `);)t++;if(n[t]===`<`&&(e.data.sourceUrlForm=`angle-bracketed`),e.title!==void 0&&e.title!==null&&n[n.length-1]===`)`){let t=n.length-2;for(;t>r+1&&(n[t]===` `||n[t]===` `||n[t]===`
|
|
342
343
|
`);)t--;n[t]===`"`?e.data.sourceTitleMarker=`double`:n[t]===`'`?e.data.sourceTitleMarker=`single`:n[t]===`)`&&(e.data.sourceTitleMarker=`paren`)}}}}break;case`definition`:{let n=t.slice(i,a);if(e.data.sourceLayout=n.includes(`
|
|
343
|
-
`)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(i,a);break;case`break`:t.slice(i,a).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}function TJ(){return RegExp(`(^|\\s)#([a-zA-Z][\\w/-]*)`,`g`)}const EJ=TJ();function DJ(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function OJ(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;EJ.lastIndex=0;let o=[],s=0;for(;;){let n=EJ.exec(e);if(n===null)break;let i=n[1]??``,c=n[2]??``,l=n.index+i.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=l&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===l){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&DJ(t,i))continue}l>s&&o.push({type:`text`,value:e.slice(s,l)});let u={type:`tag`,value:c};o.push(u),s=l+1+c.length,r=!0}o.length===0?n.push(i):(s<e.length&&o.push({type:`text`,value:e.slice(s)}),n.push(...o))}r&&(e.children=n)}const kJ=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function AJ(e,t){let n=e.position?.start?.offset??0,r=e.position?.end?.offset??0,i=r>n?t.slice(n,r):``;return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:i||(e.type??`unknown`),position:e.position}}function jJ(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;SJ(e,t);let r=typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`;KA(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!kJ.has(e.type)){let r=AJ(e,n);return i.children[t]=r,UA}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(xJ(t),OJ(t,n))}wJ(e,n,r)})}}function MJ(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function NJ(){return e=>{KA(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=MJ(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}const PJ=(e,t)=>{let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},FJ=sB(),IJ=Tz(),LJ=Ez();function RJ(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===FJ)||t.push(FJ);let n=e.fromMarkdownExtensions;n.some(e=>e===IJ)||n.push(IJ);let r=e.toMarkdownExtensions;r.some(e=>e===LJ)||r.push(LJ)}const zJ=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function BJ(){return e=>{KA(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`$`)===-1)return;zJ.lastIndex=0;let i=[],a;for(;(a=zJ.exec(r))!==null;)i.push(a);if(i.length===0)return;let o=[],s=0;for(let e of i){let t=e.index,n=t+e[0].length;if(t>s){let e={type:`text`,value:r.slice(s,t)};o.push(e)}let i={type:`inlineMath`,value:e[1]};o.push(i),s=n}if(s<r.length){let e={type:`text`,value:r.slice(s)};o.push(e)}return n.children.splice(t,1,...o),[UA,t+o.length]})}}const VJ={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function HJ(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===VJ)||e.toMarkdownExtensions.push(VJ)}const UJ={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===91?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===91?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===35?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===124?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===124?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},WJ={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===33?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===91?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===91?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===35?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===124?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===124?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function GJ(){return{text:{91:UJ,33:WJ}}}function KJ(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function qJ(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function JJ(e){return e.stack[e.stack.length-1]}function YJ(e){let t=JJ(this);t.data.target=this.sliceSerialize(e).trim()}function XJ(e){let t=JJ(this),n=this.sliceSerialize(e).trim();t.data.anchor=n.length?n:null}function ZJ(e){let t=JJ(this),n=this.sliceSerialize(e).trim();t.data.alias=n.length?n:null}function QJ(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function $J(e){QJ(JJ(this)),this.exit(e)}function eY(e){QJ(JJ(this)),this.exit(e)}const tY={enter:{wikiLink:KJ,wikiLinkEmbed:qJ},exit:{wikiLinkTarget:YJ,wikiLinkAnchor:XJ,wikiLinkAlias:ZJ,wikiLink:$J,wikiLinkEmbed:eY}},nY={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},rY=GJ();function iY(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===rY)||e.micromarkExtensions.push(rY),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===tY)||e.fromMarkdownExtensions.push(tY),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===nY)||e.toMarkdownExtensions.push(nY)}function aY(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}const oY=[{name:`remark-parse`,plugin:zR},{name:`remark-frontmatter`,plugin:RL,options:[`yaml`]},{name:`remark-mdx-agnostic`,plugin:RJ},{name:`remark-gfm`,plugin:PI},{name:`remark-math`,plugin:eR,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:iY},{name:`remark-github-alerts`,plugin:HL,options:zq},{name:`callout-transformer`,plugin:Rq},{name:`restore-from-mdx`,plugin:Tq},{name:`details-accordion-promoter`,plugin:cJ},{name:`image-promoter`,plugin:dJ},{name:`indented-code-promoter`,plugin:_J},{name:`math-promoter`,plugin:yJ},{name:`single-dollar-math-promoter`,plugin:BJ},{name:`highlight-promoter`,plugin:uJ},{name:`mermaid-promoter`,plugin:NJ},{name:`comment-promoter`,plugin:Hq},{name:`merged-post-parse-walker`,plugin:jJ},{name:`ensure-non-empty-doc`,plugin:()=>aY}];function sY(e){let t=WI();for(let e of oY)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(mL,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function cY(e){let t=WI().use(RL,[`yaml`]).use(PI,{tablePipeAlign:!1}).use(eR,{singleDollarTextMath:!1}).use(RJ).use(iY).use(HJ).use(FI,{bullet:`-`,fences:!0,rule:`-`,join:[PJ],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function lY(e,t){let n=new _A(Cq(e)),r=t.parse(n);n.value=e;let i=t.runSync(r,n);return t.stringify(i)}function uY(e,t){let n=new _A(Cq(e)),r=t.parse(n);return n.value=e,t.runSync(r,n)}function dY(e,t,n){let r=gL(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});return String(t.stringify(r))}const fY={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&zG(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=_Y(n,t.slice(o,e),r)),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=_Y(n,t.slice(o),r)),a}return _Y(n,(e.value??``).replaceAll(`\xA0`,` `),r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:hY(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(mY(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(hY(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
344
|
-
`:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(
|
|
345
|
-
`:` `;l+=s.move(
|
|
344
|
+
`)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(i,a);break;case`break`:t.slice(i,a).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}function RJ(){return RegExp(`(^|\\s)#([a-zA-Z][\\w/-]*)`,`g`)}const zJ=RJ();function BJ(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function VJ(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;zJ.lastIndex=0;let o=[],s=0;for(;;){let n=zJ.exec(e);if(n===null)break;let i=n[1]??``,c=n[2]??``,l=n.index+i.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=l&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===l){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&BJ(t,i))continue}l>s&&o.push({type:`text`,value:e.slice(s,l)});let u={type:`tag`,value:c};o.push(u),s=l+1+c.length,r=!0}o.length===0?n.push(i):(s<e.length&&o.push({type:`text`,value:e.slice(s)}),n.push(...o))}r&&(e.children=n)}const HJ=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function UJ(e,t){let n=e.position?.start?.offset??0,r=e.position?.end?.offset??0,i=r>n?t.slice(n,r):``;return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:i||(e.type??`unknown`),position:e.position}}function WJ(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;PJ(e,t);let r=typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`;KA(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!HJ.has(e.type)){let r=UJ(e,n);return i.children[t]=r,UA}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(NJ(t),VJ(t,n))}if(LJ(e,n,r),e.type===`heading`&&i!==void 0&&typeof t==`number`&&e.data?.sourceStyle===`setext`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function GJ(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function KJ(){return e=>{KA(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=GJ(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function qJ(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}const JJ=(e,t)=>{if(qJ(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},YJ=sB(),XJ=Tz(),ZJ=Ez();function QJ(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===YJ)||t.push(YJ);let n=e.fromMarkdownExtensions;n.some(e=>e===XJ)||n.push(XJ);let r=e.toMarkdownExtensions;r.some(e=>e===ZJ)||r.push(ZJ)}const $J=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function eY(){return e=>{KA(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`$`)===-1)return;$J.lastIndex=0;let i=[],a;for(;(a=$J.exec(r))!==null;)i.push(a);if(i.length===0)return;let o=[],s=0;for(let e of i){let t=e.index,n=t+e[0].length;if(t>s){let e={type:`text`,value:r.slice(s,t)};o.push(e)}let i={type:`inlineMath`,value:e[1]};o.push(i),s=n}if(s<r.length){let e={type:`text`,value:r.slice(s)};o.push(e)}return n.children.splice(t,1,...o),[UA,t+o.length]})}}const tY={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function nY(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===tY)||e.toMarkdownExtensions.push(tY)}const rY={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===91?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===91?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===35?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===124?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===124?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},iY={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===33?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===91?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===91?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===35?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===124?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===124?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function aY(){return{text:{91:rY,33:iY}}}function oY(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function sY(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function cY(e){return e.stack[e.stack.length-1]}function lY(e){let t=cY(this);t.data.target=this.sliceSerialize(e).trim()}function uY(e){let t=cY(this),n=this.sliceSerialize(e).trim();t.data.anchor=n.length?n:null}function dY(e){let t=cY(this),n=this.sliceSerialize(e).trim();t.data.alias=n.length?n:null}function fY(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function pY(e){fY(cY(this)),this.exit(e)}function mY(e){fY(cY(this)),this.exit(e)}const hY={enter:{wikiLink:oY,wikiLinkEmbed:sY},exit:{wikiLinkTarget:lY,wikiLinkAnchor:uY,wikiLinkAlias:dY,wikiLink:pY,wikiLinkEmbed:mY}},gY={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},_Y=aY();function vY(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===_Y)||e.micromarkExtensions.push(_Y),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===hY)||e.fromMarkdownExtensions.push(hY),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===gY)||e.toMarkdownExtensions.push(gY)}function yY(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}const bY=[{name:`remark-parse`,plugin:zR},{name:`remark-frontmatter`,plugin:RL,options:[`yaml`]},{name:`remark-mdx-agnostic`,plugin:QJ},{name:`remark-gfm`,plugin:PI},{name:`remark-math`,plugin:eR,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:vY},{name:`remark-github-alerts`,plugin:HL,options:Zq},{name:`callout-transformer`,plugin:Xq},{name:`restore-from-mdx`,plugin:Dq},{name:`restore-entity-refs`,plugin:Fq},{name:`restore-backslash-escapes`,plugin:Rq},{name:`details-accordion-promoter`,plugin:bJ},{name:`image-promoter`,plugin:CJ},{name:`indented-code-promoter`,plugin:kJ},{name:`math-promoter`,plugin:jJ},{name:`single-dollar-math-promoter`,plugin:eY},{name:`highlight-promoter`,plugin:SJ},{name:`mermaid-promoter`,plugin:KJ},{name:`comment-promoter`,plugin:eJ},{name:`merged-post-parse-walker`,plugin:WJ},{name:`ensure-non-empty-doc`,plugin:()=>yY}];function xY(e){let t=WI();for(let e of bY)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(mL,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function SY(e){let t=WI().use(RL,[`yaml`]).use(PI,{tablePipeAlign:!1}).use(eR,{singleDollarTextMath:!1}).use(QJ).use(vY).use(nY).use(FI,{bullet:`-`,fences:!0,rule:`-`,join:[JJ],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function CY(e,t){let n=new _A(Mq(Tq(Lq(e)))),r=t.parse(n);n.value=e;let i=t.runSync(r,n);return t.stringify(i)}function wY(e,t){let n=new _A(Mq(Tq(Lq(e)))),r=t.parse(n);return n.value=e,t.runSync(r,n)}function TY(e,t,n){let r=gL(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});return String(t.stringify(r))}const EY={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&zG(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=jY(n,t.slice(o,e),r)),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=jY(n,t.slice(o),r)),a}return jY(n,(e.value??``).replaceAll(`\xA0`,` `),r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:kY(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(OY(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(kY(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
345
|
+
`:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(kY(d)),e()}if(e.title){let t=i===`multiline`?`
|
|
346
|
+
`:` `;l+=s.move(OY(e.title,a,t))}return o(),l},thematicBreak(e,t,n){let r=e.data?.sourceRaw;return Array.isArray(n?.indexStack)&&n.indexStack.length===1&&n.indexStack[0]===0&&(!r||/^-[-\s]*-\s*$/.test(r))?`***`:r??`---`},break(e){return e.data?.sourceStyle===`backslash`?`\\
|
|
346
347
|
`:`
|
|
347
348
|
`},code(e){let t=e.value??``;if(e.data?.sourceStyle===`indented`)return t.split(`
|
|
348
349
|
`).map(e=>e.length>0?` ${e}`:e).join(`
|
|
@@ -354,6 +355,6 @@ $2`).split(`
|
|
|
354
355
|
`);l.push(m)}n.bulletCurrent=o,n.bulletLastUsed=s;let f=e.spread?`
|
|
355
356
|
|
|
356
357
|
`:`
|
|
357
|
-
`;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=e.children??[];for(let e of
|
|
358
|
-
`)},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=pY(i.attributes??[]);if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let l=c?`<${s} ${c}>`:`<${s}>`,u=`</${s}>`;return`${l}\n\n${n.containerFlow({type:`root`,children:i.children},r)}\n\n${u}`},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),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=pY(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)=>n?`>`:s?.[c++]===`none`?`>${e}`:`> ${e}`)}};function pY(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`){if(n.value.includes(`"`)){let r=n.value.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);t.push(`${e}={"${r}"}`)}else t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function mY(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function hY(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 gY(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function _Y(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==="`"));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return gY(i)}function vY(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 yY=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=ey(e.extensions),this.handlers=kY(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=AY(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=sY({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=cY({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:fY})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return lY(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?uY(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?$K(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=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})}return dY(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}};const bY=HK();function xY(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 SY(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 CY(e){return e.attrs.sourceDirty||SY(e)}function wY(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 TY(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),Object.keys(n).length===0?e:{...e,data:n}}function EY(e,t){if(e.length===0)return TY({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return TY({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:[EY(n.children,t)]}}return TY({type:`inlineCode`,value:DY(e)},t)}function DY(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=DY(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}const OY=GW;function kY(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=dL(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=dL(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).createAndFill({align:u},l);d&&c.push(d)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null;return n.table.createAndFill({sourceDashCounts:s},o.length>0?o:null)}),n.image&&(i.image=e=>n.image.createAndFill({src:e.url??``,alt:e.alt??null,title:e.title??null}),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){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars;if(!a?.length)return e.text(n.replaceAll(`\xA0`,` `));let o=[],s=0;for(let{offset:t}of a){if(t>s){let r=n.slice(s,t).replaceAll(`\xA0`,` `);r&&o.push(e.text(r))}if(t<n.length){let i=n[t].replaceAll(`\xA0`,` `);o.push(e.text(i,[r.escapeMark.create()])),s=t+1}}if(s<n.length){let t=n.slice(s).replaceAll(`\xA0`,` `);t&&o.push(e.text(t))}return o.length===1?o[0]:o}),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})]));let a=r.strike??r.delete;if(a&&(i.delete=fL(a)),r.highlight&&(i.mark=fL(r.highlight)),r.comment&&(i.comment=fL(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=dL(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=fL(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=fL(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=dL(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??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`},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`})),n.list&&(i.list=dL(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=dL(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),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 t=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,r,i)=>{let a=e.name??``,o=bY.getOrWildcard(a),s=xY(e.attributes,o.props),c=i.all(e).flat();return n.jsxComponent.createAndFill({componentName:a,kind:`element`,attributes:e.attributes,sourceRaw:t(e.data)??``,sourceDirty:!1,props:s},c.length?c:void 0)};let r=(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=i=>{if(i.name===`InlineMath`&&n.mathInline){let e=r(i,`formula`)??``,t=r(i,`id`);return n.mathInline.create({formula:e,id:t??null})}if(i.name===`Tag`&&n.tag){let e=r(i,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let r=t(i.data)??``;return n.jsxInline.createAndFill({},r?[e.text(r)]:null)}return n.jsxComponent.createAndFill({sourceRaw:t(i.data)??``})},i.mdxFlowExpression=e=>{let r=t(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:r,sourceDirty:!1})},i.mdxTextExpression=n=>{let r=t(n.data)??`{${n.value??``}}`;return e.text(r)}}n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??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=YG(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&&OY.has(l)&&n.jsxComponent&&bY.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&&KW.has(l)&&n.jsxComponent&&bY.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&&qW.has(l)&&n.jsxComponent&&bY.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&&JW.has(l)&&n.jsxComponent&&bY.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:vY(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($W.has(l)&&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])}if(r.link){let t=r.link.create({href:o,title:null,linkStyle:`inline`,refLabel:null});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")});let s=t=>{let r=t.value??t.type;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},c=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),e.text(t.value??t.type));return n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``})),i.math||=s,i.inlineMath||=c,n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=c,n.footnoteDefinition&&(i.footnoteDefinition=dL(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}})),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}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function AY(e){let t={},n={},r=e.nodes,i=e.marks;if(r.paragraph&&(t.paragraph=_L(`paragraph`)),r.blockquote&&(t.blockquote=_L(`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}:{}})),r.heading&&(t.heading=_L(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0}}))),r.codeBlock&&(t.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}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=_L(`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}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&wY(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.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?{sourceDashCounts:s}:void 0,l={type:`table`,align:i,children:o};return c&&(l.data=c),l}),r.tableRow&&(t.tableRow=_L(`tableRow`)),r.tableCell&&(t.tableCell=_L(`tableCell`)),r.tableHeader&&(t.tableHeader=_L(`tableCell`)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.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`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[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(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!CY(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:bY.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:bY,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.`)}})}),r.rawMdxFallback&&(t.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}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;return typeof n==`string`&&n.length>0?{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]}:{type:`inlineMath`,value:t}}),r.wikiLink&&(t.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},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.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}]}}),i.emphasis&&(n.emphasis=vL(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=vL(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return EY(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=vL(`delete`)}return i.highlight&&(n.highlight=vL(`mark`)),i.comment&&(n.comment=vL(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=_L(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=_L(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.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??``,n=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,r=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?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}]}}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}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=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}),i.sourceLiteral&&(n.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 zG(t,e.value)&&(e.data=e.data??{},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}const jY=/\p{M}+/gu,MY=/[^\p{L}\p{N}]+/gu,NY=/^-+|-+$/g;function PY(e){return e.trim().normalize(`NFKD`).replace(jY,``).toLowerCase().replace(MY,`-`).replace(NY,``)}function FY(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function IY(e,t){let n=PY(e);return n?FY(n,t):``}const LY=N({docName:nK,summary:iK,content:A().optional(),...rK}).loose(),RY=N({docName:nK,summary:iK,markdown:A().min(1),position:Us([`append`,`prepend`,`replace`]).optional(),...rK}).loose(),zY=N({docName:nK,summary:iK,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...rK}).loose(),BY=N({docName:nK,connectionId:A().min(1),scope:Us([`last`,`session`,`file`]).optional(),...rK}).loose(),VY=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),HY=N({type:Gs(`orphan`),parentCandidates:M(A()),message:A()}).loose(),UY=N({timestamp:A().min(1),summary:VY.optional()}).loose(),WY=N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(HY).optional(),summary:VY.optional()}).loose(),GY=N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:VY.optional()}).loose(),KY=N({docName:A().min(1),scope:Us([`last`,`session`]),undone:Ss()}).loose(),qY=N({docName:A().min(1),content:A()}).loose(),JY=N({documents:M(N({kind:Us([`document`,`asset`,`folder`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:Ss().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:Us([`image`,`video`]).nullable().optional(),referencedBy:M(A().min(1)).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.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0,{message:`document/asset/folder kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName)`}))}).loose(),YY=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),XY=N({docName:A().min(1),backlinks:M(YY)}).loose(),ZY=N({counts:Vs(A().min(1),j().int().nonnegative())}).loose(),QY=Ls(`kind`,[N({kind:Gs(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:Gs(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),$Y=N({docName:A().min(1),forwardLinks:M(QY)}).loose(),eX=Ls(`kind`,[N({id:A().min(1),kind:Gs(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:M(A()).nullable()}).loose(),N({id:A().min(1),kind:Gs(`external`),url:A().min(1),label:A()}).loose()]),tX=N({source:A().min(1),target:A().min(1)}).loose(),nX=N({nodes:M(eX),links:M(tX)}).loose(),rX=N({id:A().min(1),name:A().optional(),email:A().optional()}).loose(),iX=N({name:A().optional(),email:A().optional()}).loose(),aX=N({message:A().optional(),writers:M(rX).optional(),principal:iX.optional(),...rK}).loose(),oX=N({checkpointRef:A().min(1),versionTag:A().min(1).optional()}).loose(),sX=N({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:M(A()),summaries:M(A()).optional()}).loose(),cX=N({entries:M(N({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:Us([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(sX),checkpoint:Os().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Ss().optional()}).loose(),lX=N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),uX=N({lines:M(N({type:Us([`added`,`removed`,`unchanged`]),text:A()}).loose()),additions:j().int().nonnegative(),deletions:j().int().nonnegative()}).loose(),dX=N({contentDir:A().min(1),pathSeparator:Us([`/`,`\\`]),symlinkResolved:Ss()}).loose(),fX=M(Ls(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:Gs(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:Gs(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),pX=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),mX=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),hX=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose(),gX=N({deadLinks:M(N({target:A().min(1),sources:M(hX)}).loose())}).loose(),_X=N({target:N({docName:A().min(1),title:A(),aliases:M(A())}).loose(),mentions:M(N({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:Ss()}).loose(),vX=N({dir:A().min(1)}).loose(),yX=N({port:j().int().positive()}).loose(),bX=N({host:A().min(1).optional()}).loose(),xX=N({pat:A().min(1),host:A().min(1).optional()}).loose(),SX=N({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(),CX=N({identity:N({name:A().min(1),email:A().min(1)}).loose().nullable()}).loose(),wX=N({authenticated:Ss()}).loose(),TX=N({type:Gs(`complete`).optional(),login:A().min(1).optional()}).loose(),EX=N({}).loose(),DX=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),OX=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(DX)}).loose(),kX=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),AX=N({sessionAlive:Ss(),agent:kX.nullable(),files:M(OX)}).loose(),jX=N({diff:A(),generatedAt:j().int().min(0)}).loose(),MX=N({}).loose(),NX=N({}).loose(),PX=N({}).loose(),FX=N({}).loose(),IX=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:Us([`idle`,`writing`]),ts:j().int().min(0)}).loose(),LX=N({presence:Vs(A().min(1),IX)}).loose(),RX=Vs(A().min(1),Ss()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});N({path:A().min(1,`path must be non-empty`)}).loose();const zX=N({}).loose(),BX=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),VX=N({}).loose(),HX=N({path:A().min(1),...rK,summary:iK}).loose(),UX=N({docName:A().min(1)}).loose(),WX=N({path:A().min(1),...rK,summary:iK}).loose(),GX=N({path:A().min(1)}).loose(),KX=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1)}).loose())}).loose(),qX=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),JX=N({docName:A().min(1),headings:M(qX)}).loose();N({docName:A().min(1),newDocName:A().min(1),summary:iK,...rK}).loose();const YX=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({renamed:M(BX),rewrittenDocs:M(YX),summary:VY.optional()}).loose();const XX=N({kind:Us([`file`,`folder`]),fromPath:A().min(1),toPath:A().min(1),...rK,summary:iK}).loose(),ZX=N({renamed:M(BX),rewrittenDocs:M(YX).optional(),summary:VY.optional()}).loose(),QX=N({kind:Us([`file`,`folder`]),path:A().min(1),...rK}).loose(),$X=N({deletedDocNames:M(A().min(1))}).loose(),eZ=N({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),versionTag:A().optional(),summary:iK,...rK}).loose(),tZ=N({restoredFrom:A().min(1),timestamp:A().min(1),summary:VY.optional()}).loose(),nZ=N({state:Us([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),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:Ss(),syncEnabled:Ss(),identityUnresolved:Ss(),error:A().optional(),pausedReason:A().optional()}).loose(),rZ=N({op:Us([`sync`,`push`,`pull`]).optional()}).loose(),iZ=N({op:Us([`sync`,`push`,`pull`])}).loose(),aZ=N({conflicts:M(N({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),oZ=N({file:A().min(1),strategy:Us([`mine`,`theirs`,`content`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content is required when strategy is 'content'`,path:[`content`]}),sZ=N({}).loose(),cZ=N({file:A().min(1),base:A(),ours:A(),theirs:A()}).loose(),lZ=N({}).loose(),uZ=N({plan:pc(e=>e!==void 0,{message:`plan is required`})}).loose(),dZ=N({plan:pc(e=>e!==void 0,{message:`plan is required`})}).loose(),fZ=N({result:pc(e=>e!==void 0,{message:`result is required`})}).loose(),pZ=N({noOpen:Ss().optional(),out:A().min(1).optional()}).loose(),mZ=N({reason:Us([`unsupported-platform`,`spawn-error`]),message:A()}).loose(),hZ=Ls(`status`,[N({status:Gs(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:Gs(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:mZ.optional()}).loose(),N({status:Gs(`failed`),buildError:A()}).loose(),N({status:Gs(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),gZ=N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Ss()}).loose())}).loose(),_Z=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose(),vZ=N({name:A().min(1),docs:M(_Z)}).loose(),yZ=N({folder:Os(),frontmatter_local:Vs(A(),Os()).nullable()}).loose(),bZ=N({path:A(),frontmatter:Vs(A(),Os()).optional()}).loose(),xZ=N({applied:Os()}).loose(),SZ=Vs(A(),Os()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),CZ=N({template:N({name:A().min(1),folder:A(),scope:Us([`local`,`inherited`]),path:A().min(1),frontmatter:SZ,body:A()}).loose()}).loose(),wZ=N({folder:A(),name:A(),body:A().optional(),frontmatter:SZ.optional()}).loose(),TZ=N({path:A().min(1),created:Ss(),warnings:M(A())}).loose(),EZ=N({existed:Ss(),path:A().min(1)}).loose(),DZ=N({query:A().optional(),intent:Us([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(Us([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional()}).loose(),OZ=N({kind:Us([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:Vs(A(),Os()),snippet:A().optional()}).loose(),kZ=N({query:A(),intent:Us([`autocomplete`,`full_text`,`omnibar`]),results:M(OZ),elapsedMs:j().nonnegative()}).loose(),AZ=N({version:A().min(1),recordedAt:A().min(1)}).loose(),jZ=N({currentVersion:A().min(1),targets:Vs(A(),AZ.nullable())}).loose(),MZ=`server-info`,NZ=`branch-switched`,PZ=`disk-ack`,FZ=`config-validation-rejected`,IZ=`config-ignore-nested-error`,LZ=Us([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),RZ=N({v:Gs(1),ch:Gs(MZ),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),zZ=N({v:Gs(1),ch:Gs(NZ),seq:j(),branch:A().min(1)}).loose(),BZ=N({v:Gs(1),ch:LZ,seq:j()}).loose(),VZ=N({v:Gs(1),ch:Gs(PZ),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),HZ=N({v:Gs(1),ch:Gs(FZ),seq:j(),docName:A().min(1),error:DW}).loose(),UZ=N({v:Gs(1),ch:Gs(IZ),seq:j(),path:A().min(1),error:A().min(1)}).loose(),WZ={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},GZ=new WeakMap;function KZ(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function qZ(e){return e.trim().toLowerCase()}function JZ(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function YZ(e){return e.split(`/`).filter(Boolean).join(` `)}function XZ(e){let t=JZ(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0;return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:YZ(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function ZZ(e){let t=XH({schema:WZ});return e.length>0&&sU(t,e),t}function QZ(e){let t={documents:e};return GZ.set(t,ZZ(e)),t}function $Z(e){let t=GZ.get(e);if(t)return t;let n=ZZ(e.documents);return GZ.set(e,n),n}function eQ(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function tQ(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function nQ(e,t){let n=qZ(t);if(!n)return 0;let r=qZ(e.title),i=qZ(e.name),a=qZ(e.path),o=a.split(`/`);return r===n||i===n?700:a===n?650:r.startsWith(n)||i.startsWith(n)?600:o.some(e=>e.startsWith(n))?550:r.includes(n)||i.includes(n)?500:a.includes(n)?450:-1}function rQ(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 iQ(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function aQ(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 oQ(e,t){return qZ(t).length<4?0:e===`full_text`?1:0}function sQ(e,t,n={}){let r=n.intent??`omnibar`,i=KZ(n.limit),a=new Set(n.scopes??eQ(r)),o=e.documents.filter(e=>tQ(e,a)),s=qZ(t);if(!s)return o.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,i).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let c=LU($Z(e),{term:s,properties:iQ(r),boost:aQ(r),tolerance:oQ(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>tQ(e.document,a)).map(e=>[e.document.id,e.score])),u=rQ(o),d=new Map;for(let e of o)nQ(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)tQ(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,nQ(e,s)),n=l.get(e.id)??0,r=u.get(e.id)??0;return{document:e,score:t+n*20+r,signals:{lexical:t,fullText:n,recency:r}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score).slice(0,i)}const cQ=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),lQ=globalThis;lQ[cQ]===void 0&&(lQ[cQ]=bi());const uQ=lQ[cQ],dQ=[`.ok`,`skill-state.yml`],fQ=[`claude-cowork`,`cli-hosts`],pQ=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`],mQ=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,hQ=Ns({version:A().regex(mQ,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(uQ,{description:`Recorded skill version for this target.`}),recordedAt:Eo().register(uQ,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:Us(pQ).register(uQ,{description:`Install-source surface that recorded this entry.`}).optional()}),gQ=Ns({schema:Gs(1).register(uQ,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ns({"claude-cowork":hQ.optional(),"cli-hosts":hQ.optional()}).register(uQ,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});function _Q(){return{schema:1,targets:{}}}function vQ(){let e=!1,t=``,n=0;return r=>{let i=yQ(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 yQ(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}const bQ=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],xQ={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function SQ(e,t=bQ){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const CQ={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function wQ(e){return e?CQ[e]??`bot`:`bot`}function TQ(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||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=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of l.split(`/`))if(e===`..`){if(u.length===0)return null;u.pop()}else e!==`.`&&e!==``&&u.push(e);return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}const EQ=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function DQ(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function OQ(e){let t=e.trim();return EQ.test(t)||t.startsWith(`//`)}function kQ(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}let r=TQ(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(OQ(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=DQ(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function AQ(e,t){let n=e.trim();if(!n)return null;if(OQ(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=DQ(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function jQ(e,t){let n=e.trim();if(!n||EQ.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 MQ(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function NQ(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function PQ(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function FQ(e){return e.split(`/`).filter(e=>e!==``)}function IQ(e,t){let n=PQ(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function LQ(e,t){let n=PQ(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:FQ(r).length}function RQ(e,t){let n=FQ(e),r=FQ(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function zQ(){let e=new Map;function t(t){let n=MQ(t);if(n===``)return;let r=NQ(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=MQ(t),r=NQ(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=PQ(MQ(n)),o=[],s=[];for(let e of i)IQ(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=LQ(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=LQ(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=RQ(a,PQ(t));for(let r=1;r<e.length;r++){let i=e[r],o=RQ(a,PQ(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function BQ(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function VQ(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}export{cX as $,P as $n,sZ as $t,FW as A,IY as An,ts as Ar,eZ as At,BW as B,$U as Bn,Xt as Br,dZ as Bt,NZ as C,QZ as Cn,N as Cr,JX as Ct,MZ as D,_Q as Dn,A as Dr,XX as Dt,PZ as E,yW as En,Vs as Er,uK as Et,GX as F,OW as Fn,ka as Fr,AW as Ft,JY as G,ZG as Gn,O as Gr,gQ as Gt,QX as H,jQ as Hn,wt as Hr,uZ as Ht,HX as I,zW as In,Wr as Ir,aX as It,VX as J,sW as Jn,_X as Jt,qY as K,QU as Kn,et as Kr,zX as Kt,UX as L,aG as Ln,rr as Lr,oX as Lt,PW as M,qG as Mn,wo as Mr,dQ as Mt,NW as N,kW as Nn,Xi as Nr,fQ as Nt,jW as O,BQ as On,Fs as Or,ZX as Ot,WX as P,wQ as Pn,Oa as Pr,mQ as Pt,$Y as Q,Ud as Qn,oZ as Qt,QW as R,uW as Rn,Kt as Rr,DZ as Rt,RZ as S,TJ as Sn,j as Sr,pX as St,FZ as T,bW as Tn,gc as Tr,sK as Tt,$X as U,TQ as Un,ft as Ur,oK as Ut,gX as V,aW as Vn,Qt as Vr,fZ as Vt,uX as W,sQ as Wn,k as Wr,jZ as Wt,bZ as X,eW as Xn,cZ as Xt,yZ as Y,PY as Yn,lZ as Yt,xZ as Z,ey as Zn,aZ as Zt,zZ as _,kQ as _n,pc as _r,yY as _t,zY as a,EZ as an,Vc as ar,RX as at,BZ as b,zQ as bn,Gs as br,PX as bt,KY as c,TZ as cn,Ec as cr,bX as ct,LY as d,fK as dn,Js as dr,TX as dt,nZ as en,Lc as er,lX as et,UY as f,dK as fn,Us as fr,SX as ft,pW as g,lK as gn,Ss as gr,yX as gt,cW as h,GU as hn,M as hr,vX as ht,jX as i,gZ as in,Fc as ir,hZ as it,MW as j,qK as jn,Eo as jr,tZ as jt,IW as k,tK as kn,Os as kr,fX as kt,RY as l,NX as ln,Dc as lr,CX as lt,XY as m,KU as mn,Es as mr,pK as mt,XW as n,iZ as nn,Hc as nr,ZW as nt,GY as o,CZ as on,Ic as or,nX as ot,ZY as p,dX as pn,ws as pr,wX as pt,YW as q,VQ as qn,$e as qr,mK as qt,AX as r,vZ as rn,Oc as rr,pZ as rt,BY as s,wZ as sn,Nc as sr,EX as st,xQ as t,rZ as tn,wc as tr,mX as tt,WY as u,MX as un,vs as ur,xX as ut,UZ as v,AQ as vn,Ls as vr,LX as vt,IZ as w,XZ as wn,Ys as wr,KX as wt,VZ as x,vQ as xn,Ns as xr,RW as xt,HZ as y,SQ as yn,zs as yr,FX as yt,LW as z,vW as zn,Jt as zr,kZ as zt};
|
|
359
|
-
//# sourceMappingURL=dist-
|
|
358
|
+
`;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length),p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}return`|${n.join(`|`)}|`},h=Array.from({length:f},()=>null);if(a.length===0)return m(p,h);let g=[];g.push(m(a[0],o[0]??[])),g.push(m(p,h));for(let e=1;e<a.length;e++)g.push(m(a[e],o[e]??[]));return g.join(`
|
|
359
|
+
`)},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=DY(i.attributes??[]);if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let l=c?`<${s} ${c}>`:`<${s}>`,u=`</${s}>`;return`${l}\n\n${n.containerFlow({type:`root`,children:i.children},r)}\n\n${u}`},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),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=DY(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)=>n?`>`:s?.[c++]===`none`?`>${e}`:`> ${e}`)}};function DY(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`){if(n.value.includes(`"`)){let r=n.value.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);t.push(`${e}={"${r}"}`)}else t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function OY(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function kY(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 AY(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function jY(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==="`"));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return AY(i)}function MY(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 NY=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=ey(e.extensions),this.handlers=UY(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=WY(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=xY({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=SY({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:EY})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return CY(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?wY(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?tq(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=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})}return TY(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}};const PY=WK();function FY(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 IY(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 LY(e){return e.attrs.sourceDirty||IY(e)}function RY(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 zY(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),Object.keys(n).length===0?e:{...e,data:n}}function BY(e,t){if(e.length===0)return zY({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return zY({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:[BY(n.children,t)]}}return zY({type:`inlineCode`,value:VY(e)},t)}function VY(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=VY(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}const HY=GW;function UY(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=dL(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=dL(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;return n.table.createAndFill({sourceDashCounts:s},o.length>0?o:null)}),n.image&&(i.image=e=>n.image.createAndFill({src:e.url??``,alt:e.alt??null,title:e.title??null}),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){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));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=[],l=0;for(let t of s){if(t.offset>l){let r=n.slice(l,t.offset).replaceAll(`\xA0`,` `);r&&c.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);i&&(t.kind===`escape`?c.push(e.text(i,[r.escapeMark.create()])):r.sourceLiteral?c.push(e.text(i,[r.sourceLiteral.create({sourceRaw:t.raw})])):c.push(e.text(i))),l=t.offset+t.length}}if(l<n.length){let t=n.slice(l).replaceAll(`\xA0`,` `);t&&c.push(e.text(t))}return c.length===1?c[0]:c}),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})]));let a=r.strike??r.delete;if(a&&(i.delete=fL(a)),r.highlight&&(i.mark=fL(r.highlight)),r.comment&&(i.comment=fL(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=dL(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=fL(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=fL(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=dL(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}))),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`},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`})),n.list&&(i.list=dL(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=dL(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),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 t=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,r,i)=>{let a=e.name??``,o=PY.getOrWildcard(a),s=FY(e.attributes,o.props),c=i.all(e).flat();return n.jsxComponent.createAndFill({componentName:a,kind:`element`,attributes:e.attributes,sourceRaw:t(e.data)??``,sourceDirty:!1,props:s},c.length?c:void 0)};let r=(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=i=>{if(i.name===`InlineMath`&&n.mathInline){let e=r(i,`formula`)??``,t=r(i,`id`);return n.mathInline.create({formula:e,id:t??null})}if(i.name===`Tag`&&n.tag){let e=r(i,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let r=t(i.data)??``;return n.jsxInline.createAndFill({},r?[e.text(r)]:null)}return n.jsxComponent.createAndFill({sourceRaw:t(i.data)??``})},i.mdxFlowExpression=e=>{let r=t(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:r,sourceDirty:!1})},i.mdxTextExpression=n=>{let r=t(n.data)??`{${n.value??``}}`;return e.text(r)}}n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??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=ZG(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&&HY.has(l)&&n.jsxComponent&&PY.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&&KW.has(l)&&n.jsxComponent&&PY.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&&qW.has(l)&&n.jsxComponent&&PY.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&&JW.has(l)&&n.jsxComponent&&PY.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:MY(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($W.has(l)&&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])}if(r.link){let t=r.link.create({href:o,title:null,linkStyle:`inline`,refLabel:null});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")});let s=t=>{let r=t.value??t.type;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},c=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),e.text(t.value??t.type));return n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``})),i.math||=s,i.inlineMath||=c,n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=c,n.footnoteDefinition&&(i.footnoteDefinition=dL(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}})),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}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function WY(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=_L(`paragraph`)),r.blockquote&&(t.blockquote=_L(`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}:{}})),r.heading&&(t.heading=_L(`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}}))),r.codeBlock&&(t.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}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=_L(`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}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&RY(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.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?{sourceDashCounts:s}:void 0,l={type:`table`,align:i,children:o};return c&&(l.data=c),l}),r.tableRow&&(t.tableRow=_L(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=_L(`tableCell`,a)),r.tableHeader&&(t.tableHeader=_L(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.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`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[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(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!LY(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:PY.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:PY,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.`)}})}),r.rawMdxFallback&&(t.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}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;return typeof n==`string`&&n.length>0?{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]}:{type:`inlineMath`,value:t}}),r.wikiLink&&(t.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},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.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}]}}),i.emphasis&&(n.emphasis=vL(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=vL(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return BY(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=vL(`delete`)}return i.highlight&&(n.highlight=vL(`mark`)),i.comment&&(n.comment=vL(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=_L(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=_L(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.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??``,n=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,r=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?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}]}}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}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=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}),i.sourceLiteral&&(n.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 zG(t,e.value)&&(e.data=e.data??{},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}const GY=/\p{M}+/gu,KY=/[^\p{L}\p{N}]+/gu,qY=/^-+|-+$/g;function JY(e){return e.trim().normalize(`NFKD`).replace(GY,``).toLowerCase().replace(KY,`-`).replace(qY,``)}function YY(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function XY(e,t){let n=JY(e);return n?YY(n,t):``}const ZY=N({docName:iK,summary:oK,content:A().optional(),...aK}).loose(),QY=N({docName:iK,summary:oK,markdown:A().min(1),position:Us([`append`,`prepend`,`replace`]).optional(),...aK}).loose(),$Y=N({docName:iK,summary:oK,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...aK}).loose(),eX=N({docName:iK,connectionId:A().min(1),scope:Us([`last`,`session`,`file`]).optional(),...aK}).loose(),tX=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),nX=N({type:Gs(`orphan`),parentCandidates:M(A()),message:A()}).loose(),rX=N({timestamp:A().min(1),summary:tX.optional()}).loose(),iX=N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(nX).optional(),summary:tX.optional()}).loose(),aX=N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:tX.optional()}).loose(),oX=N({docName:A().min(1),scope:Us([`last`,`session`]),undone:Ss()}).loose(),sX=N({docName:A().min(1),content:A()}).loose(),cX=N({documents:M(N({kind:Us([`document`,`asset`,`folder`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:Ss().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:Us([`image`,`video`]).nullable().optional(),referencedBy:M(A().min(1)).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.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0,{message:`document/asset/folder kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName)`}))}).loose(),lX=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),uX=N({docName:A().min(1),backlinks:M(lX)}).loose(),dX=N({counts:Vs(A().min(1),j().int().nonnegative())}).loose(),fX=Ls(`kind`,[N({kind:Gs(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:Gs(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),pX=N({docName:A().min(1),forwardLinks:M(fX)}).loose(),mX=Ls(`kind`,[N({id:A().min(1),kind:Gs(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:M(A()).nullable()}).loose(),N({id:A().min(1),kind:Gs(`external`),url:A().min(1),label:A()}).loose()]),hX=N({source:A().min(1),target:A().min(1)}).loose(),gX=N({nodes:M(mX),links:M(hX)}).loose(),_X=N({id:A().min(1),name:A().optional(),email:A().optional()}).loose(),vX=N({name:A().optional(),email:A().optional()}).loose(),yX=N({message:A().optional(),writers:M(_X).optional(),principal:vX.optional(),...aK}).loose(),bX=N({checkpointRef:A().min(1),versionTag:A().min(1).optional()}).loose(),xX=N({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:M(A()),summaries:M(A()).optional()}).loose(),SX=N({entries:M(N({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:Us([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(xX),checkpoint:Os().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Ss().optional()}).loose(),CX=N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),wX=N({lines:M(N({type:Us([`added`,`removed`,`unchanged`]),text:A()}).loose()),additions:j().int().nonnegative(),deletions:j().int().nonnegative()}).loose(),TX=N({contentDir:A().min(1),pathSeparator:Us([`/`,`\\`]),symlinkResolved:Ss()}).loose(),EX=M(Ls(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:Gs(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:Gs(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),DX=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),OX=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),kX=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose(),AX=N({deadLinks:M(N({target:A().min(1),sources:M(kX)}).loose())}).loose(),jX=N({target:N({docName:A().min(1),title:A(),aliases:M(A())}).loose(),mentions:M(N({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:Ss()}).loose(),MX=N({dir:A().min(1)}).loose(),NX=N({port:j().int().positive()}).loose(),PX=N({host:A().min(1).optional()}).loose(),FX=N({pat:A().min(1),host:A().min(1).optional()}).loose(),IX=N({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(),LX=N({identity:N({name:A().min(1),email:A().min(1)}).loose().nullable()}).loose(),RX=N({authenticated:Ss()}).loose(),zX=N({type:Gs(`complete`).optional(),login:A().min(1).optional()}).loose(),BX=N({}).loose(),VX=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),HX=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(VX)}).loose(),UX=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),WX=N({sessionAlive:Ss(),agent:UX.nullable(),files:M(HX)}).loose(),GX=N({diff:A(),generatedAt:j().int().min(0)}).loose(),KX=N({}).loose(),qX=N({}).loose(),JX=N({}).loose(),YX=N({}).loose(),XX=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:Us([`idle`,`writing`]),ts:j().int().min(0)}).loose(),ZX=N({presence:Vs(A().min(1),XX)}).loose(),QX=Vs(A().min(1),Ss()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});N({path:A().min(1,`path must be non-empty`)}).loose();const $X=N({}).loose(),eZ=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),tZ=N({}).loose(),nZ=N({path:A().min(1),...aK,summary:oK}).loose(),rZ=N({docName:A().min(1)}).loose(),iZ=N({path:A().min(1),...aK,summary:oK}).loose(),aZ=N({path:A().min(1)}).loose(),oZ=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1)}).loose())}).loose(),sZ=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),cZ=N({docName:A().min(1),headings:M(sZ)}).loose();N({docName:A().min(1),newDocName:A().min(1),summary:oK,...aK}).loose();const lZ=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({renamed:M(eZ),rewrittenDocs:M(lZ),summary:tX.optional()}).loose();const uZ=N({kind:Us([`file`,`folder`]),fromPath:A().min(1),toPath:A().min(1),...aK,summary:oK}).loose(),dZ=N({renamed:M(eZ),rewrittenDocs:M(lZ).optional(),summary:tX.optional()}).loose(),fZ=N({kind:Us([`file`,`folder`]),path:A().min(1),...aK}).loose(),pZ=N({deletedDocNames:M(A().min(1))}).loose(),mZ=N({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),versionTag:A().optional(),summary:oK,...aK}).loose(),hZ=N({restoredFrom:A().min(1),timestamp:A().min(1),summary:tX.optional()}).loose(),gZ=N({state:Us([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),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:Ss(),syncEnabled:Ss(),identityUnresolved:Ss(),error:A().optional(),pausedReason:A().optional()}).loose(),_Z=N({op:Us([`sync`,`push`,`pull`]).optional()}).loose(),vZ=N({op:Us([`sync`,`push`,`pull`])}).loose(),yZ=N({conflicts:M(N({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),bZ=N({file:A().min(1),strategy:Us([`mine`,`theirs`,`content`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content is required when strategy is 'content'`,path:[`content`]}),xZ=N({}).loose(),SZ=N({file:A().min(1),base:A(),ours:A(),theirs:A()}).loose(),CZ=N({}).loose(),wZ=N({plan:pc(e=>e!==void 0,{message:`plan is required`})}).loose(),TZ=N({plan:pc(e=>e!==void 0,{message:`plan is required`})}).loose(),EZ=N({result:pc(e=>e!==void 0,{message:`result is required`})}).loose(),DZ=N({noOpen:Ss().optional(),out:A().min(1).optional()}).loose(),OZ=N({reason:Us([`unsupported-platform`,`spawn-error`]),message:A()}).loose(),kZ=Ls(`status`,[N({status:Gs(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:Gs(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:OZ.optional()}).loose(),N({status:Gs(`failed`),buildError:A()}).loose(),N({status:Gs(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),AZ=N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Ss()}).loose())}).loose(),jZ=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose(),MZ=N({name:A().min(1),docs:M(jZ)}).loose(),NZ=N({folder:Os(),frontmatter_local:Vs(A(),Os()).nullable()}).loose(),PZ=N({path:A(),frontmatter:Vs(A(),Os()).optional()}).loose(),FZ=N({applied:Os()}).loose(),IZ=Vs(A(),Os()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),LZ=N({template:N({name:A().min(1),folder:A(),scope:Us([`local`,`inherited`]),path:A().min(1),frontmatter:IZ,body:A()}).loose()}).loose(),RZ=N({folder:A(),name:A(),body:A().optional(),frontmatter:IZ.optional()}).loose(),zZ=N({path:A().min(1),created:Ss(),warnings:M(A())}).loose(),BZ=N({existed:Ss(),path:A().min(1)}).loose(),VZ=N({query:A().optional(),intent:Us([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(Us([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional()}).loose(),HZ=N({kind:Us([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:Vs(A(),Os()),snippet:A().optional()}).loose(),UZ=N({query:A(),intent:Us([`autocomplete`,`full_text`,`omnibar`]),results:M(HZ),elapsedMs:j().nonnegative()}).loose(),WZ=N({version:A().min(1),recordedAt:A().min(1)}).loose(),GZ=N({currentVersion:A().min(1),targets:Vs(A(),WZ.nullable())}).loose(),KZ=`server-info`,qZ=`branch-switched`,JZ=`disk-ack`,YZ=`config-validation-rejected`,XZ=`config-ignore-nested-error`,ZZ=Us([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),QZ=N({v:Gs(1),ch:Gs(KZ),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),$Z=N({v:Gs(1),ch:Gs(qZ),seq:j(),branch:A().min(1)}).loose(),eQ=N({v:Gs(1),ch:ZZ,seq:j()}).loose(),tQ=N({v:Gs(1),ch:Gs(JZ),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),nQ=N({v:Gs(1),ch:Gs(YZ),seq:j(),docName:A().min(1),error:DW}).loose(),rQ=N({v:Gs(1),ch:Gs(XZ),seq:j(),path:A().min(1),error:A().min(1)}).loose(),iQ={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},aQ=new WeakMap;function oQ(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function sQ(e){return e.trim().toLowerCase()}function cQ(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function lQ(e){return e.split(`/`).filter(Boolean).join(` `)}function uQ(e){let t=cQ(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0;return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:lQ(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function dQ(e){let t=XH({schema:iQ});return e.length>0&&sU(t,e),t}function fQ(e){let t={documents:e};return aQ.set(t,dQ(e)),t}function pQ(e){let t=aQ.get(e);if(t)return t;let n=dQ(e.documents);return aQ.set(e,n),n}function mQ(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function hQ(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function gQ(e,t){let n=sQ(t);if(!n)return 0;let r=sQ(e.title),i=sQ(e.name),a=sQ(e.path),o=a.split(`/`);return r===n||i===n?700:a===n?650:r.startsWith(n)||i.startsWith(n)?600:o.some(e=>e.startsWith(n))?550:r.includes(n)||i.includes(n)?500:a.includes(n)?450:-1}function _Q(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 vQ(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function yQ(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 bQ(e,t){return sQ(t).length<4?0:e===`full_text`?1:0}function xQ(e,t,n={}){let r=n.intent??`omnibar`,i=oQ(n.limit),a=new Set(n.scopes??mQ(r)),o=e.documents.filter(e=>hQ(e,a)),s=sQ(t);if(!s)return o.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,i).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let c=LU(pQ(e),{term:s,properties:vQ(r),boost:yQ(r),tolerance:bQ(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>hQ(e.document,a)).map(e=>[e.document.id,e.score])),u=_Q(o),d=new Map;for(let e of o)gQ(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)hQ(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,gQ(e,s)),n=l.get(e.id)??0,r=u.get(e.id)??0;return{document:e,score:t+n*20+r,signals:{lexical:t,fullText:n,recency:r}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score).slice(0,i)}const SQ=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),CQ=globalThis;CQ[SQ]===void 0&&(CQ[SQ]=bi());const wQ=CQ[SQ],TQ=[`.ok`,`skill-state.yml`],EQ=[`claude-cowork`,`cli-hosts`],DQ=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`],OQ=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,kQ=Ns({version:A().regex(OQ,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(wQ,{description:`Recorded skill version for this target.`}),recordedAt:Eo().register(wQ,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:Us(DQ).register(wQ,{description:`Install-source surface that recorded this entry.`}).optional()}),AQ=Ns({schema:Gs(1).register(wQ,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ns({"claude-cowork":kQ.optional(),"cli-hosts":kQ.optional()}).register(wQ,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});function jQ(){return{schema:1,targets:{}}}function MQ(){let e=!1,t=``,n=0;return r=>{let i=NQ(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 NQ(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}const PQ=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],FQ={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function IQ(e,t=PQ){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const LQ={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function RQ(e){return e?LQ[e]??`bot`:`bot`}function zQ(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||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=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of l.split(`/`))if(e===`..`){if(u.length===0)return null;u.pop()}else e!==`.`&&e!==``&&u.push(e);return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}const BQ=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function VQ(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function HQ(e){let t=e.trim();return BQ.test(t)||t.startsWith(`//`)}function UQ(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}let r=zQ(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(HQ(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=VQ(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function WQ(e,t){let n=e.trim();if(!n)return null;if(HQ(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=VQ(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function GQ(e,t){let n=e.trim();if(!n||BQ.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 KQ(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function qQ(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function JQ(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function YQ(e){return e.split(`/`).filter(e=>e!==``)}function XQ(e,t){let n=JQ(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function ZQ(e,t){let n=JQ(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:YQ(r).length}function QQ(e,t){let n=YQ(e),r=YQ(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function $Q(){let e=new Map;function t(t){let n=KQ(t);if(n===``)return;let r=qQ(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=KQ(t),r=qQ(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=JQ(KQ(n)),o=[],s=[];for(let e of i)XQ(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=ZQ(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=ZQ(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=QQ(a,JQ(t));for(let r=1;r<e.length;r++){let i=e[r],o=QQ(a,JQ(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function e$(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function t$(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}export{SX as $,Ud as $n,xZ as $t,FW as A,oW as An,Os as Ar,mZ as At,BW as B,vW as Bn,Jt as Br,TZ as Bt,qZ as C,fQ as Cn,j as Cr,cZ as Ct,KZ as D,jQ as Dn,Vs as Dr,uZ as Dt,JZ as E,yW as En,gc as Er,fK as Et,aZ as F,RQ as Fn,Oa as Fr,AW as Ft,cX as G,xQ as Gn,k as Gr,AQ as Gt,fZ as H,aW as Hn,Qt as Hr,wZ as Ht,nZ as I,OW as In,ka as Ir,yX as It,tZ as J,t$ as Jn,$e as Jr,jX as Jt,sX as K,$G as Kn,O as Kr,$X as Kt,rZ as L,zW as Ln,Wr as Lr,bX as Lt,PW as M,YK as Mn,Eo as Mr,TQ as Mt,NW as N,YG as Nn,wo as Nr,EQ as Nt,jW as O,e$ as On,A as Or,dZ as Ot,iZ as P,kW as Pn,Xi as Pr,OQ as Pt,pX as Q,ey as Qn,bZ as Qt,QW as R,aG as Rn,rr as Rr,VZ as Rt,QZ as S,RJ as Sn,Ns as Sr,DX as St,YZ as T,bW as Tn,Ys as Tr,lK as Tt,pZ as U,GQ as Un,wt as Ur,cK as Ut,AX as V,$U as Vn,Xt as Vr,EZ as Vt,wX as W,zQ as Wn,ft as Wr,GZ as Wt,PZ as X,JY as Xn,SZ as Xt,NZ as Y,sW as Yn,CZ as Yt,FZ as Z,eW as Zn,yZ as Zt,$Z as _,UQ as _n,Ss as _r,NY as _t,$Y as a,BZ as an,Fc as ar,QX as at,eQ as b,$Q as bn,zs as br,JX as bt,oX as c,zZ as cn,Nc as cr,PX as ct,ZY as d,mK as dn,vs as dr,zX as dt,gZ as en,P as er,CX as et,rX as f,pK as fn,Js as fr,IX as ft,pW as g,dK as gn,M as gr,NX as gt,cW as h,GU as hn,Es as hr,MX as ht,GX as i,AZ as in,Oc as ir,kZ as it,MW as j,XY as jn,ts as jr,hZ as jt,IW as k,rK as kn,Fs as kr,EX as kt,QY as l,qX as ln,Ec as lr,LX as lt,uX as m,KU as mn,ws as mr,hK as mt,XW as n,vZ as nn,wc as nr,ZW as nt,aX as o,LZ as on,Vc as or,gX as ot,dX as p,TX as pn,Us as pr,RX as pt,YW as q,QU as qn,et as qr,gK as qt,WX as r,MZ as rn,Hc as rr,DZ as rt,eX as s,RZ as sn,Ic as sr,BX as st,FQ as t,_Z as tn,Lc as tr,OX as tt,iX as u,KX as un,Dc as ur,FX as ut,rQ as v,WQ as vn,pc as vr,ZX as vt,XZ as w,uQ as wn,N as wr,oZ as wt,tQ as x,MQ as xn,Gs as xr,RW as xt,nQ as y,IQ as yn,Ls as yr,YX as yt,LW as z,uW as zn,Kt as zr,UZ as zt};
|
|
360
|
+
//# sourceMappingURL=dist-DoBoUPet.mjs.map
|