@inkeep/open-knowledge 0.4.0-beta.27 → 0.4.0-beta.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
  2. package/dist/cli.mjs +21 -21
  3. package/dist/constants-Vc8PoRm6.mjs +2 -0
  4. package/dist/dist-Cg4a9GjH.mjs +1 -0
  5. package/dist/{dist-BY6hbGlq.mjs → dist-H3Ld-L-a.mjs} +15 -15
  6. package/dist/{dist-DNYO-J2I.mjs → dist-Va4IjzRw.mjs} +3 -3
  7. package/dist/index.d.mts +4 -3
  8. package/dist/index.mjs +1 -1
  9. package/dist/init-B3-z2S8e.mjs +408 -0
  10. package/dist/init-BOu8bdIM.mjs +1 -0
  11. package/dist/loader-CtxyptVz.mjs +1 -0
  12. package/dist/{loader-CJZ7xojT.mjs → loader-nzXlKCaJ.mjs} +3 -3
  13. package/dist/{preview-f8NorGUB.mjs → preview-C5ZZtQhd.mjs} +2 -2
  14. package/dist/preview-smcIxud0.mjs +1 -0
  15. package/dist/public/assets/{ActivityModeContent-Dlois8m1.js → ActivityModeContent-CSzGBekb.js} +1 -1
  16. package/dist/public/assets/DocumentContext-HTIMnclU.js +37 -0
  17. package/dist/public/assets/{GraphPanel-BWlIJ3tc.js → GraphPanel-Bh6hilLJ.js} +2 -2
  18. package/dist/public/assets/McpConsentDialogBody-CYvKd5CR.js +1 -0
  19. package/dist/public/assets/SettingsDialog-Bn0Qb8Z-.js +11 -0
  20. package/dist/public/assets/{SourceEditor-BGZmwp3D.js → SourceEditor-CLnmY3Yf.js} +1 -1
  21. package/dist/public/assets/{config-validation-events-Czaccnqg.js → config-validation-events-CiSk03iO.js} +2 -2
  22. package/dist/public/assets/{doc-hash-CBF-HGTP.js → doc-hash-BSwTWr6y.js} +16 -16
  23. package/dist/public/assets/{index-CS7FfInu.js → index-BOCOmOox.js} +76 -76
  24. package/dist/public/assets/index-CjbILLtI.css +1 -0
  25. package/dist/public/assets/{checkbox-DBLbPikY.js → mcp-consent-store-DZ1pCmhN.js} +1 -1
  26. package/dist/public/assets/{target-navigation-intent-CFNdedu6.js → target-navigation-intent-BpcRYgIB.js} +1 -1
  27. package/dist/public/assets/{toggle-group-DC1U2RZo.js → toggle-group-CZU3XaIH.js} +1 -1
  28. package/dist/public/assets/{tooltip-BsZgyNLI.js → tooltip-DcfXr4mU.js} +1 -1
  29. package/dist/public/assets/{typing-burst-detector-CvoRQQEa.js → typing-burst-detector-BbQifQft.js} +1 -1
  30. package/dist/public/index.html +10 -10
  31. package/dist/{src-B4WFg5kb.mjs → src-DCHO3Oll.mjs} +2 -2
  32. package/dist/{start-CuX8s4nh.mjs → start-_HvLGlDx.mjs} +2 -2
  33. package/dist/start-e6EurRTD.mjs +1 -0
  34. package/package.json +1 -1
  35. package/dist/constants-DjLdNmzD.mjs +0 -2
  36. package/dist/dist-DKX8LweU.mjs +0 -1
  37. package/dist/init-BdDRn515.mjs +0 -408
  38. package/dist/init-CovPPI41.mjs +0 -1
  39. package/dist/loader-C4NU0t04.mjs +0 -1
  40. package/dist/preview-CA76mHAB.mjs +0 -1
  41. package/dist/public/assets/DocumentContext-B0jD_DRX.js +0 -37
  42. package/dist/public/assets/McpConsentDialogBody-8EQrQlPS.js +0 -1
  43. package/dist/public/assets/SettingsDialog-Jq0VRnPP.js +0 -11
  44. package/dist/public/assets/index-gFJyDijz.css +0 -1
  45. package/dist/start-BeA0EREH.mjs +0 -1
@@ -381,32 +381,32 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
381
381
  `)].join(`
382
382
  `);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(`
383
383
  `))n.push(` ${t}`);return n.join(`
