@marimo-team/frontend 0.25.2-dev34 → 0.25.2-dev35
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/{ConnectedDataExplorerComponent-Bli_Q2Pf.js → ConnectedDataExplorerComponent-CaLz42tn.js} +1 -1
- package/dist/assets/{ErrorBoundary-Dx6lhNls.js → ErrorBoundary-DMhZObiQ.js} +2 -2
- package/dist/assets/{LazyAnyLanguageCodeMirror-CfdjWQov.js → LazyAnyLanguageCodeMirror-CeDa-Cb7.js} +2 -2
- package/dist/assets/{RunButton-5jKnc29t.js → RunButton-CLSn9lEE.js} +9 -9
- package/dist/assets/{abnfDiagram-VCTEODGH-CS9VJ4IQ.js → abnfDiagram-VCTEODGH-D7dyj540.js} +1 -1
- package/dist/assets/{add-cell-with-ai-h_sx2HjG.js → add-cell-with-ai-B4AzRiqg.js} +6 -6
- package/dist/assets/{agent-panel-C3MlqlHQ.js → agent-panel-Jzofbvvo.js} +1 -1
- package/dist/assets/{ai-model-dropdown-D_95EaOb.js → ai-model-dropdown-CMYVVu6H.js} +1 -1
- package/dist/assets/{any-language-editor-DqrxopyM.js → any-language-editor-DDzv7X_M.js} +1 -1
- package/dist/assets/{app-config-button-AOmd3MSM.js → app-config-button-CMPJs1AV.js} +1 -1
- package/dist/assets/{architectureDiagram-5GKGNRK7-Cnq1OhHb.js → architectureDiagram-5GKGNRK7-DKE7POOk.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-Belx_uSy.js → blockDiagram-I7D4REHJ-0SPyUrjJ.js} +1 -1
- package/dist/assets/{cache-panel-ByvhZkRB.js → cache-panel-DVx6Y6Eb.js} +1 -1
- package/dist/assets/{cells-BXPymufT.js → cells-9Zalh8wx.js} +19 -19
- package/dist/assets/{chat-display-Bl_cm4Bv.js → chat-display-CchwEr8b.js} +1 -1
- package/dist/assets/{chat-panel-G5k-O9XI.js → chat-panel--HYfRzqB.js} +1 -1
- package/dist/assets/{chat-ui-B9ojDwqD.js → chat-ui-Co7LBn91.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-DaJnBQov.js → chunk-IMKFNOWR-DrUeS6KP.js} +1 -1
- package/dist/assets/{chunk-SHT3W25Y-ChLuP8JP.js → chunk-SHT3W25Y-D8ropkQT.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-BZxpXOz-.js → chunk-SVP7TREG-NGRbkIVQ.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-WyejxyKe.js → chunk-TICWLB2K-DNJZpRez.js} +1 -1
- package/dist/assets/{classDiagram-ZZMXUADV-D3p0TN4D.js → classDiagram-ZZMXUADV-BR8CXq05.js} +1 -1
- package/dist/assets/{classDiagram-v2-VYDZK3BY-D3p0TN4D.js → classDiagram-v2-VYDZK3BY-BR8CXq05.js} +1 -1
- package/dist/assets/{code-visibility-dpVhqYNL.js → code-visibility-dZhp42QR.js} +1 -1
- package/dist/assets/{command-palette-D6z9kPg7.js → command-palette-C4k35CJe.js} +1 -1
- package/dist/assets/{common-ByaXhTaS.js → common-Cxr6m8gb.js} +1 -1
- package/dist/assets/{components-Bg0jEPXR.js → components-CEHg9Mmd.js} +1 -1
- package/dist/assets/{components-D5oqtiLg.js → components-DGY863MX.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-ADfRyIGN.js → cynefinDiagram-5FMLGOSQ-C5lXlua0.js} +1 -1
- package/dist/assets/{dagre-BNpoWXcL.js → dagre-DqP_C-Uu.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-Diet3S0x.js → dagre-GXQ25YYZ-uWEnVTHN.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-BEM-ieFB.js → data-grid-overlay-editor-ljxiNc7b.js} +1 -1
- package/dist/assets/{dependency-graph-panel-CrensQ9d.js → dependency-graph-panel-BDc_4upi.js} +1 -1
- package/dist/assets/{diagram-S7CK7UJ4-CCX9feKM.js → diagram-S7CK7UJ4-DiGXz3FA.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-DMu2JraT.js → diagram-UQ7AKVKN-CnPMduC3.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-D3OGvedU.js → diagram-VX7I27RA-CqDYw7j-.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-MArsMIcf.js → diagram-Z3DM3KII-D2gDOUBn.js} +1 -1
- package/dist/assets/{dist-yiD-qDpu.js → dist-7dvnzaZy.js} +1 -1
- package/dist/assets/{dist-BYab5Kqm.js → dist-AI8Ml-rS.js} +1 -1
- package/dist/assets/{dist-BWSz9T8E.js → dist-B0Eh5MTr.js} +1 -1
- package/dist/assets/{dist-Cx42VZlZ.js → dist-BnkdOj4_.js} +1 -1
- package/dist/assets/dist-BsquYPpR.js +6 -0
- package/dist/assets/{dist-DvHtpUI7.js → dist-C4OeumtQ.js} +1 -1
- package/dist/assets/{dist-CCiiXOoB.js → dist-CAmPrWiy.js} +1 -1
- package/dist/assets/{dist-BYSOsNiK.js → dist-CDB8sNpz.js} +1 -1
- package/dist/assets/{dist-DuOZdyY2.js → dist-COmr-BNE.js} +1 -1
- package/dist/assets/{dist-Gcu0m5O1.js → dist-CWGd3M82.js} +1 -1
- package/dist/assets/dist-Cny7_yZb.js +14 -0
- package/dist/assets/{dist-Bviq_Dee.js → dist-CpALWntr.js} +1 -1
- package/dist/assets/{dist-DueXZKz9.js → dist-D-DQw4kU.js} +1 -1
- package/dist/assets/dist-DBMV4gqt.js +2 -0
- package/dist/assets/{dist-MRn68vX1.js → dist-DEjL-yyx.js} +1 -1
- package/dist/assets/{dist-CEjBPDxA.js → dist-DIDIbaDz.js} +1 -1
- package/dist/assets/{dist-CI-3E0S2.js → dist-DLJwyGfO.js} +1 -1
- package/dist/assets/{dist-BH-S-j9V.js → dist-DSjefvql.js} +1 -1
- package/dist/assets/{dist-Dz4H5Lpr.js → dist-Ddxbgior.js} +1 -1
- package/dist/assets/{dist-vrBHmefa.js → dist-DkdhO62E.js} +1 -1
- package/dist/assets/{dist-D5LovWSN.js → dist-DpcG8kMl.js} +1 -1
- package/dist/assets/{dist-BN-7G8qZ.js → dist-DuPWeAke.js} +1 -1
- package/dist/assets/{dist-CiUBikfn.js → dist-DwKxgyZ7.js} +1 -1
- package/dist/assets/dist-qhAY4L2r.js +1 -0
- package/dist/assets/{documentation-panel-DDYXbqvp.js → documentation-panel-DJn73pjB.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-vQJPmojo.js → ebnfDiagram-PWID7BFC-CeuUQuuq.js} +1 -1
- package/dist/assets/{edit-page-C7naRe4T.js → edit-page-B61jbuzs.js} +4 -4
- package/dist/assets/{erDiagram-RLTQ6QDP-DbMS_wVH.js → erDiagram-RLTQ6QDP-BZjLkup8.js} +1 -1
- package/dist/assets/{error-entries-FCI5CEqR.js → error-entries-B_LukMrO.js} +1 -1
- package/dist/assets/{error-panel-CgT73q4b.js → error-panel-DrR4vVc_.js} +1 -1
- package/dist/assets/{esm-BErdoAcz.js → esm-QL-JTMXj.js} +1 -1
- package/dist/assets/{feedback-button-B0hzbli5.js → feedback-button-BP_zrVT9.js} +1 -1
- package/dist/assets/{file-explorer-panel-Dl3gX4fl.js → file-explorer-panel-qUchRjG5.js} +1 -1
- package/dist/assets/{file-name-input-CV0fYc67.js → file-name-input-CO0zxoL3.js} +1 -1
- package/dist/assets/{filename-DZ9xkzQn.js → filename-DQ3sa2jY.js} +1 -1
- package/dist/assets/{flowDiagram-HODETNUW-C9M5c8rH.js → flowDiagram-HODETNUW-DIAPslOp.js} +1 -1
- package/dist/assets/{gallery-page-B6WMdce0.js → gallery-page-mwGG6PHS.js} +1 -1
- package/dist/assets/{glide-data-editor-qrXT33Qd.js → glide-data-editor-DO4MYb5e.js} +4 -4
- package/dist/assets/{graphlib-C-6pc4Zd.js → graphlib-Cz5NpYLJ.js} +1 -1
- package/dist/assets/has-E1Xnm1Pa.js +1 -0
- package/dist/assets/{home-page-DsILx4TF.js → home-page-BQztJu_Q.js} +1 -1
- package/dist/assets/index-BaMnzPvQ.js +62 -0
- package/dist/assets/{infoDiagram-27XIBGKW-b4WMhbpt.js → infoDiagram-27XIBGKW-CwLpfg5K.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-DQxtMs4g.js → ishikawaDiagram-5VMMS53U-BszGOxQd.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-rhD_vnwl.js → kanban-definition-UXKFOSKX-BdyiNIjG.js} +1 -1
- package/dist/assets/{logs-panel-ByevEcIA.js → logs-panel-Buhta5sP.js} +1 -1
- package/dist/assets/{mermaid-B2ngFN0c.js → mermaid-Dcil4z1E.js} +4 -4
- package/dist/assets/{mindmap-definition-YA3MSWOX-D5hDBYDC.js → mindmap-definition-YA3MSWOX-Bm5QuDDc.js} +1 -1
- package/dist/assets/nsis-R0OlUE7l.js +1 -0
- package/dist/assets/{number-overlay-editor-BcElw1N2.js → number-overlay-editor-CoeoZ7Db.js} +1 -1
- package/dist/assets/{outline-panel-CHw9TjuQ.js → outline-panel-Ucb4e9S9.js} +1 -1
- package/dist/assets/{packages-panel-CDb2_4Dc.js → packages-panel-zrSZXz4V.js} +1 -1
- package/dist/assets/{panels-rdTyuwHQ.js → panels-bIxJ1RbH.js} +3 -3
- package/dist/assets/{pegDiagram-XKGWAZYB-D8QLsgnM.js → pegDiagram-XKGWAZYB-ywd4HNeP.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-DeJxGsNN.js → pieDiagram-E7YTZNPT-D2cK61Ri.js} +1 -1
- package/dist/assets/{process-output-DqkSNdEt.js → process-output-CKD9usD3.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-Cv1c_MPc.js → railroadDiagram-O6MQD6OU-CsVz7jSJ.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-C5vd9-4j.js → requirementDiagram-BXWQKSXE-ATHSvoMy.js} +1 -1
- package/dist/assets/{reveal-component-Dctnn9_M.js → reveal-component-qIjNSaxB.js} +1 -1
- package/dist/assets/ruby-Yjk-N9AT.js +1 -0
- package/dist/assets/{run-page-BiThhUDc.js → run-page-Bo6aqOJS.js} +1 -1
- package/dist/assets/{scratchpad-panel-C1fSG5vy.js → scratchpad-panel-CqB5jeRI.js} +1 -1
- package/dist/assets/{secrets-panel-7_LH6R8A.js → secrets-panel-YFTNBnqF.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-C22eqEIy.js → sequenceDiagram-WJ2MYXX4-D9rmTNJ-.js} +1 -1
- package/dist/assets/{session-panel-DBsTbpC9.js → session-panel-BzUhuRl2.js} +1 -1
- package/dist/assets/{snippets-panel-ChI5aU42.js → snippets-panel-Clis01fl.js} +1 -1
- package/dist/assets/{stateDiagram-D77RDMKH-BRy9VFgk.js → stateDiagram-D77RDMKH-DGDr0wtN.js} +1 -1
- package/dist/assets/{stateDiagram-v2-MP3YSRHH-CxpbMKE8.js → stateDiagram-v2-MP3YSRHH-CDhrQR-B.js} +1 -1
- package/dist/assets/{swimlanes-42K2YHIH-CvQuAAYe.js → swimlanes-42K2YHIH-BsCckGj-.js} +1 -1
- package/dist/assets/{swimlanesDiagram-VR7AAH4N-CANFdBys.js → swimlanesDiagram-VR7AAH4N-QwZkRyhd.js} +1 -1
- package/dist/assets/{swiper-component-CCQgW-CG.js → swiper-component-TAeBrTrS.js} +1 -1
- package/dist/assets/{terminal-Ct69I5Rq.js → terminal-DDY2qkt_.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-CtEY04jV.js → timeline-definition-24CTP7MA-Dbgie_WJ.js} +1 -1
- package/dist/assets/{tracing-B6lz41O5.js → tracing-D0IHfZzS.js} +1 -1
- package/dist/assets/{tracing-panel-Hd5F5hNF.js → tracing-panel-0xNQYgf3.js} +2 -2
- package/dist/assets/{useCellActionButton-OertTn-H.js → useCellActionButton-C_vaP4op.js} +1 -1
- package/dist/assets/{vega-component-C72lP8OY.js → vega-component-4y8QkJWB.js} +1 -1
- package/dist/assets/{vega-embed-container-C0Dphqkx.js → vega-embed-container-XnD5ODpf.js} +1 -1
- package/dist/assets/{vennDiagram-4TSXK5OY-B_OWiVKd.js → vennDiagram-4TSXK5OY-DBNHiL8b.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-CvpCKTJQ.js → wardleyDiagram-VM6X3IG4-Dg8sWRRy.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-CqU92eUd.js → xychartDiagram-S5SC5T6Z-CJKbZoOQ.js} +1 -1
- package/dist/index.html +14 -14
- package/package.json +6 -6
- package/dist/assets/dist-BTskHGpb.js +0 -2
- package/dist/assets/dist-BczecT6V.js +0 -14
- package/dist/assets/dist-Ccyblc8N.js +0 -1
- package/dist/assets/dist-DBqBVprh.js +0 -6
- package/dist/assets/has-DmAIW7kM.js +0 -1
- package/dist/assets/index-DYVlDtsu.js +0 -62
- package/dist/assets/nsis-T1iBtB9C.js +0 -1
- package/dist/assets/ruby-B4BmRxk8.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Gt as t,H as n,I as r,Jt as i,Kt as a,Ot as o,Pt as s,Qt as c,Rt as l,Tt as u,Ut as d,Vt as f,Xt as p,Zt as m,at as h,dt as g,en as _,nn as v,on as ee,ot as y,qt as b,rn as te,st as x,tn as S,ut as ne,yt as C}from"./dist-BczecT6V.js";var w=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=n(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(ae(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function T(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function re(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=T(t)+T(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function E(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:re(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function ie(e,t){return r=>{for(let t=n(r.state).resolveInner(r.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(r)}}var D=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function O(e){return e.selection.main.from}function ae(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var k=l.define();function oe(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:d.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var se=new WeakMap;function ce(e){if(!Array.isArray(e))return e;let t=se.get(e);return t||se.set(e,t=E(e)),t}var A=m.define(),j=m.define(),le=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=S(e,t),r=v(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(S(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=S(e,0),i=v(r),a=i==e.length?0:-100;if(r!=t[0]){if(r==n[0])a+=-200;else return null}return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=S(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=v(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=S(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let y,b=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(y=ee(c))==y.toLowerCase()?y==y.toUpperCase()?0:2:1;(!r||b==1&&h||_==0&&b!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=b,r+=v(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?v(S(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},ue=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},M=t.define({combine(e){return te(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:de,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>N(e(n),t(n)),optionClass:(e,t)=>n=>N(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function N(e,t){return e?t?e+` `+t:e:t}function de(e,t,n,r,i,a){let o=e.textDirection==y.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var P=m.define();function fe(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function F(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var pe=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(M);this.optionContent=fe(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=F(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:P.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(M).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:j.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=F(r.length,i,e.state.facet(M).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=F(t.options.length,t.selected,this.view.state.facet(M).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>o(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&he(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(M).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0)){if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function me(e,t){return n=>new pe(n,e,t)}function he(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function ge(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function _e(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(M);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new D(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new ue(n):new le(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new D(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):ge(e.completion)>ge(c)&&(s[s.length-1]=e),c=e.completion}return s}var ve=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,Ce(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=_e(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(M).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,Ce(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:Oe,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},ye=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(we,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(M),i=(r.override||n.languageDataAt(`autocomplete`,O(n)).map(ce)).map(e=>(this.active.find(t=>t.source==e)||new I(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(L));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!be(i,this.active)||o?a=ve.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new I(e.source,0):e));for(let e of t.effects)e.is(P)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?xe:Se}};function be(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var xe={"aria-autocomplete":`list`},Se={};function Ce(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var we=[];function Te(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(k);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var I=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=Te(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(A))i=new e(i.source,1,n.value);else if(n.is(j))i=new e(i.source,0);else if(n.is(L))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(O(e.state))}},Ee=class e extends I{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=O(t.state);if(o>a||!r||n&2&&(O(t.startState)==this.from||o<this.limit))return new I(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return De(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new w(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??O(t.state)):new I(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new e(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new I(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function De(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):ae(e,!0).test(i)}var L=m.define({map(e,t){return e.map(e=>e.map(t))}}),R=c.define({create(){return ye.start()},update(e,t){return e.update(t)},provide:e=>[s.from(e,e=>e.tooltip),x.contentAttributes.from(e,e=>e.attrs)]});function z(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(R).active.find(e=>e.source==t.source);return r instanceof Ee&&(typeof n==`string`?e.dispatch({...oe(e.state,n,r.from,r.to),annotations:k.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}var Oe=me(R,z);function B(e,t=`option`){return n=>{let r=n.state.field(R,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(M).interactionDelay)return!1;let i=1,a;t==`page`&&(a=C(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:P.of(s)}),!0}}var V=e=>{let t=e.state.field(R,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(M).interactionDelay?!1:z(e,t.open.options[t.open.selected])},H=e=>e.state.field(R,!1)?(e.dispatch({effects:A.of(!0)}),!0):!1,U=e=>{let t=e.state.field(R,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:j.of(null)}),!0)},ke=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},Ae=50,je=1e3,Me=ne.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(R).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(R),n=e.state.facet(M);if(!e.selectionSet&&!e.docChanged&&e.startState.field(R)==t)return;let r=e.transactions.some(e=>{let t=Te(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>Ae&&Date.now()-n.time>je){for(let e of n.context.abortListeners)try{e()}catch(e){o(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(A)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(R);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(M).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new w(t,O(t),e.explicit,this.view),r=new ke(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:j.of(null)}),o(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(M).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(M),n=this.view.state.field(R);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=O(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new Ee(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending){if(i.done==null){let n=new I(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:L.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(R,!1);if(t&&t.tooltip&&this.view.state.facet(M).closeOnBlur){let n=t.open&&C(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:j.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:A.of(!1)}),20),this.composing=0}}}),Ne=typeof navigator==`object`&&/Win/.test(navigator.platform),Pe=b.highest(x.domEventHandlers({keydown(e,t){let n=t.state.field(R,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(Ne&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&z(t,r),!1}})),W=x.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),Fe=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},Ie=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,a.TrackDel),r=t.mapPos(this.to,1,a.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},Le=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],i=[t],a=e.doc.lineAt(t),o=/^\s*/.exec(a.text)[0];for(let a of this.lines){if(n.length){let n=o,s=/^\t*/.exec(a)[0].length;for(let t=0;t<s;t++)n+=e.facet(r);i.push(t+n.length-s),a=n+a.slice(s)}n.push(a),t+=a.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new Ie(e.field,i[e.line]+e.from,i[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1;t===0&&(t=1e9);let c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new Fe(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},Re=h.widget({widget:new class extends g{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),ze=h.mark({class:`cm-snippetField`}),G=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=h.set(e.map(e=>(e.from==e.to?Re:ze).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},K=m.define({map(e,t){return e&&e.map(t)}}),Be=m.define(),q=c.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(K))return n.value;if(n.is(Be)&&e)return new G(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>x.decorations.from(e,e=>e?e.deco:h.none)});function J(e,t){return d.create(e.filter(e=>e.field==t).map(e=>d.range(e.from,e.to)))}function Ve(t){let n=Le.parse(t);return(t,r,i,a)=>{let{text:o,ranges:s}=n.instantiate(t.state,i),{main:c}=t.state.selection,l={changes:{from:i,to:a==c.from?c.to:a,insert:e.of(o)},scrollIntoView:!0,annotations:r?[k.of(r),_.userEvent.of(`input.complete`)]:void 0};if(s.length&&(l.selection=J(s,0)),s.some(e=>e.field>0)){let e=new G(s,0),n=l.effects=[K.of(e)];t.state.field(q,!1)===void 0&&n.push(m.appendConfig.of([q,Ge,qe,W]))}t.dispatch(t.state.update(l))}}function He(e){return({state:t,dispatch:n})=>{let r=t.field(q,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:J(r.ranges,i),effects:K.of(a?null:new G(r.ranges,i)),scrollIntoView:!0})),!0}}var Ue=[{key:`Tab`,run:He(1),shift:He(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(q,!1)?(t(e.update({effects:K.of(null)})),!0):!1}],We=t.define({combine(e){return e.length?e[0]:Ue}}),Ge=b.highest(u.compute([We],e=>e.facet(We)));function Ke(e,t){return{...t,apply:Ve(e)}}var qe=x.domEventHandlers({mousedown(e,t){let n=t.state.field(q,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:J(n.ranges,i.field),effects:K.of(n.ranges.some(e=>e.field>i.field)?new G(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Y={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},X=m.define({map(e,t){return t.mapPos(e,-1,a.TrackAfter)??void 0}}),Z=new class extends p{};Z.startSide=1,Z.endSide=-1;var Je=c.define({create(){return i.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(X)&&(e=e.update({add:[Z.range(n.value,n.value+1)]}));return e}});function Ye(){return[et,Je]}var Xe=`()[]{}<>«»»«[]{}`;function Ze(e){for(let t=0;t<16;t+=2)if(Xe.charCodeAt(t)==e)return Xe.charAt(t+1);return ee(e<128?e:e+1)}function Qe(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||Y}var $e=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),et=x.inputHandler.of((e,t,n,r)=>{if(($e?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&v(S(r,0))==1||t!=i.from||n!=i.to)return!1;let a=nt(e.state,r);return a?(e.dispatch(a),!0):!1}),tt=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Qe(e,e.selection.main.head).brackets||Y.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=it(e.doc,t.head);for(let i of n)if(i==r&&Q(e.doc,t.head)==Ze(S(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:d.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function nt(e,t){let n=Qe(e,e.selection.main.head),r=n.brackets||Y.brackets;for(let i of r){let a=Ze(S(i,0));if(t==i)return a==i?st(e,i,r.indexOf(i+i+i)>-1,n):at(e,i,a,n.before||Y.before);if(t==a&&rt(e,e.selection.main.from))return ot(e,i,a)}return null}function rt(e,t){let n=!1;return e.field(Je).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function Q(e,t){let n=e.sliceString(t,t+2);return n.slice(0,v(S(n,0)))}function it(e,t){let n=e.sliceString(t-2,t);return v(S(n,0))==n.length?n:n.slice(1)}function at(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:X.of(a.to+t.length),range:d.range(a.anchor+t.length,a.head+t.length)};let o=Q(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:X.of(a.head+t.length),range:d.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function ot(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&Q(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:d.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function st(e,t,n,r){let i=r.stringPrefixes||Y.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:X.of(r.to+t.length),range:d.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=Q(e.doc,o),c;if(s==t){if(ct(e,o))return{changes:{insert:t+t,from:o},effects:X.of(o+t.length),range:d.cursor(o+t.length)};if(rt(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:d.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=$(e,o-2*t.length,i))>-1&&ct(e,c))return{changes:{insert:t+t+t+t,from:o},effects:X.of(o+t.length),range:d.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=f.Word&&$(e,o,i)>-1&&!lt(e,o,t,i))return{changes:{insert:t+t,from:o},effects:X.of(o+t.length),range:d.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function ct(e,t){let r=n(e).resolveInner(t+1);return r.parent&&r.from==t}function lt(e,t,r,i){let a=n(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let n=0;n<5;n++){let n=e.sliceDoc(a.from,Math.min(a.to,a.from+r.length+o)),s=n.indexOf(r);if(!s||s>-1&&i.indexOf(n.slice(0,s))>-1){let t=a.firstChild;for(;t&&t.from==a.from&&t.to-t.from>r.length+s;){if(e.sliceDoc(t.to-r.length,t.to)==r)return!1;t=t.firstChild}return!0}let c=a.to==t&&a.parent;if(!c)break;a=c}return!1}function $(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=f.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=f.Word)return n}return-1}function ut(e={}){return[Pe,R,M.of(e),Me,ft,W]}var dt=[{key:`Ctrl-Space`,run:H},{mac:"Alt-`",run:H},{mac:`Alt-i`,run:H},{key:`Escape`,run:U},{key:`ArrowDown`,run:B(!0)},{key:`ArrowUp`,run:B(!1)},{key:`PageDown`,run:B(!0,`page`)},{key:`PageUp`,run:B(!1,`page`)},{key:`Enter`,run:V}],ft=b.highest(u.computeN([M],e=>e.facet(M).defaultKeymap?[dt]:[]));function pt(e){let t=e.field(R,!1);return t&&t.active.some(e=>e.isPending)?`pending`:t&&t.active.some(e=>e.state!=0)?`active`:null}export{tt as a,dt as c,oe as d,B as f,H as h,Ye as i,pt as l,Ke as m,V as n,U as o,Ve as p,ut as r,E as s,w as t,ie as u};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-B0Z9INg1.js";import{$ as t,D as n,G as r,H as i,I as a,N as o,O as s,Q as c,R as l,Tt as u,Ut as d,Wt as f,X as p,Y as m,c as h,d as ee,et as g,in as _,it as te,l as ne,nt as re,qt as ie,rt as v,st as ae,u as oe,v as se}from"./dist-BczecT6V.js";import{t as ce}from"./dist-Ccyblc8N.js";import{n as le,r as ue}from"./dist-Bviq_Dee.js";var de=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,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=[[c.contextHash,r]]}addChild(e,t){e.prop(c.contextHash)!=this.hash&&(e=new v(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 v(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new v(g.none,e,t,n,this.hashProp)})}},y;(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`})(y||={});var fe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},pe=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 S(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 b(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==y.OrderedList?E:T)(n,t,!1);return r>0&&(e.type!=y.BulletList||w(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var me={[y.Blockquote](e,t,n){return n.next==62&&(n.markers.push(R(y.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(x(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[y.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[y.OrderedList]:b,[y.BulletList]:b,[y.Document](){return!0}};function x(e){return e==32||e==9||e==10||e==13}function S(e,t=0){for(;t<e.length&&x(e.charCodeAt(t));)t++;return t}function he(e,t,n){for(;t>n&&x(e.charCodeAt(t-1));)t--;return t}function C(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 ge(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function w(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(!x(n))return-1}return n&&e.next==45&&ye(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(M.SetextHeading)>-1||r<3?-1:1}function _e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function T(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||x(e.text.charCodeAt(e.pos+1)))&&(!n||_e(t,y.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function E(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&&!x(e.text.charCodeAt(r+1))||n&&!_e(t,y.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ve(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 ye(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&&x(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var D=/^[ \t]*$/,be=/-->/,xe=/\?>/,O=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,be],[/^\s*<\?/,xe],[/^\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,D],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,D]];function Se(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=O.length-+!!n;e<t;e++)if(O[e][0].test(r))return e;return-1}function Ce(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function k(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==y.CodeText?e[r].to=n:e.push(R(y.CodeText,t,n))}var A={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(k(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){k(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==y.CodeText?k(o,e.from,e.to):o.push(e);s=[]}k(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&&k(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=y.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(y.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=C(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=he(t.text,t.text.length,o),c=[R(y.CodeMark,r,r+a)];o<s&&c.push(R(y.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&&k(c,e.lineStart-1,e.lineStart),c.push(R(y.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(k(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&&(k(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(y.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=ge(t);return n<0?!1:(e.startContext(y.Blockquote,t.pos),e.addNode(y.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(w(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(y.HorizontalRule,n),!0},BulletList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=y.BulletList&&e.startContext(y.BulletList,t.basePos,t.next);let r=Ce(t,t.pos+1);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=E(t,e,!1);if(n<0)return!1;e.block.type!=y.OrderedList&&e.startContext(y.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Ce(t,t.pos+n);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ve(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=he(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!x(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(y.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(y.HeaderMark,o-r,a-r);let c=s.finish(y.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Se(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=O[n][1],a=[],o=i!=D;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==be?y.CommentBlock:i==xe?y.ProcessingInstructionBlock:y.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},we=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
|
-
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length&&this.complete(e,n,i)}finish(e,t){return(this.stage==2||this.stage==3)&&S(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,R(y.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(Be(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(R(y.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Re(e,S(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=S(e,this.pos),n=0;if(t>this.pos){let r=ze(e,t,this.start);if(r){let t=j(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=j(e,this.pos),n>0&&n<e.length?n:-1}else return j(e,this.pos)}};function j(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!x(n))return-1}return t}var Te=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:ye(t),i=t.next;if(r<0)return!1;let a=R(y.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,R(i==61?y.SetextHeading1:y.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},M={LinkReference(e,t){return t.content.charCodeAt(0)==91?new we(t):null},SetextHeading(){return new Te}},Ee=[(e,t)=>ve(t)>=0,(e,t)=>C(t)>=0,(e,t)=>ge(t)>=0,(e,t)=>T(t,e,!0)>=0,(e,t)=>E(t,e,!0)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>Se(t,e,!0)>=0],De={text:``,end:0},Oe=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new pe,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=de.create(y.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new He(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}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new fe(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
|
-
`+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=Ue(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=De;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 `+y[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
|
-
`?``:t;else{let e=t.indexOf(`
|
|
5
|
-
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=de.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new v(this.parser.nodeSet.types[e],I,I,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(G(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?ke(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=G(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(y.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?R(this.parser.getNodeType(e),t,n,r):new Ne(e,t)}get buffer(){return new Me(this.parser.nodeSet)}};function ke(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=ke(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new v(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var Ae=class e extends re{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Oe(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(n){let i=P(n);if(!i)return this;let{nodeSet:a,skipContextMarkup:o}=this,s=this.blockParsers.slice(),l=this.leafBlockParsers.slice(),u=this.blockNames.slice(),d=this.inlineParsers.slice(),f=this.inlineNames.slice(),p=this.endLeafBlock.slice(),h=this.wrappers;if(N(i.defineNodes)){o=Object.assign({},o);let e=a.types.slice(),n;for(let t of i.defineNodes){let{name:i,block:a,composite:s,style:l}=typeof t==`string`?{name:t}:t;if(e.some(e=>e.name==i))continue;s&&(o[e.length]=(e,t,n)=>s(t,n,e.value));let u=e.length,d=s?[`Block`,`BlockContext`]:a?u>=y.ATXHeading1&&u<=y.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(g.define({id:u,name:i,props:d&&[[c.group,d]]})),l&&(n||={},Array.isArray(l)||l instanceof r?n[i]=l:Object.assign(n,l))}a=new t(e),n&&(a=a.extend(m(n)))}if(N(i.props)&&(a=a.extend(...i.props)),N(i.remove))for(let e of i.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(s[t]=l[t]=void 0),n>-1&&(d[n]=void 0)}if(N(i.parseBlock))for(let e of i.parseBlock){let t=u.indexOf(e.name);if(t>-1)s[t]=e.parse,l[t]=e.leaf;else{let t=e.before?F(u,e.before):e.after?F(u,e.after)+1:u.length-1;s.splice(t,0,e.parse),l.splice(t,0,e.leaf),u.splice(t,0,e.name)}e.endLeaf&&p.push(e.endLeaf)}if(N(i.parseInline))for(let e of i.parseInline){let t=f.indexOf(e.name);if(t>-1)d[t]=e.parse;else{let t=e.before?F(f,e.before):e.after?F(f,e.after)+1:f.length-1;d.splice(t,0,e.parse),f.splice(t,0,e.name)}}return i.wrap&&(h=h.concat(i.wrap)),new e(a,s,l,u,p,o,d,f,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new W(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function N(e){return e!=null&&e.length>0}function P(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=P(e[0]);if(e.length==1)return t;let n=P(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||I).concat(t||I),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function F(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var je=[g.none];for(let e=1,t;t=y[e];e++)je[e]=g.define({id:e,name:t,props:e>=y.Escape?[]:[[c.group,e in me?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var I=[],Me=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return v.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},L=class{constructor(e,t,n,r=I){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new Me(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},Ne=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return I}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function R(e,t,n,r){return new L(e,t,n,r)}var Pe={resolve:`Emphasis`,mark:`EmphasisMark`},Fe={resolve:`Emphasis`,mark:`EmphasisMark`},z={},B={},V=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},Ie=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,H=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{H=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var U={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(Ie.charCodeAt(t)==r)return e.append(R(y.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(R(y.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(R(y.InlineCode,n,r+1,[R(y.CodeMark,n,n+i),R(y.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(R(y.Autolink,n,n+1+i[0].length,[R(y.LinkMark,n,n+1),R(y.URL,n+1,n+i[0].length),R(y.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(R(y.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(R(y.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(R(y.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=H.test(i),s=H.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new V(t==95?Pe:Fe,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(R(y.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(R(y.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new V(z,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new V(B,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof V&&(r.type==z||r.type==B)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=Le(e,i,r.type==z?y.Link:y.Image,r.from,n+1);if(r.type==z)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof V&&t.type==z&&(t.side=0)}return a.to}}return-1}};function Le(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(R(y.LinkMark,r,r+(n==y.Image?2:1))),t.push(R(y.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=Re(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=ze(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(R(y.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(R(y.LinkMark,n,s)))}else if(o==91){let n=Be(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return R(n,r,s,t)}function Re(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return R(y.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(x(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?R(y.URL,t+n,i+n):i==e.length&&null}}function ze(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return R(y.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function Be(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return!r&&R(y.LinkLabel,t+n,a+1+n);else{if(r&&!x(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var W=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new V(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof V&&(t.type==z||t.type==B))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof V&&n.type.resolve&&n.side&2))continue;let r=n.type==Pe||n.type==Fe,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof V&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof L&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new V(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new V(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof L&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof V&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof V?t:null}skipSpace(e){return S(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?R(this.parser.getNodeType(e),t,n,r):new Ne(e,t)}};W.linkStart=z,W.imageStart=B;function G(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof L&&(n[r]=new L(t.type,t.from,t.to,G(t.children,[e])))}else n.splice(r++,0,e)}return n}var Ve=[y.CodeBlock,y.ListItem,y.OrderedList,y.BulletList],He=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
6
|
-
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(c.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=Ue(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new v(e.parser.nodeSet.types[y.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(Ve.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function Ue(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var We=m({"Blockquote/...":p.quote,HorizontalRule:p.contentSeparator,"ATXHeading1/... SetextHeading1/...":p.heading1,"ATXHeading2/... SetextHeading2/...":p.heading2,"ATXHeading3/...":p.heading3,"ATXHeading4/...":p.heading4,"ATXHeading5/...":p.heading5,"ATXHeading6/...":p.heading6,"Comment CommentBlock":p.comment,Escape:p.escape,Entity:p.character,"Emphasis/...":p.emphasis,"StrongEmphasis/...":p.strong,"Link/... Image/...":p.link,"OrderedList/... BulletList/...":p.list,"BlockQuote/...":p.quote,"InlineCode CodeText":p.monospace,"URL Autolink":p.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":p.processingInstruction,"CodeInfo LinkLabel":p.labelName,LinkTitle:p.string,Paragraph:p.content}),Ge=new Ae(new t(je).extend(We),Object.keys(A).map(e=>A[e]),Object.keys(A).map(e=>M[e]),Object.keys(A),Ee,me,Object.keys(U).map(e=>U[e]),Object.keys(U),[]);function Ke(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function qe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:te((e,r)=>{let i=e.type.id;if(t&&(i==y.CodeBlock||i==y.FencedCode)){let n=``;if(i==y.FencedCode){let t=e.node.getChild(y.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==y.CodeText,bracketed:i==y.FencedCode}}else if(n&&(i==y.HTMLBlock||i==y.HTMLTag||i==y.CommentBlock))return{parser:n,overlay:Ke(e.node,e.from,e.to)};return null})}}var Je={resolve:`Strikethrough`,mark:`StrikethroughMark`},Ye={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":p.strikethrough}},{name:`StrikethroughMark`,style:p.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=H.test(r),c=H.test(i);return e.addDelimiter(Je,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function K(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function Xe(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var Ze=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Qe=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&Ze.test(r=t.text.slice(t.pos))){let i=[];K(e,n.content,0,i,n.start)==K(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];K(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},$e={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":p.heading}},`TableRow`,{name:`TableCell`,style:p.content},{name:`TableDelimiter`,style:p.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return Xe(t.content,0)?new Qe:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof Qe)||!Xe(t.text,t.basePos))return!1;let r=e.peekLine();return Ze.test(r)&&K(e,t.text,t.basePos)==K(e,r,t.basePos)},before:`SetextHeading`}]},et=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},tt={defineNodes:[{name:`Task`,block:!0,style:p.list},{name:`TaskMarker`,style:p.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new et:null},after:`SetextHeading`}]},nt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,rt=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,it=/[\w-]+\.[\w-]+($|[/:])/,at=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,ot=/\/[a-zA-Z\d@.]+/gy;function st(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function ct(e,t){rt.lastIndex=t;let n=rt.exec(e);if(!n||it.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&st(e,t,r,`)`)>st(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function lt(e,t){at.lastIndex=t;let n=at.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var ut=[$e,tt,Ye,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;nt.lastIndex=r;let i=nt.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=ct(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=lt(e.text,r):(a=lt(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(ot.lastIndex=a,i=ot.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function dt(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),x(s))break}return-1}}var ft={defineNodes:[{name:`Superscript`,style:p.special(p.content)},{name:`SuperscriptMark`,style:p.processingInstruction}],parseInline:[{name:`Superscript`,parse:dt(94,`Superscript`,`SuperscriptMark`)}]},pt={defineNodes:[{name:`Subscript`,style:p.special(p.content)},{name:`SubscriptMark`,style:p.processingInstruction}],parseInline:[{name:`Subscript`,parse:dt(126,`Subscript`,`SubscriptMark`)}]},mt={defineNodes:[{name:`Emoji`,style:p.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},ht=e({commonmarkLanguage:()=>St,deleteMarkupBackward:()=>Mt,insertNewlineContinueMarkup:()=>Dt,insertNewlineContinueMarkupCommand:()=>Et,markdown:()=>Ft,markdownKeymap:()=>Nt,markdownLanguage:()=>Y,pasteURLAsLink:()=>zt}),gt=se({commentTokens:{block:{open:`<!--`,close:`-->`}}}),_t=new c,vt=Ge.configure({props:[n.add(e=>!e.is(`Block`)||e.is(`Document`)||q(e)!=null||yt(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),_t.add(q),o.add({Document:()=>null}),l.add({Document:gt})]});function q(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function yt(e){return e.name==`OrderedList`||e.name==`BulletList`}function bt(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=q(e.type))!=null&&r<=t)break;n=e}return n.to}var xt=s.of((e,t,n)=>{for(let r=i(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(_t);if(e==null)continue;let t=bt(r,e);if(t>n)return{from:n,to:t}}return null});function J(e){return new h(gt,e,[],`markdown`)}var St=J(vt),Y=J(vt.configure([ut,pt,ft,mt,{props:[n.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function Ct(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):ne.matchLanguageName(e,n,!0),t instanceof ne)return t.support?t.support.language.parser:ee.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var X=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}marker(e,t){let n=this.node.name==`OrderedList`?String(+Tt(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function wt(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new X(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new X(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new X(i.parent,s,s+t,a[1],e,n,i))}}return r}function Tt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Z(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Tt(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function Q(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(a)!=` `)return e;let r=_(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var Et=(e={})=>({state:t,dispatch:n})=>{let r=i(t),{doc:a}=t,o=null,s=t.changeByRange(n=>{if(!n.empty||!Y.isActiveAt(t,n.from,-1)&&!Y.isActiveAt(t,n.from,1))return o={range:n};let i=n.from,s=a.lineAt(i),c=wt(r.resolveInner(i,-1),a);for(;c.length&&c[c.length-1].from>i-s.from;)c.pop();if(!c.length)return o={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>i-s.from)return o={range:n};let u=i>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){if(l.item.from<s.from&&!/^[\s>]*$/.test(s.text.slice(0,l.to)))return o={range:n};let r=l.node.firstChild,u=l.node.getChild(`ListItem`,`ListItem`);if(r.to>=i||u&&u.to<i||s.from>0&&!/[^\s>]/.test(a.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(a,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:i,insert:n}];return l.node.name==`OrderedList`&&Z(l.item,a,r,-2),e&&e.node.name==`OrderedList`&&Z(e.item,a,r),{range:d.cursor(t+n.length),changes:r}}{let e=At(c,t,s);return{range:d.cursor(i+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=a.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let f=[];l.node.name==`OrderedList`&&Z(l.item,a,f);let p=l.item&&l.item.from<s.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)m+=e==t&&!p?c[e].marker(a,1):c[e].blank(e<t?_(s.text,4,c[e+1].from)-m.length:null);let h=i;for(;h>s.from&&/\s/.test(s.text.charAt(h-s.from-1));)h--;return m=Q(m,t),kt(l.node,t.doc)&&(m=At(c,t,s)+t.lineBreak+m),f.push({from:h,to:i,insert:t.lineBreak+m}),{range:d.cursor(h+m.length+1),changes:f}});return!o&&(n(t.update(s,{scrollIntoView:!0,userEvent:`input`})),!0)},Dt=Et();function Ot(e){return e.name==`QuoteMark`||e.name==`ListMark`}function kt(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function At(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?_(n.text,4,e[t+1].from)-r.length:null,t<i);return Q(r,t)}function jt(e,t){let n=e.resolveInner(t,-1),r=t;Ot(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(Ot(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var Mt=({state:e,dispatch:t})=>{let n=i(e),r=null,a=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&Y.isActiveAt(e,t.from)){let t=a.lineAt(i),r=wt(jt(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:d.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(n.item&&t.from<=n.item.from||/^[\s>]*$/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(_(t.text,4,n.to)-_(t.text,4,n.from));return r==t.from&&(i=Q(i,e)),{range:d.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:d.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return!r&&(t(e.update(a,{scrollIntoView:!0,userEvent:`delete`})),!0)},Nt=[{key:`Enter`,run:Dt},{key:`Backspace`,run:Mt}],Pt=le({matchClosingTags:!1});function Ft(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=St,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=Pt}=e;if(!(i instanceof Ae))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,xt],d;o&&l.push(zt),n instanceof oe?(l.push(n.support),d=n.language):n&&(d=n);let f=t||d?Ct(t,d):void 0;c.push(qe({codeParser:f,htmlParser:s.language.parser})),r&&l.push(ie.high(u.of(Nt)));let p=J(i.configure(c));return a&&l.push(p.data.of({autocomplete:It})),new oe(p,l)}function It(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let a=i(t).resolveInner(n,-1);for(;a&&!a.type.isTop;){if(a.name==`CodeBlock`||a.name==`FencedCode`||a.name==`ProcessingInstructionBlock`||a.name==`CommentBlock`||a.name==`Link`||a.name==`Image`)return null;a=a.parent}return{from:n-r[0].length,to:n,options:Lt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var $=null;function Lt(){if($)return $;let e=ue(new ce(f.create({extensions:Pt}),0,!0));return $=e?e.options:[]}var Rt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,zt=ae.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!Y.isActiveAt(t.state,n.from,1)))return!1;let a=i(t.state),o=!1;return a.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||Rt.test(e.name))&&(o=!0)},leave:e=>{e.to<n.to&&(o=!0)}}),!o&&(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});export{Ft as n,Y as r,ht as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Wa as e}from"./index-DYVlDtsu.js";var t=Object.prototype.hasOwnProperty;function n(e,n){return e!=null&&t.call(e,n)}function r(t,r){return t!=null&&e(t,r,n)}export{r as t};
|