@inkeep/open-knowledge 0.0.0-dev-20260428210955 → 0.0.0-dev-20260428211426

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/cli.mjs +4 -4
  2. package/dist/constants-DCJlLBSi.mjs +2 -0
  3. package/dist/index.mjs +1 -1
  4. package/dist/{init-CRW0D5ph.mjs → init-CMkePWjl.mjs} +2 -2
  5. package/dist/init-D-5Gc0uq.mjs +1 -0
  6. package/dist/{init-6dURauqK.mjs → init-D0YdyLe_.mjs} +3 -3
  7. package/dist/{init-DRMy2_G-.mjs → init-DUA_XKK1.mjs} +1 -1
  8. package/dist/loader-1GTY76cQ.mjs +1 -0
  9. package/dist/{loader-qdIcAKh4.mjs → loader-BJU3jneI.mjs} +2 -2
  10. package/dist/{paths-B_1T9xE_.mjs → paths-CNpYe27Q.mjs} +2 -2
  11. package/dist/paths-fx16Ahvg.mjs +1 -0
  12. package/dist/preview-CHvLSbhb.mjs +1 -0
  13. package/dist/{preview-ChbZYQA2.mjs → preview-CXP9kBv6.mjs} +2 -2
  14. package/dist/public/assets/{ActivityModeContent-D5tQuic6.js → ActivityModeContent-Ccu_n0bV.js} +1 -1
  15. package/dist/public/assets/{DocumentContext-5648awue.js → DocumentContext-C1msvcHp.js} +3 -3
  16. package/dist/public/assets/McpConsentDialogBody-Csjet19t.js +1 -0
  17. package/dist/public/assets/{SourceEditor-v974jYM4.js → SourceEditor-OFesfBB2.js} +1 -1
  18. package/dist/public/assets/agent-presence-BXsx4eTl.js +1 -0
  19. package/dist/public/assets/{clipboard-jQ8LVmdA.js → clipboard-DAcKCHl1.js} +1 -1
  20. package/dist/public/assets/{index-DNmHaUwi.js → index-CwFTGDhe.js} +71 -71
  21. package/dist/public/assets/index-DjR45Lon.css +1 -0
  22. package/dist/public/index.html +5 -5
  23. package/dist/src-BIqAAP5m.mjs +1 -0
  24. package/dist/{start-Bx8bL6aP.mjs → start-BOjBm-nL.mjs} +2 -2
  25. package/dist/start-CZFHRjtT.mjs +1 -0
  26. package/package.json +1 -1
  27. package/dist/constants-BaY8SSAJ.mjs +0 -2
  28. package/dist/init-TT7UmZ_q.mjs +0 -1
  29. package/dist/loader-C0u1z8s-.mjs +0 -1
  30. package/dist/paths-CJKFicve.mjs +0 -1
  31. package/dist/preview-BECu-3G6.mjs +0 -1
  32. package/dist/public/assets/McpConsentDialogBody-YzV-7sGd.js +0 -1
  33. package/dist/public/assets/agent-presence-CN4nWhyr.js +0 -1
  34. package/dist/public/assets/index-B-gEZtZG.css +0 -1
  35. package/dist/src-BbCKX9bp.mjs +0 -1
  36. package/dist/start-DOswmHU0.mjs +0 -1