384
- `)}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.`}}function l$(e,t,n){return u$([e,t,n],[])}function u$(e,t){if(t.length>0){let n=mu(cu,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=d$(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>f$(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=u$(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function d$(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function f$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var p$=2e3;function m$(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function h$(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var g$=`__system__`,_$=`__config__/project`,v$=`__user__/config.yml`,y$=`__local__/project`,b$=`__config__/okignore`;Object.freeze([_$,y$,v$,b$]);var x$=[`incoming`,`outgoing`,`both`];function S$(e){return x$.includes(e)}var C$=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],w$=[`video/mp4`,`video/webm`,`video/ogg`],T$=[`audio/mpeg`,`audio/wav`,`audio/ogg`],E$=[`application/pdf`],D$=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),O$=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),k$=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),A$=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(`.`)),j$=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(`.`)),M$=`wikiembed`,N$=`toast`,P$=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(`.`)),F$=[`png`,`jpg`,`jpeg`],I$=[`mp4`];function L$(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}L$(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,F$,D$),L$(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,I$,O$),L$(`FILE_ATTACHMENT_EXTENSIONS`,[...A$],P$);var R$=new Set(F$),z$=new Set(I$);L$(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...F$,...I$])],j$);function B$(e){let t=e.toLowerCase().replace(/^\./,``);return R$.has(t)?`image`:z$.has(t)?`video`:null}var V$=Qx.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`}}}}),H$=dS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Cx({find:oS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Cx({find:cS,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),U$=aS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Cx({find:eS,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Cx({find:nS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),W$=Qb.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),G$=pS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),K$=hS.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1}}}}),q$=Gx.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]}}),J$=Gx.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}})}}}),Y$=Gx.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]}}),X$=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],Z$=X$.map(e=>`${e}:`).join(`|`),Q$=RegExp(`^(?:${Z$}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function $$(e){let t=e.trim();return t===``?!0:Q$.test(t)}function e1(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var t1=new Set(X$.map(e=>`${e}:`)),n1=`https://placeholder.invalid`;function r1(e){try{let t=new URL(e,n1);return t1.has(t.protocol.toLowerCase())}catch{return!1}}var i1=jw.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:r1,validate:r1,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}}}}),a1=Gx.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function o1(e){return e.type.name===`list`&&!e.attrs.ordered}function s1(e){return e.type.name===`list`&&!!e.attrs.ordered}function c1(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function l1(e,t,n,r,i,a,o){let s=Ey(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?vm(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 hm(n,a)(e,void 0)?t?hm(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var u1=Gx.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,Iy(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:l1(e,t,n,r,e=>o1(e)&&!c1(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:l1(e,t,n,r,e=>s1(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:l1(e,t,n,r,e=>o1(e)&&c1(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Ex({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Ex({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new Wb({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=wf(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()}}}),d1=Gx.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`,Iy(t),0]:[`li`,Iy(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(Iy(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}}}}),f1=u1,p1=d1,m1=Gx.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}})}}}),h1=Gx.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}}}}),g1=VE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),_1=GE.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1}}}}),v1=Gx.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)}}}),y1=Qb.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)}}}),b1=Gx.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`}]})}}}),x1=Gx.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}})}}}),S1=Gx.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;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function C1(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var w1=Kte.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Iy(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=C1(t.src)),[`img`,t]}}),T1=Qb.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 E1(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:D1(n)===r}function D1(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var O1=RE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null}}}}),k1=CE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),A1=wE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),j1=Gx.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()}}}),M1=/^(?:---|—-|___\s|\*\*\*\s)$/;function N1(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var P1=JE.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[wx({find:M1,type:this.type,getAttributes:e=>({sourceRaw:N1(e)})})]}});function F1(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function I1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var L1=Gx.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:F1(e.getAttribute(`data-alias`)),anchor:F1(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:F1(e.getAttribute(`data-alias`)),anchor:F1(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=F1(e.attrs.alias),i=F1(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`},I1({target:n,alias:r,anchor:i})]}});function R1(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function z1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var B1=Gx.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:F1(e.getAttribute(`data-alias`)),anchor:F1(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=F1(e.attrs.alias),i=F1(e.attrs.anchor),a=F1(e.attrs.resolvedSrc),o=R1(n);if(D$.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`},z1({target:n,alias:r,anchor:i})]}}),V1=[J$,h1,Y$,m1,L1,B1,j1,f1,p1,H$,U$,_1,V$,g1,K$,P1,i1,q$,a1,G$,W$,T1,Wte.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}}),O1.configure({resizable:!0}),TE,A1,k1,w1.configure({inline:!0}),S1,Pw,y1,v1,x1,b1],H1=/^[a-zA-Z][\w/-]*$/;function U1(e,t){let n=encodeURIComponent(t.prompt),r=encodeURIComponent(t.projectDir),i=encodeURIComponent(t.docPath);return`claude://${e.mode}/new?q=${n}&folder=${r}&file=${i}`}function W1(e){return`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${encodeURIComponent(e.projectDir)}`}function G1(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function K1(e){return`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${encodeURIComponent(G1(e.projectDir))}&mode=agent`}function q1(e){return`Open Knowledge doc: ${e.relativePath}. Use the open-knowledge MCP tool for backlinks and related context.`}var J1=A().refine(e=>!e.includes(`..`)&&!e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`\\`),{message:`docName contains unsafe path characters`}).optional(),Y1={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},X1=A().optional(),Z1=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Q1=N({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:Ha(A().min(1),A().min(1)).optional()}).loose(),$1=N({id:A().min(1),display_name:A().min(1),display_email:A(),source:Wa([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),e0=Wa(`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(`.`)),t0=N({type:e0,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(Z1,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose();N({parentDocName:A().min(1),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose();var n0=N({src:A().min(1),path:A().min(1).optional(),deduped:Ta().optional()}).loose();N({url:A().min(1),dir:A().min(1)}).loose(),N({type:Ga(`error`),problem:t0}).loose();var r0={"ok:shell:spawn-cursor":{"urn:ok:error:cursor-not-installed":`not-installed`,"urn:ok:error:cursor-spawn-timeout":`timeout`,"urn:ok:error:cursor-spawn-failed":`spawn-error`,"urn:ok:error:invalid-request":`invalid-path`,"urn:ok:error:path-escape":`invalid-path`}},i0=new Set(`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:method-not-allowed.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`.split(`.`));function a0(e,t){let n=e0.safeParse(e);if(!n.success)return{kind:`unknown`,problemType:e};let r=n.data,i=r0[t][r];return i===void 0?i0.has(r)?{kind:`http-only`}:{kind:`unknown`,problemType:e}:{kind:`mapped`,channel:t,reason:i}}function o0(e){throw Error(`Unhandled UrnIpcLookup: ${JSON.stringify(e)}`)}function s0(e){return`https://claude.ai/new?q=${encodeURIComponent(e)}`}var c0=/notionvc:/i,l0=()=>e=>{u0(e)&&(d0(e),f0(e))};function u0(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(c0.test(e))return!0}if(t.type===`element`&&u0(t))return!0}return!1}function d0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&d0(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
384
+ `)}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.`}}function l$(e,t,n){return u$([e,t,n],[])}function u$(e,t){if(t.length>0){let n=mu(cu,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=d$(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>f$(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=u$(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function d$(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function f$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var p$=2e3;function m$(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function h$(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var g$=`__system__`,_$=`__config__/project`,v$=`__user__/config.yml`,y$=`__local__/project`,b$=`__config__/okignore`;Object.freeze([_$,y$,v$,b$]);var x$=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],S$=[`claude`,`claude-desktop`,`cursor`,`codex`],C$={claude:`Claude Code`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`},w$=[`incoming`,`outgoing`,`both`];function T$(e){return w$.includes(e)}var E$=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],D$=[`video/mp4`,`video/webm`,`video/ogg`],O$=[`audio/mpeg`,`audio/wav`,`audio/ogg`],k$=[`application/pdf`],A$=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),j$=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),M$=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),N$=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(`.`)),P$=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(`.`)),F$=`wikiembed`,I$=`toast`,L$=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(`.`)),R$=[`png`,`jpg`,`jpeg`],z$=[`mp4`];function B$(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}B$(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,R$,A$),B$(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,z$,j$),B$(`FILE_ATTACHMENT_EXTENSIONS`,[...N$],L$);var V$=new Set(R$),H$=new Set(z$);B$(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...R$,...z$])],P$);function U$(e){let t=e.toLowerCase().replace(/^\./,``);return V$.has(t)?`image`:H$.has(t)?`video`:null}var W$=Qx.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`}}}}),G$=dS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Cx({find:oS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Cx({find:cS,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),K$=aS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Cx({find:eS,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Cx({find:nS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),q$=Qb.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),J$=pS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),Y$=hS.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1}}}}),X$=Gx.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]}}),Z$=Gx.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}})}}}),Q$=Gx.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]}}),$$=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],e1=$$.map(e=>`${e}:`).join(`|`),t1=RegExp(`^(?:${e1}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function n1(e){let t=e.trim();return t===``?!0:t1.test(t)}function r1(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var i1=new Set($$.map(e=>`${e}:`)),a1=`https://placeholder.invalid`;function o1(e){try{let t=new URL(e,a1);return i1.has(t.protocol.toLowerCase())}catch{return!1}}var s1=jw.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:o1,validate:o1,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}}}}),c1=Gx.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function l1(e){return e.type.name===`list`&&!e.attrs.ordered}function u1(e){return e.type.name===`list`&&!!e.attrs.ordered}function d1(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function f1(e,t,n,r,i,a,o){let s=Ey(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?vm(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 hm(n,a)(e,void 0)?t?hm(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var p1=Gx.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,Iy(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:f1(e,t,n,r,e=>l1(e)&&!d1(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:f1(e,t,n,r,e=>u1(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:f1(e,t,n,r,e=>l1(e)&&d1(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Ex({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Ex({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new Wb({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=wf(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()}}}),m1=Gx.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`,Iy(t),0]:[`li`,Iy(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(Iy(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}}}}),h1=p1,g1=m1,_1=Gx.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}})}}}),v1=Gx.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}}}}),y1=VE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),b1=GE.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1}}}}),x1=Gx.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)}}}),S1=Qb.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)}}}),C1=Gx.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`}]})}}}),w1=Gx.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}})}}}),T1=Gx.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;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function E1(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var D1=Kte.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Iy(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=E1(t.src)),[`img`,t]}}),O1=Qb.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 k1(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:A1(n)===r}function A1(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var j1=RE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null}}}}),M1=CE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),N1=wE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),P1=Gx.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()}}}),F1=/^(?:---|—-|___\s|\*\*\*\s)$/;function I1(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var L1=JE.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[wx({find:F1,type:this.type,getAttributes:e=>({sourceRaw:I1(e)})})]}});function R1(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function z1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var B1=Gx.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:R1(e.getAttribute(`data-alias`)),anchor:R1(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:R1(e.getAttribute(`data-alias`)),anchor:R1(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=R1(e.attrs.alias),i=R1(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`},z1({target:n,alias:r,anchor:i})]}});function V1(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function H1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var U1=Gx.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:R1(e.getAttribute(`data-alias`)),anchor:R1(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=R1(e.attrs.alias),i=R1(e.attrs.anchor),a=R1(e.attrs.resolvedSrc),o=V1(n);if(A$.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`},H1({target:n,alias:r,anchor:i})]}}),W1=[Z$,v1,Q$,_1,B1,U1,P1,h1,g1,G$,K$,b1,W$,y1,Y$,L1,s1,X$,c1,J$,q$,O1,Wte.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}}),j1.configure({resizable:!0}),TE,N1,M1,D1.configure({inline:!0}),T1,Pw,S1,x1,w1,C1],G1=/^[a-zA-Z][\w/-]*$/;function K1(e,t){let n=encodeURIComponent(t.prompt),r=encodeURIComponent(t.projectDir),i=encodeURIComponent(t.docPath);return`claude://${e.mode}/new?q=${n}&folder=${r}&file=${i}`}function q1(e){return`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${encodeURIComponent(e.projectDir)}`}function J1(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function Y1(e){return`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${encodeURIComponent(J1(e.projectDir))}&mode=agent`}function X1(e){return`Open Knowledge doc: ${e.relativePath}. Use the open-knowledge MCP tool for backlinks and related context.`}var Z1=A().refine(e=>!e.includes(`..`)&&!e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`\\`),{message:`docName contains unsafe path characters`}).optional(),Q1={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},$1=A().optional(),e0=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,t0=N({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:Ha(A().min(1),A().min(1)).optional()}).loose(),n0=N({id:A().min(1),display_name:A().min(1),display_email:A(),source:Wa([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),r0=Wa(`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(`.`)),i0=N({type:r0,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(e0,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose();N({parentDocName:A().min(1),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose();var a0=N({src:A().min(1),path:A().min(1).optional(),deduped:Ta().optional()}).loose();N({url:A().min(1),dir:A().min(1)}).loose(),N({type:Ga(`error`),problem:i0}).loose();var o0={"ok:shell:spawn-cursor":{"urn:ok:error:cursor-not-installed":`not-installed`,"urn:ok:error:cursor-spawn-timeout":`timeout`,"urn:ok:error:cursor-spawn-failed":`spawn-error`,"urn:ok:error:invalid-request":`invalid-path`,"urn:ok:error:path-escape":`invalid-path`}},s0=new Set(`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:method-not-allowed.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`.split(`.`));function c0(e,t){let n=r0.safeParse(e);if(!n.success)return{kind:`unknown`,problemType:e};let r=n.data,i=o0[t][r];return i===void 0?s0.has(r)?{kind:`http-only`}:{kind:`unknown`,problemType:e}:{kind:`mapped`,channel:t,reason:i}}function l0(e){throw Error(`Unhandled UrnIpcLookup: ${JSON.stringify(e)}`)}function u0(e){return`https://claude.ai/new?q=${encodeURIComponent(e)}`}var d0=/notionvc:/i,f0=()=>e=>{p0(e)&&(m0(e),h0(e))};function p0(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(d0.test(e))return!0}if(t.type===`element`&&p0(t))return!0}return!1}function m0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&m0(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
385
385
  `)){t.push(n);continue}let r=e.split(`
386
- `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function f0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!c0.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&f0(t)}}var p0=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),m0=()=>e=>{h0(e)};function h0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&h0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return g0(t)?[]:_0(t)?t.children:[t]})}}function g0(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function _0(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>p0.has(String(e))):!1}var v0=`docs-internal-guid-`;function y0(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var b0=()=>e=>{x0(e)};function x0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&x0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(S0(r)||C0(r)){y0(e,t);continue}t++}}function S0(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(v0)}function C0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var w0=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),T0=()=>e=>{E0(e)};function E0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&E0(t);for(let t of e.children)t.type===`element`&&D0(t)}}function D0(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!w0.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var O0=/^gmail_/,k0=()=>e=>{A0(e)};function A0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&A0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&j0(r,`gmail_quote`)&&(r.tagName=`blockquote`),M0(r),N0(r)){e.children.splice(t,1,...r.children);continue}t++}}function j0(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function M0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!O0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function N0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var P0=()=>e=>{F0(e)};function F0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&F0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(I0(t),[t])})}}function I0(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var L0=[`o:`,`w:`,`m:`,`v:`,`u1:`],R0=/^Mso[A-Z]/,z0=/^\s*\[if\s+[^\]]*\]/,B0=()=>e=>{V0(e)};function V0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&V0(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return z0.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return H0(t)?[]:(U0(t),[t])})}}function H0(e){return L0.some(t=>e.tagName.startsWith(t))}function U0(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!R0.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&R0.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);L0.some(e=>e===`${n}:`)&&delete t[e]}}var W0=/^c-(message_kit__|message__|compose|timestamp)/,G0=()=>e=>{K0(e)};function K0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&K0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return q0(t)?[]:(J0(t),[t])})}}function q0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function J0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!W0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var Y0=()=>e=>{X0(e)};function X0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&X0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;Z0(r)&&(e.children[t]=$0(r))}}}function Z0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>Q0(e))}function Q0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||Q0(e))return!0}return!1}function $0(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>e2(e)).join(`
387
- `)}]}]}}function e2(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=e2(n));return t}var t2=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},n2=[b0,B0,m0,k0,l0,Y0,P0,G0,T0];function r2(e){qP(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function i2(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new t2(e.length,n);let r=RH().use(GN,{fragment:!0});for(let e of n2)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(KI);let i=r.parse(e),a=r.runSync(i);return r2(a),a}function a2(e){return String(RH().use(kH).use(AH).stringify(e))}function o2(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=s2(e,t);r>=0?n[r]=o:n.push(o)}return n}function s2(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 c2(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:o2(t,r),children:n.all(t),data:{}}}var l2=[{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`}],u2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:C$,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`}],d2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:w$,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`}],f2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:T$,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`}],p2=[{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`}],m2=[l2[0],l2[1],l2[4],l2[5],l2[6]],h2=[u2[0],u2[1],u2[7]],g2=[p2[0],p2[1],p2[4],p2[5]],_2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],v2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],y2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],b2=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],x2=[b2[0]],S2=[b2[0]],C2=[{name:`chart`,type:`string`,required:!0,autoFocus:!0,language:`mermaid`,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"}],w2=[C2[0]],T2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],E2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],D2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:E$,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 O2(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function k2(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function A2(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var j2=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:l2,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)=>c2(`Callout`,e,t,l2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:u2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>c2(`img`,e,t,u2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:d2,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)=>c2(`video`,e,t,d2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:f2,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)=>c2(`audio`,e,t,f2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:D2,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)=>c2(`Pdf`,e,t,D2)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:E2,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)=>c2(`File`,e,t,E2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:p2,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)=>c2(`Accordion`,e,t,p2)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:b2,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)=>c2(`Math`,e,t,b2)},{name:`Mermaid`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:C2,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)=>c2(`Mermaid`,e,t,C2)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:m2,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:h2,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:_2,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:A2},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:v2,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:A2},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:y2,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:A2},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:T2,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:A2},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:g2,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="${O2(n.name)}"`:``,a=n?.id?` id="${O2(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${k2(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:x2,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:S2,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:w2,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??``})}],M2={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>c2(e.attrs.componentName||`*`,e,t)};function N2(){let e=new Map;e.set(`*`,M2);for(let t of j2)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var P2={parseFallback:{blockLevel:0,wholeDoc:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{}};function F2(){P2.parseFallback.blockLevel++}function I2(){P2.parseFallback.wholeDoc++}function L2(e){P2.jsxRenderFailure[e]=(P2.jsxRenderFailure[e]??0)+1}function R2(e){P2.jsxAutoConvertFailed[e]=(P2.jsxAutoConvertFailed[e]??0)+1}function z2(e){P2.jsxAutoConvertSucceeded[e]=(P2.jsxAutoConvertSucceeded[e]??0)+1}function B2(e){P2.jsxPropDropped[e]=(P2.jsxPropDropped[e]??0)+1}function V2(e){P2.jsxMoveFailed[e]=(P2.jsxMoveFailed[e]??0)+1}function H2(e){P2.jsxStuckCopyFailed[e]=(P2.jsxStuckCopyFailed[e]??0)+1}function U2(e){P2.jsxStuckDeleteFailed[e]=(P2.jsxStuckDeleteFailed[e]??0)+1}var W2=/^(`{3,}|~{3,})/gm;function G2(e){let t=[],n=null;for(let r of e.matchAll(W2)){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 K2(e,t){return t.some(([t,n])=>e>=t&&e<n)}var q2=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function J2(e){let t=G2(e),n=[];for(let r of e.matchAll(q2))K2(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
388
- `)}\n\n`:``}var Y2=500,X2=1e3;function Z2(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return t4(e,t.parse,0,n)}function Q2(e){return e.calls>=X2?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=Y2}var $2=500;function e4(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,$2),stack:e.stack?.split(`
386
+ `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function h0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!d0.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&h0(t)}}var g0=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),_0=()=>e=>{v0(e)};function v0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&v0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return y0(t)?[]:b0(t)?t.children:[t]})}}function y0(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function b0(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>g0.has(String(e))):!1}var x0=`docs-internal-guid-`;function S0(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var C0=()=>e=>{w0(e)};function w0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&w0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(T0(r)||E0(r)){S0(e,t);continue}t++}}function T0(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(x0)}function E0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var D0=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),O0=()=>e=>{k0(e)};function k0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&k0(t);for(let t of e.children)t.type===`element`&&A0(t)}}function A0(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!D0.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var j0=/^gmail_/,M0=()=>e=>{N0(e)};function N0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&N0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&P0(r,`gmail_quote`)&&(r.tagName=`blockquote`),F0(r),I0(r)){e.children.splice(t,1,...r.children);continue}t++}}function P0(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function F0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!j0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function I0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var L0=()=>e=>{R0(e)};function R0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&R0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(z0(t),[t])})}}function z0(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var B0=[`o:`,`w:`,`m:`,`v:`,`u1:`],V0=/^Mso[A-Z]/,H0=/^\s*\[if\s+[^\]]*\]/,U0=()=>e=>{W0(e)};function W0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&W0(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return H0.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return G0(t)?[]:(K0(t),[t])})}}function G0(e){return B0.some(t=>e.tagName.startsWith(t))}function K0(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!V0.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&V0.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);B0.some(e=>e===`${n}:`)&&delete t[e]}}var q0=/^c-(message_kit__|message__|compose|timestamp)/,J0=()=>e=>{Y0(e)};function Y0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&Y0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return X0(t)?[]:(Z0(t),[t])})}}function X0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function Z0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!q0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var Q0=()=>e=>{$0(e)};function $0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&$0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;e2(r)&&(e.children[t]=n2(r))}}}function e2(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>t2(e))}function t2(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||t2(e))return!0}return!1}function n2(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>r2(e)).join(`
387
+ `)}]}]}}function r2(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=r2(n));return t}var i2=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},a2=[C0,U0,_0,M0,f0,Q0,L0,J0,O0];function o2(e){qP(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function s2(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new i2(e.length,n);let r=RH().use(GN,{fragment:!0});for(let e of a2)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(KI);let i=r.parse(e),a=r.runSync(i);return o2(a),a}function c2(e){return String(RH().use(kH).use(AH).stringify(e))}function l2(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=u2(e,t);r>=0?n[r]=o:n.push(o)}return n}function u2(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 d2(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:l2(t,r),children:n.all(t),data:{}}}var f2=[{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`}],p2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:E$,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`}],m2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:D$,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`}],h2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:O$,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`}],g2=[{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`}],_2=[f2[0],f2[1],f2[4],f2[5],f2[6]],v2=[p2[0],p2[1],p2[7]],y2=[g2[0],g2[1],g2[4],g2[5]],b2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],x2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],S2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],C2=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],w2=[C2[0]],T2=[C2[0]],E2=[{name:`chart`,type:`string`,required:!0,autoFocus:!0,language:`mermaid`,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"}],D2=[E2[0]],O2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],k2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],A2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:k$,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 j2(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function M2(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function N2(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var P2=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:f2,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)=>d2(`Callout`,e,t,f2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:p2,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)=>d2(`img`,e,t,p2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:m2,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)=>d2(`video`,e,t,m2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:h2,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)=>d2(`audio`,e,t,h2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:A2,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)=>d2(`Pdf`,e,t,A2)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:k2,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)=>d2(`File`,e,t,k2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:g2,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)=>d2(`Accordion`,e,t,g2)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:C2,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)=>d2(`Math`,e,t,C2)},{name:`Mermaid`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:E2,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)=>d2(`Mermaid`,e,t,E2)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:_2,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:v2,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:b2,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:N2},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:x2,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:N2},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:S2,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:N2},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:O2,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:N2},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:y2,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="${j2(n.name)}"`:``,a=n?.id?` id="${j2(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${M2(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:w2,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:T2,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:D2,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??``})}],F2={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>d2(e.attrs.componentName||`*`,e,t)};function I2(){let e=new Map;e.set(`*`,F2);for(let t of P2)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var L2={parseFallback:{blockLevel:0,wholeDoc:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{}};function R2(){L2.parseFallback.blockLevel++}function z2(){L2.parseFallback.wholeDoc++}function B2(e){L2.jsxRenderFailure[e]=(L2.jsxRenderFailure[e]??0)+1}function V2(e){L2.jsxAutoConvertFailed[e]=(L2.jsxAutoConvertFailed[e]??0)+1}function H2(e){L2.jsxAutoConvertSucceeded[e]=(L2.jsxAutoConvertSucceeded[e]??0)+1}function U2(e){L2.jsxPropDropped[e]=(L2.jsxPropDropped[e]??0)+1}function W2(e){L2.jsxMoveFailed[e]=(L2.jsxMoveFailed[e]??0)+1}function G2(e){L2.jsxStuckCopyFailed[e]=(L2.jsxStuckCopyFailed[e]??0)+1}function K2(e){L2.jsxStuckDeleteFailed[e]=(L2.jsxStuckDeleteFailed[e]??0)+1}var q2=/^(`{3,}|~{3,})/gm;function J2(e){let t=[],n=null;for(let r of e.matchAll(q2)){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 Y2(e,t){return t.some(([t,n])=>e>=t&&e<n)}var X2=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function Z2(e){let t=J2(e),n=[];for(let r of e.matchAll(X2))Y2(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
388
+ `)}\n\n`:``}var Q2=500,$2=1e3;function e4(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return i4(e,t.parse,0,n)}function t4(e){return e.calls>=$2?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=Q2}var n4=500;function r4(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,n4),stack:e.stack?.split(`
389
389
  `).slice(0,4).join(`
390
- `)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,$2)}}function t4(e,t,n,r){if(n>20)return I2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),d4(e);if(r){if(Q2(r))return I2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),d4(e);r.calls+=1}try{return t(e)}catch(i){let a=n4(i),o=e4(i);if(a===void 0){if(n===0){let n=u4(e,t,i,r);if(n)return n}return I2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),d4(e)}F2(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=c4(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?t4(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?t4(J2(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){I2();let n=e4(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})),d4(e)}}}function n4(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 r4(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 i4(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var a4=32*1024;function o4(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(K2(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+a4),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 s4(e){let t=o4(e,G2(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=i4(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=i4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function c4(e,t){let n=s4(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:r4(e,t)??0,end:i4(e,t)??e.length}}function l4(e){let t=G2(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;K2(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 u4(e,t,n,r){let i=l4(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&Q2(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=J2(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){F2();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 d4(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var f4=``,p4=``,m4=``,h4=``,g4=``,_4=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,v4=/<!--[\s\S]*?-->/g,y4=/<\/([a-z][a-z0-9]*)\s*>/g,b4=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,x4=new Set([`img`,`video`,`audio`]),S4=new Set([`mark`]),C4=/<\/([A-Z][A-Za-z0-9.]*)>/g;function w4(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 T4(e){let t=new Map,n=new RegExp(C4.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 E4(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 D4(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function O4(e){let t=e;t=t.replace(v4,e=>e.replace(/</g,f4).replace(/>/g,p4)),t=t.replace(_4,(e,t)=>`${f4}${t.replaceAll(`:`,m4).replaceAll(`@`,h4)}${p4}`),t=t.replace(y4,(e,t)=>S4.has(t)?e:e.replace(/</g,f4).replace(/>/g,p4)),t=t.replace(b4,(e,t)=>x4.has(t)&&e.endsWith(`/>`)||S4.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,f4).replace(/>/g,p4):e),t=t.replace(/<>/g,`${f4}${p4}`);let n=T4(t),r=E4(t),i=D4(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:f4;let s=/^<([a-z][a-z0-9]*)([^>]*)\/>/.exec(o);if(s&&x4.has(s[1]))return e;let c=/^<([a-z][a-z0-9]*)([\s/>])/.exec(o);if(c&&S4.has(c[1])){let n=c[1];return o.startsWith(`<${n}/>`)||t.indexOf(`</${n}>`,a)!==-1?e:f4}let l=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(o);if(!l)return f4;let u=l[1],d=w4(r,a),f=w4(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&&w4(p,a)<p.length?e:f4});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
390
+ `)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,n4)}}function i4(e,t,n,r){if(n>20)return z2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),m4(e);if(r){if(t4(r))return z2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),m4(e);r.calls+=1}try{return t(e)}catch(i){let a=a4(i),o=r4(i);if(a===void 0){if(n===0){let n=p4(e,t,i,r);if(n)return n}return z2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),m4(e)}R2(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=d4(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?i4(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?i4(Z2(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){z2();let n=r4(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})),m4(e)}}}function a4(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 o4(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 s4(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var c4=32*1024;function l4(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(Y2(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+c4),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 u4(e){let t=l4(e,J2(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=s4(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=s4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function d4(e,t){let n=u4(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:o4(e,t)??0,end:s4(e,t)??e.length}}function f4(e){let t=J2(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;Y2(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 p4(e,t,n,r){let i=f4(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&t4(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=Z2(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){R2();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 m4(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var h4=``,g4=``,_4=``,v4=``,y4=``,b4=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,x4=/<!--[\s\S]*?-->/g,S4=/<\/([a-z][a-z0-9]*)\s*>/g,C4=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,w4=new Set([`img`,`video`,`audio`]),T4=new Set([`mark`]),E4=/<\/([A-Z][A-Za-z0-9.]*)>/g;function D4(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 O4(e){let t=new Map,n=new RegExp(E4.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 k4(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 A4(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function j4(e){let t=e;t=t.replace(x4,e=>e.replace(/</g,h4).replace(/>/g,g4)),t=t.replace(b4,(e,t)=>`${h4}${t.replaceAll(`:`,_4).replaceAll(`@`,v4)}${g4}`),t=t.replace(S4,(e,t)=>T4.has(t)?e:e.replace(/</g,h4).replace(/>/g,g4)),t=t.replace(C4,(e,t)=>w4.has(t)&&e.endsWith(`/>`)||T4.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,h4).replace(/>/g,g4):e),t=t.replace(/<>/g,`${h4}${g4}`);let n=O4(t),r=k4(t),i=A4(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:h4;let s=/^<([a-z][a-z0-9]*)([^>]*)\/>/.exec(o);if(s&&w4.has(s[1]))return e;let c=/^<([a-z][a-z0-9]*)([\s/>])/.exec(o);if(c&&T4.has(c[1])){let n=c[1];return o.startsWith(`<${n}/>`)||t.indexOf(`</${n}>`,a)!==-1?e:h4}let l=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(o);if(!l)return h4;let u=l[1],d=D4(r,a),f=D4(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&&D4(p,a)<p.length?e:h4});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
391
391
  `){let i=t[r+1];if(i===`
392
392
  `||i===`>`){if(e.push(...n),n.length=0,i===`
393
393
  `)for(;t[r+1]===`
394
- `;)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]=g4;t=n.join(``)}}return t}function k4(e){return e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)}function A4(){return e=>{qP(e,e=>{let t=e;typeof t.value==`string`&&k4(t.value)&&(t.value=j4(t.value)),typeof t.url==`string`&&k4(t.url)&&(t.url=j4(t.url)),typeof t.title==`string`&&k4(t.title)&&(t.title=j4(t.title)),typeof t.alt==`string`&&k4(t.alt)&&(t.alt=j4(t.alt))})}}function j4(e){return e.replaceAll(f4,`<`).replaceAll(p4,`>`).replaceAll(m4,`:`).replaceAll(h4,`@`).replaceAll(g4,`{`)}var M4=``,N4=``,P4=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function F4(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function I4(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||F4(e,r)%2==1?t:n(t))}function L4(e){return I4(e,P4,e=>`${M4}${e.slice(1,-1)}${N4}`)}var R4=RegExp(`${M4}([^${N4}]+)${N4}`,`g`);function z4(e){if(!e.includes(M4))return{value:e,spans:[]};let t=[],n=``,r=0;R4.lastIndex=0;let i=R4.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=R4.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function B4(){return e=>{qP(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(M4)){let{value:n,spans:r}=z4(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(M4)&&(t[e]=z4(n).value)}})}}var V4=``,H4=/\\</g;function U4(e){return I4(e,H4,e=>`${V4}${e.slice(1)}`)}function W4(){return e=>{qP(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(V4)&&(t.value=t.value.split(V4).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(V4)&&(t[e]=n.split(V4).join(``))}})}}var G4=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),K4={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`},q4=`ok-alert`,J4=RegExp(`(?:^|\\s)${q4}-(\\w+)(?:\\s|$)`),Y4=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function X4(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
395
- `,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(Y4);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function Z4(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(J4);return n?n[1].toLowerCase():null}function Q4(e){return K4[e.toLowerCase()]??null}function $4(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&&e3(o[0],s)?o.slice(1):o,position:e.position}}function e3(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 t3(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${q4}-title`)}function n3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;qP(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=Z4(e);if(!i)return;let a=Q4(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=X4(n,e.position.start.offset),s&&(o=s.title,a||=Q4(s.rawType)));let c=a??`note`,l=s&&G4.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=X4(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!t3(e.children[0]))return;let f=$4(e,c,o,l,d);r.children[t]=f})}}var r3=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,i3={markers:`*`,classPrefix:q4,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>r3})},a3=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,o3=/<!--([\s\S]*?)-->/g;function s3(){return e=>{l3(e),qP(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=c3(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),[WP,t+a.length]})}}function c3(e){let t=[];a3.lastIndex=0;let n;for(;(n=a3.exec(e))!==null;)n[1].trim().length!==0&&t.push({start:n.index,end:n.index+n[0].length,body:n[1],sourceForm:`percent`});o3.lastIndex=0;let r;for(;(r=o3.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 l3(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(e.type===`paragraph`){let r=u3(e);if(r!==null){let e=d3(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=f3(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=p3(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=m3(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`&&g3(e)){let e=n+1;for(;e<t.length;){let n=t[e];if(n.type===`paragraph`&&g3(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 u3(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function d3(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function f3(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 p3(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(h3(r,`<!--`)>1||h3(r,`-->`)>0)return null}else if(t===e.children.length-1){if(h3(r,`<!--`)>0||h3(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 m3(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 h3(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 g3(e){let t=u3(e);return t===null?!1:t.trim()===`%%`}var _3=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,v3=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,y3=/^\s*<\/details>\s*$/;function b3(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 x3(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 S3(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function C3(e){return e.children[0].value??``}function w3(e){if(!S3(e))return null;let t=C3(e).match(_3);if(!t)return null;let{defaultOpen:n,name:r,id:i}=b3(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:x3({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function T3(e,t){let n=e[t];if(!S3(n))return null;let r=C3(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(v3);if(!i)return null;let{defaultOpen:a,name:o,id:s}=b3(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!S3(t))continue;let r=C3(t);if(y3.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function E3(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(S3(e)){let r=w3(e);if(r){t[n]=r,n++;continue}let i=T3(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:x3(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 D3(){return e=>{qP(e,e=>{`children`in e&&Array.isArray(e.children)&&E3(e)})}}var O3=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function k3(){return e=>{qP(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`==`)===-1)return;O3.lastIndex=0;let i=[],a;for(;(a=O3.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),[WP,t+o.length]}),qP(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 A3(){return e=>{qP(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=j3(r,e);n.children[t]=i})}}function j3(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}var M3=/^( {4}|\t)/;function N3(e){let t=e.split(`
396
- `),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!M3.test(e)))return!1;return n}function P3(e){return e.split(`
394
+ `;)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]=y4;t=n.join(``)}}return t}function M4(e){return e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)}function N4(){return e=>{qP(e,e=>{let t=e;typeof t.value==`string`&&M4(t.value)&&(t.value=P4(t.value)),typeof t.url==`string`&&M4(t.url)&&(t.url=P4(t.url)),typeof t.title==`string`&&M4(t.title)&&(t.title=P4(t.title)),typeof t.alt==`string`&&M4(t.alt)&&(t.alt=P4(t.alt))})}}function P4(e){return e.replaceAll(h4,`<`).replaceAll(g4,`>`).replaceAll(_4,`:`).replaceAll(v4,`@`).replaceAll(y4,`{`)}var F4=``,I4=``,L4=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function R4(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function z4(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||R4(e,r)%2==1?t:n(t))}function B4(e){return z4(e,L4,e=>`${F4}${e.slice(1,-1)}${I4}`)}var V4=RegExp(`${F4}([^${I4}]+)${I4}`,`g`);function H4(e){if(!e.includes(F4))return{value:e,spans:[]};let t=[],n=``,r=0;V4.lastIndex=0;let i=V4.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=V4.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function U4(){return e=>{qP(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(F4)){let{value:n,spans:r}=H4(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(F4)&&(t[e]=H4(n).value)}})}}var W4=``,G4=/\\</g;function K4(e){return z4(e,G4,e=>`${W4}${e.slice(1)}`)}function q4(){return e=>{qP(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(W4)&&(t.value=t.value.split(W4).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(W4)&&(t[e]=n.split(W4).join(``))}})}}var J4=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),Y4={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`},X4=`ok-alert`,Z4=RegExp(`(?:^|\\s)${X4}-(\\w+)(?:\\s|$)`),Q4=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function $4(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
395
+ `,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(Q4);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function e3(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(Z4);return n?n[1].toLowerCase():null}function t3(e){return Y4[e.toLowerCase()]??null}function n3(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&&r3(o[0],s)?o.slice(1):o,position:e.position}}function r3(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 i3(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${X4}-title`)}function a3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;qP(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=e3(e);if(!i)return;let a=t3(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=$4(n,e.position.start.offset),s&&(o=s.title,a||=t3(s.rawType)));let c=a??`note`,l=s&&J4.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=$4(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!i3(e.children[0]))return;let f=n3(e,c,o,l,d);r.children[t]=f})}}var o3=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,s3={markers:`*`,classPrefix:X4,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>o3})},c3=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,l3=/<!--([\s\S]*?)-->/g;function u3(){return e=>{f3(e),qP(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=d3(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),[WP,t+a.length]})}}function d3(e){let t=[];c3.lastIndex=0;let n;for(;(n=c3.exec(e))!==null;)n[1].trim().length!==0&&t.push({start:n.index,end:n.index+n[0].length,body:n[1],sourceForm:`percent`});l3.lastIndex=0;let r;for(;(r=l3.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 f3(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(e.type===`paragraph`){let r=p3(e);if(r!==null){let e=m3(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=h3(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=g3(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=_3(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`&&y3(e)){let e=n+1;for(;e<t.length;){let n=t[e];if(n.type===`paragraph`&&y3(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 p3(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function m3(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function h3(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 g3(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(v3(r,`<!--`)>1||v3(r,`-->`)>0)return null}else if(t===e.children.length-1){if(v3(r,`<!--`)>0||v3(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 _3(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 v3(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 y3(e){let t=p3(e);return t===null?!1:t.trim()===`%%`}var b3=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,x3=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,S3=/^\s*<\/details>\s*$/;function C3(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 w3(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 T3(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function E3(e){return e.children[0].value??``}function D3(e){if(!T3(e))return null;let t=E3(e).match(b3);if(!t)return null;let{defaultOpen:n,name:r,id:i}=C3(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:w3({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function O3(e,t){let n=e[t];if(!T3(n))return null;let r=E3(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(x3);if(!i)return null;let{defaultOpen:a,name:o,id:s}=C3(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!T3(t))continue;let r=E3(t);if(S3.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function k3(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(T3(e)){let r=D3(e);if(r){t[n]=r,n++;continue}let i=O3(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:w3(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 A3(){return e=>{qP(e,e=>{`children`in e&&Array.isArray(e.children)&&k3(e)})}}var j3=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function M3(){return e=>{qP(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`==`)===-1)return;j3.lastIndex=0;let i=[],a;for(;(a=j3.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),[WP,t+o.length]}),qP(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 N3(){return e=>{qP(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=P3(r,e);n.children[t]=i})}}function P3(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}var F3=/^( {4}|\t)/;function I3(e){let t=e.split(`
396
+ `),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!F3.test(e)))return!1;return n}function L3(e){return e.split(`
397
397
  `).map(e=>e.length===0?e:e.startsWith(` `)?e.slice(4):e.startsWith(` `)?e.slice(1):e).join(`
398
- `)}function F3(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]!==`
399
- `;)a--;if(a===r)return null;let o=t.slice(a,r);if(!M3.test(o))return null;let s=t.slice(a,i);if(!N3(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:P3(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var I3=function(){return(e,t)=>{let n=String(t.value??``);n&&qP(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=F3(e,n);a&&(r.children[t]=a)})}};function L3(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function R3(){return e=>{qP(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=L3(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),qP(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=L3(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var z3=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function B3(e){let t=[],n=!1;for(let r of e.children){if(r.type!==`text`){t.push(r);continue}let e=r.value;z3.lastIndex=0;let i=[],a=0;for(;;){let t=z3.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 V3(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(`
400
- `),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)}var H3=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function U3(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 W3(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&&H3.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]!==`
398
+ `)}function R3(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]!==`
399
+ `;)a--;if(a===r)return null;let o=t.slice(a,r);if(!F3.test(o))return null;let s=t.slice(a,i);if(!I3(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:L3(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var z3=function(){return(e,t)=>{let n=String(t.value??``);n&&qP(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=R3(e,n);a&&(r.children[t]=a)})}};function B3(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function V3(){return e=>{qP(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=B3(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),qP(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=B3(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var H3=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function U3(e){let t=[],n=!1;for(let r of e.children){if(r.type!==`text`){t.push(r);continue}let e=r.value;H3.lastIndex=0;let i=[],a=0;for(;;){let t=H3.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 W3(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(`
400
+ `),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)}var G3=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function K3(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 q3(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&&G3.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]!==`
401
401
  `;)n--;let r=!1;for(let e=n;e<i;e++)if(t[e]===`>`){r=!0;break}let o=t.slice(i,a).split(`
402
402
  `),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(`
403
403
  `);if(r===-1)break;let o=n.slice(r+1),s=o.indexOf(`
404
404
  `),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(`
405
- `);a!==-1&&(i=i.slice(0,a));let o=U3(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]===`
405
+ `);a!==-1&&(i=i.slice(0,a));let o=K3(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]===`
406
406
  `);)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(`
407
- `)?`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}}var G3=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function K3(){return new RegExp(G3,`g`)}var q3=K3();function J3(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 Y3(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;q3.lastIndex=0;let o=[],s=0;for(;;){let n=q3.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&&J3(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)}var X3=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 Z3(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 Q3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;V3(e,t);let r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;qP(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!X3.has(e.type)){let r=Z3(e,n);return i.children[t]=r,WP}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(B3(t),Y3(t,n))}if(W3(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 $3(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function e6(){return e=>{qP(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=$3(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function t6(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var n6=(e,t)=>{if(t6(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},r6=CK(),i6=IG(),a6=LG();function o6(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===r6)||t.push(r6);let n=e.fromMarkdownExtensions;n.some(e=>e===i6)||n.push(i6);let r=e.toMarkdownExtensions;r.some(e=>e===a6)||r.push(a6)}var s6=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function c6(){return e=>{qP(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`$`)===-1)return;s6.lastIndex=0;let i=[],a;for(;(a=s6.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),[WP,t+o.length]})}}var l6={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function u6(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===l6)||e.toMarkdownExtensions.push(l6)}var d6=33,f6=91,p6=93,m6=124,h6=35,g6={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===f6?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===f6?(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===f6?n(t):t===p6?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===h6?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===m6?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===f6?n(t):t===p6?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===m6?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===f6?n(t):t===p6?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===p6?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===p6?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},_6={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===d6?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===f6?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===f6?(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===f6?n(t):t===p6?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===h6?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===m6?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===f6?n(t):t===p6?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===m6?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===f6?n(t):t===p6?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===p6?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===p6?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function v6(){return{text:{[f6]:g6,[d6]:_6}}}function y6(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function b6(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function x6(e){return e.stack[e.stack.length-1]}function S6(e){let t=x6(this);t.data.target=this.sliceSerialize(e).trim()}function C6(e){let t=x6(this),n=this.sliceSerialize(e).trim();t.data.anchor=n.length?n:null}function w6(e){let t=x6(this),n=this.sliceSerialize(e).trim();t.data.alias=n.length?n:null}function T6(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 E6(e){T6(x6(this)),this.exit(e)}function D6(e){T6(x6(this)),this.exit(e)}var O6={enter:{wikiLink:y6,wikiLinkEmbed:b6},exit:{wikiLinkTarget:S6,wikiLinkAnchor:C6,wikiLinkAlias:w6,wikiLink:E6,wikiLinkEmbed:D6}},k6={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`]}]},A6=v6();function j6(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===A6)||e.micromarkExtensions.push(A6),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===O6)||e.fromMarkdownExtensions.push(O6),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===k6)||e.toMarkdownExtensions.push(k6)}function M6(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var N6=[{name:`remark-parse`,plugin:IW},{name:`remark-frontmatter`,plugin:FU,options:[`yaml`]},{name:`remark-mdx-agnostic`,plugin:o6},{name:`remark-gfm`,plugin:kH},{name:`remark-math`,plugin:ZU,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:j6},{name:`remark-github-alerts`,plugin:zU,options:i3},{name:`callout-transformer`,plugin:n3},{name:`restore-from-mdx`,plugin:A4},{name:`restore-entity-refs`,plugin:B4},{name:`restore-backslash-escapes`,plugin:W4},{name:`details-accordion-promoter`,plugin:D3},{name:`image-promoter`,plugin:A3},{name:`indented-code-promoter`,plugin:I3},{name:`math-promoter`,plugin:R3},{name:`single-dollar-math-promoter`,plugin:c6},{name:`highlight-promoter`,plugin:k3},{name:`mermaid-promoter`,plugin:e6},{name:`comment-promoter`,plugin:s3},{name:`merged-post-parse-walker`,plugin:Q3},{name:`ensure-non-empty-doc`,plugin:()=>M6}];function P6(e){let t=RH();for(let e of N6)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(uU,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function F6(e){let t=RH().use(FU,[`yaml`]).use(kH,{tablePipeAlign:!1}).use(ZU,{singleDollarTextMath:!1}).use(o6).use(j6).use(u6).use(AH,{bullet:`-`,fences:!0,rule:`-`,join:[n6],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function I6(e,t){let n=new ON(L4(O4(U4(e)))),r=t.parse(n);n.value=e;let i=t.runSync(r,n);return t.stringify(i)}function L6(e,t){let n=new ON(L4(O4(U4(e)))),r=t.parse(n);return n.value=e,t.runSync(r,n)}function R6(e,t,n){let r=fU(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});return String(t.stringify(r))}function z6(){return!1}function B6(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function V6(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function H6(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!e1(e))return e;let n=V6(B6(t),e);return n===``||n===`..`||n.startsWith(`../`)?(z6()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var U6={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&E1(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+=J6(n,t.slice(o,e),r)),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=J6(n,t.slice(o),r)),a}return J6(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}>`:K6(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(G6(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(K6(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`?`
408
- `:` `;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(K6(d)),e()}if(e.title){let t=i===`multiline`?`
409
- `:` `;l+=s.move(G6(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`?`\\
407
+ `)?`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}}var J3=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function Y3(){return new RegExp(J3,`g`)}var X3=Y3();function Z3(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 Q3(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;X3.lastIndex=0;let o=[],s=0;for(;;){let n=X3.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&&Z3(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)}var $3=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 e6(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 t6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;W3(e,t);let r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;qP(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!$3.has(e.type)){let r=e6(e,n);return i.children[t]=r,WP}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(U3(t),Q3(t,n))}if(q3(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 n6(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function r6(){return e=>{qP(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=n6(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function i6(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var a6=(e,t)=>{if(i6(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},o6=CK(),s6=IG(),c6=LG();function l6(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===o6)||t.push(o6);let n=e.fromMarkdownExtensions;n.some(e=>e===s6)||n.push(s6);let r=e.toMarkdownExtensions;r.some(e=>e===c6)||r.push(c6)}var u6=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function d6(){return e=>{qP(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`$`)===-1)return;u6.lastIndex=0;let i=[],a;for(;(a=u6.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),[WP,t+o.length]})}}var f6={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function p6(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===f6)||e.toMarkdownExtensions.push(f6)}var m6=33,h6=91,g6=93,_6=124,v6=35,y6={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===h6?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===h6?(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===h6?n(t):t===g6?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===v6?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===_6?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===h6?n(t):t===g6?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===_6?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===h6?n(t):t===g6?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===g6?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===g6?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},b6={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===m6?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===h6?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===h6?(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===h6?n(t):t===g6?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===v6?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===_6?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===h6?n(t):t===g6?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===_6?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===h6?n(t):t===g6?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===g6?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===g6?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function x6(){return{text:{[h6]:y6,[m6]:b6}}}function S6(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function C6(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function w6(e){return e.stack[e.stack.length-1]}function T6(e){let t=w6(this);t.data.target=this.sliceSerialize(e).trim()}function E6(e){let t=w6(this),n=this.sliceSerialize(e).trim();t.data.anchor=n.length?n:null}function D6(e){let t=w6(this),n=this.sliceSerialize(e).trim();t.data.alias=n.length?n:null}function O6(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 k6(e){O6(w6(this)),this.exit(e)}function A6(e){O6(w6(this)),this.exit(e)}var j6={enter:{wikiLink:S6,wikiLinkEmbed:C6},exit:{wikiLinkTarget:T6,wikiLinkAnchor:E6,wikiLinkAlias:D6,wikiLink:k6,wikiLinkEmbed:A6}},M6={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`]}]},N6=x6();function P6(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===N6)||e.micromarkExtensions.push(N6),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===j6)||e.fromMarkdownExtensions.push(j6),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===M6)||e.toMarkdownExtensions.push(M6)}function F6(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var I6=[{name:`remark-parse`,plugin:IW},{name:`remark-frontmatter`,plugin:FU,options:[`yaml`]},{name:`remark-mdx-agnostic`,plugin:l6},{name:`remark-gfm`,plugin:kH},{name:`remark-math`,plugin:ZU,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:P6},{name:`remark-github-alerts`,plugin:zU,options:s3},{name:`callout-transformer`,plugin:a3},{name:`restore-from-mdx`,plugin:N4},{name:`restore-entity-refs`,plugin:U4},{name:`restore-backslash-escapes`,plugin:q4},{name:`details-accordion-promoter`,plugin:A3},{name:`image-promoter`,plugin:N3},{name:`indented-code-promoter`,plugin:z3},{name:`math-promoter`,plugin:V3},{name:`single-dollar-math-promoter`,plugin:d6},{name:`highlight-promoter`,plugin:M3},{name:`mermaid-promoter`,plugin:r6},{name:`comment-promoter`,plugin:u3},{name:`merged-post-parse-walker`,plugin:t6},{name:`ensure-non-empty-doc`,plugin:()=>F6}];function L6(e){let t=RH();for(let e of I6)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(uU,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function R6(e){let t=RH().use(FU,[`yaml`]).use(kH,{tablePipeAlign:!1}).use(ZU,{singleDollarTextMath:!1}).use(l6).use(P6).use(p6).use(AH,{bullet:`-`,fences:!0,rule:`-`,join:[a6],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function z6(e,t){let n=new ON(B4(j4(K4(e)))),r=t.parse(n);n.value=e;let i=t.runSync(r,n);return t.stringify(i)}function B6(e,t){let n=new ON(B4(j4(K4(e)))),r=t.parse(n);return n.value=e,t.runSync(r,n)}function V6(e,t,n){let r=fU(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});return String(t.stringify(r))}function H6(){return!1}function U6(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function W6(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function G6(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!r1(e))return e;let n=W6(U6(t),e);return n===``||n===`..`||n.startsWith(`../`)?(H6()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var K6={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&k1(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+=Z6(n,t.slice(o,e),r)),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=Z6(n,t.slice(o),r)),a}return Z6(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}>`:Y6(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(J6(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(Y6(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`?`
408
+ `:` `;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(Y6(d)),e()}if(e.title){let t=i===`multiline`?`
409
+ `:` `;l+=s.move(J6(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`?`\\
410
410
  `:`
411
411
  `},code(e){let t=e.value??``;if(e.data?.sourceStyle===`indented`)return t.split(`
412
412
  `).map(e=>e.length>0?` ${e}`:e).join(`
@@ -419,4 +419,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
419
419
 
420
420
  `:`
421
421
  `;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(`
422
- `)},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=W6(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=W6(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 W6(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 G6(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function K6(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 q6(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function J6(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 q6(i)}function Y6(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 X6=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Ky(e.extensions),this.handlers=o8(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=s8(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=P6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=F6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:U6})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return I6(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?L6(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?Z2(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 R6(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},Z6=N2();function Q6(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 $6(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 e8(e){return e.attrs.sourceDirty||$6(e)}function t8(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 n8(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 r8(e,t){if(e.length===0)return n8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return n8({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:[r8(n.children,t)]}}return n8({type:`inlineCode`,value:i8(e)},t)}function i8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=i8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var a8=D$;function o8(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=sU(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=sU(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=>{let r=e.url??``,i=H6(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){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=cU(a)),r.highlight&&(i.mark=cU(r.highlight)),r.comment&&(i.comment=cU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=sU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=cU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=cU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=sU(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=sU(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=sU(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 r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=Z6.getOrWildcard(o),c=Q6(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=H6(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}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=R1(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&&a8.has(l)&&n.jsxComponent&&Z6.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&&O$.has(l)&&n.jsxComponent&&Z6.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&&k$.has(l)&&n.jsxComponent&&Z6.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&&A$.has(l)&&n.jsxComponent&&Z6.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:Y6(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(P$.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=sU(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 s8(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=pU(`paragraph`)),r.blockquote&&(t.blockquote=pU(`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=pU(`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=pU(`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&&t8(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=pU(`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=pU(`tableCell`,a)),r.tableHeader&&(t.tableHeader=pU(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??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!e8(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:Z6.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:Z6,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=mU(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=mU(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return r8(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=mU(`delete`)}return i.highlight&&(n.highlight=mU(`mark`)),i.comment&&(n.comment=mU(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=pU(`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=pU(`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 E1(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}}var c8=/\p{M}+/gu,l8=/[^\p{L}\p{N}]+/gu,u8=/^-+|-+$/g;function d8(e){return e.trim().normalize(`NFKD`).replace(c8,``).toLowerCase().replace(l8,`-`).replace(u8,``)}function f8(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function p8(e,t){let n=d8(e);return n?f8(n,t):``}function m8(e,t){let n=d8(e);return t?`#${n}-${d8(t)}`:`#${n}`}var h8=new Set([`img`,`video`,`audio`,`mark`]);function g8(e){let t=e.name;if(!t||!h8.has(t))return null;let n={};for(let t of e.attributes){if(t.type!==`mdxJsxAttribute`)return null;let e=t.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(t.value===null)n[t.name]=!0;else if(typeof t.value==`string`)n[t.name]=t.value;else return null}return{type:`element`,tagName:t,properties:n,children:[]}}var _8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:m8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},v8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:m8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},y8=(e,t)=>{let n=t,r=g8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,i),e.applyData(t,i)},b8=(e,t)=>{let n=t,r=g8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,i),e.applyData(t,i)},x8=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},S8=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function C8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(C8).join(``):``}var w8={wikiLink:_8,wikiLinkEmbed:v8,mdxJsxFlowElement:y8,mdxJsxTextElement:b8,rawMdxFallback:x8,mark:S8,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:C8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:C8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},T8=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,E8=/\bexpression\s*\(/i,D8=1e4;function O8(e){return!(e.length>D8||T8.test(e)||E8.test(e))}function k8(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!$$(e.split(/\s+/)[0]??``))return!1}return!0}var A8=()=>e=>{qP(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!$$(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!$$(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!$$(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!k8(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!k8(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!$$(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!O8(r)&&delete n.style})};function j8(e){let t=RH().use(IW).use(FU,[`yaml`]).use(o6).use(kH).use(j6).use(cJ,{handlers:w8}).use(A8).use(xq);return String(t.processSync(e))}N({docName:J1,summary:X1,content:A().optional(),...Y1}).loose(),N({docName:J1,summary:X1,markdown:A().min(1),position:Wa([`append`,`prepend`,`replace`]).optional(),...Y1}).loose(),N({docName:J1,summary:X1,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...Y1}).loose(),N({docName:J1,connectionId:A().min(1),scope:Wa([`last`,`session`,`file`]).optional(),...Y1}).loose();var M8=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),N8=N({type:Ga(`orphan`),parentCandidates:M(A()),message:A()}).loose();N({timestamp:A().min(1),summary:M8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(N8).optional(),summary:M8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:M8.optional()}).loose(),N({docName:A().min(1),scope:Wa([`last`,`session`]),undone:Ta()}).loose(),N({docName:A().min(1),content:A()}).loose();var P8=N({documents:M(N({kind:Wa([`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:Ta().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:Wa([`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(),F8=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),I8=N({docName:A().min(1),backlinks:M(F8)}).loose();N({counts:Ha(A().min(1),j().int().nonnegative())}).loose();var L8=Ra(`kind`,[N({kind:Ga(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:Ga(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),R8=N({docName:A().min(1),forwardLinks:M(L8)}).loose(),z8=Ra(`kind`,[N({id:A().min(1),kind:Ga(`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:Ga(`external`),url:A().min(1),label:A()}).loose()]),B8=N({source:A().min(1),target:A().min(1)}).loose(),V8=N({nodes:M(z8),links:M(B8)}).loose(),H8=N({id:A().min(1),name:A().optional(),email:A().optional()}).loose(),U8=N({name:A().optional(),email:A().optional()}).loose();N({message:A().optional(),writers:M(H8).optional(),principal:U8.optional(),...Y1}).loose(),N({checkpointRef:A().min(1),versionTag:A().min(1).optional()}).loose();var W8=N({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:M(A()),summaries:M(A()).optional()}).loose();N({entries:M(N({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:Wa([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(W8),checkpoint:ka().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Ta().optional()}).loose(),N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),N({lines:M(N({type:Wa([`added`,`removed`,`unchanged`]),text:A()}).loose()),additions:j().int().nonnegative(),deletions:j().int().nonnegative()}).loose();var G8=N({contentDir:A().min(1),pathSeparator:Wa([`/`,`\\`]),symlinkResolved:Ta()}).loose();M(Ra(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:Ga(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:Ga(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var K8=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),q8=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),J8=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose();N({deadLinks:M(N({target:A().min(1),sources:M(J8)}).loose())}).loose(),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:Ta()}).loose(),N({dir:A().min(1)}).loose(),N({port:j().int().positive()}).loose(),N({host:A().min(1).optional()}).loose(),N({pat:A().min(1),host:A().min(1).optional()}).loose(),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(),N({identity:N({name:A().min(1),email:A().min(1)}).loose().nullable()}).loose(),N({authenticated:Ta()}).loose(),N({type:Ga(`complete`).optional(),login:A().min(1).optional()}).loose(),N({}).loose();var Y8=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),X8=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(Y8)}).loose(),Z8=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),Q8=N({sessionAlive:Ta(),agent:Z8.nullable(),files:M(X8)}).loose(),$8=N({diff:A(),generatedAt:j().int().min(0)}).loose();N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose();var e5=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:Wa([`idle`,`writing`]),ts:j().int().min(0)}).loose();N({presence:Ha(A().min(1),e5)}).loose(),Ha(A().min(1),Ta()).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(),N({}).loose();var t5=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose();N({}).loose(),N({path:A().min(1),...Y1,summary:X1}).loose();var n5=N({docName:A().min(1)}).loose();N({path:A().min(1),...Y1,summary:X1}).loose();var r5=N({path:A().min(1)}).loose(),i5=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1)}).loose())}).loose(),a5=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),o5=N({docName:A().min(1),headings:M(a5)}).loose();N({docName:A().min(1),newDocName:A().min(1),summary:X1,...Y1}).loose();var s5=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({renamed:M(t5),rewrittenDocs:M(s5),summary:M8.optional()}).loose(),N({kind:Wa([`file`,`folder`]),fromPath:A().min(1),toPath:A().min(1),...Y1,summary:X1}).loose();var c5=N({renamed:M(t5),rewrittenDocs:M(s5).optional(),summary:M8.optional()}).loose();N({kind:Wa([`file`,`folder`]),path:A().min(1),...Y1}).loose();var l5=N({deletedDocNames:M(A().min(1))}).loose();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:X1,...Y1}).loose(),N({restoredFrom:A().min(1),timestamp:A().min(1),summary:M8.optional()}).loose(),N({state:Wa([`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:Ta(),syncEnabled:Ta(),identityUnresolved:Ta(),error:A().optional(),pausedReason:A().optional()}).loose(),N({op:Wa([`sync`,`push`,`pull`]).optional()}).loose(),N({op:Wa([`sync`,`push`,`pull`])}).loose(),N({conflicts:M(N({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),N({file:A().min(1),strategy:Wa([`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`]}),N({}).loose(),N({file:A().min(1),base:A(),ours:A(),theirs:A()}).loose(),N({}).loose(),N({plan:mo(e=>e!==void 0,{message:`plan is required`})}).loose(),N({plan:mo(e=>e!==void 0,{message:`plan is required`})}).loose(),N({result:mo(e=>e!==void 0,{message:`result is required`})}).loose();var u5=N({path:A().min(1),summary:A().min(1)}).loose();N({packs:M(N({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:M(u5)}).loose())}).loose(),N({noOpen:Ta().optional(),out:A().min(1).optional()}).loose();var d5=N({reason:Wa([`unsupported-platform`,`spawn-error`]),message:A()}).loose();Ra(`status`,[N({status:Ga(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:Ga(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:d5.optional()}).loose(),N({status:Ga(`failed`),buildError:A()}).loose(),N({status:Ga(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Ta()}).loose())}).loose();var f5=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose();N({name:A().min(1),docs:M(f5)}).loose(),N({folder:ka(),frontmatter_local:Ha(A(),ka()).nullable()}).loose(),N({path:A(),frontmatter:Ha(A(),ka()).optional()}).loose(),N({applied:ka()}).loose();var p5=Ha(A(),ka()).meta({description:`Free-form frontmatter map embedded in template payloads.`});N({template:N({name:A().min(1),folder:A(),scope:Wa([`local`,`inherited`]),path:A().min(1),frontmatter:p5,body:A()}).loose()}).loose(),N({folder:A(),name:A(),body:A().optional(),frontmatter:p5.optional()}).loose(),N({path:A().min(1),created:Ta(),warnings:M(A())}).loose(),N({existed:Ta(),path:A().min(1)}).loose(),N({query:A().optional(),intent:Wa([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(Wa([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional()}).loose();var m5=N({kind:Wa([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:Ha(A(),ka()),snippet:A().optional()}).loose();N({query:A(),intent:Wa([`autocomplete`,`full_text`,`omnibar`]),results:M(m5),elapsedMs:j().nonnegative()}).loose();var h5=N({version:A().min(1),recordedAt:A().min(1)}).loose();N({currentVersion:A().min(1),targets:Ha(A(),h5.nullable())}).loose();var g5=`server-info`,_5=`branch-switched`,v5=`disk-ack`,y5=`config-validation-rejected`,b5=`config-ignore-nested-error`,x5=Wa([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),S5=N({v:Ga(1),ch:Ga(g5),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),C5=N({v:Ga(1),ch:Ga(_5),seq:j(),branch:A().min(1)}).loose(),w5=N({v:Ga(1),ch:x5,seq:j()}).loose(),T5=N({v:Ga(1),ch:Ga(v5),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),E5=N({v:Ga(1),ch:Ga(y5),seq:j(),docName:A().min(1),error:o$}).loose(),D5=N({v:Ga(1),ch:Ga(b5),seq:j(),path:A().min(1),error:A().min(1)}).loose(),O5={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},k5=new WeakMap;function A5(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function j5(e){return e.trim().toLowerCase()}function M5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function N5(e){return e.split(`/`).filter(Boolean).join(` `)}function P5(e){let t=M5(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:N5(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function F5(e){let t=rZ({schema:O5});return e.length>0&&mZ(t,e),t}function I5(e){let t={documents:e};return k5.set(t,F5(e)),t}function L5(e){let t=k5.get(e);if(t)return t;let n=F5(e.documents);return k5.set(e,n),n}function R5(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function z5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function B5(e,t){let n=j5(t);if(!n)return 0;let r=j5(e.title),i=j5(e.name),a=j5(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 V5(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 H5(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function U5(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 W5(e,t){return j5(t).length<4?0:+(e===`full_text`)}function G5(e,t,n={}){let r=n.intent??`omnibar`,i=A5(n.limit),a=new Set(n.scopes??R5(r)),o=e.documents.filter(e=>z5(e,a)),s=j5(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=WZ(L5(e),{term:s,properties:H5(r),boost:U5(r),tolerance:W5(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>z5(e.document,a)).map(e=>[e.document.id,e.score])),u=V5(o),d=new Map;for(let e of o)B5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)z5(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,B5(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)}var K5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),q5=globalThis;q5[K5]===void 0&&(q5[K5]=_r());var J5=q5[K5],Y5=Pa({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(J5,{description:`Recorded skill version for this target.`}),recordedAt:Pi().register(J5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:Wa([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`]).register(J5,{description:`Install-source surface that recorded this entry.`}).optional()});Pa({schema:Ga(1).register(J5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Pa({"claude-cowork":Y5.optional(),"cli-hosts":Y5.optional()}).register(J5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var X5=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function lne(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??une,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new X5(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function une(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function dne(){let e=!1,t=``,n=0;return r=>{let i=fne(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 fne(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var pne=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],mne={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},hne={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},Z5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function gne(e,t=pne){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function _ne(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function vne(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var yne={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function bne(e){return e?yne[e]??`bot`:`bot`}function xne(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Sne(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Cne(e){let[t]=xne(e);return Sne(t,45,32)}var wne=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Tne=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],Q5=`ok-user-name-v3`,$5=`ok-user-color-v3`;function e7(e){return e[Math.floor(Math.random()*e.length)]}function Ene(){return`${e7(wne)} ${e7(Tne)}`}function Dne(){return e7(Z5)}function t7(e){try{return localStorage.getItem(e)}catch{return null}}function n7(e,t){try{localStorage.setItem(e,t)}catch{}}function One(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=t7(Q5),r=t7($5);return n||(n=Ene(),n7(Q5,n)),r||(r=Dne(),n7($5,r)),{name:n,color:r,coeditor:e,tabId:t}}function kne(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}}function Ane(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var r7=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function i7(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function a7(e){return e.split(`/`).filter(Boolean)}function o7(e){let t=e.trim();return r7.test(t)||t.startsWith(`//`)}function jne(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=kne(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(o7(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=i7(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Mne(e,t){let n=e.trim();if(!n)return null;if(o7(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=i7(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Nne(e,t){let n=e.trim();if(!n||r7.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 Pne(e,t,n=null){let r=a7(e);r.pop();let i=a7(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function Fne(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}var s7=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ine=`VisuallyHidden`,c7=y.forwardRef((e,t)=>(0,_o.jsx)(c.span,{...e,ref:t,style:{...s7,...e.style}}));c7.displayName=Ine;var Lne=c7;function Rne(e){let t=e+`CollectionProvider`,[n,r]=l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=y.useRef(null),a=y.useRef(new Map).current;return(0,_o.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=d(s),u=y.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,_o.jsx)(c,{ref:p(t,a(s,n).collectionRef),children:r})});u.displayName=s;let f=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=d(f),g=y.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=y.useRef(null),s=p(t,o),c=a(f,n);return y.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,_o.jsx)(h,{[m]:``,ref:s,children:r})});g.displayName=f;function _(t){let n=a(e+`CollectionConsumer`,t);return y.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},_,r]}var zne=y.createContext(void 0);function Bne(e){let t=y.useContext(zne);return e||t||`ltr`}var l7=[`top`,`right`,`bottom`,`left`],u7=[`start`,`end`],d7=l7.reduce((e,t)=>e.concat(t,t+`-`+u7[0],t+`-`+u7[1]),[]),f7=Math.min,p7=Math.max,m7=Math.round,h7=Math.floor,g7=e=>({x:e,y:e}),Vne={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function _7(e,t,n){return p7(e,f7(t,n))}function v7(e,t){return typeof e==`function`?e(t):e}function y7(e){return e.split(`-`)[0]}function b7(e){return e.split(`-`)[1]}function x7(e){return e===`x`?`y`:`x`}function S7(e){return e===`y`?`height`:`width`}function C7(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function w7(e){return x7(C7(e))}function T7(e,t,n){n===void 0&&(n=!1);let r=b7(e),i=w7(e),a=S7(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=k7(o)),[o,k7(o)]}function Hne(e){let t=k7(e);return[E7(e),t,E7(t)]}function E7(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var D7=[`left`,`right`],O7=[`right`,`left`],Une=[`top`,`bottom`],Wne=[`bottom`,`top`];function Gne(e,t,n){switch(e){case`top`:case`bottom`:return n?t?O7:D7:t?D7:O7;case`left`:case`right`:return t?Une:Wne;default:return[]}}function Kne(e,t,n,r){let i=b7(e),a=Gne(y7(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(E7)))),a}function k7(e){let t=y7(e);return Vne[t]+e.slice(t.length)}function qne(e){return{top:0,right:0,bottom:0,left:0,...e}}function A7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:qne(e)}function j7(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function M7(e,t,n){let{reference:r,floating:i}=e,a=C7(t),o=w7(t),s=S7(o),c=y7(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(b7(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Jne(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=v7(t,e),p=A7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=j7(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=j7(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Yne=50,Xne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Jne},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=M7(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Yne&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=M7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zne=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=v7(e,t)||{};if(l==null)return{};let d=A7(u),f={x:n,y:r},p=w7(i),m=S7(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=f7(d[_],T),ee=f7(d[v],T),te=E,ne=C-h[m]-ee,re=C/2-h[m]/2+w,ie=_7(te,re,ne),ae=!c.arrow&&b7(i)!=null&&re!==ie&&a.reference[m]/2-(re<te?E:ee)-h[m]/2<0,D=ae?re<te?re-te:re-ne:0;return{[p]:f[p]+D,data:{[p]:ie,centerOffset:re-ie-D,...ae&&{alignmentOffset:D}},reset:ae}}});function Qne(e,t,n){return(e?[...n.filter(t=>b7(t)===e),...n.filter(t=>b7(t)!==e)]:n.filter(e=>y7(e)===e)).filter(n=>e?b7(n)===e||(t?E7(n)!==n:!1):!0)}var $ne=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=d7,autoAlignment:u=!0,...d}=v7(e,t),f=c!==void 0||l===d7?Qne(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=T7(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[y7(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=b7(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,b7(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},ere=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=v7(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=y7(r),_=C7(o),v=y7(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[k7(o)]:Hne(o)),x=p!==`none`;!d&&x&&b.push(...Kne(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=T7(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==C7(t))||T.every(e=>C7(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=C7(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function N7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function P7(e){return l7.some(t=>e[t]>=0)}var tre=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=v7(e,t);switch(i){case`referenceHidden`:{let e=N7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:P7(e)}}}case`escaped`:{let e=N7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:P7(e)}}}default:return{}}}}};function F7(e){let t=f7(...e.map(e=>e.left)),n=f7(...e.map(e=>e.top)),r=p7(...e.map(e=>e.right)),i=p7(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function nre(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>j7(F7(e)))}var rre=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=v7(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=nre(u),f=j7(F7(u)),p=A7(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(C7(n)===`y`){let e=d[0],t=d[d.length-1],r=y7(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=y7(n)===`left`,t=p7(...d.map(e=>e.right)),r=f7(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},I7=new Set([`left`,`top`]);async function ire(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=y7(n),s=b7(n),c=C7(n)===`y`,l=I7.has(o)?-1:1,u=a&&c?-1:1,d=v7(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var are=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ire(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ore=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=v7(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=C7(y7(i)),p=x7(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=_7(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=_7(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},sre=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=v7(e,t),u={x:n,y:r},d=C7(i),f=x7(d),p=u[f],m=u[d],h=v7(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=I7.has(y7(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},cre=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=v7(e,t),u=await o.detectOverflow(t,l),d=y7(i),f=b7(i),p=C7(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=f7(h-u[g],v),x=f7(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=p7(u.left,0),t=p7(u.right,0),n=p7(u.top,0),r=p7(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:p7(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:p7(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function L7(){return typeof window<`u`}function R7(e){return V7(e)?(e.nodeName||``).toLowerCase():`#document`}function z7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function B7(e){return((V7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function V7(e){return L7()?e instanceof Node||e instanceof z7(e).Node:!1}function H7(e){return L7()?e instanceof Element||e instanceof z7(e).Element:!1}function U7(e){return L7()?e instanceof HTMLElement||e instanceof z7(e).HTMLElement:!1}function W7(e){return!L7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof z7(e).ShadowRoot}function G7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Q7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function lre(e){return/^(table|td|th)$/.test(R7(e))}function K7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ure=/transform|translate|scale|rotate|perspective|filter/,dre=/paint|layout|strict|content/,q7=e=>!!e&&e!==`none`,J7;function Y7(e){let t=H7(e)?Q7(e):e;return q7(t.transform)||q7(t.translate)||q7(t.scale)||q7(t.rotate)||q7(t.perspective)||!X7()&&(q7(t.backdropFilter)||q7(t.filter))||ure.test(t.willChange||``)||dre.test(t.contain||``)}function fre(e){let t=e9(e);for(;U7(t)&&!Z7(t);){if(Y7(t))return t;if(K7(t))return null;t=e9(t)}return null}function X7(){return J7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),J7}function Z7(e){return/^(html|body|#document)$/.test(R7(e))}function Q7(e){return z7(e).getComputedStyle(e)}function $7(e){return H7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function e9(e){if(R7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||W7(e)&&e.host||B7(e);return W7(t)?t.host:t}function t9(e){let t=e9(e);return Z7(t)?e.ownerDocument?e.ownerDocument.body:e.body:U7(t)&&G7(t)?t:t9(t)}function n9(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=t9(e),i=r===e.ownerDocument?.body,a=z7(r);if(i){let e=r9(a);return t.concat(a,a.visualViewport||[],G7(r)?r:[],e&&n?n9(e):[])}else return t.concat(r,n9(r,[],n))}function r9(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function i9(e){let t=Q7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=U7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=m7(n)!==a||m7(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function a9(e){return H7(e)?e:e.contextElement}function o9(e){let t=a9(e);if(!U7(t))return g7(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=i9(t),o=(a?m7(n.width):n.width)/r,s=(a?m7(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var pre=g7(0);function s9(e){let t=z7(e);return!X7()||!t.visualViewport?pre:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mre(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==z7(e)?!1:t}function c9(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=a9(e),o=g7(1);t&&(r?H7(r)&&(o=o9(r)):o=o9(e));let s=mre(a,n,r)?s9(a):g7(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=z7(a),t=r&&H7(r)?z7(r):r,n=e,i=r9(n);for(;i&&r&&t!==n;){let e=o9(i),t=i.getBoundingClientRect(),r=Q7(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=z7(i),i=r9(n)}}return j7({width:u,height:d,x:c,y:l})}function l9(e,t){let n=$7(e).scrollLeft;return t?t.left+n:c9(B7(e)).left+n}function u9(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-l9(e,n),y:n.top+t.scrollTop}}function hre(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=B7(r),s=t?K7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=g7(1),u=g7(0),d=U7(r);if((d||!d&&!a)&&((R7(r)!==`body`||G7(o))&&(c=$7(r)),d)){let e=c9(r);l=o9(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?u9(o,c):g7(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function gre(e){return Array.from(e.getClientRects())}function _re(e){let t=B7(e),n=$7(e),r=e.ownerDocument.body,i=p7(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=p7(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+l9(e),s=-n.scrollTop;return Q7(r).direction===`rtl`&&(o+=p7(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var d9=25;function vre(e,t){let n=z7(e),r=B7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=X7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=l9(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=d9&&(a-=o)}else l<=d9&&(a+=l);return{width:a,height:o,x:s,y:c}}function yre(e,t){let n=c9(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=U7(e)?o9(e):g7(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function f9(e,t,n){let r;if(t===`viewport`)r=vre(e,n);else if(t===`document`)r=_re(B7(e));else if(H7(t))r=yre(t,n);else{let n=s9(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return j7(r)}function p9(e,t){let n=e9(e);return n===t||!H7(n)||Z7(n)?!1:Q7(n).position===`fixed`||p9(n,t)}function bre(e,t){let n=t.get(e);if(n)return n;let r=n9(e,[],!1).filter(e=>H7(e)&&R7(e)!==`body`),i=null,a=Q7(e).position===`fixed`,o=a?e9(e):e;for(;H7(o)&&!Z7(o);){let t=Q7(o),n=Y7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||G7(o)&&!n&&p9(e,o))?r=r.filter(e=>e!==o):i=t,o=e9(o)}return t.set(e,r),r}function xre(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?K7(t)?[]:bre(t,this._c):[].concat(n),r],o=f9(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=f9(t,a[e],i);s=p7(n.top,s),c=f7(n.right,c),l=f7(n.bottom,l),u=p7(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Sre(e){let{width:t,height:n}=i9(e);return{width:t,height:n}}function Cre(e,t,n){let r=U7(t),i=B7(t),a=n===`fixed`,o=c9(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=g7(0);function l(){c.x=l9(i)}if(r||!r&&!a)if((R7(t)!==`body`||G7(i))&&(s=$7(t)),r){let e=c9(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?u9(i,s):g7(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function m9(e){return Q7(e).position===`static`}function h9(e,t){if(!U7(e)||Q7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return B7(e)===n&&(n=n.ownerDocument.body),n}function g9(e,t){let n=z7(e);if(K7(e))return n;if(!U7(e)){let t=e9(e);for(;t&&!Z7(t);){if(H7(t)&&!m9(t))return t;t=e9(t)}return n}let r=h9(e,t);for(;r&&lre(r)&&m9(r);)r=h9(r,t);return r&&Z7(r)&&m9(r)&&!Y7(r)?n:r||fre(e)||n}var wre=async function(e){let t=this.getOffsetParent||g9,n=this.getDimensions,r=await n(e.floating);return{reference:Cre(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tre(e){return Q7(e).direction===`rtl`}var Ere={convertOffsetParentRelativeRectToViewportRelativeRect:hre,getDocumentElement:B7,getClippingRect:xre,getOffsetParent:g9,getElementRects:wre,getClientRects:gre,getDimensions:Sre,getScale:o9,isElement:H7,isRTL:Tre};function _9(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Dre(e,t){let n=null,r,i=B7(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=h7(d),h=h7(i.clientWidth-(u+f)),g=h7(i.clientHeight-(d+p)),_=h7(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:p7(0,f7(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!_9(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function v9(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=a9(e),u=i||a?[...l?n9(l):[],...t?n9(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Dre(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?c9(e):null;c&&g();function g(){let t=c9(e);h&&!_9(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var y9=are,Ore=$ne,b9=ore,x9=ere,S9=cre,C9=tre,w9=Zne,kre=rre,Are=sre,T9=(e,t,n)=>{let r=new Map,i={platform:Ere,...n},a={...i.platform,_c:r};return Xne(e,t,{...i,platform:a})},E9=typeof document<`u`?y.useLayoutEffect:function(){};function D9(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!D9(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!D9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function O9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function k9(e,t){let n=O9(e);return Math.round(t*n)/n}function A9(e){let t=y.useRef(e);return E9(()=>{t.current=e}),t}function jre(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);D9(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=y.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=y.useRef(null),w=y.useRef(null),T=y.useRef(u),E=c!=null,ee=A9(c),te=A9(i),ne=A9(l),re=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),T9(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!D9(T.current,t)&&(T.current=t,vo.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);E9(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=y.useRef(!1);E9(()=>(ie.current=!0,()=>{ie.current=!1}),[]),E9(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(ee.current)return ee.current(x,S,re);re()}},[x,S,re,ee,E]);let ae=y.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:b}),[v,b]),D=y.useMemo(()=>({reference:x,floating:S}),[x,S]),oe=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=k9(D.floating,u.x),r=k9(D.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...O9(D.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,D.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:re,refs:ae,elements:D,floatingStyles:oe}),[u,re,ae,D,oe])}var Mre=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:w9({element:r.current,padding:i}).fn(n):r?w9({element:r,padding:i}).fn(n):{}}}},Nre=(e,t)=>{let n=y9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pre=(e,t)=>{let n=b9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fre=(e,t)=>({fn:Are(e).fn,options:[e,t]}),Ire=(e,t)=>{let n=x9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lre=(e,t)=>{let n=S9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rre=(e,t)=>{let n=C9(e);return{name:n.name,fn:n.fn,options:[e,t]}},zre=(e,t)=>{let n=Mre(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bre=`Arrow`,j9=y.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,_o.jsx)(c.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,_o.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});j9.displayName=Bre;var Vre=j9,M9=`Popper`,[N9,Hre]=l(M9),[Ure,P9]=N9(M9),F9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return(0,_o.jsx)(Ure,{scope:t,anchor:r,onAnchorChange:i,children:n})};F9.displayName=M9;var I9=`PopperAnchor`,L9=y.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=P9(I9,n),o=y.useRef(null),s=p(t,o),l=y.useRef(null);return y.useEffect(()=>{let e=l.current;l.current=r?.current||o.current,e!==l.current&&a.onAnchorChange(l.current)}),r?null:(0,_o.jsx)(c.div,{...i,ref:s})});L9.displayName=I9;var R9=`PopperContent`,[Wre,Gre]=N9(R9),z9=y.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h=`partial`,hideWhenDetached:g=!1,updatePositionStrategy:_=`optimized`,onPlaced:b,...x}=e,S=P9(R9,n),[C,w]=y.useState(null),T=p(t,e=>w(e)),[E,ee]=y.useState(null),te=v(E),ne=te?.width??0,re=te?.height??0,ie=r+(a===`center`?``:`-`+a),ae=typeof m==`number`?m:{top:0,right:0,bottom:0,left:0,...m},D=Array.isArray(f)?f:[f],oe=D.length>0,se={padding:ae,boundary:D.filter(qre),altBoundary:oe},{refs:O,floatingStyles:ce,placement:le,isPositioned:ue,middlewareData:de}=jre({strategy:`fixed`,placement:ie,whileElementsMounted:(...e)=>v9(...e,{animationFrame:_===`always`}),elements:{reference:S.anchor},middleware:[Nre({mainAxis:i+re,alignmentAxis:o}),d&&Pre({mainAxis:!0,crossAxis:!1,limiter:h===`partial`?Fre():void 0,...se}),d&&Ire({...se}),Lre({...se,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&zre({element:E,padding:l}),Jre({arrowWidth:ne,arrowHeight:re}),g&&Rre({strategy:`referenceHidden`,...se})]}),[fe,pe]=H9(le),me=u(b);s(()=>{ue&&me?.()},[ue,me]);let he=de.arrow?.x,ge=de.arrow?.y,_e=de.arrow?.centerOffset!==0,[ve,ye]=y.useState();return s(()=>{C&&ye(window.getComputedStyle(C).zIndex)},[C]),(0,_o.jsx)(`div`,{ref:O.setFloating,"data-radix-popper-content-wrapper":``,style:{...ce,transform:ue?ce.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ve,"--radix-popper-transform-origin":[de.transformOrigin?.x,de.transformOrigin?.y].join(` `),...de.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,_o.jsx)(Wre,{scope:n,placedSide:fe,onArrowChange:ee,arrowX:he,arrowY:ge,shouldHideArrow:_e,children:(0,_o.jsx)(c.div,{"data-side":fe,"data-align":pe,...x,ref:T,style:{...x.style,animation:ue?void 0:`none`}})})})});z9.displayName=R9;var B9=`PopperArrow`,Kre={top:`bottom`,right:`left`,bottom:`top`,left:`right`},V9=y.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Gre(B9,n),a=Kre[i.placedSide];return(0,_o.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,_o.jsx)(Vre,{...r,ref:t,style:{...r.style,display:`block`}})})});V9.displayName=B9;function qre(e){return e!==null}var Jre=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=H9(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function H9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Yre=F9,Xre=L9,Zre=z9,Qre=V9;function U9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function $re(e){return e.kind===`asset`}function eie(e){return e.kind===`document`}function tie(e){return e.kind===`folder`}function nie(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function rie(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}var W9=null,G9=new Set;function K9(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function iie(e,t){return e===null?!1:e===t?!0:K9(e.pages,t.pages)&&K9(e.folderPaths,t.folderPaths)&&K9(e.assetPaths??new Set,t.assetPaths??new Set)}function aie(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function oie(){return W9}function sie(e){if(!iie(W9,e)){W9=e;for(let t of[...G9])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function cie(e){if(G9.add(e),W9!==null)try{e(W9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{G9.delete(e)}}var q9=`open-knowledge:documents-changed`,lie=new Set(x5.options);function J9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>lie.has(e)))]}function uie(e=[`files`]){window.dispatchEvent(new CustomEvent(q9,{detail:{channels:J9(e)}}))}function Y9(e){let t=t=>{e(J9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(q9,t),()=>window.removeEventListener(q9,t)}function X9(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function die(e){let t=X9(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function fie(e){let t=e.trim();return{normalizedTarget:X9(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function Z9(e){let t=new Set;for(let n of e)for(let e of nie(n))t.add(e);return t}function pie(e,t){if(!t)return;let n=d8(e);if(n)return t.get(n)}function mie(e,t){let{normalizedTarget:n,expectsFolder:r}=fie(e);if(!n)return{kind:`missing`,target:n};if(!r&&t.pages.has(n))return{kind:`doc`,target:n,docName:n};if(!r){let e=pie(n,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let i=`${n}/index`;if(t.pages.has(i))return{kind:`folder-index`,target:n,folderPath:n,docName:i,noteKind:`canonical-index`};let a=n.split(`/`).pop(),o=a?`${n}/${a}`:null;return o&&t.pages.has(o)?{kind:`folder-index`,target:n,folderPath:n,docName:o,noteKind:`legacy-folder-note`}:(t.folderPaths??Z9(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function hie(e){switch(e.kind){case`doc`:case`folder-index`:return e.docName;case`missing`:return e.target;case`asset`:case`folder`:return null}}var Q9=(0,y.createContext)(null);function gie(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function _ie(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function vie(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function yie(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(U9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function bie(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(U9(t)??`/api/documents responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.documents)?{assetPaths:t.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:t.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[]}}function xie(e){console.error(`[PageListContext] Failed to load pages:`,e)}function Sie(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function Cie(e){let t=(0,yo.c)(43),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,y.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,y.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,y.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,y.useState)(f),h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[4]=h):h=t[4];let[g,_]=(0,y.useState)(h),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[5]=v):v=t[5];let[b,x]=(0,y.useState)(v),[S,C]=(0,y.useState)(!0),[w,T]=(0,y.useState)(null),E=(0,y.useRef)(0),ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(){let e=E.current+=1;C(!0),Promise.all([yie(),bie().catch(Die)]).then(t=>{let[n,r]=t;if(e!==E.current)return;let i=new Set(n.map(Eie));a(i),c(new Map(n.map(Tie))),d(new Map(n.map(wie))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),x(e=>_ie(e,i)),T(null)}).catch(t=>{e===E.current&&(xie(t),T(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===E.current&&C(!1)})},t[6]=ee):ee=t[6];let te=ee,ne;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(ne=function(e){x(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),T(null)},t[7]=ne):ne=t[7];let re=ne,ie,ae;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{te();let e=()=>{document.visibilityState===`visible`&&te()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=Y9(e=>{e.includes(`files`)&&te()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},ie=[],t[8]=ie,t[9]=ae):(ie=t[8],ae=t[9]),(0,y.useEffect)(ae,ie);let D,oe,se,O,ce,le;if(t[10]!==b||t[11]!==p||t[12]!==g||t[13]!==u||t[14]!==s||t[15]!==i){ce=gie(i,b);let e;t[22]!==b||t[23]!==s?(e=vie(s,b),t[22]=b,t[23]=s,t[24]=e):e=t[24],O=e,se=u,D=p,oe=new Set([...Z9(ce),...g]),le=aie(ce,d8),t[10]=b,t[11]=p,t[12]=g,t[13]=u,t[14]=s,t[15]=i,t[16]=D,t[17]=oe,t[18]=se,t[19]=O,t[20]=ce,t[21]=le}else D=t[16],oe=t[17],se=t[18],O=t[19],ce=t[20],le=t[21];let ue=le,de,fe;t[25]!==D||t[26]!==oe||t[27]!==ce||t[28]!==ue?(de=()=>{sie({pages:ce,folderPaths:oe,pagesBySlug:ue,assetPaths:D})},fe=[ce,oe,ue,D],t[25]=D,t[26]=oe,t[27]=ce,t[28]=ue,t[29]=de,t[30]=fe):(de=t[29],fe=t[30]),(0,y.useEffect)(de,fe);let pe;t[31]!==D||t[32]!==w||t[33]!==oe||t[34]!==S||t[35]!==se||t[36]!==O||t[37]!==ce||t[38]!==ue?(pe={pages:ce,pagesBySlug:ue,pageTitles:O,pageMeta:se,folderPaths:oe,assetPaths:D,loading:S,error:w,refetch:te,addPage:re},t[31]=D,t[32]=w,t[33]=oe,t[34]=S,t[35]=se,t[36]=O,t[37]=ce,t[38]=ue,t[39]=pe):pe=t[39];let me;return t[40]!==n||t[41]!==pe?(me=(0,_o.jsx)(Q9,{value:pe,children:n}),t[40]=n,t[41]=pe,t[42]=me):me=t[42],me}function wie(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt}]}function Tie(e){return[e.docName,e.title]}function Eie(e){return e.docName}function Die(e){return Sie(e),{assetPaths:[],folderPaths:[]}}function Oie(){let e=(0,y.use)(Q9);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function kie(e){if(e.startsWith($9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function Aie(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}function jie(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}?anchor=${encodeURIComponent(t)}`:r}var $9=`#/__asset__/`;function Mie(e){if(!e.startsWith($9))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function Nie(e){return`${$9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}export{_$ as $,sx as $n,Mne as $t,x9 as A,s$ as An,au as Ar,X$ as At,mne as B,pQ as Bn,G8 as Bt,Zre as C,V2 as Cn,R as Cr,K8 as Ct,Ore as D,U2 as Dn,Xu as Dr,t0 as Dt,w9 as E,H2 as En,F as Er,$1 as Et,S9 as F,a2 as Fn,se as Fr,n0 as Ft,I8 as G,iQ as Gn,$Q as Gt,k$ as H,Nne as Hn,o0 as Ht,Bne as I,B$ as In,oe as Ir,O$ as It,E5 as J,m8 as Jn,W1 as Jt,C5 as K,C1 as Kn,s0 as Kt,Rne as L,l$ as Ln,ee as Lr,P$ as Lt,kre as M,e1 as Mn,Ga as Mr,g$ as Mt,y9 as N,a0 as Nn,N as Nr,Q1 as Nt,v9 as O,eQ as On,I as Or,h1 as Ot,b9 as P,j8 as Pn,A as Pr,j1 as Pt,b$ as Q,Sx as Qn,jne as Qt,Lne as R,F1 as Rn,E as Rr,L1 as Rt,Qre as S,z2 as Sn,lp as Sr,x$ as St,Hre as T,L2 as Tn,Vd as Tr,i5 as Tt,Q8 as U,G5 as Un,qQ as Ut,hne as V,fQ as Vn,Ane as Vt,$8 as W,V1 as Wn,zQ as Wt,T5 as X,Vte as Xn,Pne as Xt,w5 as Y,M5 as Yn,K1 as Yt,S5 as Z,tT as Zn,lne as Zt,$re as _,h$ as _n,mp as _r,J$ as _t,jie as a,I5 as an,Ky as ar,N$ as at,U9 as b,bne as bn,jp as br,X6 as bt,hie as c,m$ as cn,hb as cr,P8 as ct,X9 as d,XZ as dn,Iy as dr,H1 as dt,gne as en,mb as er,y$ as et,uie as f,Y6 as fn,_b as fr,R8 as ft,rie as g,I1 as gn,mv as gr,D$ as gt,cie as h,One as hn,P_ as hr,q8 as ht,Aie as i,N2 as in,Ly as ir,n5 as it,C9 as j,S$ as jn,pu as jr,Q$ as jt,T9 as k,o7 as kn,cu as kr,c5 as kt,mie as l,R1 as ln,jx as lr,A$ as lt,oie as m,p8 as mn,j_ as mr,t2 as mt,kie as n,_ne as nn,Ux as nr,X5 as nt,Cie as o,P5 as on,Jy as or,M$ as ot,Y9 as p,vne as pn,Hx as pr,Z5 as pt,D5 as q,d8 as qn,U1 as qt,Nie as r,dne as rn,Ax as rr,r5 as rt,Oie as s,Cne as sn,Yy as sr,l5 as st,Mie as t,q1 as tn,Kx as tr,v$ as tt,die as u,i7 as un,ny as ur,p$ as ut,eie as v,i2 as vn,z as vr,i1 as vt,Yre as w,B2 as wn,of as wr,o5 as wt,Xre as x,R2 as xn,L as xr,m1 as xt,tie as y,c$ as yn,Op as yr,V8 as yt,s7 as z,Fne as zn,B1 as zt};
422
+ `)},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=q6(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=q6(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 q6(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 J6(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function Y6(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 X6(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function Z6(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 X6(i)}function Q6(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 $6=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Ky(e.extensions),this.handlers=l8(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=u8(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=L6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=R6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:K6})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return z6(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?B6(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?e4(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 V6(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},e8=I2();function t8(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 n8(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 r8(e){return e.attrs.sourceDirty||n8(e)}function i8(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 a8(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 o8(e,t){if(e.length===0)return a8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return a8({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:[o8(n.children,t)]}}return a8({type:`inlineCode`,value:s8(e)},t)}function s8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=s8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var c8=A$;function l8(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=sU(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=sU(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=>{let r=e.url??``,i=G6(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){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=cU(a)),r.highlight&&(i.mark=cU(r.highlight)),r.comment&&(i.comment=cU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=sU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=cU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=cU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=sU(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=sU(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=sU(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 r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=e8.getOrWildcard(o),c=t8(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=G6(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}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=V1(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&&c8.has(l)&&n.jsxComponent&&e8.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&&j$.has(l)&&n.jsxComponent&&e8.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&&M$.has(l)&&n.jsxComponent&&e8.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&&N$.has(l)&&n.jsxComponent&&e8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:Q6(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(L$.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=sU(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 u8(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=pU(`paragraph`)),r.blockquote&&(t.blockquote=pU(`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=pU(`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=pU(`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&&i8(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=pU(`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=pU(`tableCell`,a)),r.tableHeader&&(t.tableHeader=pU(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??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!r8(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:e8.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:e8,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=mU(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=mU(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return o8(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=mU(`delete`)}return i.highlight&&(n.highlight=mU(`mark`)),i.comment&&(n.comment=mU(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=pU(`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=pU(`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 k1(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}}var d8=/\p{M}+/gu,f8=/[^\p{L}\p{N}]+/gu,p8=/^-+|-+$/g;function m8(e){return e.trim().normalize(`NFKD`).replace(d8,``).toLowerCase().replace(f8,`-`).replace(p8,``)}function h8(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function g8(e,t){let n=m8(e);return n?h8(n,t):``}function _8(e,t){let n=m8(e);return t?`#${n}-${m8(t)}`:`#${n}`}var v8=new Set([`img`,`video`,`audio`,`mark`]);function y8(e){let t=e.name;if(!t||!v8.has(t))return null;let n={};for(let t of e.attributes){if(t.type!==`mdxJsxAttribute`)return null;let e=t.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(t.value===null)n[t.name]=!0;else if(typeof t.value==`string`)n[t.name]=t.value;else return null}return{type:`element`,tagName:t,properties:n,children:[]}}var b8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:_8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},x8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:_8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},S8=(e,t)=>{let n=t,r=y8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,i),e.applyData(t,i)},C8=(e,t)=>{let n=t,r=y8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,i),e.applyData(t,i)},w8=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},T8=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function E8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(E8).join(``):``}var D8={wikiLink:b8,wikiLinkEmbed:x8,mdxJsxFlowElement:S8,mdxJsxTextElement:C8,rawMdxFallback:w8,mark:T8,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:E8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:E8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},O8=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,k8=/\bexpression\s*\(/i,A8=1e4;function j8(e){return!(e.length>A8||O8.test(e)||k8.test(e))}function M8(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!n1(e.split(/\s+/)[0]??``))return!1}return!0}var N8=()=>e=>{qP(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!n1(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!n1(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!n1(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!M8(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!M8(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!n1(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!j8(r)&&delete n.style})};function P8(e){let t=RH().use(IW).use(FU,[`yaml`]).use(l6).use(kH).use(P6).use(cJ,{handlers:D8}).use(N8).use(xq);return String(t.processSync(e))}N({docName:Z1,summary:$1,content:A().optional(),...Q1}).loose(),N({docName:Z1,summary:$1,markdown:A().min(1),position:Wa([`append`,`prepend`,`replace`]).optional(),...Q1}).loose(),N({docName:Z1,summary:$1,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...Q1}).loose(),N({docName:Z1,connectionId:A().min(1),scope:Wa([`last`,`session`,`file`]).optional(),...Q1}).loose();var F8=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),I8=N({type:Ga(`orphan`),parentCandidates:M(A()),message:A()}).loose();N({timestamp:A().min(1),summary:F8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(I8).optional(),summary:F8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:F8.optional()}).loose(),N({docName:A().min(1),scope:Wa([`last`,`session`]),undone:Ta()}).loose(),N({docName:A().min(1),content:A()}).loose();var L8=N({documents:M(N({kind:Wa([`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:Ta().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:Wa([`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(),R8=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),z8=N({docName:A().min(1),backlinks:M(R8)}).loose();N({counts:Ha(A().min(1),j().int().nonnegative())}).loose();var B8=Ra(`kind`,[N({kind:Ga(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:Ga(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),V8=N({docName:A().min(1),forwardLinks:M(B8)}).loose(),H8=Ra(`kind`,[N({id:A().min(1),kind:Ga(`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:Ga(`external`),url:A().min(1),label:A()}).loose()]),U8=N({source:A().min(1),target:A().min(1)}).loose(),W8=N({nodes:M(H8),links:M(U8)}).loose(),G8=N({id:A().min(1),name:A().optional(),email:A().optional()}).loose(),K8=N({name:A().optional(),email:A().optional()}).loose();N({message:A().optional(),writers:M(G8).optional(),principal:K8.optional(),...Q1}).loose(),N({checkpointRef:A().min(1),versionTag:A().min(1).optional()}).loose();var q8=N({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:M(A()),summaries:M(A()).optional()}).loose();N({entries:M(N({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:Wa([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(q8),checkpoint:ka().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Ta().optional()}).loose(),N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),N({lines:M(N({type:Wa([`added`,`removed`,`unchanged`]),text:A()}).loose()),additions:j().int().nonnegative(),deletions:j().int().nonnegative()}).loose();var J8=N({contentDir:A().min(1),pathSeparator:Wa([`/`,`\\`]),symlinkResolved:Ta()}).loose();M(Ra(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:Ga(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:Ga(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var Y8=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),X8=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),Z8=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose();N({deadLinks:M(N({target:A().min(1),sources:M(Z8)}).loose())}).loose(),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:Ta()}).loose(),N({dir:A().min(1)}).loose(),N({port:j().int().positive()}).loose(),N({host:A().min(1).optional()}).loose(),N({pat:A().min(1),host:A().min(1).optional()}).loose(),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(),N({identity:N({name:A().min(1),email:A().min(1)}).loose().nullable()}).loose(),N({authenticated:Ta()}).loose(),N({type:Ga(`complete`).optional(),login:A().min(1).optional()}).loose(),N({}).loose();var Q8=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),$8=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(Q8)}).loose(),e5=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),t5=N({sessionAlive:Ta(),agent:e5.nullable(),files:M($8)}).loose(),n5=N({diff:A(),generatedAt:j().int().min(0)}).loose();N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose();var r5=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:Wa([`idle`,`writing`]),ts:j().int().min(0)}).loose();N({presence:Ha(A().min(1),r5)}).loose(),Ha(A().min(1),Ta()).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(),N({}).loose();var i5=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose();N({}).loose(),N({path:A().min(1),...Q1,summary:$1}).loose();var a5=N({docName:A().min(1)}).loose();N({path:A().min(1),...Q1,summary:$1}).loose();var o5=N({path:A().min(1)}).loose(),s5=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1)}).loose())}).loose(),c5=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),l5=N({docName:A().min(1),headings:M(c5)}).loose();N({docName:A().min(1),newDocName:A().min(1),summary:$1,...Q1}).loose();var u5=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({renamed:M(i5),rewrittenDocs:M(u5),summary:F8.optional()}).loose(),N({kind:Wa([`file`,`folder`]),fromPath:A().min(1),toPath:A().min(1),...Q1,summary:$1}).loose();var d5=N({renamed:M(i5),rewrittenDocs:M(u5).optional(),summary:F8.optional()}).loose();N({kind:Wa([`file`,`folder`]),path:A().min(1),...Q1}).loose();var f5=N({deletedDocNames:M(A().min(1))}).loose();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:$1,...Q1}).loose(),N({restoredFrom:A().min(1),timestamp:A().min(1),summary:F8.optional()}).loose(),N({state:Wa([`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:Ta(),syncEnabled:Ta(),identityUnresolved:Ta(),error:A().optional(),pausedReason:A().optional()}).loose(),N({op:Wa([`sync`,`push`,`pull`]).optional()}).loose(),N({op:Wa([`sync`,`push`,`pull`])}).loose(),N({conflicts:M(N({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),N({file:A().min(1),strategy:Wa([`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`]}),N({}).loose(),N({file:A().min(1),base:A(),ours:A(),theirs:A()}).loose(),N({}).loose(),N({plan:mo(e=>e!==void 0,{message:`plan is required`})}).loose(),N({plan:mo(e=>e!==void 0,{message:`plan is required`})}).loose(),N({result:mo(e=>e!==void 0,{message:`result is required`})}).loose();var p5=N({path:A().min(1),summary:A().min(1)}).loose();N({packs:M(N({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:M(p5)}).loose())}).loose(),N({noOpen:Ta().optional(),out:A().min(1).optional()}).loose();var m5=N({reason:Wa([`unsupported-platform`,`spawn-error`]),message:A()}).loose();Ra(`status`,[N({status:Ga(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:Ga(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:m5.optional()}).loose(),N({status:Ga(`failed`),buildError:A()}).loose(),N({status:Ga(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Ta()}).loose())}).loose();var h5=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose();N({name:A().min(1),docs:M(h5)}).loose(),N({folder:ka(),frontmatter_local:Ha(A(),ka()).nullable()}).loose(),N({path:A(),frontmatter:Ha(A(),ka()).optional()}).loose(),N({applied:ka()}).loose();var g5=Ha(A(),ka()).meta({description:`Free-form frontmatter map embedded in template payloads.`});N({template:N({name:A().min(1),folder:A(),scope:Wa([`local`,`inherited`]),path:A().min(1),frontmatter:g5,body:A()}).loose()}).loose(),N({folder:A(),name:A(),body:A().optional(),frontmatter:g5.optional()}).loose(),N({path:A().min(1),created:Ta(),warnings:M(A())}).loose(),N({existed:Ta(),path:A().min(1)}).loose(),N({query:A().optional(),intent:Wa([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(Wa([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional()}).loose();var _5=N({kind:Wa([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:Ha(A(),ka()),snippet:A().optional()}).loose();N({query:A(),intent:Wa([`autocomplete`,`full_text`,`omnibar`]),results:M(_5),elapsedMs:j().nonnegative()}).loose();var v5=N({version:A().min(1),recordedAt:A().min(1)}).loose();N({currentVersion:A().min(1),targets:Ha(A(),v5.nullable())}).loose();var y5=`server-info`,b5=`branch-switched`,x5=`disk-ack`,S5=`config-validation-rejected`,C5=`config-ignore-nested-error`,w5=Wa([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),T5=N({v:Ga(1),ch:Ga(y5),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),E5=N({v:Ga(1),ch:Ga(b5),seq:j(),branch:A().min(1)}).loose(),D5=N({v:Ga(1),ch:w5,seq:j()}).loose(),O5=N({v:Ga(1),ch:Ga(x5),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),k5=N({v:Ga(1),ch:Ga(S5),seq:j(),docName:A().min(1),error:o$}).loose(),A5=N({v:Ga(1),ch:Ga(C5),seq:j(),path:A().min(1),error:A().min(1)}).loose(),j5={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},M5=new WeakMap;function N5(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function P5(e){return e.trim().toLowerCase()}function F5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function I5(e){return e.split(`/`).filter(Boolean).join(` `)}function L5(e){let t=F5(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:I5(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function R5(e){let t=rZ({schema:j5});return e.length>0&&mZ(t,e),t}function z5(e){let t={documents:e};return M5.set(t,R5(e)),t}function B5(e){let t=M5.get(e);if(t)return t;let n=R5(e.documents);return M5.set(e,n),n}function V5(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function H5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function U5(e,t){let n=P5(t);if(!n)return 0;let r=P5(e.title),i=P5(e.name),a=P5(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 W5(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 G5(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function lne(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 une(e,t){return P5(t).length<4?0:+(e===`full_text`)}function dne(e,t,n={}){let r=n.intent??`omnibar`,i=N5(n.limit),a=new Set(n.scopes??V5(r)),o=e.documents.filter(e=>H5(e,a)),s=P5(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=WZ(B5(e),{term:s,properties:G5(r),boost:lne(r),tolerance:une(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>H5(e.document,a)).map(e=>[e.document.id,e.score])),u=W5(o),d=new Map;for(let e of o)U5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)H5(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,U5(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)}var K5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),q5=globalThis;q5[K5]===void 0&&(q5[K5]=_r());var J5=q5[K5],Y5=Pa({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(J5,{description:`Recorded skill version for this target.`}),recordedAt:Pi().register(J5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:Wa([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`]).register(J5,{description:`Install-source surface that recorded this entry.`}).optional()});Pa({schema:Ga(1).register(J5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Pa({"claude-cowork":Y5.optional(),"cli-hosts":Y5.optional()}).register(J5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var X5=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function fne(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??pne,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new X5(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function pne(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function mne(){let e=!1,t=``,n=0;return r=>{let i=hne(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 hne(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var gne=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],_ne={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},vne={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},Z5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function yne(e,t=gne){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function bne(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function xne(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Sne={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function Cne(e){return e?Sne[e]??`bot`:`bot`}function wne(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Tne(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Ene(e){let[t]=wne(e);return Tne(t,45,32)}var Dne=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],One=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],Q5=`ok-user-name-v3`,$5=`ok-user-color-v3`;function e7(e){return e[Math.floor(Math.random()*e.length)]}function kne(){return`${e7(Dne)} ${e7(One)}`}function Ane(){return e7(Z5)}function t7(e){try{return localStorage.getItem(e)}catch{return null}}function n7(e,t){try{localStorage.setItem(e,t)}catch{}}function jne(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=t7(Q5),r=t7($5);return n||(n=kne(),n7(Q5,n)),r||(r=Ane(),n7($5,r)),{name:n,color:r,coeditor:e,tabId:t}}function Mne(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}}function Nne(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var r7=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function i7(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function a7(e){return e.split(`/`).filter(Boolean)}function o7(e){let t=e.trim();return r7.test(t)||t.startsWith(`//`)}function Pne(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=Mne(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(o7(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=i7(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Fne(e,t){let n=e.trim();if(!n)return null;if(o7(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=i7(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Ine(e,t){let n=e.trim();if(!n||r7.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 Lne(e,t,n=null){let r=a7(e);r.pop();let i=a7(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function Rne(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}function zne(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}var s7=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Bne=`VisuallyHidden`,c7=y.forwardRef((e,t)=>(0,_o.jsx)(c.span,{...e,ref:t,style:{...s7,...e.style}}));c7.displayName=Bne;var Vne=c7;function Hne(e){let t=e+`CollectionProvider`,[n,r]=l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=y.useRef(null),a=y.useRef(new Map).current;return(0,_o.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=d(s),u=y.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,_o.jsx)(c,{ref:p(t,a(s,n).collectionRef),children:r})});u.displayName=s;let f=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=d(f),g=y.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=y.useRef(null),s=p(t,o),c=a(f,n);return y.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,_o.jsx)(h,{[m]:``,ref:s,children:r})});g.displayName=f;function _(t){let n=a(e+`CollectionConsumer`,t);return y.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},_,r]}var Une=y.createContext(void 0);function Wne(e){let t=y.useContext(Une);return e||t||`ltr`}var l7=[`top`,`right`,`bottom`,`left`],u7=[`start`,`end`],d7=l7.reduce((e,t)=>e.concat(t,t+`-`+u7[0],t+`-`+u7[1]),[]),f7=Math.min,p7=Math.max,m7=Math.round,h7=Math.floor,g7=e=>({x:e,y:e}),Gne={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function _7(e,t,n){return p7(e,f7(t,n))}function v7(e,t){return typeof e==`function`?e(t):e}function y7(e){return e.split(`-`)[0]}function b7(e){return e.split(`-`)[1]}function x7(e){return e===`x`?`y`:`x`}function S7(e){return e===`y`?`height`:`width`}function C7(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function w7(e){return x7(C7(e))}function T7(e,t,n){n===void 0&&(n=!1);let r=b7(e),i=w7(e),a=S7(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=k7(o)),[o,k7(o)]}function Kne(e){let t=k7(e);return[E7(e),t,E7(t)]}function E7(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var D7=[`left`,`right`],O7=[`right`,`left`],qne=[`top`,`bottom`],Jne=[`bottom`,`top`];function Yne(e,t,n){switch(e){case`top`:case`bottom`:return n?t?O7:D7:t?D7:O7;case`left`:case`right`:return t?qne:Jne;default:return[]}}function Xne(e,t,n,r){let i=b7(e),a=Yne(y7(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(E7)))),a}function k7(e){let t=y7(e);return Gne[t]+e.slice(t.length)}function Zne(e){return{top:0,right:0,bottom:0,left:0,...e}}function A7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Zne(e)}function j7(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function M7(e,t,n){let{reference:r,floating:i}=e,a=C7(t),o=w7(t),s=S7(o),c=y7(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(b7(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Qne(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=v7(t,e),p=A7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=j7(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=j7(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var $ne=50,ere=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Qne},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=M7(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<$ne&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=M7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},tre=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=v7(e,t)||{};if(l==null)return{};let d=A7(u),f={x:n,y:r},p=w7(i),m=S7(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=f7(d[_],T),ee=f7(d[v],T),te=E,ne=C-h[m]-ee,re=C/2-h[m]/2+w,ie=_7(te,re,ne),ae=!c.arrow&&b7(i)!=null&&re!==ie&&a.reference[m]/2-(re<te?E:ee)-h[m]/2<0,D=ae?re<te?re-te:re-ne:0;return{[p]:f[p]+D,data:{[p]:ie,centerOffset:re-ie-D,...ae&&{alignmentOffset:D}},reset:ae}}});function nre(e,t,n){return(e?[...n.filter(t=>b7(t)===e),...n.filter(t=>b7(t)!==e)]:n.filter(e=>y7(e)===e)).filter(n=>e?b7(n)===e||(t?E7(n)!==n:!1):!0)}var rre=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=d7,autoAlignment:u=!0,...d}=v7(e,t),f=c!==void 0||l===d7?nre(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=T7(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[y7(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=b7(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,b7(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},ire=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=v7(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=y7(r),_=C7(o),v=y7(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[k7(o)]:Kne(o)),x=p!==`none`;!d&&x&&b.push(...Xne(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=T7(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==C7(t))||T.every(e=>C7(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=C7(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function N7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function P7(e){return l7.some(t=>e[t]>=0)}var are=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=v7(e,t);switch(i){case`referenceHidden`:{let e=N7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:P7(e)}}}case`escaped`:{let e=N7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:P7(e)}}}default:return{}}}}};function F7(e){let t=f7(...e.map(e=>e.left)),n=f7(...e.map(e=>e.top)),r=p7(...e.map(e=>e.right)),i=p7(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function ore(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>j7(F7(e)))}var sre=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=v7(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=ore(u),f=j7(F7(u)),p=A7(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(C7(n)===`y`){let e=d[0],t=d[d.length-1],r=y7(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=y7(n)===`left`,t=p7(...d.map(e=>e.right)),r=f7(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},I7=new Set([`left`,`top`]);async function cre(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=y7(n),s=b7(n),c=C7(n)===`y`,l=I7.has(o)?-1:1,u=a&&c?-1:1,d=v7(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var lre=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await cre(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ure=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=v7(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=C7(y7(i)),p=x7(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=_7(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=_7(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},dre=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=v7(e,t),u={x:n,y:r},d=C7(i),f=x7(d),p=u[f],m=u[d],h=v7(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=I7.has(y7(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},fre=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=v7(e,t),u=await o.detectOverflow(t,l),d=y7(i),f=b7(i),p=C7(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=f7(h-u[g],v),x=f7(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=p7(u.left,0),t=p7(u.right,0),n=p7(u.top,0),r=p7(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:p7(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:p7(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function L7(){return typeof window<`u`}function R7(e){return V7(e)?(e.nodeName||``).toLowerCase():`#document`}function z7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function B7(e){return((V7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function V7(e){return L7()?e instanceof Node||e instanceof z7(e).Node:!1}function H7(e){return L7()?e instanceof Element||e instanceof z7(e).Element:!1}function U7(e){return L7()?e instanceof HTMLElement||e instanceof z7(e).HTMLElement:!1}function W7(e){return!L7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof z7(e).ShadowRoot}function G7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Q7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function pre(e){return/^(table|td|th)$/.test(R7(e))}function K7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var mre=/transform|translate|scale|rotate|perspective|filter/,hre=/paint|layout|strict|content/,q7=e=>!!e&&e!==`none`,J7;function Y7(e){let t=H7(e)?Q7(e):e;return q7(t.transform)||q7(t.translate)||q7(t.scale)||q7(t.rotate)||q7(t.perspective)||!X7()&&(q7(t.backdropFilter)||q7(t.filter))||mre.test(t.willChange||``)||hre.test(t.contain||``)}function gre(e){let t=e9(e);for(;U7(t)&&!Z7(t);){if(Y7(t))return t;if(K7(t))return null;t=e9(t)}return null}function X7(){return J7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),J7}function Z7(e){return/^(html|body|#document)$/.test(R7(e))}function Q7(e){return z7(e).getComputedStyle(e)}function $7(e){return H7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function e9(e){if(R7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||W7(e)&&e.host||B7(e);return W7(t)?t.host:t}function t9(e){let t=e9(e);return Z7(t)?e.ownerDocument?e.ownerDocument.body:e.body:U7(t)&&G7(t)?t:t9(t)}function n9(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=t9(e),i=r===e.ownerDocument?.body,a=z7(r);if(i){let e=r9(a);return t.concat(a,a.visualViewport||[],G7(r)?r:[],e&&n?n9(e):[])}else return t.concat(r,n9(r,[],n))}function r9(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function i9(e){let t=Q7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=U7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=m7(n)!==a||m7(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function a9(e){return H7(e)?e:e.contextElement}function o9(e){let t=a9(e);if(!U7(t))return g7(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=i9(t),o=(a?m7(n.width):n.width)/r,s=(a?m7(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var _re=g7(0);function s9(e){let t=z7(e);return!X7()||!t.visualViewport?_re:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vre(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==z7(e)?!1:t}function c9(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=a9(e),o=g7(1);t&&(r?H7(r)&&(o=o9(r)):o=o9(e));let s=vre(a,n,r)?s9(a):g7(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=z7(a),t=r&&H7(r)?z7(r):r,n=e,i=r9(n);for(;i&&r&&t!==n;){let e=o9(i),t=i.getBoundingClientRect(),r=Q7(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=z7(i),i=r9(n)}}return j7({width:u,height:d,x:c,y:l})}function l9(e,t){let n=$7(e).scrollLeft;return t?t.left+n:c9(B7(e)).left+n}function u9(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-l9(e,n),y:n.top+t.scrollTop}}function yre(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=B7(r),s=t?K7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=g7(1),u=g7(0),d=U7(r);if((d||!d&&!a)&&((R7(r)!==`body`||G7(o))&&(c=$7(r)),d)){let e=c9(r);l=o9(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?u9(o,c):g7(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function bre(e){return Array.from(e.getClientRects())}function xre(e){let t=B7(e),n=$7(e),r=e.ownerDocument.body,i=p7(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=p7(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+l9(e),s=-n.scrollTop;return Q7(r).direction===`rtl`&&(o+=p7(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var d9=25;function Sre(e,t){let n=z7(e),r=B7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=X7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=l9(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=d9&&(a-=o)}else l<=d9&&(a+=l);return{width:a,height:o,x:s,y:c}}function Cre(e,t){let n=c9(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=U7(e)?o9(e):g7(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function f9(e,t,n){let r;if(t===`viewport`)r=Sre(e,n);else if(t===`document`)r=xre(B7(e));else if(H7(t))r=Cre(t,n);else{let n=s9(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return j7(r)}function p9(e,t){let n=e9(e);return n===t||!H7(n)||Z7(n)?!1:Q7(n).position===`fixed`||p9(n,t)}function wre(e,t){let n=t.get(e);if(n)return n;let r=n9(e,[],!1).filter(e=>H7(e)&&R7(e)!==`body`),i=null,a=Q7(e).position===`fixed`,o=a?e9(e):e;for(;H7(o)&&!Z7(o);){let t=Q7(o),n=Y7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||G7(o)&&!n&&p9(e,o))?r=r.filter(e=>e!==o):i=t,o=e9(o)}return t.set(e,r),r}function Tre(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?K7(t)?[]:wre(t,this._c):[].concat(n),r],o=f9(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=f9(t,a[e],i);s=p7(n.top,s),c=f7(n.right,c),l=f7(n.bottom,l),u=p7(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ere(e){let{width:t,height:n}=i9(e);return{width:t,height:n}}function Dre(e,t,n){let r=U7(t),i=B7(t),a=n===`fixed`,o=c9(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=g7(0);function l(){c.x=l9(i)}if(r||!r&&!a)if((R7(t)!==`body`||G7(i))&&(s=$7(t)),r){let e=c9(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?u9(i,s):g7(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function m9(e){return Q7(e).position===`static`}function h9(e,t){if(!U7(e)||Q7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return B7(e)===n&&(n=n.ownerDocument.body),n}function g9(e,t){let n=z7(e);if(K7(e))return n;if(!U7(e)){let t=e9(e);for(;t&&!Z7(t);){if(H7(t)&&!m9(t))return t;t=e9(t)}return n}let r=h9(e,t);for(;r&&pre(r)&&m9(r);)r=h9(r,t);return r&&Z7(r)&&m9(r)&&!Y7(r)?n:r||gre(e)||n}var Ore=async function(e){let t=this.getOffsetParent||g9,n=this.getDimensions,r=await n(e.floating);return{reference:Dre(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kre(e){return Q7(e).direction===`rtl`}var Are={convertOffsetParentRelativeRectToViewportRelativeRect:yre,getDocumentElement:B7,getClippingRect:Tre,getOffsetParent:g9,getElementRects:Ore,getClientRects:bre,getDimensions:Ere,getScale:o9,isElement:H7,isRTL:kre};function _9(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jre(e,t){let n=null,r,i=B7(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=h7(d),h=h7(i.clientWidth-(u+f)),g=h7(i.clientHeight-(d+p)),_=h7(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:p7(0,f7(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!_9(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function v9(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=a9(e),u=i||a?[...l?n9(l):[],...t?n9(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?jre(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?c9(e):null;c&&g();function g(){let t=c9(e);h&&!_9(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var y9=lre,Mre=rre,b9=ure,x9=ire,S9=fre,C9=are,w9=tre,Nre=sre,Pre=dre,T9=(e,t,n)=>{let r=new Map,i={platform:Are,...n},a={...i.platform,_c:r};return ere(e,t,{...i,platform:a})},E9=typeof document<`u`?y.useLayoutEffect:function(){};function D9(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!D9(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!D9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function O9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function k9(e,t){let n=O9(e);return Math.round(t*n)/n}function A9(e){let t=y.useRef(e);return E9(()=>{t.current=e}),t}function Fre(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);D9(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=y.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=y.useRef(null),w=y.useRef(null),T=y.useRef(u),E=c!=null,ee=A9(c),te=A9(i),ne=A9(l),re=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),T9(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!D9(T.current,t)&&(T.current=t,vo.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);E9(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=y.useRef(!1);E9(()=>(ie.current=!0,()=>{ie.current=!1}),[]),E9(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(ee.current)return ee.current(x,S,re);re()}},[x,S,re,ee,E]);let ae=y.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:b}),[v,b]),D=y.useMemo(()=>({reference:x,floating:S}),[x,S]),oe=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=k9(D.floating,u.x),r=k9(D.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...O9(D.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,D.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:re,refs:ae,elements:D,floatingStyles:oe}),[u,re,ae,D,oe])}var Ire=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:w9({element:r.current,padding:i}).fn(n):r?w9({element:r,padding:i}).fn(n):{}}}},Lre=(e,t)=>{let n=y9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rre=(e,t)=>{let n=b9(e);return{name:n.name,fn:n.fn,options:[e,t]}},zre=(e,t)=>({fn:Pre(e).fn,options:[e,t]}),Bre=(e,t)=>{let n=x9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vre=(e,t)=>{let n=S9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hre=(e,t)=>{let n=C9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ure=(e,t)=>{let n=Ire(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wre=`Arrow`,j9=y.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,_o.jsx)(c.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,_o.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});j9.displayName=Wre;var Gre=j9,M9=`Popper`,[N9,Kre]=l(M9),[qre,P9]=N9(M9),F9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return(0,_o.jsx)(qre,{scope:t,anchor:r,onAnchorChange:i,children:n})};F9.displayName=M9;var I9=`PopperAnchor`,L9=y.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=P9(I9,n),o=y.useRef(null),s=p(t,o),l=y.useRef(null);return y.useEffect(()=>{let e=l.current;l.current=r?.current||o.current,e!==l.current&&a.onAnchorChange(l.current)}),r?null:(0,_o.jsx)(c.div,{...i,ref:s})});L9.displayName=I9;var R9=`PopperContent`,[Jre,Yre]=N9(R9),z9=y.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h=`partial`,hideWhenDetached:g=!1,updatePositionStrategy:_=`optimized`,onPlaced:b,...x}=e,S=P9(R9,n),[C,w]=y.useState(null),T=p(t,e=>w(e)),[E,ee]=y.useState(null),te=v(E),ne=te?.width??0,re=te?.height??0,ie=r+(a===`center`?``:`-`+a),ae=typeof m==`number`?m:{top:0,right:0,bottom:0,left:0,...m},D=Array.isArray(f)?f:[f],oe=D.length>0,se={padding:ae,boundary:D.filter(Zre),altBoundary:oe},{refs:O,floatingStyles:ce,placement:le,isPositioned:ue,middlewareData:de}=Fre({strategy:`fixed`,placement:ie,whileElementsMounted:(...e)=>v9(...e,{animationFrame:_===`always`}),elements:{reference:S.anchor},middleware:[Lre({mainAxis:i+re,alignmentAxis:o}),d&&Rre({mainAxis:!0,crossAxis:!1,limiter:h===`partial`?zre():void 0,...se}),d&&Bre({...se}),Vre({...se,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&Ure({element:E,padding:l}),Qre({arrowWidth:ne,arrowHeight:re}),g&&Hre({strategy:`referenceHidden`,...se})]}),[fe,pe]=H9(le),me=u(b);s(()=>{ue&&me?.()},[ue,me]);let he=de.arrow?.x,ge=de.arrow?.y,_e=de.arrow?.centerOffset!==0,[ve,ye]=y.useState();return s(()=>{C&&ye(window.getComputedStyle(C).zIndex)},[C]),(0,_o.jsx)(`div`,{ref:O.setFloating,"data-radix-popper-content-wrapper":``,style:{...ce,transform:ue?ce.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ve,"--radix-popper-transform-origin":[de.transformOrigin?.x,de.transformOrigin?.y].join(` `),...de.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,_o.jsx)(Jre,{scope:n,placedSide:fe,onArrowChange:ee,arrowX:he,arrowY:ge,shouldHideArrow:_e,children:(0,_o.jsx)(c.div,{"data-side":fe,"data-align":pe,...x,ref:T,style:{...x.style,animation:ue?void 0:`none`}})})})});z9.displayName=R9;var B9=`PopperArrow`,Xre={top:`bottom`,right:`left`,bottom:`top`,left:`right`},V9=y.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Yre(B9,n),a=Xre[i.placedSide];return(0,_o.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,_o.jsx)(Gre,{...r,ref:t,style:{...r.style,display:`block`}})})});V9.displayName=B9;function Zre(e){return e!==null}var Qre=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=H9(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function H9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var $re=F9,eie=L9,tie=z9,nie=V9;function U9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function rie(e){return e.kind===`asset`}function iie(e){return e.kind===`document`}function aie(e){return e.kind===`folder`}function oie(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function sie(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}var W9=null,G9=new Set;function K9(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function cie(e,t){return e===null?!1:e===t?!0:K9(e.pages,t.pages)&&K9(e.folderPaths,t.folderPaths)&&K9(e.assetPaths??new Set,t.assetPaths??new Set)}function lie(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function uie(){return W9}function die(e){if(!cie(W9,e)){W9=e;for(let t of[...G9])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function fie(e){if(G9.add(e),W9!==null)try{e(W9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{G9.delete(e)}}var q9=`open-knowledge:documents-changed`,pie=new Set(w5.options);function J9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>pie.has(e)))]}function mie(e=[`files`]){window.dispatchEvent(new CustomEvent(q9,{detail:{channels:J9(e)}}))}function Y9(e){let t=t=>{e(J9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(q9,t),()=>window.removeEventListener(q9,t)}function X9(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function hie(e){let t=X9(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function gie(e){let t=e.trim();return{normalizedTarget:X9(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function Z9(e){let t=new Set;for(let n of e)for(let e of oie(n))t.add(e);return t}function _ie(e,t){if(!t)return;let n=m8(e);if(n)return t.get(n)}function vie(e,t){let{normalizedTarget:n,expectsFolder:r}=gie(e);if(!n)return{kind:`missing`,target:n};if(!r&&t.pages.has(n))return{kind:`doc`,target:n,docName:n};if(!r){let e=_ie(n,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let i=`${n}/index`;if(t.pages.has(i))return{kind:`folder-index`,target:n,folderPath:n,docName:i,noteKind:`canonical-index`};let a=n.split(`/`).pop(),o=a?`${n}/${a}`:null;return o&&t.pages.has(o)?{kind:`folder-index`,target:n,folderPath:n,docName:o,noteKind:`legacy-folder-note`}:(t.folderPaths??Z9(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function yie(e){switch(e.kind){case`doc`:case`folder-index`:return e.docName;case`missing`:return e.target;case`asset`:case`folder`:return null}}var Q9=(0,y.createContext)(null);function bie(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function xie(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function Sie(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function Cie(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(U9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function wie(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(U9(t)??`/api/documents responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.documents)?{assetPaths:t.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:t.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[]}}function Tie(e){console.error(`[PageListContext] Failed to load pages:`,e)}function Eie(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function Die(e){let t=(0,yo.c)(43),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,y.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,y.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,y.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,y.useState)(f),h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[4]=h):h=t[4];let[g,_]=(0,y.useState)(h),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[5]=v):v=t[5];let[b,x]=(0,y.useState)(v),[S,C]=(0,y.useState)(!0),[w,T]=(0,y.useState)(null),E=(0,y.useRef)(0),ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(){let e=E.current+=1;C(!0),Promise.all([Cie(),wie().catch(jie)]).then(t=>{let[n,r]=t;if(e!==E.current)return;let i=new Set(n.map(Aie));a(i),c(new Map(n.map(kie))),d(new Map(n.map(Oie))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),x(e=>xie(e,i)),T(null)}).catch(t=>{e===E.current&&(Tie(t),T(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===E.current&&C(!1)})},t[6]=ee):ee=t[6];let te=ee,ne;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(ne=function(e){x(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),T(null)},t[7]=ne):ne=t[7];let re=ne,ie,ae;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{te();let e=()=>{document.visibilityState===`visible`&&te()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=Y9(e=>{e.includes(`files`)&&te()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},ie=[],t[8]=ie,t[9]=ae):(ie=t[8],ae=t[9]),(0,y.useEffect)(ae,ie);let D,oe,se,O,ce,le;if(t[10]!==b||t[11]!==p||t[12]!==g||t[13]!==u||t[14]!==s||t[15]!==i){ce=bie(i,b);let e;t[22]!==b||t[23]!==s?(e=Sie(s,b),t[22]=b,t[23]=s,t[24]=e):e=t[24],O=e,se=u,D=p,oe=new Set([...Z9(ce),...g]),le=lie(ce,m8),t[10]=b,t[11]=p,t[12]=g,t[13]=u,t[14]=s,t[15]=i,t[16]=D,t[17]=oe,t[18]=se,t[19]=O,t[20]=ce,t[21]=le}else D=t[16],oe=t[17],se=t[18],O=t[19],ce=t[20],le=t[21];let ue=le,de,fe;t[25]!==D||t[26]!==oe||t[27]!==ce||t[28]!==ue?(de=()=>{die({pages:ce,folderPaths:oe,pagesBySlug:ue,assetPaths:D})},fe=[ce,oe,ue,D],t[25]=D,t[26]=oe,t[27]=ce,t[28]=ue,t[29]=de,t[30]=fe):(de=t[29],fe=t[30]),(0,y.useEffect)(de,fe);let pe;t[31]!==D||t[32]!==w||t[33]!==oe||t[34]!==S||t[35]!==se||t[36]!==O||t[37]!==ce||t[38]!==ue?(pe={pages:ce,pagesBySlug:ue,pageTitles:O,pageMeta:se,folderPaths:oe,assetPaths:D,loading:S,error:w,refetch:te,addPage:re},t[31]=D,t[32]=w,t[33]=oe,t[34]=S,t[35]=se,t[36]=O,t[37]=ce,t[38]=ue,t[39]=pe):pe=t[39];let me;return t[40]!==n||t[41]!==pe?(me=(0,_o.jsx)(Q9,{value:pe,children:n}),t[40]=n,t[41]=pe,t[42]=me):me=t[42],me}function Oie(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt}]}function kie(e){return[e.docName,e.title]}function Aie(e){return e.docName}function jie(e){return Eie(e),{assetPaths:[],folderPaths:[]}}function Mie(){let e=(0,y.use)(Q9);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function Nie(e){if(e.startsWith($9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function Pie(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}function Fie(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}?anchor=${encodeURIComponent(t)}`:r}var $9=`#/__asset__/`;function Iie(e){if(!e.startsWith($9))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function Lie(e){return`${$9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}export{b$ as $,F5 as $n,Lne as $t,x9 as A,K2 as An,F as Ar,i0 as At,_ne as B,l$ as Bn,oe as Br,L$ as Bt,tie as C,Cne as Cn,Op as Cr,$6 as Ct,Mre as D,U2 as Dn,R as Dr,l5 as Dt,w9 as E,W2 as En,lp as Er,Y8 as Et,S9 as F,r1 as Fn,pu as Fr,g$ as Ft,n5 as G,Ine as Gn,l0 as Gt,S$ as H,Rne as Hn,E as Hr,U1 as Ht,Wne as I,c0 as In,Ga as Ir,t0 as It,A5 as J,W1 as Jn,$Q as Jt,z8 as K,zne as Kn,qQ as Kt,Hne as L,P8 as Ln,N as Lr,P1 as Lt,Nre as M,o7 as Mn,I as Mr,d5 as Mt,y9 as N,s$ as Nn,cu as Nr,$$ as Nt,v9 as O,B2 as On,of as Or,s5 as Ot,b9 as P,T$ as Pn,au as Pr,t1 as Pt,T5 as Q,_8 as Qn,Y1 as Qt,Vne as R,c2 as Rn,A as Rr,a0 as Rt,nie as S,c$ as Sn,z as Sr,W8 as St,Kre as T,H2 as Tn,L as Tr,w$ as Tt,M$ as U,pQ as Un,J8 as Ut,vne as V,R1 as Vn,ee as Vr,B1 as Vt,t5 as W,fQ as Wn,Nne as Wt,D5 as X,E1 as Xn,K1 as Xt,k5 as Y,iQ as Yn,u0 as Yt,O5 as Z,m8 as Zn,q1 as Zt,rie as _,g8 as _n,Hx as _r,i2 as _t,Fie as a,bne as an,Kx as ar,o5 as at,U9 as b,h$ as bn,mv as br,Z$ as bt,yie as c,z5 as cn,Ly as cr,F$ as ct,X9 as d,m$ as dn,Yy as dr,C$ as dt,fne as en,Vte as er,_$ as et,mie as f,V1 as fn,hb as fr,N$ as ft,sie as g,xne as gn,_b as gr,Z5 as gt,fie as h,Q6 as hn,Iy as hr,V8 as ht,Pie as i,X1 as in,mb as ir,X5 as it,C9 as j,eQ as jn,Xu as jr,v1 as jt,T9 as k,G2 as kn,Vd as kr,n0 as kt,vie as l,L5 as ln,Ky as lr,f5 as lt,uie as m,XZ as mn,ny as mr,G1 as mt,Nie as n,Fne as nn,Sx as nr,v$ as nt,Die as o,mne as on,Ux as or,a5 as ot,Y9 as p,i7 as pn,jx as pr,p$ as pt,E5 as q,dne as qn,zQ as qt,Lie as r,yne as rn,sx as rr,x$ as rt,Mie as s,I2 as sn,Ax as sr,I$ as st,Iie as t,Pne as tn,tT as tr,y$ as tt,hie as u,Ene as un,Jy as ur,L8 as ut,iie as v,jne as vn,j_ as vr,X8 as vt,$re as w,V2 as wn,jp as wr,_1 as wt,eie as x,s2 as xn,mp as xr,s1 as xt,aie as y,z1 as yn,P_ as yr,A$ as yt,s7 as z,U$ as zn,se as zr,j$ as zt};