@inkeep/open-knowledge 0.5.0-beta.21 → 0.5.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
- package/dist/{banner-DdbR6AZr.mjs → banner-KC_FjiUK.mjs} +1 -1
- package/dist/cli.mjs +42 -41
- package/dist/constants-UznaWgKW.mjs +2 -0
- package/dist/{dist-Be0To_ZO.mjs → dist-C2u-rxF1.mjs} +1 -1
- package/dist/{dist-pXZHJhkA.mjs → dist-CibAeq--.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/init-9f8VdHd7.mjs +1 -0
- package/dist/{init-DzR46fd1.mjs → init-BtC2SMv8.mjs} +6 -6
- package/dist/loader-ChlCdDN9.mjs +1 -0
- package/dist/{loader-DwNW79Kd.mjs → loader-D-WyaDzc.mjs} +2 -2
- package/dist/{open-browser-BOeCxs2W.mjs → open-browser-Be-7qaQ9.mjs} +1 -1
- package/dist/{preview-xvI7NDqX.mjs → preview-87-KFMPd.mjs} +2 -2
- package/dist/preview-D5HXmkil.mjs +1 -0
- package/dist/public/assets/ActivityModeContent-4zLTqVCC.js +2 -0
- package/dist/public/assets/{DocumentContext-YWII9sVm.js → DocumentContext-mhvvV02u.js} +10 -10
- package/dist/public/assets/{GraphPanel-BmhccH_K.js → GraphPanel-BGdpuLXE.js} +3 -3
- package/dist/public/assets/{SettingsDialog-BLylznoD.js → SettingsDialog-YV23t38c.js} +2 -2
- package/dist/public/assets/{SourceEditor-Bi21q-DL.js → SourceEditor-CZ1jZux8.js} +1 -1
- package/dist/public/assets/{config-validation-events-Dnk5hVFm.js → config-validation-events-B8ssr9T7.js} +3 -3
- package/dist/public/assets/{doc-hash-D0E42f7E.js → doc-hash-CGOOAxMs.js} +1 -1
- package/dist/public/assets/index-Dem5cTAO.js +1853 -0
- package/dist/public/assets/{target-navigation-intent-B2g_ui3h.js → target-navigation-intent-B4Stg_GZ.js} +1 -1
- package/dist/public/assets/{toggle-group-CPBWIRG3.js → toggle-group-FOEgJa6h.js} +1 -1
- package/dist/public/assets/{tooltip-Cbd9CeO5.js → tooltip-1yQ0AYa7.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-B0_5HYmy.js → typing-burst-detector-CPAaH_c3.js} +2 -2
- package/dist/public/index.html +8 -8
- package/dist/repair-launch-json-JMXFIk5a.mjs +2 -0
- package/dist/repair-mcp-configs-Bay0Zqru.mjs +2 -0
- package/dist/src-B_Y-6c9W.mjs +2 -0
- package/dist/start--xgfEslo.mjs +3 -0
- package/dist/start-Dc0l88_T.mjs +1 -0
- package/package.json +1 -1
- package/dist/constants-E3p7nhGa.mjs +0 -2
- package/dist/init-DRNhMBUZ.mjs +0 -1
- package/dist/loader-C13KhFbm.mjs +0 -1
- package/dist/preview-B6LY5kDY.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-BS4JoRCC.js +0 -2
- package/dist/public/assets/index-p0rA34CH.js +0 -1853
- package/dist/repair-mcp-configs-BE_1I-Cj.mjs +0 -2
- package/dist/src-Dbjmbz2J.mjs +0 -2
- package/dist/start-CFVMbPig.mjs +0 -1
- package/dist/start-Cv7sP3Zd.mjs +0 -3
|
@@ -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=Z6(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=Z6(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 Z6(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 Q6(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function $6(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 e8(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function t8(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 e8(i)}function n8(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 r8=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=bb(e.extensions),this.handlers=p8(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=m8(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=V6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=H6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:X6})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return U6(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?W6(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?$2(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 G6(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},i8=j2();function a8(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 o8(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 s8(e){return e.attrs.sourceDirty||o8(e)}function c8(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 l8(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 u8(e,t){if(e.length===0)return l8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return l8({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:[u8(n.children,t)]}}return l8({type:`inlineCode`,value:d8(e)},t)}function d8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=d8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var f8=D$;function p8(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=iU(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=iU(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=Y6(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=aU(a)),r.highlight&&(i.mark=aU(r.highlight)),r.comment&&(i.comment=aU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=iU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=aU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=aU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=iU(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=iU(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=iU(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=i8.getOrWildcard(o),c=a8(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=Y6(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null})),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&&f8.has(l)&&n.jsxComponent&&i8.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&&i8.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&&i8.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&&i8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:n8(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")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=iU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function m8(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=uU(`paragraph`)),r.blockquote&&(t.blockquote=uU(`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=uU(`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=uU(`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&&c8(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=uU(`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=uU(`tableCell`,a)),r.tableHeader&&(t.tableHeader=uU(`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!s8(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:i8.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:i8,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=dU(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=dU(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return u8(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=dU(`delete`)}return i.highlight&&(n.highlight=dU(`mark`)),i.comment&&(n.comment=dU(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=uU(`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=uU(`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 h8=/\p{M}+/gu,g8=/[^\p{L}\p{N}]+/gu,_8=/^-+|-+$/g;function v8(e){return e.trim().normalize(`NFKD`).replace(h8,``).toLowerCase().replace(g8,`-`).replace(_8,``)}function y8(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function b8(e,t){let n=v8(e);return n?y8(n,t):``}function x8(e,t){let n=v8(e);return t?`#${n}-${v8(t)}`:`#${n}`}var S8=new Set([`img`,`video`,`audio`,`mark`]);function C8(e){let t=e.name;if(!t||!S8.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 w8=(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:x8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},T8=(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:x8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},E8=(e,t)=>{let n=t,r=C8(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)},D8=(e,t)=>{let n=t,r=C8(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)},O8=(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)]},k8=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function A8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(A8).join(``):``}var j8={wikiLink:w8,wikiLinkEmbed:T8,mdxJsxFlowElement:E8,mdxJsxTextElement:D8,rawMdxFallback:O8,mark:k8,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:A8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:A8(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)}},M8=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,N8=/\bexpression\s*\(/i,P8=1e4;function F8(e){return!(e.length>P8||M8.test(e)||N8.test(e))}function I8(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!$$(e.split(/\s+/)[0]??``))return!1}return!0}var L8=()=>e=>{WP(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`&&!I8(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!I8(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`&&!F8(r)&&delete n.style})};function R8(e){let t=FH().use(NW).use(MU,[`yaml`]).use(p6).use(EH).use(R6).use(aJ,{handlers:j8}).use(L8).use(vq);return String(t.processSync(e))}N({docName:Y1,summary:Z1,content:A().optional(),...X1}).loose(),N({docName:Y1,summary:Z1,markdown:A().min(1),position:Ka([`append`,`prepend`,`replace`]).optional(),...X1}).loose(),N({docName:Y1,summary:Z1,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...X1}).loose(),N({docName:Y1,connectionId:A().min(1),scope:Ka([`last`,`session`,`file`]).optional(),...X1}).loose();var z8=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),B8=N({type:Ja(`orphan`),parentCandidates:M(A()),message:A()}).loose();N({timestamp:A().min(1),summary:z8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(B8).optional(),summary:z8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:z8.optional()}).loose(),N({docName:A().min(1),scope:Ka([`last`,`session`]),undone:Da()}).loose(),N({docName:A().min(1),content:A()}).loose();var V8=N({documents:M(N({kind:Ka([`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:Da().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:Ka([`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(),H8=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),U8=N({docName:A().min(1),backlinks:M(H8)}).loose();N({counts:Wa(A().min(1),j().int().nonnegative())}).loose();var W8=Ba(`kind`,[N({kind:Ja(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:Ja(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),G8=N({docName:A().min(1),forwardLinks:M(W8)}).loose(),K8=Ba(`kind`,[N({id:A().min(1),kind:Ja(`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:Ja(`external`),url:A().min(1),label:A()}).loose()]),q8=N({source:A().min(1),target:A().min(1)}).loose(),J8=N({nodes:M(K8),links:M(q8)}).loose(),Y8=N({id:A().min(1),name:A().optional(),email:A().optional()}).loose(),X8=N({name:A().optional(),email:A().optional()}).loose();N({message:A().optional(),writers:M(Y8).optional(),principal:X8.optional(),...X1}).loose(),N({checkpointRef:A().min(1),versionTag:A().min(1).optional()}).loose();var Z8=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:Ka([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(Z8),checkpoint:ja().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Da().optional()}).loose(),N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),N({lines:M(N({type:Ka([`added`,`removed`,`unchanged`]),text:A()}).loose()),additions:j().int().nonnegative(),deletions:j().int().nonnegative()}).loose();var Q8=N({contentDir:A().min(1),pathSeparator:Ka([`/`,`\\`]),symlinkResolved:Da()}).loose();M(Ba(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:Ja(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:Ja(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var $8=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),e5=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),t5=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose();N({deadLinks:M(N({target:A().min(1),sources:M(t5)}).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:Da()}).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:Da()}).loose(),N({type:Ja(`complete`).optional(),login:A().min(1).optional()}).loose(),N({}).loose();var n5=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),r5=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(n5)}).loose(),i5=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),a5=N({sessionAlive:Da(),agent:i5.nullable(),files:M(r5)}).loose(),o5=N({diff:A(),generatedAt:j().int().min(0)}).loose();N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose();var s5=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:Ka([`idle`,`writing`]),ts:j().int().min(0)}).loose();N({presence:Wa(A().min(1),s5)}).loose(),Wa(A().min(1),Da()).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 c5=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose();N({}).loose(),N({path:A().min(1),...X1,summary:Z1}).loose();var l5=N({docName:A().min(1)}).loose();N({path:A().min(1),...X1,summary:Z1}).loose();var u5=N({path:A().min(1)}).loose(),d5=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1)}).loose())}).loose(),f5=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),p5=N({docName:A().min(1),headings:M(f5)}).loose();N({docName:A().min(1),newDocName:A().min(1),summary:Z1,...X1}).loose();var m5=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({renamed:M(c5),rewrittenDocs:M(m5),summary:z8.optional()}).loose(),N({kind:Ka([`file`,`folder`]),fromPath:A().min(1),toPath:A().min(1),...X1,summary:Z1}).loose();var h5=N({renamed:M(c5),rewrittenDocs:M(m5).optional(),summary:z8.optional()}).loose();N({kind:Ka([`file`,`folder`]),path:A().min(1),...X1}).loose();var g5=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:Z1,...X1}).loose(),N({restoredFrom:A().min(1),timestamp:A().min(1),summary:z8.optional()}).loose(),N({state:Ka([`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:Da(),syncEnabled:Da(),identityUnresolved:Da(),error:A().optional(),pausedReason:A().optional()}).loose(),N({op:Ka([`sync`,`push`,`pull`]).optional()}).loose(),N({op:Ka([`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:Ka([`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:_o(e=>e!==void 0,{message:`plan is required`})}).loose(),N({plan:_o(e=>e!==void 0,{message:`plan is required`})}).loose(),N({result:_o(e=>e!==void 0,{message:`result is required`})}).loose();var _5=N({path:A().min(1),summary:A().min(1)}).loose(),v5=N({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose();N({packs:M(N({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:M(_5),entryCounts:v5}).loose())}).loose(),N({noOpen:Da().optional(),out:A().min(1).optional()}).loose();var y5=N({reason:Ka([`unsupported-platform`,`spawn-error`]),message:A()}).loose();Ba(`status`,[N({status:Ja(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:Ja(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:y5.optional()}).loose(),N({status:Ja(`failed`),buildError:A()}).loose(),N({status:Ja(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Da()}).loose())}).loose();var b5=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose();N({name:A().min(1),docs:M(b5)}).loose(),N({folder:ja(),frontmatter_local:Wa(A(),ja()).nullable()}).loose(),N({path:A(),frontmatter:Wa(A(),ja()).optional()}).loose(),N({applied:ja()}).loose();var x5=Wa(A(),ja()).meta({description:`Free-form frontmatter map embedded in template payloads.`});N({template:N({name:A().min(1),folder:A(),scope:Ka([`local`,`inherited`,`user`]),path:A().min(1),frontmatter:x5,body:A()}).loose()}).loose(),N({folder:A(),name:A(),body:A().optional(),frontmatter:x5.optional()}).loose(),N({path:A().min(1),created:Da(),warnings:M(A())}).loose(),N({existed:Da(),path:A().min(1)}).loose(),N({query:A().optional(),intent:Ka([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(Ka([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional()}).loose();var S5=N({kind:Ka([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:Wa(A(),ja()),snippet:A().optional()}).loose();N({query:A(),intent:Ka([`autocomplete`,`full_text`,`omnibar`]),results:M(S5),elapsedMs:j().nonnegative()}).loose();var C5=N({version:A().min(1),recordedAt:A().min(1)}).loose();N({currentVersion:A().min(1),targets:Wa(A(),C5.nullable())}).loose();var w5=`server-info`,T5=`branch-switched`,E5=`disk-ack`,D5=`config-validation-rejected`,O5=`config-ignore-nested-error`,k5=Ka([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),A5=N({v:Ja(1),ch:Ja(w5),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),j5=N({v:Ja(1),ch:Ja(T5),seq:j(),branch:A().min(1)}).loose(),M5=N({v:Ja(1),ch:k5,seq:j()}).loose(),N5=N({v:Ja(1),ch:Ja(E5),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),P5=N({v:Ja(1),ch:Ja(D5),seq:j(),docName:A().min(1),error:r$}).loose(),F5=N({v:Ja(1),ch:Ja(O5),seq:j(),path:A().min(1),error:A().min(1)}).loose(),I5={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},L5=new WeakMap;function R5(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function z5(e){return e.trim().toLowerCase()}function B5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function V5(e){return e.split(`/`).filter(Boolean).join(` `)}function pne(e){let t=B5(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:V5(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function H5(e){let t=eZ({schema:I5});return e.length>0&&dZ(t,e),t}function mne(e){let t={documents:e};return L5.set(t,H5(e)),t}function hne(e){let t=L5.get(e);if(t)return t;let n=H5(e.documents);return L5.set(e,n),n}function gne(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function U5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function W5(e,t){let n=z5(t);if(!n)return 0;let r=z5(e.title),i=z5(e.name),a=z5(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 _ne(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 vne(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function yne(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 bne(e,t){return z5(t).length<4?0:+(e===`full_text`)}function xne(e,t,n={}){let r=n.intent??`omnibar`,i=R5(n.limit),a=new Set(n.scopes??gne(r)),o=e.documents.filter(e=>U5(e,a)),s=z5(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=VZ(hne(e),{term:s,properties:vne(r),boost:yne(r),tolerance:bne(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>U5(e.document,a)).map(e=>[e.document.id,e.score])),u=_ne(o),d=new Map;for(let e of o)W5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)U5(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,W5(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 G5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),K5=globalThis;K5[G5]===void 0&&(K5[G5]=vr());var q5=K5[G5],J5=Ia({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(q5,{description:`Recorded skill version for this target.`}),recordedAt:Ni().register(q5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:Ka([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`]).register(q5,{description:`Install-source surface that recorded this entry.`}).optional()});Ia({schema:Ja(1).register(q5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ia({"claude-cowork":J5.optional(),"cli-hosts":J5.optional()}).register(q5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var Y5=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 Sne(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Cne,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 Y5(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 Cne(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function wne(){let e=!1,t=``,n=0;return r=>{let i=Tne(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 Tne(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 Ene=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Dne={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},One={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},X5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function kne(e,t=Ene){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Ane(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 jne(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 Mne={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Nne(e){return e?Mne[e]??`bot`:`bot`}function Pne(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 Fne(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 Ine(e){let[t]=Pne(e);return Fne(t,45,32)}var Lne=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Rne=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],Z5=`ok-user-name-v3`,Q5=`ok-user-color-v3`;function $5(e){return e[Math.floor(Math.random()*e.length)]}function zne(){return`${$5(Lne)} ${$5(Rne)}`}function Bne(){return $5(X5)}function e7(e){try{return localStorage.getItem(e)}catch{return null}}function t7(e,t){try{localStorage.setItem(e,t)}catch{}}function Vne(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=e7(Z5),r=e7(Q5);return n||(n=zne(),t7(Z5,n)),r||(r=Bne(),t7(Q5,r)),{name:n,color:r,coeditor:e,tabId:t}}function Hne(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 Une(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var n7=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function r7(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function i7(e){return e.split(`/`).filter(Boolean)}function a7(e){let t=e.trim();return n7.test(t)||t.startsWith(`//`)}function Wne(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=Hne(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(a7(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=r7(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Gne(e,t){let n=e.trim();if(!n)return null;if(a7(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=r7(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Kne(e,t){let n=e.trim();if(!n||n7.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 qne(e,t,n=null){let r=i7(e);r.pop();let i=i7(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 Jne(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 Yne(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}var o7=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`}),Xne=`VisuallyHidden`,s7=y.forwardRef((e,t)=>(0,bo.jsx)(d.span,{...e,ref:t,style:{...o7,...e.style}}));s7.displayName=Xne;var Zne=s7;function Qne(e){let t=e+`CollectionProvider`,[n,r]=c(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,bo.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=l(s),d=y.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,bo.jsx)(u,{ref:p(t,a(s,n).collectionRef),children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=l(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,bo.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:d,ItemSlot:g},_,r]}var $ne=y.createContext(void 0);function ere(e){let t=y.useContext($ne);return e||t||`ltr`}var c7=[`top`,`right`,`bottom`,`left`],l7=[`start`,`end`],u7=c7.reduce((e,t)=>e.concat(t,t+`-`+l7[0],t+`-`+l7[1]),[]),d7=Math.min,f7=Math.max,p7=Math.round,m7=Math.floor,h7=e=>({x:e,y:e}),tre={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function g7(e,t,n){return f7(e,d7(t,n))}function _7(e,t){return typeof e==`function`?e(t):e}function v7(e){return e.split(`-`)[0]}function y7(e){return e.split(`-`)[1]}function b7(e){return e===`x`?`y`:`x`}function x7(e){return e===`y`?`height`:`width`}function S7(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function C7(e){return b7(S7(e))}function w7(e,t,n){n===void 0&&(n=!1);let r=y7(e),i=C7(e),a=x7(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=O7(o)),[o,O7(o)]}function nre(e){let t=O7(e);return[T7(e),t,T7(t)]}function T7(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var E7=[`left`,`right`],D7=[`right`,`left`],rre=[`top`,`bottom`],ire=[`bottom`,`top`];function are(e,t,n){switch(e){case`top`:case`bottom`:return n?t?D7:E7:t?E7:D7;case`left`:case`right`:return t?rre:ire;default:return[]}}function ore(e,t,n,r){let i=y7(e),a=are(v7(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(T7)))),a}function O7(e){let t=v7(e);return tre[t]+e.slice(t.length)}function sre(e){return{top:0,right:0,bottom:0,left:0,...e}}function k7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:sre(e)}function A7(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 j7(e,t,n){let{reference:r,floating:i}=e,a=S7(t),o=C7(t),s=x7(o),c=v7(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(y7(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 cre(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}=_7(t,e),p=k7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=A7(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=A7(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 lre=50,ure=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:cre},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=j7(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<lre&&(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}=j7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},dre=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}=_7(e,t)||{};if(l==null)return{};let d=k7(u),f={x:n,y:r},p=C7(i),m=x7(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=d7(d[_],T),ee=d7(d[v],T),te=E,ne=C-h[m]-ee,re=C/2-h[m]/2+w,ie=g7(te,re,ne),ae=!c.arrow&&y7(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 fre(e,t,n){return(e?[...n.filter(t=>y7(t)===e),...n.filter(t=>y7(t)!==e)]:n.filter(e=>v7(e)===e)).filter(n=>e?y7(n)===e||(t?T7(n)!==n:!1):!0)}var pre=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=u7,autoAlignment:u=!0,...d}=_7(e,t),f=c!==void 0||l===u7?fre(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=w7(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[v7(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=y7(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,y7(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}}}}},mre=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}=_7(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=v7(r),_=S7(o),v=v7(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[O7(o)]:nre(o)),x=p!==`none`;!d&&x&&b.push(...ore(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=w7(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`&&_!==S7(t))||T.every(e=>S7(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=S7(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 M7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function N7(e){return c7.some(t=>e[t]>=0)}var hre=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=_7(e,t);switch(i){case`referenceHidden`:{let e=M7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:N7(e)}}}case`escaped`:{let e=M7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:N7(e)}}}default:return{}}}}};function P7(e){let t=d7(...e.map(e=>e.left)),n=d7(...e.map(e=>e.top)),r=f7(...e.map(e=>e.right)),i=f7(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function gre(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=>A7(P7(e)))}var _re=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}=_7(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=gre(u),f=A7(P7(u)),p=k7(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(S7(n)===`y`){let e=d[0],t=d[d.length-1],r=v7(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=v7(n)===`left`,t=f7(...d.map(e=>e.right)),r=d7(...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}}:{}}}},F7=new Set([`left`,`top`]);async function vre(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=v7(n),s=y7(n),c=S7(n)===`y`,l=F7.has(o)?-1:1,u=a&&c?-1:1,d=_7(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 yre=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 vre(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}}}}},bre=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}=_7(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=S7(v7(i)),p=b7(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=g7(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=g7(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}}}}}},xre=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}=_7(e,t),u={x:n,y:r},d=S7(i),f=b7(d),p=u[f],m=u[d],h=_7(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=F7.has(v7(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}}}},Sre=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}=_7(e,t),u=await o.detectOverflow(t,l),d=v7(i),f=y7(i),p=S7(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=d7(h-u[g],v),x=d7(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=f7(u.left,0),t=f7(u.right,0),n=f7(u.top,0),r=f7(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:f7(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:f7(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 I7(){return typeof window<`u`}function L7(e){return B7(e)?(e.nodeName||``).toLowerCase():`#document`}function R7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function z7(e){return((B7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function B7(e){return I7()?e instanceof Node||e instanceof R7(e).Node:!1}function V7(e){return I7()?e instanceof Element||e instanceof R7(e).Element:!1}function H7(e){return I7()?e instanceof HTMLElement||e instanceof R7(e).HTMLElement:!1}function U7(e){return!I7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof R7(e).ShadowRoot}function W7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Cre(e){return/^(table|td|th)$/.test(L7(e))}function G7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var wre=/transform|translate|scale|rotate|perspective|filter/,Tre=/paint|layout|strict|content/,K7=e=>!!e&&e!==`none`,q7;function J7(e){let t=V7(e)?Z7(e):e;return K7(t.transform)||K7(t.translate)||K7(t.scale)||K7(t.rotate)||K7(t.perspective)||!Y7()&&(K7(t.backdropFilter)||K7(t.filter))||wre.test(t.willChange||``)||Tre.test(t.contain||``)}function Ere(e){let t=$7(e);for(;H7(t)&&!X7(t);){if(J7(t))return t;if(G7(t))return null;t=$7(t)}return null}function Y7(){return q7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),q7}function X7(e){return/^(html|body|#document)$/.test(L7(e))}function Z7(e){return R7(e).getComputedStyle(e)}function Q7(e){return V7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $7(e){if(L7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||U7(e)&&e.host||z7(e);return U7(t)?t.host:t}function e9(e){let t=$7(e);return X7(t)?e.ownerDocument?e.ownerDocument.body:e.body:H7(t)&&W7(t)?t:e9(t)}function t9(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=e9(e),i=r===e.ownerDocument?.body,a=R7(r);if(i){let e=n9(a);return t.concat(a,a.visualViewport||[],W7(r)?r:[],e&&n?t9(e):[])}else return t.concat(r,t9(r,[],n))}function n9(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function r9(e){let t=Z7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=H7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=p7(n)!==a||p7(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function i9(e){return V7(e)?e:e.contextElement}function a9(e){let t=i9(e);if(!H7(t))return h7(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=r9(t),o=(a?p7(n.width):n.width)/r,s=(a?p7(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dre=h7(0);function o9(e){let t=R7(e);return!Y7()||!t.visualViewport?Dre:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ore(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==R7(e)?!1:t}function s9(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=i9(e),o=h7(1);t&&(r?V7(r)&&(o=a9(r)):o=a9(e));let s=Ore(a,n,r)?o9(a):h7(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=R7(a),t=r&&V7(r)?R7(r):r,n=e,i=n9(n);for(;i&&r&&t!==n;){let e=a9(i),t=i.getBoundingClientRect(),r=Z7(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=R7(i),i=n9(n)}}return A7({width:u,height:d,x:c,y:l})}function c9(e,t){let n=Q7(e).scrollLeft;return t?t.left+n:s9(z7(e)).left+n}function l9(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-c9(e,n),y:n.top+t.scrollTop}}function kre(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=z7(r),s=t?G7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=h7(1),u=h7(0),d=H7(r);if((d||!d&&!a)&&((L7(r)!==`body`||W7(o))&&(c=Q7(r)),d)){let e=s9(r);l=a9(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?l9(o,c):h7(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 Are(e){return Array.from(e.getClientRects())}function jre(e){let t=z7(e),n=Q7(e),r=e.ownerDocument.body,i=f7(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=f7(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+c9(e),s=-n.scrollTop;return Z7(r).direction===`rtl`&&(o+=f7(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var u9=25;function Mre(e,t){let n=R7(e),r=z7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Y7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=c9(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<=u9&&(a-=o)}else l<=u9&&(a+=l);return{width:a,height:o,x:s,y:c}}function Nre(e,t){let n=s9(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=H7(e)?a9(e):h7(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function d9(e,t,n){let r;if(t===`viewport`)r=Mre(e,n);else if(t===`document`)r=jre(z7(e));else if(V7(t))r=Nre(t,n);else{let n=o9(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return A7(r)}function f9(e,t){let n=$7(e);return n===t||!V7(n)||X7(n)?!1:Z7(n).position===`fixed`||f9(n,t)}function Pre(e,t){let n=t.get(e);if(n)return n;let r=t9(e,[],!1).filter(e=>V7(e)&&L7(e)!==`body`),i=null,a=Z7(e).position===`fixed`,o=a?$7(e):e;for(;V7(o)&&!X7(o);){let t=Z7(o),n=J7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||W7(o)&&!n&&f9(e,o))?r=r.filter(e=>e!==o):i=t,o=$7(o)}return t.set(e,r),r}function Fre(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?G7(t)?[]:Pre(t,this._c):[].concat(n),r],o=d9(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=d9(t,a[e],i);s=f7(n.top,s),c=d7(n.right,c),l=d7(n.bottom,l),u=f7(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ire(e){let{width:t,height:n}=r9(e);return{width:t,height:n}}function Lre(e,t,n){let r=H7(t),i=z7(t),a=n===`fixed`,o=s9(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=h7(0);function l(){c.x=c9(i)}if(r||!r&&!a)if((L7(t)!==`body`||W7(i))&&(s=Q7(t)),r){let e=s9(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?l9(i,s):h7(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 p9(e){return Z7(e).position===`static`}function m9(e,t){if(!H7(e)||Z7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return z7(e)===n&&(n=n.ownerDocument.body),n}function h9(e,t){let n=R7(e);if(G7(e))return n;if(!H7(e)){let t=$7(e);for(;t&&!X7(t);){if(V7(t)&&!p9(t))return t;t=$7(t)}return n}let r=m9(e,t);for(;r&&Cre(r)&&p9(r);)r=m9(r,t);return r&&X7(r)&&p9(r)&&!J7(r)?n:r||Ere(e)||n}var Rre=async function(e){let t=this.getOffsetParent||h9,n=this.getDimensions,r=await n(e.floating);return{reference:Lre(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zre(e){return Z7(e).direction===`rtl`}var Bre={convertOffsetParentRelativeRectToViewportRelativeRect:kre,getDocumentElement:z7,getClippingRect:Fre,getOffsetParent:h9,getElementRects:Rre,getClientRects:Are,getDimensions:Ire,getScale:a9,isElement:V7,isRTL:zre};function g9(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vre(e,t){let n=null,r,i=z7(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=m7(d),h=m7(i.clientWidth-(u+f)),g=m7(i.clientHeight-(d+p)),_=m7(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:f7(0,d7(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&&!g9(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 _9(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=i9(e),u=i||a?[...l?t9(l):[],...t?t9(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Vre(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?s9(e):null;c&&g();function g(){let t=s9(e);h&&!g9(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 v9=yre,Hre=pre,y9=bre,b9=mre,x9=Sre,S9=hre,C9=dre,Ure=_re,Wre=xre,w9=(e,t,n)=>{let r=new Map,i={platform:Bre,...n},a={...i.platform,_c:r};return ure(e,t,{...i,platform:a})},T9=typeof document<`u`?y.useLayoutEffect:function(){};function E9(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(!E9(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)&&!E9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function D9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function O9(e,t){let n=D9(e);return Math.round(t*n)/n}function k9(e){let t=y.useRef(e);return T9(()=>{t.current=e}),t}function Gre(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);E9(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=k9(c),te=k9(i),ne=k9(l),re=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),w9(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!E9(T.current,t)&&(T.current=t,xo.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);T9(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=y.useRef(!1);T9(()=>(ie.current=!0,()=>{ie.current=!1}),[]),T9(()=>{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=O9(D.floating,u.x),r=O9(D.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...D9(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 Kre=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?{}:C9({element:r.current,padding:i}).fn(n):r?C9({element:r,padding:i}).fn(n):{}}}},qre=(e,t)=>{let n=v9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jre=(e,t)=>{let n=y9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yre=(e,t)=>({fn:Wre(e).fn,options:[e,t]}),Xre=(e,t)=>{let n=b9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zre=(e,t)=>{let n=x9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qre=(e,t)=>{let n=S9(e);return{name:n.name,fn:n.fn,options:[e,t]}},$re=(e,t)=>{let n=Kre(e);return{name:n.name,fn:n.fn,options:[e,t]}},eie=`Arrow`,A9=y.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,bo.jsx)(d.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,bo.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});A9.displayName=eie;var tie=A9,j9=`Popper`,[M9,nie]=c(j9),[rie,N9]=M9(j9),P9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return(0,bo.jsx)(rie,{scope:t,anchor:r,onAnchorChange:i,children:n})};P9.displayName=j9;var F9=`PopperAnchor`,I9=y.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=N9(F9,n),o=y.useRef(null),s=p(t,o),c=y.useRef(null);return y.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,bo.jsx)(d.div,{...i,ref:s})});I9.displayName=F9;var L9=`PopperContent`,[iie,aie]=M9(L9),R9=y.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h=`partial`,hideWhenDetached:g=!1,updatePositionStrategy:_=`optimized`,onPlaced:b,...x}=e,S=N9(L9,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(sie),altBoundary:oe},{refs:O,floatingStyles:ce,placement:le,isPositioned:ue,middlewareData:de}=Gre({strategy:`fixed`,placement:ie,whileElementsMounted:(...e)=>_9(...e,{animationFrame:_===`always`}),elements:{reference:S.anchor},middleware:[qre({mainAxis:i+re,alignmentAxis:o}),l&&Jre({mainAxis:!0,crossAxis:!1,limiter:h===`partial`?Yre():void 0,...se}),l&&Xre({...se}),Zre({...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&&$re({element:E,padding:c}),cie({arrowWidth:ne,arrowHeight:re}),g&&Qre({strategy:`referenceHidden`,...se})]}),[fe,pe]=V9(le),me=s(b);u(()=>{ue&&me?.()},[ue,me]);let he=de.arrow?.x,ge=de.arrow?.y,_e=de.arrow?.centerOffset!==0,[ve,ye]=y.useState();return u(()=>{C&&ye(window.getComputedStyle(C).zIndex)},[C]),(0,bo.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,bo.jsx)(iie,{scope:n,placedSide:fe,onArrowChange:ee,arrowX:he,arrowY:ge,shouldHideArrow:_e,children:(0,bo.jsx)(d.div,{"data-side":fe,"data-align":pe,...x,ref:T,style:{...x.style,animation:ue?void 0:`none`}})})})});R9.displayName=L9;var z9=`PopperArrow`,oie={top:`bottom`,right:`left`,bottom:`top`,left:`right`},B9=y.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=aie(z9,n),a=oie[i.placedSide];return(0,bo.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,bo.jsx)(tie,{...r,ref:t,style:{...r.style,display:`block`}})})});B9.displayName=z9;function sie(e){return e!==null}var cie=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]=V9(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 V9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var lie=P9,uie=I9,die=R9,fie=B9;function H9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function pie(e){return e.kind===`asset`}function mie(e){return e.kind===`document`}function hie(e){return e.kind===`folder`}function gie(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 _ie(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}var U9=null,W9=new Set;function G9(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 vie(e,t){return e===null?!1:e===t?!0:G9(e.pages,t.pages)&&G9(e.folderPaths,t.folderPaths)&&G9(e.assetPaths??new Set,t.assetPaths??new Set)}function yie(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 bie(){return U9}function xie(e){if(!vie(U9,e)){U9=e;for(let t of[...W9])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function Sie(e){if(W9.add(e),U9!==null)try{e(U9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{W9.delete(e)}}var K9=`open-knowledge:documents-changed`,Cie=new Set(k5.options);function q9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>Cie.has(e)))]}function wie(e=[`files`]){window.dispatchEvent(new CustomEvent(K9,{detail:{channels:q9(e)}}))}function J9(e){let t=t=>{e(q9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(K9,t),()=>window.removeEventListener(K9,t)}var Y9=`open-knowledge:templates-changed`;function Tie(){window.dispatchEvent(new CustomEvent(Y9))}function Eie(e){let t=()=>e();return window.addEventListener(Y9,t),()=>window.removeEventListener(Y9,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 Oie(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 gie(n))t.add(e);return t}function kie(e,t){if(!t)return;let n=v8(e);if(n)return t.get(n)}function Aie(e,t){let{normalizedTarget:n,expectsFolder:r}=Oie(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=kie(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 jie(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 Mie(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 Nie(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 Pie(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function Fie(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function Iie(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(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 Lie(e){console.error(`[PageListContext] Failed to load pages:`,e)}function Rie(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function zie(e){let t=(0,So.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([Fie(),Iie().catch(Uie)]).then(t=>{let[n,r]=t;if(e!==E.current)return;let i=new Set(n.map(Hie));a(i),c(new Map(n.map(Vie))),d(new Map(n.map(Bie))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),x(e=>Nie(e,i)),T(null)}).catch(t=>{e===E.current&&(Lie(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=J9(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=Mie(i,b);let e;t[22]!==b||t[23]!==s?(e=Pie(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=yie(ce,v8),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=()=>{xie({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,bo.jsx)(Q9,{value:pe,children:n}),t[40]=n,t[41]=pe,t[42]=me):me=t[42],me}function Bie(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt}]}function Vie(e){return[e.docName,e.title]}function Hie(e){return e.docName}function Uie(e){return Rie(e),{assetPaths:[],folderPaths:[]}}function Wie(){let e=(0,y.use)(Q9);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function Gie(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 Kie(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}function qie(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}?anchor=${encodeURIComponent(t)}`:r}var $9=`#/__asset__/`;function Jie(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 Yie(e){return`${$9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}export{N5 as $,xne as $n,W1 as $t,_9 as A,L2 as An,z as Ar,p5 as At,Zne as B,i$ as Bn,I as Br,j1 as Bt,uie as C,f$ as Cn,ub as Cr,J$ as Ct,nie as D,W2 as Dn,L_ as Dr,m1 as Dt,lie as E,Nne as En,P_ as Er,r8 as Et,v9 as F,F2 as Fn,R as Fr,h5 as Ft,k$ as G,B$ as Gn,N as Gr,B1 as Gt,Dne as H,e1 as Hn,cu as Hr,O$ as Ht,y9 as I,B2 as In,lf as Ir,X$ as It,U8 as J,Jne as Jn,oe as Jr,WQ as Jt,a5 as K,o$ as Kn,A as Kr,Q8 as Kt,x9 as L,V2 as Ln,Wd as Lr,Q$ as Lt,b9 as M,z2 as Mn,Pp as Mr,e0 as Mt,S9 as N,H2 as Nn,L as Nr,t0 as Nt,C9 as O,G2 as On,_v as Or,x$ as Ot,Ure as P,R2 as Pn,fp as Pr,h1 as Pt,M5 as Q,Yne as Qn,U1 as Qt,ere as R,ZZ as Rn,F as Rr,p$ as Rt,H9 as S,I1 as Sn,ay as Sr,D$ as St,die as T,a$ as Tn,gS as Tr,J8 as Tt,One as U,R8 as Un,gu as Ur,P$ as Ut,o7 as V,S$ as Vn,du as Vr,n0 as Vt,y$ as W,t2 as Wn,Ja as Wr,L1 as Wt,F5 as X,lQ as Xn,E as Xr,XQ as Xt,j5 as Y,uQ as Yn,ee as Yr,IQ as Yt,P5 as Z,Kne as Zn,r0 as Zt,Sie as _,qZ as _n,bb as _r,H1 as _t,qie as a,kne as an,B5 as ar,v$ as at,mie as b,b8 as bn,Ub as br,Z0 as bt,jie as c,Ane as cn,AT as cr,u5 as ct,X9 as d,mne as dn,Hb as dr,M$ as dt,K1 as en,V1 as er,A5 as et,wie as f,pne as fn,bS as fr,g5 as ft,bie as g,r7 as gn,db as gr,u$ as gt,Eie as h,R1 as hn,Zy as hr,A$ as ht,Kie as i,Gne as in,x8 as ir,h$ as it,w9 as j,U2 as jn,jp as jr,d5 as jt,Hre as k,I2 as kn,_p as kr,$8 as kt,Aie as l,wne as ln,Xx as lr,l5 as lt,J9 as m,d$ as mn,iS as mr,b$ as mt,Gie as n,Sne as nn,C1 as nr,m$ as nt,zie as o,J1 as on,qte as or,Y5 as ot,Tie as p,Ine as pn,_S as pr,V8 as pt,o5 as q,F1 as qn,se as qr,Une as qt,Yie as r,Wne as rn,v8 as rr,g$ as rt,Wie as s,q1 as sn,Vte as sr,V$ as st,Jie as t,qne as tn,tQ as tr,_$ as tt,Die as u,j2 as un,Fx as ur,N$ as ut,_ie as v,n8 as vn,Sb as vr,G8 as vt,fie as w,e2 as wn,Gb as wr,i1 as wt,hie as x,Vne as xn,aS as xr,e5 as xt,pie as y,jne as yn,Cb as yr,X5 as yt,Qne as z,a7 as zn,$u as zr,$1 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=Z6(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=Z6(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 Z6(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 Q6(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function $6(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 e8(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function t8(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 e8(i)}function n8(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 r8=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=bb(e.extensions),this.handlers=p8(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=m8(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=V6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=H6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:X6})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return U6(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?W6(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?$2(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 G6(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},i8=j2();function a8(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 o8(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 s8(e){return e.attrs.sourceDirty||o8(e)}function c8(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 l8(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 u8(e,t){if(e.length===0)return l8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return l8({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:[u8(n.children,t)]}}return l8({type:`inlineCode`,value:d8(e)},t)}function d8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=d8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var f8=D$;function p8(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=iU(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=iU(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=Y6(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=aU(a)),r.highlight&&(i.mark=aU(r.highlight)),r.comment&&(i.comment=aU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=iU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=aU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=aU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=iU(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=iU(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=iU(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=i8.getOrWildcard(o),c=a8(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=Y6(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null})),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&&f8.has(l)&&n.jsxComponent&&i8.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&&i8.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&&i8.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&&i8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:n8(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")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=iU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function m8(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=uU(`paragraph`)),r.blockquote&&(t.blockquote=uU(`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=uU(`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=uU(`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&&c8(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=uU(`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=uU(`tableCell`,a)),r.tableHeader&&(t.tableHeader=uU(`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!s8(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:i8.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:i8,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=dU(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=dU(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return u8(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=dU(`delete`)}return i.highlight&&(n.highlight=dU(`mark`)),i.comment&&(n.comment=dU(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=uU(`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=uU(`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 h8=/\p{M}+/gu,g8=/[^\p{L}\p{N}]+/gu,_8=/^-+|-+$/g;function v8(e){return e.trim().normalize(`NFKD`).replace(h8,``).toLowerCase().replace(g8,`-`).replace(_8,``)}function y8(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function b8(e,t){let n=v8(e);return n?y8(n,t):``}function x8(e,t){let n=v8(e);return t?`#${n}-${v8(t)}`:`#${n}`}var S8=new Set([`img`,`video`,`audio`,`mark`]);function C8(e){let t=e.name;if(!t||!S8.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 w8=(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:x8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},T8=(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:x8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},E8=(e,t)=>{let n=t,r=C8(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)},D8=(e,t)=>{let n=t,r=C8(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)},O8=(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)]},k8=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function A8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(A8).join(``):``}var j8={wikiLink:w8,wikiLinkEmbed:T8,mdxJsxFlowElement:E8,mdxJsxTextElement:D8,rawMdxFallback:O8,mark:k8,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:A8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:A8(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)}},M8=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,N8=/\bexpression\s*\(/i,P8=1e4;function F8(e){return!(e.length>P8||M8.test(e)||N8.test(e))}function I8(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!$$(e.split(/\s+/)[0]??``))return!1}return!0}var L8=()=>e=>{WP(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`&&!I8(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!I8(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`&&!F8(r)&&delete n.style})};function R8(e){let t=FH().use(NW).use(MU,[`yaml`]).use(p6).use(EH).use(R6).use(aJ,{handlers:j8}).use(L8).use(vq);return String(t.processSync(e))}N({docName:Y1,summary:Z1,content:A().optional(),...X1}).loose(),N({docName:Y1,summary:Z1,markdown:A().min(1),position:Ka([`append`,`prepend`,`replace`]).optional(),...X1}).loose(),N({docName:Y1,summary:Z1,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...X1}).loose(),N({docName:Y1,connectionId:A().min(1),scope:Ka([`last`,`session`,`file`]).optional(),...X1}).loose();var z8=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),B8=N({type:Ja(`orphan`),parentCandidates:M(A()),message:A()}).loose();N({timestamp:A().min(1),summary:z8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(B8).optional(),summary:z8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:z8.optional()}).loose(),N({docName:A().min(1),scope:Ka([`last`,`session`]),undone:Da()}).loose(),N({docName:A().min(1),content:A()}).loose();var V8=N({documents:M(N({kind:Ka([`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:Da().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:Ka([`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(),H8=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),U8=N({docName:A().min(1),backlinks:M(H8)}).loose();N({counts:Wa(A().min(1),j().int().nonnegative())}).loose();var W8=Ba(`kind`,[N({kind:Ja(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:Ja(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),G8=N({docName:A().min(1),forwardLinks:M(W8)}).loose(),K8=Ba(`kind`,[N({id:A().min(1),kind:Ja(`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:Ja(`external`),url:A().min(1),label:A()}).loose()]),q8=N({source:A().min(1),target:A().min(1)}).loose(),J8=N({nodes:M(K8),links:M(q8)}).loose(),Y8=N({id:A().min(1),name:A().optional(),email:A().optional()}).loose(),X8=N({name:A().optional(),email:A().optional()}).loose();N({message:A().optional(),writers:M(Y8).optional(),principal:X8.optional(),...X1}).loose(),N({checkpointRef:A().min(1),versionTag:A().min(1).optional()}).loose();var Z8=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:Ka([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(Z8),checkpoint:ja().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Da().optional()}).loose(),N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),N({lines:M(N({type:Ka([`added`,`removed`,`unchanged`]),text:A()}).loose()),additions:j().int().nonnegative(),deletions:j().int().nonnegative()}).loose();var Q8=N({contentDir:A().min(1),pathSeparator:Ka([`/`,`\\`]),symlinkResolved:Da()}).loose();M(Ba(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:Ja(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:Ja(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var $8=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),e5=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),t5=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose();N({deadLinks:M(N({target:A().min(1),sources:M(t5)}).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:Da()}).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:Da()}).loose(),N({type:Ja(`complete`).optional(),login:A().min(1).optional()}).loose(),N({}).loose();var n5=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),r5=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(n5)}).loose(),i5=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),a5=N({sessionAlive:Da(),agent:i5.nullable(),files:M(r5)}).loose(),o5=N({diff:A(),generatedAt:j().int().min(0)}).loose();N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose();var s5=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:Ka([`idle`,`writing`]),ts:j().int().min(0)}).loose();N({presence:Wa(A().min(1),s5)}).loose(),Wa(A().min(1),Da()).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 c5=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose();N({}).loose(),N({path:A().min(1),...X1,summary:Z1}).loose();var l5=N({docName:A().min(1)}).loose();N({path:A().min(1),...X1,summary:Z1}).loose();var u5=N({path:A().min(1)}).loose(),d5=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1)}).loose())}).loose(),f5=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),p5=N({docName:A().min(1),headings:M(f5)}).loose();N({docName:A().min(1),newDocName:A().min(1),summary:Z1,...X1}).loose();var m5=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({renamed:M(c5),rewrittenDocs:M(m5),summary:z8.optional()}).loose(),N({kind:Ka([`file`,`folder`]),fromPath:A().min(1),toPath:A().min(1),...X1,summary:Z1}).loose();var h5=N({renamed:M(c5),rewrittenDocs:M(m5).optional(),summary:z8.optional()}).loose();N({kind:Ka([`file`,`folder`]),path:A().min(1),...X1}).loose();var g5=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:Z1,...X1}).loose(),N({restoredFrom:A().min(1),timestamp:A().min(1),summary:z8.optional()}).loose(),N({state:Ka([`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:Da(),syncEnabled:Da(),identityUnresolved:Da(),error:A().optional(),pausedReason:A().optional()}).loose(),N({op:Ka([`sync`,`push`,`pull`]).optional()}).loose(),N({op:Ka([`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:Ka([`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:_o(e=>e!==void 0,{message:`plan is required`})}).loose(),N({plan:_o(e=>e!==void 0,{message:`plan is required`})}).loose(),N({result:_o(e=>e!==void 0,{message:`result is required`})}).loose();var _5=N({path:A().min(1),summary:A().min(1)}).loose(),v5=N({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose();N({packs:M(N({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:M(_5),entryCounts:v5}).loose())}).loose(),N({noOpen:Da().optional(),out:A().min(1).optional()}).loose();var y5=N({reason:Ka([`unsupported-platform`,`spawn-error`]),message:A()}).loose();Ba(`status`,[N({status:Ja(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:Ja(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:y5.optional()}).loose(),N({status:Ja(`failed`),buildError:A()}).loose(),N({status:Ja(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Da()}).loose())}).loose();var b5=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose();N({name:A().min(1),docs:M(b5)}).loose(),N({folder:ja(),frontmatter_local:Wa(A(),ja()).nullable()}).loose(),N({path:A(),frontmatter:Wa(A(),ja()).optional()}).loose(),N({applied:ja()}).loose();var x5=Wa(A(),ja()).meta({description:`Free-form frontmatter map embedded in template payloads.`});N({template:N({name:A().min(1),folder:A(),scope:Ka([`local`,`inherited`,`user`]),path:A().min(1),frontmatter:x5,body:A()}).loose()}).loose(),N({folder:A(),name:A(),body:A().optional(),frontmatter:x5.optional()}).loose(),N({path:A().min(1),created:Da(),warnings:M(A())}).loose(),N({existed:Da(),path:A().min(1)}).loose(),N({query:A().optional(),intent:Ka([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(Ka([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional()}).loose();var S5=N({kind:Ka([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:Wa(A(),ja()),snippet:A().optional()}).loose();N({query:A(),intent:Ka([`autocomplete`,`full_text`,`omnibar`]),results:M(S5),elapsedMs:j().nonnegative()}).loose();var C5=N({version:A().min(1),recordedAt:A().min(1)}).loose();N({currentVersion:A().min(1),targets:Wa(A(),C5.nullable())}).loose();var w5=`server-info`,T5=`branch-switched`,E5=`disk-ack`,D5=`config-validation-rejected`,O5=`config-ignore-nested-error`,k5=Ka([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),A5=N({v:Ja(1),ch:Ja(w5),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),j5=N({v:Ja(1),ch:Ja(T5),seq:j(),branch:A().min(1)}).loose(),M5=N({v:Ja(1),ch:k5,seq:j()}).loose(),N5=N({v:Ja(1),ch:Ja(E5),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),P5=N({v:Ja(1),ch:Ja(D5),seq:j(),docName:A().min(1),error:r$}).loose(),F5=N({v:Ja(1),ch:Ja(O5),seq:j(),path:A().min(1),error:A().min(1)}).loose(),I5={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},L5=new WeakMap;function R5(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function z5(e){return e.trim().toLowerCase()}function B5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function V5(e){return e.split(`/`).filter(Boolean).join(` `)}function pne(e){let t=B5(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:V5(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function H5(e){let t=eZ({schema:I5});return e.length>0&&dZ(t,e),t}function mne(e){let t={documents:e};return L5.set(t,H5(e)),t}function hne(e){let t=L5.get(e);if(t)return t;let n=H5(e.documents);return L5.set(e,n),n}function gne(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function U5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function W5(e,t){let n=z5(t);if(!n)return 0;let r=z5(e.title),i=z5(e.name),a=z5(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 _ne(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 vne(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function yne(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 bne(e,t){return z5(t).length<4?0:+(e===`full_text`)}function xne(e,t,n={}){let r=n.intent??`omnibar`,i=R5(n.limit),a=new Set(n.scopes??gne(r)),o=e.documents.filter(e=>U5(e,a)),s=z5(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=VZ(hne(e),{term:s,properties:vne(r),boost:yne(r),tolerance:bne(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>U5(e.document,a)).map(e=>[e.document.id,e.score])),u=_ne(o),d=new Map;for(let e of o)W5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)U5(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,W5(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 G5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),K5=globalThis;K5[G5]===void 0&&(K5[G5]=vr());var q5=K5[G5],J5=Ia({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(q5,{description:`Recorded skill version for this target.`}),recordedAt:Ni().register(q5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:Ka([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`]).register(q5,{description:`Install-source surface that recorded this entry.`}).optional()});Ia({schema:Ja(1).register(q5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ia({"claude-cowork":J5.optional(),"cli-hosts":J5.optional()}).register(q5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var Y5=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 Sne(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Cne,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 Y5(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 Cne(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function wne(){let e=!1,t=``,n=0;return r=>{let i=Tne(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 Tne(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 Ene=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Dne={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},One={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},X5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function kne(e,t=Ene){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Ane(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 jne(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 Mne={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Nne(e){return e?Mne[e]??`bot`:`bot`}function Pne(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 Fne(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 Ine(e){let[t]=Pne(e);return Fne(t,45,32)}var Lne=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Rne=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],Z5=`ok-user-name-v3`,Q5=`ok-user-color-v3`;function $5(e){return e[Math.floor(Math.random()*e.length)]}function zne(){return`${$5(Lne)} ${$5(Rne)}`}function Bne(){return $5(X5)}function e7(e){try{return localStorage.getItem(e)}catch{return null}}function t7(e,t){try{localStorage.setItem(e,t)}catch{}}function Vne(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=e7(Z5),r=e7(Q5);return n||(n=zne(),t7(Z5,n)),r||(r=Bne(),t7(Q5,r)),{name:n,color:r,coeditor:e,tabId:t}}function Hne(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 Une(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var n7=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function r7(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function i7(e){return e.split(`/`).filter(Boolean)}function a7(e){let t=e.trim();return n7.test(t)||t.startsWith(`//`)}function Wne(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=Hne(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(a7(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=r7(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Gne(e,t){let n=e.trim();if(!n)return null;if(a7(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=r7(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Kne(e,t){let n=e.trim();if(!n||n7.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 qne(e,t,n=null){let r=i7(e);r.pop();let i=i7(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 Jne(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 Yne(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}var o7=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`}),Xne=`VisuallyHidden`,s7=y.forwardRef((e,t)=>(0,bo.jsx)(d.span,{...e,ref:t,style:{...o7,...e.style}}));s7.displayName=Xne;var Zne=s7;function Qne(e){let t=e+`CollectionProvider`,[n,r]=c(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,bo.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=l(s),d=y.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,bo.jsx)(u,{ref:p(t,a(s,n).collectionRef),children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=l(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,bo.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:d,ItemSlot:g},_,r]}var $ne=y.createContext(void 0);function ere(e){let t=y.useContext($ne);return e||t||`ltr`}var c7=[`top`,`right`,`bottom`,`left`],l7=[`start`,`end`],u7=c7.reduce((e,t)=>e.concat(t,t+`-`+l7[0],t+`-`+l7[1]),[]),d7=Math.min,f7=Math.max,p7=Math.round,m7=Math.floor,h7=e=>({x:e,y:e}),tre={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function g7(e,t,n){return f7(e,d7(t,n))}function _7(e,t){return typeof e==`function`?e(t):e}function v7(e){return e.split(`-`)[0]}function y7(e){return e.split(`-`)[1]}function b7(e){return e===`x`?`y`:`x`}function x7(e){return e===`y`?`height`:`width`}function S7(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function C7(e){return b7(S7(e))}function w7(e,t,n){n===void 0&&(n=!1);let r=y7(e),i=C7(e),a=x7(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=O7(o)),[o,O7(o)]}function nre(e){let t=O7(e);return[T7(e),t,T7(t)]}function T7(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var E7=[`left`,`right`],D7=[`right`,`left`],rre=[`top`,`bottom`],ire=[`bottom`,`top`];function are(e,t,n){switch(e){case`top`:case`bottom`:return n?t?D7:E7:t?E7:D7;case`left`:case`right`:return t?rre:ire;default:return[]}}function ore(e,t,n,r){let i=y7(e),a=are(v7(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(T7)))),a}function O7(e){let t=v7(e);return tre[t]+e.slice(t.length)}function sre(e){return{top:0,right:0,bottom:0,left:0,...e}}function k7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:sre(e)}function A7(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 j7(e,t,n){let{reference:r,floating:i}=e,a=S7(t),o=C7(t),s=x7(o),c=v7(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(y7(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 cre(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}=_7(t,e),p=k7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=A7(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=A7(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 lre=50,ure=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:cre},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=j7(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<lre&&(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}=j7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},dre=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}=_7(e,t)||{};if(l==null)return{};let d=k7(u),f={x:n,y:r},p=C7(i),m=x7(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=d7(d[_],T),ee=d7(d[v],T),te=E,ne=C-h[m]-ee,re=C/2-h[m]/2+w,ie=g7(te,re,ne),ae=!c.arrow&&y7(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 fre(e,t,n){return(e?[...n.filter(t=>y7(t)===e),...n.filter(t=>y7(t)!==e)]:n.filter(e=>v7(e)===e)).filter(n=>e?y7(n)===e||(t?T7(n)!==n:!1):!0)}var pre=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=u7,autoAlignment:u=!0,...d}=_7(e,t),f=c!==void 0||l===u7?fre(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=w7(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[v7(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=y7(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,y7(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}}}}},mre=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}=_7(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=v7(r),_=S7(o),v=v7(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[O7(o)]:nre(o)),x=p!==`none`;!d&&x&&b.push(...ore(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=w7(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`&&_!==S7(t))||T.every(e=>S7(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=S7(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 M7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function N7(e){return c7.some(t=>e[t]>=0)}var hre=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=_7(e,t);switch(i){case`referenceHidden`:{let e=M7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:N7(e)}}}case`escaped`:{let e=M7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:N7(e)}}}default:return{}}}}};function P7(e){let t=d7(...e.map(e=>e.left)),n=d7(...e.map(e=>e.top)),r=f7(...e.map(e=>e.right)),i=f7(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function gre(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=>A7(P7(e)))}var _re=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}=_7(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=gre(u),f=A7(P7(u)),p=k7(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(S7(n)===`y`){let e=d[0],t=d[d.length-1],r=v7(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=v7(n)===`left`,t=f7(...d.map(e=>e.right)),r=d7(...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}}:{}}}},F7=new Set([`left`,`top`]);async function vre(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=v7(n),s=y7(n),c=S7(n)===`y`,l=F7.has(o)?-1:1,u=a&&c?-1:1,d=_7(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 yre=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 vre(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}}}}},bre=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}=_7(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=S7(v7(i)),p=b7(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=g7(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=g7(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}}}}}},xre=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}=_7(e,t),u={x:n,y:r},d=S7(i),f=b7(d),p=u[f],m=u[d],h=_7(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=F7.has(v7(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}}}},Sre=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}=_7(e,t),u=await o.detectOverflow(t,l),d=v7(i),f=y7(i),p=S7(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=d7(h-u[g],v),x=d7(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=f7(u.left,0),t=f7(u.right,0),n=f7(u.top,0),r=f7(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:f7(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:f7(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 I7(){return typeof window<`u`}function L7(e){return B7(e)?(e.nodeName||``).toLowerCase():`#document`}function R7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function z7(e){return((B7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function B7(e){return I7()?e instanceof Node||e instanceof R7(e).Node:!1}function V7(e){return I7()?e instanceof Element||e instanceof R7(e).Element:!1}function H7(e){return I7()?e instanceof HTMLElement||e instanceof R7(e).HTMLElement:!1}function U7(e){return!I7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof R7(e).ShadowRoot}function W7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Cre(e){return/^(table|td|th)$/.test(L7(e))}function G7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var wre=/transform|translate|scale|rotate|perspective|filter/,Tre=/paint|layout|strict|content/,K7=e=>!!e&&e!==`none`,q7;function J7(e){let t=V7(e)?Z7(e):e;return K7(t.transform)||K7(t.translate)||K7(t.scale)||K7(t.rotate)||K7(t.perspective)||!Y7()&&(K7(t.backdropFilter)||K7(t.filter))||wre.test(t.willChange||``)||Tre.test(t.contain||``)}function Ere(e){let t=$7(e);for(;H7(t)&&!X7(t);){if(J7(t))return t;if(G7(t))return null;t=$7(t)}return null}function Y7(){return q7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),q7}function X7(e){return/^(html|body|#document)$/.test(L7(e))}function Z7(e){return R7(e).getComputedStyle(e)}function Q7(e){return V7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $7(e){if(L7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||U7(e)&&e.host||z7(e);return U7(t)?t.host:t}function e9(e){let t=$7(e);return X7(t)?e.ownerDocument?e.ownerDocument.body:e.body:H7(t)&&W7(t)?t:e9(t)}function t9(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=e9(e),i=r===e.ownerDocument?.body,a=R7(r);if(i){let e=n9(a);return t.concat(a,a.visualViewport||[],W7(r)?r:[],e&&n?t9(e):[])}else return t.concat(r,t9(r,[],n))}function n9(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function r9(e){let t=Z7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=H7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=p7(n)!==a||p7(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function i9(e){return V7(e)?e:e.contextElement}function a9(e){let t=i9(e);if(!H7(t))return h7(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=r9(t),o=(a?p7(n.width):n.width)/r,s=(a?p7(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dre=h7(0);function o9(e){let t=R7(e);return!Y7()||!t.visualViewport?Dre:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ore(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==R7(e)?!1:t}function s9(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=i9(e),o=h7(1);t&&(r?V7(r)&&(o=a9(r)):o=a9(e));let s=Ore(a,n,r)?o9(a):h7(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=R7(a),t=r&&V7(r)?R7(r):r,n=e,i=n9(n);for(;i&&r&&t!==n;){let e=a9(i),t=i.getBoundingClientRect(),r=Z7(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=R7(i),i=n9(n)}}return A7({width:u,height:d,x:c,y:l})}function c9(e,t){let n=Q7(e).scrollLeft;return t?t.left+n:s9(z7(e)).left+n}function l9(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-c9(e,n),y:n.top+t.scrollTop}}function kre(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=z7(r),s=t?G7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=h7(1),u=h7(0),d=H7(r);if((d||!d&&!a)&&((L7(r)!==`body`||W7(o))&&(c=Q7(r)),d)){let e=s9(r);l=a9(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?l9(o,c):h7(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 Are(e){return Array.from(e.getClientRects())}function jre(e){let t=z7(e),n=Q7(e),r=e.ownerDocument.body,i=f7(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=f7(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+c9(e),s=-n.scrollTop;return Z7(r).direction===`rtl`&&(o+=f7(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var u9=25;function Mre(e,t){let n=R7(e),r=z7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Y7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=c9(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<=u9&&(a-=o)}else l<=u9&&(a+=l);return{width:a,height:o,x:s,y:c}}function Nre(e,t){let n=s9(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=H7(e)?a9(e):h7(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function d9(e,t,n){let r;if(t===`viewport`)r=Mre(e,n);else if(t===`document`)r=jre(z7(e));else if(V7(t))r=Nre(t,n);else{let n=o9(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return A7(r)}function f9(e,t){let n=$7(e);return n===t||!V7(n)||X7(n)?!1:Z7(n).position===`fixed`||f9(n,t)}function Pre(e,t){let n=t.get(e);if(n)return n;let r=t9(e,[],!1).filter(e=>V7(e)&&L7(e)!==`body`),i=null,a=Z7(e).position===`fixed`,o=a?$7(e):e;for(;V7(o)&&!X7(o);){let t=Z7(o),n=J7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||W7(o)&&!n&&f9(e,o))?r=r.filter(e=>e!==o):i=t,o=$7(o)}return t.set(e,r),r}function Fre(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?G7(t)?[]:Pre(t,this._c):[].concat(n),r],o=d9(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=d9(t,a[e],i);s=f7(n.top,s),c=d7(n.right,c),l=d7(n.bottom,l),u=f7(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ire(e){let{width:t,height:n}=r9(e);return{width:t,height:n}}function Lre(e,t,n){let r=H7(t),i=z7(t),a=n===`fixed`,o=s9(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=h7(0);function l(){c.x=c9(i)}if(r||!r&&!a)if((L7(t)!==`body`||W7(i))&&(s=Q7(t)),r){let e=s9(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?l9(i,s):h7(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 p9(e){return Z7(e).position===`static`}function m9(e,t){if(!H7(e)||Z7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return z7(e)===n&&(n=n.ownerDocument.body),n}function h9(e,t){let n=R7(e);if(G7(e))return n;if(!H7(e)){let t=$7(e);for(;t&&!X7(t);){if(V7(t)&&!p9(t))return t;t=$7(t)}return n}let r=m9(e,t);for(;r&&Cre(r)&&p9(r);)r=m9(r,t);return r&&X7(r)&&p9(r)&&!J7(r)?n:r||Ere(e)||n}var Rre=async function(e){let t=this.getOffsetParent||h9,n=this.getDimensions,r=await n(e.floating);return{reference:Lre(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zre(e){return Z7(e).direction===`rtl`}var Bre={convertOffsetParentRelativeRectToViewportRelativeRect:kre,getDocumentElement:z7,getClippingRect:Fre,getOffsetParent:h9,getElementRects:Rre,getClientRects:Are,getDimensions:Ire,getScale:a9,isElement:V7,isRTL:zre};function g9(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vre(e,t){let n=null,r,i=z7(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=m7(d),h=m7(i.clientWidth-(u+f)),g=m7(i.clientHeight-(d+p)),_=m7(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:f7(0,d7(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&&!g9(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 _9(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=i9(e),u=i||a?[...l?t9(l):[],...t?t9(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Vre(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?s9(e):null;c&&g();function g(){let t=s9(e);h&&!g9(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 v9=yre,Hre=pre,y9=bre,b9=mre,x9=Sre,S9=hre,C9=dre,Ure=_re,Wre=xre,w9=(e,t,n)=>{let r=new Map,i={platform:Bre,...n},a={...i.platform,_c:r};return ure(e,t,{...i,platform:a})},T9=typeof document<`u`?y.useLayoutEffect:function(){};function E9(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(!E9(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)&&!E9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function D9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function O9(e,t){let n=D9(e);return Math.round(t*n)/n}function k9(e){let t=y.useRef(e);return T9(()=>{t.current=e}),t}function Gre(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);E9(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=k9(c),te=k9(i),ne=k9(l),re=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),w9(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!E9(T.current,t)&&(T.current=t,xo.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);T9(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=y.useRef(!1);T9(()=>(ie.current=!0,()=>{ie.current=!1}),[]),T9(()=>{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=O9(D.floating,u.x),r=O9(D.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...D9(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 Kre=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?{}:C9({element:r.current,padding:i}).fn(n):r?C9({element:r,padding:i}).fn(n):{}}}},qre=(e,t)=>{let n=v9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jre=(e,t)=>{let n=y9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yre=(e,t)=>({fn:Wre(e).fn,options:[e,t]}),Xre=(e,t)=>{let n=b9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zre=(e,t)=>{let n=x9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qre=(e,t)=>{let n=S9(e);return{name:n.name,fn:n.fn,options:[e,t]}},$re=(e,t)=>{let n=Kre(e);return{name:n.name,fn:n.fn,options:[e,t]}},eie=`Arrow`,A9=y.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,bo.jsx)(d.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,bo.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});A9.displayName=eie;var tie=A9,j9=`Popper`,[M9,nie]=c(j9),[rie,N9]=M9(j9),P9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return(0,bo.jsx)(rie,{scope:t,anchor:r,onAnchorChange:i,children:n})};P9.displayName=j9;var F9=`PopperAnchor`,I9=y.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=N9(F9,n),o=y.useRef(null),s=p(t,o),c=y.useRef(null);return y.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,bo.jsx)(d.div,{...i,ref:s})});I9.displayName=F9;var L9=`PopperContent`,[iie,aie]=M9(L9),R9=y.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h=`partial`,hideWhenDetached:g=!1,updatePositionStrategy:_=`optimized`,onPlaced:b,...x}=e,S=N9(L9,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(sie),altBoundary:oe},{refs:O,floatingStyles:ce,placement:le,isPositioned:ue,middlewareData:de}=Gre({strategy:`fixed`,placement:ie,whileElementsMounted:(...e)=>_9(...e,{animationFrame:_===`always`}),elements:{reference:S.anchor},middleware:[qre({mainAxis:i+re,alignmentAxis:o}),l&&Jre({mainAxis:!0,crossAxis:!1,limiter:h===`partial`?Yre():void 0,...se}),l&&Xre({...se}),Zre({...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&&$re({element:E,padding:c}),cie({arrowWidth:ne,arrowHeight:re}),g&&Qre({strategy:`referenceHidden`,...se})]}),[fe,pe]=V9(le),me=s(b);u(()=>{ue&&me?.()},[ue,me]);let he=de.arrow?.x,ge=de.arrow?.y,_e=de.arrow?.centerOffset!==0,[ve,ye]=y.useState();return u(()=>{C&&ye(window.getComputedStyle(C).zIndex)},[C]),(0,bo.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,bo.jsx)(iie,{scope:n,placedSide:fe,onArrowChange:ee,arrowX:he,arrowY:ge,shouldHideArrow:_e,children:(0,bo.jsx)(d.div,{"data-side":fe,"data-align":pe,...x,ref:T,style:{...x.style,animation:ue?void 0:`none`}})})})});R9.displayName=L9;var z9=`PopperArrow`,oie={top:`bottom`,right:`left`,bottom:`top`,left:`right`},B9=y.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=aie(z9,n),a=oie[i.placedSide];return(0,bo.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,bo.jsx)(tie,{...r,ref:t,style:{...r.style,display:`block`}})})});B9.displayName=z9;function sie(e){return e!==null}var cie=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]=V9(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 V9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var lie=P9,uie=I9,die=R9,fie=B9;function H9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function pie(e){return e.kind===`asset`}function mie(e){return e.kind===`document`}function hie(e){return e.kind===`folder`}function gie(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 _ie(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}var U9=null,W9=new Set;function G9(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 vie(e,t){return e===null?!1:e===t?!0:G9(e.pages,t.pages)&&G9(e.folderPaths,t.folderPaths)&&G9(e.assetPaths??new Set,t.assetPaths??new Set)}function yie(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 bie(){return U9}function xie(e){if(!vie(U9,e)){U9=e;for(let t of[...W9])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function Sie(e){if(W9.add(e),U9!==null)try{e(U9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{W9.delete(e)}}var K9=`open-knowledge:documents-changed`,Cie=new Set(k5.options);function q9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>Cie.has(e)))]}function wie(e=[`files`]){window.dispatchEvent(new CustomEvent(K9,{detail:{channels:q9(e)}}))}function J9(e){let t=t=>{e(q9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(K9,t),()=>window.removeEventListener(K9,t)}var Y9=`open-knowledge:templates-changed`;function Tie(){window.dispatchEvent(new CustomEvent(Y9))}function Eie(e){let t=()=>e();return window.addEventListener(Y9,t),()=>window.removeEventListener(Y9,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 Oie(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 gie(n))t.add(e);return t}function kie(e,t){if(!t)return;let n=v8(e);if(n)return t.get(n)}function Aie(e,t){let{normalizedTarget:n,expectsFolder:r}=Oie(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=kie(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 jie(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function Mie(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 Nie(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 Pie(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 Fie(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function Iie(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function Lie(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(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 Rie(e){console.error(`[PageListContext] Failed to load pages:`,e)}function zie(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function Bie(e){let t=(0,So.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([Iie(),Lie().catch(Wie)]).then(t=>{let[n,r]=t;if(e!==E.current)return;let i=new Set(n.map(Uie));a(i),c(new Map(n.map(Hie))),d(new Map(n.map(Vie))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),x(e=>Pie(e,i)),T(null)}).catch(t=>{e===E.current&&(Rie(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=J9(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=Nie(i,b);let e;t[22]!==b||t[23]!==s?(e=Fie(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=yie(ce,v8),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=()=>{xie({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,bo.jsx)(Q9,{value:pe,children:n}),t[40]=n,t[41]=pe,t[42]=me):me=t[42],me}function Vie(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt}]}function Hie(e){return[e.docName,e.title]}function Uie(e){return e.docName}function Wie(e){return zie(e),{assetPaths:[],folderPaths:[]}}function Gie(){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 qie(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 Yie(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 Xie(e){return`${$9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}export{M5 as $,Yne as $n,U1 as $t,Hre as A,I2 as An,_p as Ar,$8 as At,Qne as B,a7 as Bn,$u as Br,$1 as Bt,H9 as C,I1 as Cn,ay as Cr,D$ as Ct,lie as D,Nne as Dn,P_ as Dr,r8 as Dt,die as E,a$ as En,gS as Er,J8 as Et,Ure as F,R2 as Fn,fp as Fr,h1 as Ft,y$ as G,t2 as Gn,Ja as Gr,L1 as Gt,o7 as H,S$ as Hn,du as Hr,n0 as Ht,v9 as I,F2 as In,R as Ir,h5 as It,o5 as J,F1 as Jn,se as Jr,Une as Jt,k$ as K,B$ as Kn,N as Kr,B1 as Kt,y9 as L,B2 as Ln,lf as Lr,X$ as Lt,w9 as M,U2 as Mn,jp as Mr,d5 as Mt,b9 as N,z2 as Nn,Pp as Nr,e0 as Nt,nie as O,W2 as On,L_ as Or,m1 as Ot,S9 as P,H2 as Pn,L as Pr,t0 as Pt,P5 as Q,Kne as Qn,r0 as Qt,x9 as R,V2 as Rn,Wd as Rr,Q$ as Rt,hie as S,Vne as Sn,aS as Sr,e5 as St,fie as T,e2 as Tn,Gb as Tr,i1 as Tt,Dne as U,e1 as Un,cu as Ur,O$ as Ut,Zne as V,i$ as Vn,I as Vr,j1 as Vt,One as W,R8 as Wn,gu as Wr,P$ as Wt,j5 as X,uQ as Xn,ee as Xr,IQ as Xt,U8 as Y,Jne as Yn,oe as Yr,WQ as Yt,F5 as Z,lQ as Zn,E as Zr,XQ as Zt,bie as _,r7 as _n,db as _r,u$ as _t,Jie as a,Gne as an,x8 as ar,h$ as at,pie as b,jne as bn,Cb as br,X5 as bt,Mie as c,q1 as cn,Vte as cr,V$ as ct,Die as d,j2 as dn,Fx as dr,N$ as dt,W1 as en,xne as er,N5 as et,X9 as f,mne as fn,Hb as fr,M$ as ft,Eie as g,R1 as gn,Zy as gr,A$ as gt,J9 as h,d$ as hn,iS as hr,b$ as ht,qie as i,Wne as in,v8 as ir,g$ as it,_9 as j,L2 as jn,z as jr,p5 as jt,C9 as k,G2 as kn,_v as kr,x$ as kt,jie as l,Ane as ln,AT as lr,u5 as lt,Tie as m,Ine as mn,_S as mr,V8 as mt,Kie as n,qne as nn,tQ as nr,_$ as nt,Bie as o,kne as on,B5 as or,v$ as ot,wie as p,pne as pn,bS as pr,g5 as pt,a5 as q,o$ as qn,A as qr,Q8 as qt,Xie as r,Sne as rn,C1 as rr,m$ as rt,Gie as s,J1 as sn,qte as sr,Y5 as st,Yie as t,K1 as tn,V1 as tr,A5 as tt,Aie as u,wne as un,Xx as ur,l5 as ut,Sie as v,qZ as vn,bb as vr,H1 as vt,uie as w,f$ as wn,ub as wr,J$ as wt,mie as x,b8 as xn,Ub as xr,Z0 as xt,_ie as y,n8 as yn,Sb as yr,G8 as yt,ere as z,ZZ as zn,F as zr,p$ as zt};
|