@@ -0,0 +1 @@
1
+ import{i as e,n as t,r as n,t as r}from"./index-CwFTGDhe.js";export{r as McpConsentDialogBody,r as default,t as computeInitialSelection,n as selectedIdsOrdered,e as toggleSelectedId};
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-DlS42TIP.js","./dist-CgLbXgrr.js","./chunk-DECur_0Z.js","./w3c-keyname-CSlwavrd.js","./dist-GlH2KPqY.js","./dist-DeDgmJv2.js","./dist-DR1MrLJC.js","./dist-D2wwoXzm.js","./dist-BqO6NfD-.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-DECur_0Z.js";import{d as t}from"./propagation-api-Bugyj7xy.js";import{n,r,t as i}from"./compiler-runtime-Y11fyRVL.js";import{l as a}from"./panel-BCRdtBla.js";import{$ as o,D as s,E as c,G as l,H as u,I as d,J as f,K as p,O as m,P as h,Q as g,W as _,X as v,Y as y,Z as b,_ as x,d as S,et as C,g as w,h as T,k as E,q as D,v as ee}from"./DocumentContext-5648awue.js";import{G as te,Q as O,S as ne,V as re,q as ie}from"./PageListContext-B5SWnlyE.js";import{_ as ae,a as oe,c as se,d as ce,f as le,g as ue,h as de,l as fe,m as pe,p as me,s as he,t as ge,u as _e,v as ve}from"./clipboard-jQ8LVmdA.js";import{At as ye,Dt as k,Et as be,N as A,Nt as j,Pt as M,Q as xe,Tt as N,Y as P,Z as F,a as I,bt as L,ft as R,jt as z,lt as Se,q as B,wt as V}from"./dist-CgLbXgrr.js";var H=e(n(),1),Ce=i(),we=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:y(this.yanchor),yhead:y(this.yhead)}}static fromJSON(t){return new e(D(t.yanchor),D(t.yhead))}},Te=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new _(e)}toYPos(e,t=0){return f(this.ytext,e,t)}fromYPos(e){let t=p(D(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new we(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?N.cursor(n.pos,n.assoc):N.range(t.pos,n.pos)}},U=k.define({combine(e){return e[e.length-1]}}),W=L.define(),Ee=class{constructor(e){this.view=e,this.conf=e.state.facet(U),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[W.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(W)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
+ import{r as e}from"./chunk-DECur_0Z.js";import{d as t}from"./propagation-api-Bugyj7xy.js";import{n,r,t as i}from"./compiler-runtime-Y11fyRVL.js";import{l as a}from"./panel-BCRdtBla.js";import{$ as o,D as s,E as c,G as l,H as u,I as d,J as f,K as p,O as m,P as h,Q as g,W as _,X as v,Y as y,Z as b,_ as x,d as S,et as C,g as w,h as T,k as E,q as D,v as ee}from"./DocumentContext-C1msvcHp.js";import{G as te,Q as O,S as ne,V as re,q as ie}from"./PageListContext-B5SWnlyE.js";import{_ as ae,a as oe,c as se,d as ce,f as le,g as ue,h as de,l as fe,m as pe,p as me,s as he,t as ge,u as _e,v as ve}from"./clipboard-DAcKCHl1.js";import{At as ye,Dt as k,Et as be,N as A,Nt as j,Pt as M,Q as xe,Tt as N,Y as P,Z as F,a as I,bt as L,ft as R,jt as z,lt as Se,q as B,wt as V}from"./dist-CgLbXgrr.js";var H=e(n(),1),Ce=i(),we=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:y(this.yanchor),yhead:y(this.yhead)}}static fromJSON(t){return new e(D(t.yanchor),D(t.yhead))}},Te=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new _(e)}toYPos(e,t=0){return f(this.ytext,e,t)}fromYPos(e){let t=p(D(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new we(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?N.cursor(n.pos,n.assoc):N.range(t.pos,n.pos)}},U=k.define({combine(e){return e[e.length-1]}}),W=L.define(),Ee=class{constructor(e){this.view=e,this.conf=e.state.facet(U),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[W.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(W)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
3
3
  `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},De=F.fromClass(Ee),Oe=P.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),ke=L.define(),Ae=class extends xe{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return v(`span`,[g(`class`,`cm-ySelectionCaret`),g(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[b(`⁠`),v(`div`,[g(`class`,`cm-ySelectionCaretDot`)]),b(`⁠`),v(`div`,[g(`class`,`cm-ySelectionInfo`)],[b(this.name)]),b(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},je=class{constructor(e){this.conf=e.state.facet(U),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[ke.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=ye.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,r=this.conf.awareness,i=[],a=this.conf.awareness.getLocalState();if(a!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=n?e.state.selection.main:null,o=a.cursor==null?null:D(a.cursor.anchor),s=a.cursor==null?null:D(a.cursor.head);if(i!=null){let e=f(t,i.anchor),n=f(t,i.head);(a.cursor==null||!l(o,e)||!l(s,n))&&r.setLocalStateField(`cursor`,{anchor:e,head:n})}else a.cursor!=null&&n&&r.setLocalStateField(`cursor`,null)}r.getStates().forEach((a,s)=>{if(s===r.doc.clientID)return;let c=a.cursor;if(c==null||c.anchor==null||c.head==null)return;let l=p(c.anchor,n),u=p(c.head,n);if(l==null||u==null||l.type!==t||u.type!==t)return;let{color:d=`#30bced`,name:f=`Anonymous`}=a.user||{},m=a.user&&a.user.colorLight||d+`33`,h=C(l.index,u.index),g=o(l.index,u.index),_=e.view.state.doc.lineAt(h),v=e.view.state.doc.lineAt(g);if(_.number===v.number)i.push({from:h,to:g,value:B.mark({attributes:{style:`background-color: ${m}`},class:`cm-ySelection`})});else{i.push({from:h,to:_.from+_.length,value:B.mark({attributes:{style:`background-color: ${m}`},class:`cm-ySelection`})}),i.push({from:v.from,to:g,value:B.mark({attributes:{style:`background-color: ${m}`},class:`cm-ySelection`})});for(let t=_.number+1;t<v.number;t++){let n=e.view.state.doc.line(t).from;i.push({from:n,to:n,value:B.line({attributes:{style:`background-color: ${m}`,class:`cm-yLineSelection`}})})}}i.push({from:u.index,to:u.index,value:B.widget({side:u.index-l.index>0?-1:1,block:!1,widget:new Ae(d,f)})})}),this.decorations=B.set(i,!0)}},Me=F.fromClass(je,{decorations:e=>e.decorations}),Ne=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},G=k.define({combine(e){return e[e.length-1]}});L.define();var Pe=class{constructor(e){this.view=e,this.conf=e.state.facet(G),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(U),this._beforeChangeSelection=null,this._mux=u(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let t=this.syncConf.fromYRange(n);e.dispatch(e.state.update({selection:t,effects:[P.scrollIntoView(t)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(W)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},Fe=F.fromClass(Pe),Ie=({state:e,dispatch:t})=>e.facet(G).undo()||!0,Le=({state:e,dispatch:t})=>e.facet(G).redo()||!0,Re=(e,t,{undoManager:n=new _(e)}={})=>{let r=new Te(e,t),i=[U.of(r),De];return t&&i.push(Oe,Me),n!==!1&&i.push(G.of(new Ne(n)),Fe,P.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?Ie(t):e.inputType===`historyRedo`?Le(t):!1}})),i},ze=[I.of({name:`javascript`,alias:[`js`,`jsx`],extensions:[`js`,`mjs`,`cjs`,`jsx`],load:async()=>pe({jsx:!0})}),I.of({name:`typescript`,alias:[`ts`,`tsx`],extensions:[`ts`,`mts`,`cts`,`tsx`],load:async()=>pe({typescript:!0,jsx:!0})}),I.of({name:`json`,alias:[`jsonc`],extensions:[`json`,`jsonc`],load:()=>t(()=>import(`./dist-DlS42TIP.js`).then(e=>e.json()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}),I.of({name:`yaml`,alias:[`yml`],extensions:[`yaml`,`yml`],load:()=>t(()=>import(`./dist-DeDgmJv2.js`).then(e=>e.yaml()),__vite__mapDeps([5,1,2,3,4]),import.meta.url)}),I.of({name:`css`,alias:[`scss`,`less`],extensions:[`css`,`scss`,`less`],load:async()=>de()}),I.of({name:`html`,alias:[`htm`],extensions:[`html`,`htm`],load:async()=>me()}),I.of({name:`python`,alias:[`py`],extensions:[`py`,`pyw`],load:()=>t(()=>import(`./dist-DR1MrLJC.js`).then(e=>e.python()),__vite__mapDeps([6,7,1,2,3,4]),import.meta.url)}),I.of({name:`rust`,alias:[`rs`],extensions:[`rs`],load:()=>t(()=>import(`./dist-BqO6NfD-.js`).then(e=>e.rust()),__vite__mapDeps([8,1,2,3,4]),import.meta.url)}),I.of({name:`markdown`,alias:[`md`,`mdx`],extensions:[`md`,`mdx`,`markdown`],load:async()=>ce()}),I.of({name:`bash`,alias:[`sh`,`shell`,`zsh`],extensions:[`sh`,`bash`,`zsh`],load:async()=>{let[{StreamLanguage:e,LanguageSupport:n},{shell:r}]=await Promise.all([t(()=>import(`./dist-CgLbXgrr.js`).then(e=>e.m),__vite__mapDeps([1,2,3]),import.meta.url),t(()=>import(`./shell-7yok6dsz.js`),[],import.meta.url)]);return new n(e.define(r))}}),I.of({name:`go`,alias:[`golang`],extensions:[`go`],load:async()=>{let[{StreamLanguage:e,LanguageSupport:n},{go:r}]=await Promise.all([t(()=>import(`./dist-CgLbXgrr.js`).then(e=>e.m),__vite__mapDeps([1,2,3]),import.meta.url),t(()=>import(`./go-DatQmDtN.js`),[],import.meta.url)]);return new n(e.define(r))}})],Be=j.define(),Ve=j.define(),He=B.line({class:`agent-flash`}),Ue=M.define({create(){return B.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Be)){let{from:r,to:i}=n.value,a=[];for(let e=r;e<=i;){let n=t.state.doc.lineAt(e);a.push(He.range(n.from)),e=n.to+1}e=e.update({add:a,sort:!0})}else n.is(Ve)&&(e=B.none);return e},provide:e=>P.decorations.from(e)});function We(e){let t=e.getMap(`agent-flash`);return[Ue,F.define(e=>{let n=0,r=Date.now(),i=null,a=null,o=!1;function s(){let t=e.state.doc.length;t!==0&&(o||(e.dispatch({effects:Be.of({from:0,to:t})}),a&&clearTimeout(a),a=setTimeout(()=>{a=null,!o&&e.dispatch({effects:Ve.of(null)})},ne)))}let c=e=>{if(ie(t),!O(t,r))return;r=Date.now();let a=Date.now();if(a-n<500){if(!i){let e=500-(a-n);i=setTimeout(()=>{i=null,n=Date.now(),s()},e)}return}n=a,s()};t.observe(c);let l=()=>{document.visibilityState===`visible`?O(t,r)&&(r=Date.now(),n=Date.now(),s()):r=Date.now()};return document.addEventListener(`visibilitychange`,l),{update(e){},destroy(){o=!0,t.unobserve(c),document.removeEventListener(`visibilitychange`,l),i&&=(clearTimeout(i),null),a&&=(clearTimeout(a),null)}}})]}var K=/\[([^\]\n]*)\]\((<[^>\n]+>|[^)\s\n]+)(?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?\)/g,Ge=B.mark({class:`cm-md-internal-link`});function Ke(e,t){return t>0&&e[t-1]===`!`}function qe(e){let t=e[2]??``;return t.startsWith(`<`)&&t.endsWith(`>`)?t.slice(1,-1):t}function Je(e){let t=new z;for(let{from:n,to:r}of e.visibleRanges){let i=e.state.doc.sliceString(n,r);K.lastIndex=0;let a=K.exec(i);for(;a!==null;){let e=Ke(i,a.index)?null:c(qe(a));e&&e.kind!==`external`&&t.add(n+a.index,n+a.index+a[0].length,Ge),a=K.exec(i)}}return t.finish()}var Ye=F.fromClass(class{decorations;constructor(e){this.decorations=Je(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Je(e.view))}},{decorations:e=>e.decorations}),Xe=P.domEventHandlers({mousedown(e,t){if(!e.ctrlKey&&!e.metaKey)return!1;let n=t.posAtCoords({x:e.clientX,y:e.clientY});if(n===null)return!1;let r=t.state.doc.lineAt(n);K.lastIndex=0;let i=K.exec(r.text);for(;i!==null;){let t=r.from+i.index,a=t+i[0].length;if(n>=t&&n<=a){let t=Ke(r.text,i.index)?null:c(qe(i));if(t&&t.kind!==`external`)return e.preventDefault(),t.kind===`doc`&&E(e)?(m(t),!0):(s(t),!0)}i=K.exec(r.text)}return!1}}),Ze=P.theme({".cm-md-internal-link":{color:`oklch(52.7% 0.154 228.4)`,fontWeight:`500`},".cm-md-internal-link:hover":{textDecoration:`underline`,cursor:`pointer`}});function Qe(){return[Ye,Xe,Ze]}var $e=5e3,q=null,et=0,tt=null,J=new Map;async function nt(){let e=Date.now();return q&&e-et<$e?q:(q=await w(),et=e,tt=st(q),q)}async function rt(e){let t=Date.now(),n=J.get(e);if(n!==void 0&&t-n.time<$e)return n.headings;try{let n=await T(e);return J.set(e,{headings:n,time:t}),n}catch(n){return console.warn(`[wiki-link-source] /api/page-headings fetch failed:`,n),J.set(e,{headings:[],time:t}),[]}}var Y=/\[\[[^\]]*?\]\]/g,it=B.mark({class:`cm-wiki-link`}),at=B.mark({class:`cm-wiki-link cm-wiki-link-broken`});function ot(e){let t=new Set;for(let n of e)t.add(n.docName.toLowerCase()),n.title&&t.add(n.title.toLowerCase());return t}function st(e){let t=ot(e);for(let n of e){let e=n.docName.split(`/`);e.pop();let r=``;for(let n of e)r=r?`${r}/${n}`:n,t.add(r.toLowerCase())}return t}function ct(e){return e.split(/[#|]/)[0].trim().toLowerCase()}function lt(e){let t=new z,n=q?tt:null;for(let{from:r,to:i}of e.visibleRanges){let a=e.state.doc.sliceString(r,i);Y.lastIndex=0;let o=Y.exec(a);for(;o!==null;){let e=it;if(n){let t=ct(o[0].slice(2,-2));t&&!n.has(t)&&(e=at)}t.add(r+o.index,r+o.index+o[0].length,e),o=Y.exec(a)}}return t.finish()}var ut=F.fromClass(class{decorations;cacheWarmAtBuild;constructor(e){this.cacheWarmAtBuild=q!==null,this.decorations=lt(e),this.cacheWarmAtBuild||this.warmCache(e)}update(e){let t=q!==null;(e.docChanged||e.viewportChanged||!this.cacheWarmAtBuild&&t)&&(this.cacheWarmAtBuild=t,this.decorations=lt(e.view))}warmCache(e){nt().then(()=>{try{e.dispatch({})}catch{}}).catch(e=>{console.warn(`[wiki-link-source] warmCache fetch failed:`,e)})}},{decorations:e=>e.decorations}),X=/\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/g,dt=P.domEventHandlers({mousedown(e,t){if(!e.ctrlKey&&!e.metaKey)return!1;let n=t.posAtCoords({x:e.clientX,y:e.clientY});if(n===null)return!1;let r=t.state.doc.lineAt(n);X.lastIndex=0;let i=X.exec(r.text);for(;i!==null;){let t=r.from+i.index,a=t+i[0].length;if(n>=t&&n<=a){let t=i[1]?.trim(),n=i[2]?.trim()||null;if(t){let r=re(t,n);if(!r)return!1;e.preventDefault(),r.kind===`external`?window.open(r.url,`_blank`,`noopener,noreferrer`):E(e)?m(r):window.location.hash=r.anchor?`#/${r.docName}?anchor=${encodeURIComponent(r.anchor)}`:`#/${r.docName}`}return!0}i=X.exec(r.text)}return!1}});async function ft(e){let t=e.state.doc.sliceString(0,e.pos).match(/\[\[([^\]]*)$/);if(!t)return null;let n=t[1],r=e.pos-n.length,i=n.indexOf(`#`);if(i>0){let e=n.slice(0,i),t=n.slice(i+1),a=r+i+1,o=await rt(e);if(!o.length)return null;let s=x(o,t);return s.length?{from:a,filter:!1,options:s.map(e=>({label:e.text,detail:`H${e.level}`,apply(t,n,r,i){let a=t.state.doc.sliceString(i,i+2)===`]]`?``:`]]`;t.dispatch({changes:{from:r,to:i,insert:e.slug+a},selection:{anchor:r+e.slug.length+a.length}})}}))}:null}return{from:r,filter:!1,options:ee(await nt().catch(e=>(console.warn(`[wiki-link-source] Failed to fetch pages:`,e),[])),n).map(e=>({label:e.title,detail:e.title===e.docName?void 0:e.docName,apply(t,n,r,i){let a=t.state.doc.sliceString(i,i+2)===`]]`?``:`]]`;t.dispatch({changes:{from:r,to:i,insert:e.docName+a},selection:{anchor:r+e.docName.length+a.length}})}}))}}var pt=P.theme({".cm-wiki-link":{color:`oklch(52.7% 0.154 228.4)`,fontWeight:`500`},".cm-wiki-link:hover":{textDecoration:`underline`,cursor:`pointer`}});function mt(){return[ut,dt,pt,le.data.of({autocomplete:ft})]}var ht=B.mark({class:`cm-link-ref-broken`}),gt=/^\s{0,3}\[([^\]]+)\]:\s/,_t=/\[([^\]]*)\]\[([^\]]*)\]/g,vt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function Z(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function yt(e){let t=[];return A(e).iterate({enter(e){if(vt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function Q(e){let t=new Set,n=[],r=e.doc,i=yt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(Z(n.from,i))continue;let a=gt.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!Z(t.from,i)&&!gt.test(t.text))for(_t.lastIndex=0;;){let e=_t.exec(t.text);if(!e)break;let r=t.from+e.index;if(Z(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ht.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),B.set(a)}var bt=M.define({create(e){return Q(e)},update(e,t){return t.docChanged?Q(t.state):e},provide:e=>P.decorations.from(e)}),xt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,St=B.mark({class:`cm-del`}),Ct=B.line({class:`cm-table-header`}),wt=B.line({class:`cm-table-row`});function Tt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function Et(e,t){let n=[],r=A(e);for(let{from:i,to:a}of t)r.iterate({from:i,to:a,enter(t){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(St.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=xt.exec(r.text),a=i?i[1].length:2,o=B.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=Tt(r.text),a=B.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(Ct.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(wt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(wt.range(r.from)),!1}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),B.set(n)}var Dt=class{decorations;constructor(e){this.decorations=Et(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||A(e.startState)!==A(e.state))&&(this.decorations=Et(e.view.state,e.view.visibleRanges))}},Ot=F.fromClass(Dt,{decorations:e=>e.decorations});function kt(){return[Ot,bt]}var At=r(),jt=_e({settings:{background:`var(--background)`,gutterBackground:`var(--background)`}}),Mt=fe({settings:{background:`var(--background)`,gutterBackground:`var(--background)`}}),Nt=new V,Pt=new V;function $(e,t){let n=e.state.doc,r=1;if(n.lines>=1&&n.line(1).text===`---`){for(let e=2;e<=n.lines;e++)if(n.line(e).text===`---`){r=e+1;break}}let i=te(),a=0;for(let o=r;o<=n.lines;o++){let r=n.line(o);if(!i(r.text)&&/^#{1,6}\s/.test(r.text)){if(a===t.index){e.dispatch({selection:N.cursor(r.from),effects:P.scrollIntoView(r.from,{y:`start`})}),e.focus();return}a++}}}function Ft(e,t){requestAnimationFrame(()=>{let n=e.state.doc,r=Math.min(t.offset,n.length);e.dispatch({selection:N.cursor(r),effects:P.scrollIntoView(r,{y:`center`})}),e.focus()})}function It(e){let t=(0,Ce.c)(23),{docName:n,ytext:r,provider:i,placeholder:o,isSourceModeActive:s}=e,c=(0,H.useRef)(null),l=(0,H.useRef)(null),[u,f]=(0,H.useState)(null);if(u)throw u;let{resolvedTheme:p}=a(),m=(0,H.useRef)(null),g;t[0]!==o||t[1]!==i||t[2]!==p||t[3]!==r?(g=()=>{let e=c.current;if(!e)return;let t=i.configuration.name??``,n,a=Lt;try{n=h({docName:t,container:e,sizeStats:{viewCount:0,bytes:r.length},factory:e=>{let t=ge({ydoc:i.document,ytext:r}),n=new P({state:be.create({doc:r.toString(),extensions:[he,Se.of([se]),ce({base:le,extensions:[ue],codeLanguages:ze}),Re(r,i.awareness),We(i.document),mt(),Qe(),kt(),t,Nt.of(p===`dark`?jt:Mt),Pt.of(R(o??``)),P.lineWrapping,P.theme({"&":{height:`100%`}})]}),parent:e}),s=n.contentDOM;return s.addEventListener(`keydown`,a),s.addEventListener(`paste`,a),s.addEventListener(`drop`,a),s.addEventListener(`cut`,a),{view:n,ydoc:i.document,ytext:r,provider:i}}}),m.current=n,l.current=n.view}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),m.current=null,l.current=null,f(t instanceof Error?t:Error(String(t)))}return()=>{let e=m.current;e&&d(e),m.current=null,l.current=null}},t[0]=o,t[1]=i,t[2]=p,t[3]=r,t[4]=g):g=t[4];let _;t[5]!==i||t[6]!==r?(_=[r,i],t[5]=i,t[6]=r,t[7]=_):_=t[7],(0,H.useEffect)(g,_);let v,y;t[8]===p?(v=t[9],y=t[10]):(v=()=>{l.current&&l.current.dispatch({effects:Nt.reconfigure(p===`dark`?jt:Mt)})},y=[p],t[8]=p,t[9]=v,t[10]=y),(0,H.useEffect)(v,y);let b,x;t[11]===o?(b=t[12],x=t[13]):(b=()=>{l.current&&l.current.dispatch({effects:Pt.reconfigure(R(o??``))})},x=[o],t[11]=o,t[12]=b,t[13]=x),(0,H.useEffect)(b,x);let S,C;t[14]!==n||t[15]!==s?(S=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!s)return;let r=l.current;r&&($(r,t),ae(n))};return window.addEventListener(oe,e),()=>window.removeEventListener(oe,e)},C=[n,s],t[14]=n,t[15]=s,t[16]=S,t[17]=C):(S=t[16],C=t[17]),(0,H.useEffect)(S,C);let w,T;t[18]!==n||t[19]!==s?(T=()=>{if(!s)return;let e=l.current;if(!e)return;let t=ve(n);if(t){if(t.kind===`outline`){$(e,t.detail);return}Ft(e,t.detail)}},w=[n,s],t[18]=n,t[19]=s,t[20]=w,t[21]=T):(w=t[20],T=t[21]),(0,H.useEffect)(T,w);let E;return t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,At.jsx)(`div`,{ref:c,className:`source-editor h-full py-3`}),t[22]=E):E=t[22],E}function Lt(){return S()}export{It as SourceEditor};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{x as i}from"./button-BPXuMr5W.js";var a=i(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),o=i(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),s=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),c=i(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),l=i(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),u=r(),d=n();function f(e){let t=(0,u.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,d.jsx)(`title`,{children:`Claude icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,d.jsx)(`g`,{clipPath:`url(#clip0_claude)`,children:(0,d.jsx)(`path`,{d:`M4.704 15.96L9.432 13.32L9.504 13.08L9.432 12.96H9.192L8.4 12.912L5.712 12.84L3.36 12.72L1.08 12.6L0.504 12.48L0 11.76L0.048 11.4L0.528 11.088L1.224 11.136L2.736 11.256L5.016 11.4L6.672 11.496L9.12 11.784H9.504L9.552 11.616L9.432 11.52L9.336 11.424L6.96 9.84L4.416 8.16L3.072 7.176L2.352 6.696L1.992 6.216L1.848 5.208L2.496 4.488L3.384 4.56L3.6 4.608L4.488 5.304L6.408 6.768L8.88 8.64L9.24 8.928L9.384 8.832L9.408 8.76L9.24 8.496L7.92 6L6.48 3.504L5.832 2.472L5.664 1.848C5.592 1.608 5.568 1.368 5.568 1.128L6.288 0.12L6.72 0L7.728 0.144L8.112 0.48L8.736 1.92L9.72 4.152L11.28 7.176L11.76 8.088L12 8.904L12.072 9.144H12.24V9.024L12.36 7.296L12.6 5.208L12.84 2.52L12.912 1.752L13.296 0.84L14.016 0.36L14.64 0.624L15.12 1.32L15.048 1.752L14.784 3.6L14.16 6.504L13.8 8.472H14.016L14.256 8.208L15.24 6.912L16.896 4.848L17.616 4.008L18.48 3.12L19.032 2.688H20.064L20.808 3.816L20.472 4.992L19.416 6.336L18.528 7.464L17.256 9.168L16.488 10.536L16.56 10.632H16.728L19.608 10.008L21.144 9.744L22.968 9.432L23.808 9.816L23.904 10.2L23.568 11.016L21.6 11.496L19.296 11.976L15.864 12.768L15.816 12.792L15.864 12.864L17.4 13.008L18.072 13.056H19.704L22.728 13.296L23.52 13.776L23.976 14.424L23.904 14.904L22.68 15.528L21.048 15.144L17.208 14.232L15.912 13.92H15.72V14.016L16.824 15.096L18.816 16.896L21.36 19.224L21.48 19.8L21.168 20.28L20.832 20.232L18.624 18.552L17.76 17.832L15.84 16.2H15.72V16.368L16.152 17.016L18.504 20.544L18.624 21.624L18.456 21.96L17.832 22.2L17.184 22.056L15.792 20.136L14.352 17.976L13.224 16.008L13.104 16.104L12.408 23.352L12.096 23.712L11.376 24L10.776 23.52L10.44 22.8L10.776 21.312L11.16 19.392L11.472 17.856L11.76 15.96L11.928 15.336V15.288H11.76L10.32 17.28L8.16 20.232L6.432 22.056L6.024 22.224L5.304 21.864L5.376 21.192L5.76 20.64L8.16 17.568L9.6 15.672L10.56 14.568L10.536 14.448H10.464L4.128 18.576L3 18.72L2.52 18.24L2.568 17.52L2.808 17.28L4.728 15.96H4.704Z`,fill:`currentColor`})}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,d.jsx)(`defs`,{children:(0,d.jsx)(`clipPath`,{id:`clip0_claude`,children:(0,d.jsx)(`rect`,{width:`24`,height:`24`,fill:`white`})})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,d.jsxs)(`svg`,{role:`img`,"aria-label":`Claude icon`,fill:`none`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function p(e){let t=(0,u.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,d.jsx)(`title`,{children:`Cline icon`}),r=(0,d.jsx)(`path`,{fill:`currentColor`,d:`M463.6,275.08l-29.26-58.75v-33.83c0-56.08-45.01-101.5-100.53-101.5h-50.01c3.62-7.43,5.61-15.79,5.61-24.61,0-31.17-25.08-56.39-56.07-56.39s-56.07,25.22-56.07,56.39c0,8.82,1.99,17.17,5.61,24.61h-50.01c-55.51,0-100.52,45.42-100.52,101.5v33.83l-29.87,58.59c-3.01,5.9-3.01,12.92,0,18.81l29.87,57.93v33.83c0,56.08,45.01,101.5,100.52,101.5h200.95c55.51,0,100.53-45.42,100.53-101.5v-33.83l29.21-58.13c2.9-5.79,2.9-12.61.05-18.46ZM202.75,322.96c0,25.48-20.54,46.14-45.88,46.14s-45.88-20.66-45.88-46.14v-82.02c0-25.48,20.54-46.14,45.88-46.14s45.88,20.66,45.88,46.14v82.02ZM350.58,322.96c0,25.48-20.54,46.14-45.88,46.14s-45.88-20.66-45.88-46.14v-82.02c0-25.48,20.54-46.14,45.88-46.14s45.88,20.66,45.88,46.14v82.02Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,d.jsxs)(`svg`,{role:`img`,"aria-label":`Cline icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 466.73 487.04`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var m=e(t(),1);function h(e){let t=(0,u.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,d.jsx)(`title`,{children:`Codex icon`}),r=(0,d.jsx)(`path`,{stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`2.484`,d:`M22.356 19.797H17.17M9.662 12.29l1.979 3.576a.511.511 0 0 1-.005.504l-1.974 3.409M30.758 16c0 8.15-6.607 14.758-14.758 14.758-8.15 0-14.758-6.607-14.758-14.758C1.242 7.85 7.85 1.242 16 1.242c8.15 0 14.758 6.608 14.758 14.758Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,d.jsxs)(`svg`,{role:`img`,"aria-label":`Codex icon`,xmlns:`http://www.w3.org/2000/svg`,width:32,height:32,fill:`none`,viewBox:`0 0 32 32`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function g(e){let t=(0,u.c)(15),n=(0,m.useId)(),r;if(t[0]!==n){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/:/g,t[2]=e):e=t[2],r=n.replace(e,``),t[0]=n,t[1]=r}else r=t[1];let i=`codex-brand-gradient-${r}`,a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,d.jsx)(`title`,{children:`Codex icon`}),t[3]=a):a=t[3];let o=`url(#${i})`,s;t[4]===o?s=t[5]:(s=(0,d.jsx)(`path`,{d:`M3.03191 0.172167C3.39319 0.023523 3.7865 -0.030181 4.17441 0.0161665C4.67441 0.0736665 5.11991 0.286167 5.51091 0.653667C5.51591 0.658667 5.52291 0.662167 5.52941 0.664167C5.53647 0.665904 5.54385 0.665904 5.55091 0.664167C6.05923 0.532896 6.59731 0.581475 7.07391 0.801667L7.09741 0.812666L7.15541 0.841167C7.65429 1.09402 8.04342 1.52067 8.24941 2.04067C8.35391 2.29567 8.40591 2.56117 8.40691 2.83817C8.41442 3.04417 8.39185 3.25017 8.33991 3.44967C8.33735 3.45974 8.33738 3.47029 8.34 3.48035C8.34263 3.4904 8.34775 3.49963 8.35491 3.50717C8.65191 3.81067 8.84891 4.17217 8.94641 4.59217C9.09091 5.30467 8.94291 5.94717 8.50291 6.51917L8.43491 6.60217C8.14349 6.93574 7.761 7.17695 7.33441 7.29617C7.32515 7.29888 7.31666 7.30373 7.30962 7.31033C7.30259 7.31694 7.2972 7.3251 7.29391 7.33417C7.19841 7.60967 7.10241 7.84567 6.92391 8.08117C6.47391 8.67467 5.81291 9.00417 5.06841 9.00017C4.47491 8.99717 3.94891 8.78017 3.48991 8.34917C3.483 8.3427 3.4745 8.33819 3.46528 8.33608C3.45606 8.33397 3.44644 8.33435 3.43741 8.33717C3.24341 8.39967 3.04741 8.40867 2.83541 8.40617C2.49774 8.40346 2.16514 8.32377 1.86291 8.17317C1.54632 8.01629 1.27069 7.78773 1.05791 7.50567C0.981908 7.40467 0.906408 7.30967 0.850908 7.19717C0.775141 7.04279 0.713231 6.88199 0.665908 6.71667C0.566008 6.34048 0.563599 5.94504 0.658908 5.56767C0.662042 5.55869 0.663069 5.54911 0.661908 5.53967C0.660196 5.53039 0.655446 5.52195 0.648408 5.51567C0.417442 5.28189 0.240911 5.00002 0.131408 4.69017C0.0585831 4.49931 0.0162322 4.29818 0.00590778 4.09417C-0.0122568 3.82546 0.0115281 3.55556 0.0764078 3.29417C0.244908 2.73817 0.567408 2.30167 1.04291 1.98517C1.14891 1.91467 1.24941 1.85967 1.34341 1.82017C1.45091 1.77567 1.55841 1.73817 1.66641 1.70667C1.67413 1.70427 1.68113 1.70001 1.6868 1.69425C1.69247 1.68849 1.69663 1.68142 1.69891 1.67367C1.78091 1.37919 1.92194 1.10446 2.11341 0.866166C2.35477 0.559671 2.67114 0.320634 3.03191 0.172167ZM4.77291 5.45467C4.69165 5.45922 4.61522 5.49471 4.55931 5.55385C4.5034 5.61299 4.47225 5.69128 4.47225 5.77267C4.47225 5.85405 4.5034 5.93235 4.55931 5.99148C4.61522 6.05062 4.69165 6.08611 4.77291 6.09067H6.59091C6.63417 6.09309 6.67747 6.08667 6.71816 6.07178C6.75885 6.0569 6.79608 6.03387 6.82756 6.0041C6.85905 5.97433 6.88413 5.93846 6.90127 5.89866C6.91841 5.85887 6.92725 5.81599 6.92725 5.77267C6.92725 5.72934 6.91841 5.68647 6.90127 5.64667C6.88413 5.60688 6.85905 5.571 6.82756 5.54123C6.79608 5.51146 6.75885 5.48843 6.71816 5.47355C6.67747 5.45866 6.63417 5.45224 6.59091 5.45467H4.77291ZM2.73091 3.11517C2.68764 3.04469 2.61865 2.99381 2.53854 2.97328C2.45844 2.95275 2.37348 2.96419 2.30165 3.00517C2.22982 3.04615 2.17675 3.11346 2.15366 3.19287C2.13056 3.27228 2.13926 3.35756 2.17791 3.43067L2.81391 4.54267L2.18091 5.61067C2.1596 5.64662 2.14558 5.68641 2.13966 5.72778C2.13373 5.76914 2.13601 5.81127 2.14636 5.85176C2.15671 5.89225 2.17494 5.9303 2.2 5.96374C2.22506 5.99718 2.25646 6.02536 2.29241 6.04667C2.32836 6.06797 2.36815 6.08199 2.40952 6.08792C2.45088 6.09385 2.49301 6.09157 2.5335 6.08121C2.57399 6.07086 2.61204 6.05263 2.64548 6.02758C2.67892 6.00252 2.7071 5.97112 2.72841 5.93517L3.45541 4.70767C3.48407 4.65931 3.4994 4.60422 3.49984 4.548C3.50028 4.49179 3.48581 4.43647 3.45791 4.38767L2.73091 3.11517Z`,fill:o}),t[4]=o,t[5]=s);let c,l,f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,d.jsx)(`stop`,{stopColor:`#B1A7FF`}),l=(0,d.jsx)(`stop`,{offset:`0.5`,stopColor:`#7A9DFF`}),f=(0,d.jsx)(`stop`,{offset:`1`,stopColor:`#3941FF`}),t[6]=c,t[7]=l,t[8]=f):(c=t[6],l=t[7],f=t[8]);let p;t[9]===i?p=t[10]:(p=(0,d.jsx)(`defs`,{children:(0,d.jsxs)(`linearGradient`,{id:i,x1:`4.49991`,y1:`0.000166496`,x2:`4.49991`,y2:`9.00017`,gradientUnits:`userSpaceOnUse`,children:[c,l,f]})}),t[9]=i,t[10]=p);let h;return t[11]!==e||t[12]!==s||t[13]!==p?(h=(0,d.jsxs)(`svg`,{role:`img`,"aria-label":`Codex icon`,xmlns:`http://www.w3.org/2000/svg`,width:9,height:9,fill:`none`,viewBox:`0 0 9 9`,...e,children:[a,s,p]}),t[11]=e,t[12]=s,t[13]=p,t[14]=h):h=t[14],h}function _(e){let t=(0,u.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,d.jsx)(`title`,{children:`GitHub Copilot icon`}),r=(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,fill:`currentColor`,d:`M9.6225 2.682C10.2835 3.362 10.561 4.29 10.6775 5.5905C10.9885 5.5905 11.2775 5.658 11.4735 5.9175L11.8385 6.3995C11.9435 6.5385 12 6.7045 12 6.877V8.187C12 8.3565 11.9135 8.5215 11.7735 8.621C10.1195 9.801 8.0785 10.75 6 10.75C3.7 10.75 1.3975 9.4585 0.2265 8.621C0.0865 8.521 0.0005 8.356 0 8.187V6.877C0 6.7045 0.0565 6.5375 0.1605 6.399L0.5255 5.9175C0.7215 5.659 1.0125 5.5905 1.322 5.5905L1.3365 5.442C1.4615 4.219 1.7415 3.3355 2.3775 2.682C3.608 1.412 5.2325 1.2565 5.9505 1.25H6.0495C6.7675 1.2565 8.392 1.4115 9.6225 2.682ZM6.0005 4.846C5.8585 4.846 5.694 4.854 5.5195 4.871C5.458 5.0945 5.367 5.296 5.2345 5.425C4.7095 5.9365 4.0765 6.015 3.7375 6.015C3.4185 6.015 3.0845 5.95 2.812 5.783C2.554 5.8655 2.306 5.9845 2.29 6.281C2.26898 6.76138 2.25847 7.24216 2.2585 7.723L2.2575 7.963C2.2565 8.2445 2.255 8.526 2.251 8.808C2.252 8.971 2.353 9.123 2.506 9.1905C3.747 9.7415 4.921 10.019 6.001 10.019C7.079 10.019 8.253 9.7415 9.4935 9.1905C9.56814 9.15767 9.63181 9.10416 9.677 9.03628C9.72219 8.96841 9.747 8.88902 9.7485 8.8075C9.7635 7.9665 9.7515 7.1215 9.7105 6.281C9.695 5.983 9.4465 5.866 9.1875 5.783C8.9145 5.9495 8.5815 6.015 8.2625 6.015C7.924 6.015 7.2915 5.9365 6.766 5.425C6.633 5.296 6.5425 5.0945 6.481 4.871C6.321 4.855 6.1605 4.8465 6.0005 4.846ZM4.738 6.8525C5.0075 6.8525 5.226 7.0655 5.226 7.3275V8.204C5.226 8.4665 5.0075 8.679 4.738 8.679C4.61033 8.6806 4.48725 8.63149 4.39576 8.54243C4.30426 8.45338 4.25184 8.33166 4.25 8.204V7.328C4.25 7.0655 4.4685 6.8525 4.738 6.8525ZM7.238 6.8525C7.5075 6.8525 7.726 7.0655 7.726 7.3275V8.204C7.726 8.4665 7.5075 8.679 7.238 8.679C7.11033 8.6806 6.98725 8.63149 6.89576 8.54243C6.80426 8.45338 6.75184 8.33166 6.75 8.204V7.328C6.75 7.0655 6.9685 6.8525 7.238 6.8525ZM3.8175 2.5435C3.2925 2.5945 2.85 2.7625 2.625 2.9965C2.1375 3.515 2.2425 4.8305 2.52 5.1085C2.7225 5.3055 3.105 5.437 3.5175 5.437H3.5625C3.887 5.4305 4.455 5.349 4.9275 4.882C5.145 4.677 5.28 4.1655 5.265 3.647C5.25 3.23 5.13 2.887 4.95 2.7405C4.755 2.5725 4.3125 2.4995 3.8175 2.5435ZM7.05 2.7405C6.87 2.8865 6.75 3.2305 6.735 3.647C6.72 4.1655 6.855 4.677 7.0725 4.882C7.5565 5.3605 8.1405 5.434 8.4605 5.437H8.4825C8.895 5.437 9.2775 5.3055 9.48 5.1085C9.7575 4.8305 9.8625 3.515 9.375 2.9965C9.15 2.7625 8.7075 2.5945 8.1825 2.5435C7.6875 2.4995 7.245 2.5725 7.05 2.7405ZM6 3.8075C5.88 3.8075 5.7375 3.815 5.58 3.8295C5.595 3.9095 5.6025 3.9975 5.61 4.0925L5.6095 4.172C5.60894 4.21375 5.60661 4.25545 5.6025 4.297C5.715 4.286 5.815 4.2835 5.9085 4.283H6.0915C6.185 4.283 6.285 4.286 6.3975 4.297C6.39 4.224 6.39 4.1585 6.39 4.0925C6.3975 3.9975 6.405 3.91 6.42 3.8295C6.2804 3.81583 6.14026 3.80849 6 3.8075Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,d.jsxs)(`svg`,{role:`img`,"aria-label":`GitHub Copilot icon`,xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function v(e){let t=(0,u.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,d.jsx)(`title`,{children:`Cursor icon`}),r=(0,d.jsx)(`path`,{fill:`currentColor`,d:`M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,d.jsxs)(`svg`,{role:`img`,"aria-label":`Cursor icon`,fill:`none`,height:24,width:24,viewBox:`0 0 466.73 532.09`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function y(e){let t=(0,u.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,d.jsx)(`title`,{children:`Windsurf icon`}),r=(0,d.jsx)(`path`,{fill:`currentColor`,d:`M21.3192 4.9697H21.1203C20.0734 4.96806 19.2238 5.81589 19.2238 6.86264V11.0961C19.2238 11.9415 18.525 12.6263 17.6934 12.6263C17.1993 12.6263 16.706 12.3777 16.4133 11.9603L12.0896 5.78492C11.7308 5.27214 11.1471 4.96643 10.5152 4.96643C9.52943 4.96643 8.64234 5.80448 8.64234 6.83902V11.0969C8.64234 11.9423 7.94932 12.6271 7.11197 12.6271C6.61625 12.6271 6.12376 12.3785 5.83105 11.9611L0.992853 5.0504C0.883594 4.89387 0.638184 4.97133 0.638184 5.1621V8.85424C0.638184 9.04094 0.695264 9.22193 0.802059 9.37517L5.56362 16.175C5.84492 16.5769 6.25994 16.8753 6.73852 16.9837C7.93627 17.256 9.03861 16.334 9.03861 15.1592V10.9037C9.03861 10.0583 9.7235 9.37354 10.569 9.37354H10.5714C11.081 9.37354 11.5588 9.62219 11.8515 10.0396L16.1761 16.2141C16.5356 16.7277 17.0892 17.0326 17.7497 17.0326C18.7574 17.0326 19.6209 16.1937 19.6209 15.16V10.9029C19.6209 10.0575 20.3058 9.37273 21.1512 9.37273H21.32C21.426 9.37273 21.5116 9.28713 21.5116 9.18116V5.16127C21.5116 5.05531 21.426 4.9697 21.32 4.9697H21.3192Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,d.jsxs)(`svg`,{role:`img`,"aria-label":`Windsurf icon`,xmlns:`http://www.w3.org/2000/svg`,width:22,height:22,viewBox:`0 0 22 22`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var b=class{map=new Map;constructor(e){if(this.limit=e,e<=0)throw Error(`LruStringCache: limit must be > 0 (got ${e})`)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}set(e,t){for(this.map.has(e)&&this.map.delete(e),this.map.set(e,t);this.map.size>this.limit;){let e=this.map.keys().next().value;if(e===void 0)break;this.map.delete(e)}}clear(){this.map.clear()}get size(){return this.map.size}};function x(e){let t=(0,u.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,d.jsx)(f,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,d.jsx)(v,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,d.jsx)(y,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,d.jsx)(h,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,d.jsx)(p,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,d.jsx)(_,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,d.jsx)(c,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function S(e){return typeof e==`object`&&!!e&&typeof e.getStates==`function`}function C(e,t,n){let r=[],i=[];for(let a of e.getStates().values()){let e=a.agentPresence;if(e)for(let[a,o]of Object.entries(e))o.currentDoc&&(n-o.ts>=5e3||(o.currentDoc===t?r.push({agentId:a,entry:o}):i.push({agentId:a,entry:o})))}return{current:r,crossDoc:i}}export{y as a,g as c,f as d,l as f,a as g,o as h,b as i,h as l,s as m,C as n,v as o,c as p,x as r,_ as s,S as t,p as u};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{a as i,f as a,i as o,n as s,o as c,r as l,s as u,t as d,u as f}from"./panel-BCRdtBla.js";import{n as p}from"./button-BPXuMr5W.js";import{J as m,K as ee,it as te,n as ne}from"./DocumentContext-5648awue.js";import{x as re}from"./dialog-CtSN0d2b.js";import{$ as ie,Ht as ae,it as oe,n as se,rt as ce,w as le,x as h,z as ue,zt as de}from"./PageListContext-B5SWnlyE.js";import{$ as g,A as _,B as v,Bt as y,Ct as b,D as fe,Dt as pe,E as x,Et as me,Ft as he,G as S,H as ge,Ht as _e,I as C,It as ve,J as ye,K as be,L as w,Lt as xe,M as Se,N as T,Nt as E,P as Ce,Pt as we,Q as Te,Rt as Ee,S as De,St as Oe,T as ke,Tt as D,U as Ae,V as je,Vt as Me,W as Ne,Y as O,Z as Pe,_ as Fe,a as Ie,at as Le,b as Re,bt as ze,c as Be,ct as Ve,d as He,et as Ue,f as We,g as Ge,gt as Ke,h as qe,ht as Je,i as Ye,j as Xe,jt as Ze,k as Qe,kt as $e,l as et,lt as tt,mt as nt,n as rt,nt as it,o as at,ot,p as st,pt as ct,q as k,r as lt,s as ut,st as dt,t as ft,tt as pt,u as mt,ut as ht,v as gt,vt as A,w as _t,x as vt,xt as yt,y as bt,z as xt,zt as St}from"./dist-CgLbXgrr.js";import{a as Ct,c as j,i as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt}from"./dist-D2wwoXzm.js";import{i as At,n as M,r as jt,t as Mt}from"./dist-GlH2KPqY.js";var Nt=e(t(),1),Pt=r(),Ft=new Map;function It(e,t){Ft.set(e,t)}function Lt(e){let t=Ft.get(e)??null;return Ft.delete(e),t}function Rt(e){Ft.delete(e)}var zt=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[v.contextHash,r]]}addChild(e,t){e.prop(v.contextHash)!=this.hash&&(e=new S(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new S(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new S(ge.none,e,t,n,this.hashProp)})}},N;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(N||={});var Bt=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},Vt=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Wt(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function Ht(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==N.OrderedList?Zt:Xt)(n,t,!1);return r>0&&(e.type!=N.BulletList||Jt(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var Ut={[N.Blockquote](e,t,n){return n.next==62?(n.markers.push(F(N.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(P(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[N.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[N.OrderedList]:Ht,[N.BulletList]:Ht,[N.Document](){return!0}};function P(e){return e==32||e==9||e==10||e==13}function Wt(e,t=0){for(;t<e.length&&P(e.charCodeAt(t));)t++;return t}function Gt(e,t,n){for(;t>n&&P(e.charCodeAt(t-1));)t--;return t}function Kt(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function qt(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function Jt(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!P(n))return-1}return n&&e.next==45&&$t(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(fn.SetextHeading)>-1||r<3?-1:1}function Yt(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function Xt(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||P(e.text.charCodeAt(e.pos+1)))&&(!n||Yt(t,N.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function Zt(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!P(e.text.charCodeAt(r+1))||n&&!Yt(t,N.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function Qt(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function $t(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&P(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var en=/^[ \t]*$/,tn=/-->/,nn=/\?>/,rn=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,tn],[/^\s*<\?/,nn],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,en],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,en]];function an(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=rn.length-+!!n;e<t;e++)if(rn[e][0].test(r))return e;return-1}function on(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function sn(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==N.CodeText?e[r].to=n:e.push(F(N.CodeText,t,n))}var cn={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(sn(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){sn(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==N.CodeText?sn(o,e.from,e.to):o.push(e);s=[]}sn(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&sn(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=N.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(N.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=Kt(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=Gt(t.text,t.text.length,o),c=[F(N.CodeMark,r,r+a)];o<s&&c.push(F(N.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&sn(c,e.lineStart-1,e.lineStart),c.push(F(N.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(sn(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(sn(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(N.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=qt(t);return n<0?!1:(e.startContext(N.Blockquote,t.pos),e.addNode(N.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(Jt(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(N.HorizontalRule,n),!0},BulletList(e,t){let n=Xt(t,e,!1);if(n<0)return!1;e.block.type!=N.BulletList&&e.startContext(N.BulletList,t.basePos,t.next);let r=on(t,t.pos+1);return e.startContext(N.ListItem,t.basePos,r-t.baseIndent),e.addNode(N.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=Zt(t,e,!1);if(n<0)return!1;e.block.type!=N.OrderedList&&e.startContext(N.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=on(t,t.pos+n);return e.startContext(N.ListItem,t.basePos,r-t.baseIndent),e.addNode(N.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=Qt(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=Gt(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!P(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(N.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(N.HeaderMark,o-r,a-r);let c=s.finish(N.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=an(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=rn[n][1],a=[],o=i!=en;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==tn?N.CommentBlock:i==nn?N.ProcessingInstructionBlock:N.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},ln=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{a as i,f as a,i as o,n as s,o as c,r as l,s as u,t as d,u as f}from"./panel-BCRdtBla.js";import{n as p}from"./button-BPXuMr5W.js";import{J as m,K as ee,it as te,n as ne}from"./DocumentContext-C1msvcHp.js";import{x as re}from"./dialog-CtSN0d2b.js";import{$ as ie,Ht as ae,it as oe,n as se,rt as ce,w as le,x as h,z as ue,zt as de}from"./PageListContext-B5SWnlyE.js";import{$ as g,A as _,B as v,Bt as y,Ct as b,D as fe,Dt as pe,E as x,Et as me,Ft as he,G as S,H as ge,Ht as _e,I as C,It as ve,J as ye,K as be,L as w,Lt as xe,M as Se,N as T,Nt as E,P as Ce,Pt as we,Q as Te,Rt as Ee,S as De,St as Oe,T as ke,Tt as D,U as Ae,V as je,Vt as Me,W as Ne,Y as O,Z as Pe,_ as Fe,a as Ie,at as Le,b as Re,bt as ze,c as Be,ct as Ve,d as He,et as Ue,f as We,g as Ge,gt as Ke,h as qe,ht as Je,i as Ye,j as Xe,jt as Ze,k as Qe,kt as $e,l as et,lt as tt,mt as nt,n as rt,nt as it,o as at,ot,p as st,pt as ct,q as k,r as lt,s as ut,st as dt,t as ft,tt as pt,u as mt,ut as ht,v as gt,vt as A,w as _t,x as vt,xt as yt,y as bt,z as xt,zt as St}from"./dist-CgLbXgrr.js";import{a as Ct,c as j,i as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt}from"./dist-D2wwoXzm.js";import{i as At,n as M,r as jt,t as Mt}from"./dist-GlH2KPqY.js";var Nt=e(t(),1),Pt=r(),Ft=new Map;function It(e,t){Ft.set(e,t)}function Lt(e){let t=Ft.get(e)??null;return Ft.delete(e),t}function Rt(e){Ft.delete(e)}var zt=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[v.contextHash,r]]}addChild(e,t){e.prop(v.contextHash)!=this.hash&&(e=new S(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new S(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new S(ge.none,e,t,n,this.hashProp)})}},N;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(N||={});var Bt=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},Vt=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Wt(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function Ht(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==N.OrderedList?Zt:Xt)(n,t,!1);return r>0&&(e.type!=N.BulletList||Jt(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var Ut={[N.Blockquote](e,t,n){return n.next==62?(n.markers.push(F(N.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(P(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[N.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[N.OrderedList]:Ht,[N.BulletList]:Ht,[N.Document](){return!0}};function P(e){return e==32||e==9||e==10||e==13}function Wt(e,t=0){for(;t<e.length&&P(e.charCodeAt(t));)t++;return t}function Gt(e,t,n){for(;t>n&&P(e.charCodeAt(t-1));)t--;return t}function Kt(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function qt(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function Jt(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!P(n))return-1}return n&&e.next==45&&$t(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(fn.SetextHeading)>-1||r<3?-1:1}function Yt(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function Xt(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||P(e.text.charCodeAt(e.pos+1)))&&(!n||Yt(t,N.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function Zt(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!P(e.text.charCodeAt(r+1))||n&&!Yt(t,N.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function Qt(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function $t(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&P(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var en=/^[ \t]*$/,tn=/-->/,nn=/\?>/,rn=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,tn],[/^\s*<\?/,nn],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,en],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,en]];function an(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=rn.length-+!!n;e<t;e++)if(rn[e][0].test(r))return e;return-1}function on(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function sn(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==N.CodeText?e[r].to=n:e.push(F(N.CodeText,t,n))}var cn={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(sn(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){sn(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==N.CodeText?sn(o,e.from,e.to):o.push(e);s=[]}sn(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&sn(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=N.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(N.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=Kt(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=Gt(t.text,t.text.length,o),c=[F(N.CodeMark,r,r+a)];o<s&&c.push(F(N.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&sn(c,e.lineStart-1,e.lineStart),c.push(F(N.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(sn(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(sn(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(N.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=qt(t);return n<0?!1:(e.startContext(N.Blockquote,t.pos),e.addNode(N.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(Jt(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(N.HorizontalRule,n),!0},BulletList(e,t){let n=Xt(t,e,!1);if(n<0)return!1;e.block.type!=N.BulletList&&e.startContext(N.BulletList,t.basePos,t.next);let r=on(t,t.pos+1);return e.startContext(N.ListItem,t.basePos,r-t.baseIndent),e.addNode(N.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=Zt(t,e,!1);if(n<0)return!1;e.block.type!=N.OrderedList&&e.startContext(N.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=on(t,t.pos+n);return e.startContext(N.ListItem,t.basePos,r-t.baseIndent),e.addNode(N.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=Qt(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=Gt(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!P(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(N.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(N.HeaderMark,o-r,a-r);let c=s.finish(N.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=an(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=rn[n][1],a=[],o=i!=en;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==tn?N.CommentBlock:i==nn?N.ProcessingInstructionBlock:N.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},ln=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
2
2
  `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&Wt(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,F(N.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(In(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(F(N.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Pn(e,Wt(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=Wt(e,this.pos),n=0;if(t>this.pos){let r=Fn(e,t,this.start);if(r){let t=un(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=un(e,this.pos),n>0&&n<e.length?n:-1}else return un(e,this.pos)}};function un(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!P(n))return-1}return t}var dn=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:$t(t),i=t.next;if(r<0)return!1;let a=F(N.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,F(i==61?N.SetextHeading1:N.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},fn={LinkReference(e,t){return t.content.charCodeAt(0)==91?new ln(t):null},SetextHeading(){return new dn}},pn=[(e,t)=>Qt(t)>=0,(e,t)=>Kt(t)>=0,(e,t)=>qt(t)>=0,(e,t)=>Xt(t,e,!0)>=0,(e,t)=>Zt(t,e,!0)>=0,(e,t)=>Jt(t,e,!0)>=0,(e,t)=>an(t,e,!0)>=0],mn={text:``,end:0},hn=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new Vt,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=zt.create(N.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Bn(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new Bt(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
3
3
  `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=Vn(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=mn;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+N[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
4
4
  `?``:t;else{let e=t.indexOf(`