/** * 由 Fantastic-admin 提供技术支持 * Powered by Fantastic-admin * https://fantastic-admin.github.io */ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-C3NItWbX.js","./index-BERX8Mlm.js","./index-b8Ls1WmH.css","./index-DA118ti0.js","./index-CVdKItNW.js","./index-HbrSBKa6.js","./index-CJZijCqE.js","./index-BRLpoAL3.js","./index-CoAQ05zQ.js","./index-lXyw_eK-.js","./index-BFJf1VL1.js","./index-BKsxNJi6.js","./index-Dgty_-Sl.js","./index-BS70MvZz.js","./index-Bz6lYfzJ.js","./index-B1pFhXfc.js","./dockerfile-knGOOxt4.js","./simple-mode-C3vEBAcb.js","./factor-CFXhaUWb.js","./nsis-BvKfQ9lQ.js","./pug-_kJOm_E2.js","./javascript-D48wDJXV.js","./index-s5oNnYH8.js","./index-Ba5HOdXi.js"])))=>i.map(i=>d[i]); var e,t,i,n,r,s,o,a,l,h,c,u,d,p,f,m,O,g,v,b,y,k,x,w,S,Q,$,_,P,C,T,A,E,M,R,D,Z,L,X,q,V,I,z,j,B,F,Y,W,N,G,U=Object.defineProperty,H=e=>{throw TypeError(e)},K=(e,t,i)=>((e,t,i)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i),J=(e,t,i)=>t.has(e)||H("Cannot "+i),ee=(e,t,i)=>(J(e,t,"read from private field"),i?i.call(e):t.get(e)),te=(e,t,i)=>t.has(e)?H("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),ie=(e,t,i,n)=>(J(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),ne=(e,t,i)=>(J(e,t,"access private method"),i),re=(e,t,i,n)=>({set _(n){ie(e,t,n,i)},get _(){return ee(e,t,n)}});import{d as se,$ as oe,r as ae,a0 as le,b as he,an as ce,ao as ue,f as de,ap as pe,O as fe,aq as me,P as Oe,V as ge,ar as ve,as as be,at as ye,a9 as ke,au as xe,av as we,aw as Se,ax as Qe}from"./index-BERX8Mlm.js";const $e=(e,t=new WeakMap)=>{if(null===e||(e=>{const t=typeof e;return"function"!==t&&"object"!==t||null===e})(e))return e;if(t.has(e))return t.get(e);if(e instanceof RegExp)return(e=>{const t=""===e.flags?void 0:e.flags;return new RegExp(e.source,t)})(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof Function)return e;if(e instanceof Map){const i=new Map;return t.set(e,i),e.forEach(((e,n)=>{i.set(n,$e(e,t))})),i}if(e instanceof Set){const i=new Set;t.set(e,i);for(const n of e)i.add($e(n,t));return i}if(Array.isArray(e)){const i=[];return t.set(e,i),e.forEach((e=>{i.push($e(e,t))})),i}const i={};t.set(e,i);for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=$e(e[n],t));return i},_e=(e,t=200)=>{let i=0;return(...n)=>new Promise((r=>{i&&(clearTimeout(i),r("cancel")),i=window.setTimeout((()=>{e.apply(void 0,n),i=0,r("done")}),t)}))},Pe=()=>{let e=-1;return(t,i,n,r=100)=>{const s=()=>{n&&("number"==typeof r?setTimeout(n,r):n())};-1!==e&&(cancelAnimationFrame(e),s());let o=t.scrollTop;const a=()=>{e=-1;const n=i-o;o+=n/5,Math.abs(n)<1?(t.scrollTo(0,i),s()):(t.scrollTo(0,o),e=requestAnimationFrame(a))};e=requestAnimationFrame(a)}},Ce=(e,t=200)=>{let i=0,n=null;const r=s=>{0===i&&(i=s),s-i>=t?(e.apply(void 0,n),n=null,i=0):window.requestAnimationFrame(r)};return(...e)=>{null===n&&window.requestAnimationFrame(r),n=e}},Te=()=>`${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`,Ae=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),Ee=(e,t,i={})=>{const{excludeKeys:n}=i;for(const r in t)n&&n(r)?e[r]=t[r]:Ae(t[r])&&Ae(e[r])?e[r]=Ee(e[r],t[r],i):e[r]=t[r];return e},Me="md-editor",Re="https://unpkg.com",De={main:`${Re}/prettier@3.3.3/standalone.js`,markdown:`${Re}/prettier@3.3.3/plugins/markdown.js`},Ze={a11y:{light:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/a11y-light.min.css`,dark:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/a11y-dark.min.css`},atom:{light:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/atom-one-light.min.css`,dark:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/atom-one-dark.min.css`},github:{light:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/github.min.css`,dark:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/github-dark.min.css`},gradient:{light:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/gradient-light.min.css`,dark:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/gradient-dark.min.css`},kimbie:{light:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/kimbie-light.min.css`,dark:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/kimbie-dark.min.css`},paraiso:{light:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/paraiso-light.min.css`,dark:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/paraiso-dark.min.css`},qtcreator:{light:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/qtcreator-light.min.css`,dark:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/stackoverflow-light.min.css`,dark:`${Re}/@highlightjs/cdn-assets@11.10.0/styles/stackoverflow-dark.min.css`}},Le=["bold","underline","italic","strikeThrough","-","title","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","mermaid","katex","-","revoke","next","save","=","prettier","pageFullscreen","fullscreen","preview","previewOnly","htmlPreview","catalog","github"],Xe=["markdownTotal","=","scrollSwitch"],qe={"zh-CN":{toolbarTips:{bold:"加粗",underline:"下划线",italic:"斜体",strikeThrough:"删除线",title:"标题",sub:"下标",sup:"上标",quote:"引用",unorderedList:"无序列表",orderedList:"有序列表",task:"任务列表",codeRow:"行内代码",code:"块级代码",link:"链接",image:"图片",table:"表格",mermaid:"mermaid图",katex:"katex公式",revoke:"后退",next:"前进",save:"保存",prettier:"美化",pageFullscreen:"浏览器全屏",fullscreen:"屏幕全屏",preview:"预览",previewOnly:"仅预览",htmlPreview:"html代码预览",catalog:"目录",github:"源码地址"},titleItem:{h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题"},imgTitleItem:{link:"添加链接",upload:"上传图片",clip2upload:"裁剪上传"},linkModalTips:{linkTitle:"添加链接",imageTitle:"添加图片",descLabel:"链接描述:",descLabelPlaceHolder:"请输入描述...",urlLabel:"链接地址:",urlLabelPlaceHolder:"请输入链接...",buttonOK:"确定"},clipModalTips:{title:"裁剪图片上传",buttonUpload:"上传"},copyCode:{text:"复制代码",successTips:"已复制!",failTips:"复制失败!"},mermaid:{flow:"流程图",sequence:"时序图",gantt:"甘特图",class:"类图",state:"状态图",pie:"饼图",relationship:"关系图",journey:"旅程图"},katex:{inline:"行内公式",block:"块级公式"},footer:{markdownTotal:"字数",scrollAuto:"同步滚动"}},"en-US":{toolbarTips:{bold:"bold",underline:"underline",italic:"italic",strikeThrough:"strikeThrough",title:"title",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"unordered list",orderedList:"ordered list",task:"task list",codeRow:"inline code",code:"block-level code",link:"link",image:"image",table:"table",mermaid:"mermaid",katex:"formula",revoke:"revoke",next:"undo revoke",save:"save",prettier:"prettier",pageFullscreen:"fullscreen in page",fullscreen:"fullscreen",preview:"preview",previewOnly:"preview only",htmlPreview:"html preview",catalog:"catalog",github:"source code"},titleItem:{h1:"Lv1 Heading",h2:"Lv2 Heading",h3:"Lv3 Heading",h4:"Lv4 Heading",h5:"Lv5 Heading",h6:"Lv6 Heading"},imgTitleItem:{link:"Add Image Link",upload:"Upload Images",clip2upload:"Clip Upload"},linkModalTips:{linkTitle:"Add Link",imageTitle:"Add Image",descLabel:"Desc:",descLabelPlaceHolder:"Enter a description...",urlLabel:"Link:",urlLabelPlaceHolder:"Enter a link...",buttonOK:"OK"},clipModalTips:{title:"Crop Image",buttonUpload:"Upload"},copyCode:{text:"Copy",successTips:"Copied!",failTips:"Copy failed!"},mermaid:{flow:"flow",sequence:"sequence",gantt:"gantt",class:"class",state:"state",pie:"pie",relationship:"relationship",journey:"journey"},katex:{inline:"inline",block:"block"},footer:{markdownTotal:"Character Count",scrollAuto:"Scroll Auto"}}},Ve={editorExtensions:{highlight:{js:`${Re}/@highlightjs/cdn-assets@11.10.0/highlight.min.js`,css:Ze},prettier:{standaloneJs:De.main,parserMarkdownJs:De.markdown},cropper:{...{css:`${Re}/cropperjs@1.6.2/dist/cropper.min.css`,js:`${Re}/cropperjs@1.6.2/dist/cropper.min.js`}},screenfull:{js:`${Re}/screenfull@5.2.0/dist/screenfull.js`},mermaid:{js:`${Re}/mermaid@11.3.0/dist/mermaid.min.js`,enableZoom:!0},katex:{...{js:`${Re}/katex@0.16.11/dist/katex.min.js`,css:`${Re}/katex@0.16.11/dist/katex.min.css`}}},editorExtensionsAttrs:{},editorConfig:{languageUserDefined:{},mermaidTemplate:{},renderDelay:500,zIndex:2e4},codeMirrorExtensions:(e,t)=>t,markdownItConfig:()=>{},markdownItPlugins:e=>e,mermaidConfig:e=>e,katexConfig:e=>e},Ie=.1,ze=({instance:e,ctx:t,props:i={}},n="default")=>{const r=(null==e?void 0:e.$slots[n])||(null==t?void 0:t.slots[n]);return(r?r(e):"")||i[n]},je={overlay:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},relative:{type:String,default:"html"},disabled:{type:Boolean,default:void 0}},Be=se({name:`${Me}-dropdown`,props:je,setup(e,t){const i=`${Me}-dropdown-hidden`,n=oe({overlayClass:[i],overlayStyle:{},triggerHover:!1,overlayHover:!1}),r=ae(),s=ae(),o=()=>{var t,i;if(e.disabled)return!1;n.triggerHover=!0;const o=r.value,a=s.value;if(!o||!a)return;const l=o.getBoundingClientRect(),h=o.offsetTop,c=o.offsetLeft,u=l.height,d=l.width,p=o.getRootNode(),f=(null==(t=p.querySelector(e.relative))?void 0:t.scrollLeft)||0,m=(null==(i=p.querySelector(e.relative))?void 0:i.clientWidth)||0;let O=c-a.offsetWidth/2+d/2-f;O+a.offsetWidth>f+m&&(O=f+m-a.offsetWidth),O<0&&(O=0),n.overlayStyle={...n.overlayStyle,top:h+u+"px",left:O+"px"},e.onChange(!0)},a=()=>{if(e.disabled)return!1;n.overlayHover=!0};le((()=>e.visible),(e=>{e?n.overlayClass=n.overlayClass.filter((e=>e!==i)):n.overlayClass.push(i)}));let l=-1;const h=t=>{r.value===t.target?n.triggerHover=!1:n.overlayHover=!1,clearTimeout(l),l=window.setTimeout((()=>{n.overlayHover||n.triggerHover||e.onChange(!1)}),10)};return he((()=>{r.value.addEventListener("mouseenter",o),r.value.addEventListener("mouseleave",h),s.value.addEventListener("mouseenter",a),s.value.addEventListener("mouseleave",h)})),ce((()=>{r.value.removeEventListener("mouseenter",o),r.value.removeEventListener("mouseleave",h),s.value.removeEventListener("mouseenter",a),s.value.removeEventListener("mouseleave",h)})),()=>{const i=ze({ctx:t}),o=ze({props:e,ctx:t},"overlay");return[ue(i instanceof Array?i[0]:i,{ref:r,key:"cloned-dropdown-trigger"}),de("div",{class:[`${Me}-dropdown`,n.overlayClass],style:n.overlayStyle,ref:s},[de("div",{class:`${Me}-dropdown-overlay`},[o instanceof Array?o[0]:o])])]}}}),Fe=se({name:"DropdownToolbar",props:{title:{type:String,default:""},visible:{type:Boolean,default:void 0},trigger:{type:[String,Object],default:void 0},onChange:{type:Function,default:void 0},overlay:{type:[String,Object],default:void 0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},emits:["onChange"],setup(e,t){const i=pe("editorId");return()=>{const n=ze({props:e,ctx:t},"trigger"),r=ze({props:e,ctx:t},"overlay"),s=ze({props:e,ctx:t});return de(Be,{relative:`#${i}-toolbar-wrapper`,visible:e.visible,onChange:i=>{var n;null==(n=e.onChange)||n.call(e,i),t.emit("onChange",i)},overlay:r,disabled:e.disabled},{default:()=>[de("div",{class:[`${Me}-toolbar-item`,e.disabled&&`${Me}-disabled`],title:e.title||""},[s||n])]})}}});Fe.install=e=>(e.component(Fe.name,Fe),e);var Ye=Object.defineProperty,We=(e,t,i)=>((e,t,i)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,t+"",i);const Ne=new class{constructor(){We(this,"pools",{})}remove(e,t,i){const n=this.pools[e]&&this.pools[e][t];n&&(this.pools[e][t]=n.filter((e=>e!==i)))}clear(e){this.pools[e]={}}on(e,t){return this.pools[e]||(this.pools[e]={}),this.pools[e][t.name]||(this.pools[e][t.name]=[]),this.pools[e][t.name].push(t.callback),this.pools[e][t.name].includes(t.callback)}emit(e,t,...i){this.pools[e]||(this.pools[e]={});const n=this.pools[e][t];n&&n.forEach((e=>{try{e(...i)}catch(t){}}))}},Ge="onSave",Ue="changeCatalogVisible",He="changeFullscreen",Ke="pageFullscreenChanged",Je="fullscreenChanged",et="previewChanged",tt="previewOnlyChanged",it="htmlPreviewChanged",nt="catalogVisibleChanged",rt="buildFinished",st="errorCatcher",ot="replace",at="uploadImage",lt="openModals",ht="ctrlZ",ct="ctrlShiftZ",ut="catalogChanged",dt="pushCatalog",pt="rerender",ft="eventListener",mt="taskStateChanged",Ot="sendEditorView",gt="getEditorView",vt={copy:``,"collapse-tips":``,pin:'',"pin-off":''},bt=(e,t)=>"string"==typeof t[e]?t[e]:vt[e],yt=(e,t)=>{const i=i=>{const n=e.parentElement||document.body,r=n.offsetWidth,s=n.offsetHeight,{clientWidth:o,clientHeight:a}=document.documentElement,l=i.offsetX,h=i.offsetY,c=e=>{let i=e.x+document.body.scrollLeft-document.body.clientLeft-l,c=e.y+document.body.scrollTop-document.body.clientTop-h;i=i<1?1:i{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mouseup",u)};return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)}},kt=(e,t,i="")=>{var n;const r=document.getElementById(t.id);if(r)""!==i&&(Reflect.get(window,i)?null==(n=t.onload)||n.call(r,new Event("load")):t.onload&&r.addEventListener("load",t.onload));else{const i={...t};i.onload=null;const n=xt(e,i);t.onload&&n.addEventListener("load",t.onload),document.head.appendChild(n)}},xt=(e,t)=>{const i=document.createElement(e);return Object.keys(t).forEach((e=>{void 0!==t[e]&&(i[e]=t[e])})),i},wt=(()=>(e,t)=>{const i=new Map;return null==e||e.forEach((e=>{let n=e.querySelector(`.${Me}-mermaid-action`);n||(e.insertAdjacentHTML("beforeend",`
${bt("pin-off",t.customIcon)}
`),n=e.querySelector(`.${Me}-mermaid-action`));const r=()=>{const r=i.get(e);if(null==r?void 0:r.removeEvent)r.removeEvent(),e.removeAttribute("data-grab"),i.set(e,{removeClick:r.removeClick}),n.innerHTML=bt("pin-off",t.customIcon);else{const s=(e=>{if(!e)return()=>{};const t=e.firstChild;let i,n,r,s=1,o=0,a=0,l=!1,h=1;const c=()=>{t.style.transform=`translate(${o}px, ${a}px) scale(${s})`},u=e=>{1===e.touches.length?(l=!0,i=e.touches[0].clientX-o,n=e.touches[0].clientY-a):2===e.touches.length&&(r=Math.hypot(e.touches[0].clientX-e.touches[1].clientX,e.touches[0].clientY-e.touches[1].clientY),h=s)},d=e=>{if(e.preventDefault(),l&&1===e.touches.length)o=e.touches[0].clientX-i,a=e.touches[0].clientY-n,c();else if(2===e.touches.length){const i=Math.hypot(e.touches[0].clientX-e.touches[1].clientX,e.touches[0].clientY-e.touches[1].clientY),n=s;s=h*(i/r-1+1);const l=(e.touches[0].clientX+e.touches[1].clientX)/2,u=(e.touches[0].clientY+e.touches[1].clientY)/2,d=t.getBoundingClientRect(),p=(l-d.left)/n,f=(u-d.top)/n;o-=p*(s-n),a-=f*(s-n),c()}},p=()=>{l=!1},f=e=>{e.preventDefault();const i=s;e.deltaY<0?s+=.02:s=Math.max(.1,s-.02);const n=t.getBoundingClientRect(),r=e.clientX-n.left,l=e.clientY-n.top;o-=r/i*(s-i),a-=l/i*(s-i),c()},m=e=>{l=!0,i=e.clientX-o,n=e.clientY-a},O=e=>{l&&(o=e.clientX-i,a=e.clientY-n,c())},g=()=>{l=!1},v=()=>{l=!1};return e.addEventListener("touchstart",u,{passive:!1}),e.addEventListener("touchmove",d,{passive:!1}),e.addEventListener("touchend",p),e.addEventListener("wheel",f,{passive:!1}),e.addEventListener("mousedown",m),e.addEventListener("mousemove",O),e.addEventListener("mouseup",g),e.addEventListener("mouseleave",v),()=>{e.removeEventListener("touchstart",u),e.removeEventListener("touchmove",d),e.removeEventListener("touchend",p),e.removeEventListener("wheel",f),e.removeEventListener("mousedown",m),e.removeEventListener("mousemove",O),e.removeEventListener("mouseup",g),e.removeEventListener("mouseleave",v)}})(e);e.setAttribute("data-grab",""),i.set(e,{removeEvent:s,removeClick:null==r?void 0:r.removeClick}),n.innerHTML=bt("pin",t.customIcon)}};n.addEventListener("click",r),i.set(e,{removeClick:()=>n.removeEventListener("click",r)})})),()=>{i.forEach((({removeEvent:e,removeClick:t})=>{null==e||e(),null==t||t()})),i.clear()}})();var St=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=window.Promise||function(e){function t(){}e(t,t)},r=function(){for(var e=arguments.length,t=Array(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:{}).target,t=function(){var e={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},t=void 0,i=void 0;if(d.container)if(d.container instanceof Object)t=(e=St({},e,d.container)).width-e.left-e.right-2*d.margin,i=e.height-e.top-e.bottom-2*d.margin;else{var n=($t(d.container)?d.container:document.querySelector(d.container)).getBoundingClientRect(),r=n.width,s=n.height,o=n.left,a=n.top;e=St({},e,{width:r,height:s,left:o,top:a})}t=t||e.width-2*d.margin,i=i||e.height-2*d.margin;var l=p.zoomedHd||p.original,h=_t(l)?t:l.naturalWidth||t,c=_t(l)?i:l.naturalHeight||i,u=l.getBoundingClientRect(),f=u.top,m=u.left,O=u.width,g=u.height,v=Math.min(Math.max(O,h),t)/O,b=Math.min(Math.max(g,c),i)/g,y=Math.min(v,b),k="scale("+y+") translate3d("+((t-O)/2-m+d.margin+e.left)/y+"px, "+((i-g)/2-f+d.margin+e.top)/y+"px, 0)";p.zoomed.style.transform=k,p.zoomedHd&&(p.zoomedHd.style.transform=k)};return new n((function(i){if(e&&-1===l.indexOf(e))i(m);else{if(p.zoomed)i(m);else{if(e)p.original=e;else{if(!(l.length>0))return void i(m);var n=l;p.original=n[0]}if(p.original.dispatchEvent(Ct("medium-zoom:open",{detail:{zoom:m}})),u=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,c=!0,p.zoomed=function(e){var t=e.getBoundingClientRect(),i=t.top,n=t.left,r=t.width,s=t.height,o=e.cloneNode(),a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,l=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return o.removeAttribute("id"),o.style.position="absolute",o.style.top=i+a+"px",o.style.left=n+l+"px",o.style.width=r+"px",o.style.height=s+"px",o.style.transform="",o}(p.original),document.body.appendChild(f),d.template){var r=$t(d.template)?d.template:document.querySelector(d.template);p.template=document.createElement("div"),p.template.appendChild(r.content.cloneNode(!0)),document.body.appendChild(p.template)}if(p.original.parentElement&&"PICTURE"===p.original.parentElement.tagName&&p.original.currentSrc&&(p.zoomed.src=p.original.currentSrc),document.body.appendChild(p.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),p.original.classList.add("medium-zoom-image--hidden"),p.zoomed.classList.add("medium-zoom-image--opened"),p.zoomed.addEventListener("click",o),p.zoomed.addEventListener("transitionend",(function e(){c=!1,p.zoomed.removeEventListener("transitionend",e),p.original.dispatchEvent(Ct("medium-zoom:opened",{detail:{zoom:m}})),i(m)})),p.original.getAttribute("data-zoom-src")){p.zoomedHd=p.zoomed.cloneNode(),p.zoomedHd.removeAttribute("srcset"),p.zoomedHd.removeAttribute("sizes"),p.zoomedHd.removeAttribute("loading"),p.zoomedHd.src=p.zoomed.getAttribute("data-zoom-src"),p.zoomedHd.onerror=function(){clearInterval(s),p.zoomedHd=null,t()};var s=setInterval((function(){p.zoomedHd.complete&&(clearInterval(s),p.zoomedHd.classList.add("medium-zoom-image--opened"),p.zoomedHd.addEventListener("click",o),document.body.appendChild(p.zoomedHd),t())}),10)}else if(p.original.hasAttribute("srcset")){p.zoomedHd=p.zoomed.cloneNode(),p.zoomedHd.removeAttribute("sizes"),p.zoomedHd.removeAttribute("loading");var a=p.zoomedHd.addEventListener("load",(function(){p.zoomedHd.removeEventListener("load",a),p.zoomedHd.classList.add("medium-zoom-image--opened"),p.zoomedHd.addEventListener("click",o),document.body.appendChild(p.zoomedHd),t()}))}else t()}}}))},o=function(){return new n((function(e){if(!c&&p.original){c=!0,document.body.classList.remove("medium-zoom--opened"),p.zoomed.style.transform="",p.zoomedHd&&(p.zoomedHd.style.transform=""),p.template&&(p.template.style.transition="opacity 150ms",p.template.style.opacity=0),p.original.dispatchEvent(Ct("medium-zoom:close",{detail:{zoom:m}})),p.zoomed.addEventListener("transitionend",(function t(){p.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(p.zoomed),p.zoomedHd&&document.body.removeChild(p.zoomedHd),document.body.removeChild(f),p.zoomed.classList.remove("medium-zoom-image--opened"),p.template&&document.body.removeChild(p.template),c=!1,p.zoomed.removeEventListener("transitionend",t),p.original.dispatchEvent(Ct("medium-zoom:closed",{detail:{zoom:m}})),p.original=null,p.zoomed=null,p.zoomedHd=null,p.template=null,e(m)}))}else e(m)}))},a=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target;return p.original?o():s({target:e})},l=[],h=[],c=!1,u=0,d=i,p={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(t)?d=t:(t||"string"==typeof t)&&r(t);var f=function(e){var t=document.createElement("div");return t.classList.add("medium-zoom-overlay"),t.style.background=e,t}((d=St({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},d)).background);document.addEventListener("click",(function(e){var t=e.target;t!==f?-1!==l.indexOf(t)&&a({target:t}):o()})),document.addEventListener("keyup",(function(e){var t=e.key||e.keyCode;"Escape"!==t&&"Esc"!==t&&27!==t||o()})),document.addEventListener("scroll",(function(){if(!c&&p.original){var e=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(u-e)>d.scrollOffset&&setTimeout(o,150)}})),window.addEventListener("resize",o);var m={open:s,close:o,toggle:a,update:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e;if(e.background&&(f.style.background=e.background),e.container&&e.container instanceof Object&&(t.container=St({},d.container,e.container)),e.template){var i=$t(e.template)?e.template:document.querySelector(e.template);t.template=i}return d=St({},d,t),l.forEach((function(e){e.dispatchEvent(Ct("medium-zoom:update",{detail:{zoom:m}}))})),m},clone:function(){return e(St({},d,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))},attach:r,detach:function(){for(var e=arguments.length,t=Array(e),i=0;i0?t.reduce((function(e,t){return[].concat(e,Pt(t))}),[]):l;return n.forEach((function(e){e.classList.remove("medium-zoom-image"),e.dispatchEvent(Ct("medium-zoom:detach",{detail:{zoom:m}}))})),l=l.filter((function(e){return-1===n.indexOf(e)})),m},on:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l.forEach((function(n){n.addEventListener("medium-zoom:"+e,t,i)})),h.push({type:"medium-zoom:"+e,listener:t,options:i}),m},off:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l.forEach((function(n){n.removeEventListener("medium-zoom:"+e,t,i)})),h=h.filter((function(i){return!(i.type==="medium-zoom:"+e&&i.listener.toString()===t.toString())})),m},getOptions:function(){return d},getImages:function(){return l},getZoomedImage:function(){return p.original}};return m};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}");var At,Et={exports:{}};const Mt=fe(At?Et.exports:(At=1,"undefined"!=typeof self&&self,Et.exports=async function(e){if("string"==typeof e){if(window.isSecureContext&&navigator.clipboard)return await navigator.clipboard.writeText(e);{const t=document.createElement("textarea");let i=!1;if(t.value=e,t.style.position="fixed",t.style.opacity=0,t.style.zIndex="-10000",t.style.top="-10000",document.body.appendChild(t),t.select(),i=document.execCommand("copy"),document.body.removeChild(t),i)return;throw new Error('Failed to copy content via "execCommand"!')}}})),Rt={};function Dt(e,t){"string"!=typeof t&&(t=Dt.defaultChars);const i=function(e){let t=Rt[e];if(t)return t;t=Rt[e]=[];for(let i=0;i<128;i++){const e=String.fromCharCode(i);t.push(e)}for(let i=0;i=55296&&e<=57343?"���":String.fromCharCode(e),n+=6;continue}}if(240==(248&s)&&n+91114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),n+=9;continue}}t+="�"}}return t}))}Dt.defaultChars=";/?:@&=+$,#",Dt.componentChars="";const Zt={};function Lt(e,t,i){"string"!=typeof t&&(i=t,t=Lt.defaultChars),void 0===i&&(i=!0);const n=function(e){let t=Zt[e];if(t)return t;t=Zt[e]=[];for(let i=0;i<128;i++){const e=String.fromCharCode(i);/^[0-9a-z]$/i.test(e)?t.push(e):t.push("%"+("0"+i.toString(16).toUpperCase()).slice(-2))}for(let i=0;i=55296&&t<=57343){if(t>=55296&&t<=56319&&s+1=56320&&t<=57343){r+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}r+="%EF%BF%BD"}else r+=encodeURIComponent(e[s])}return r}function Xt(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function qt(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}Lt.defaultChars=";/?:@&=+$,-_.!~*'()#",Lt.componentChars="-_.!~*'()";const Vt=/^([a-z0-9.+-]+:)/i,It=/:[0-9]*$/,zt=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,jt=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Bt=["'"].concat(jt),Ft=["%","/","?",";","#"].concat(Bt),Yt=["/","?","#"],Wt=/^[+a-z0-9A-Z_-]{0,63}$/,Nt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Gt={javascript:!0,"javascript:":!0},Ut={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Ht(e,t){if(e&&e instanceof qt)return e;const i=new qt;return i.parse(e,t),i}qt.prototype.parse=function(e,t){let i,n,r,s=e;if(s=s.trim(),!t&&1===e.split("#").length){const e=zt.exec(s);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=Vt.exec(s);if(o&&(o=o[0],i=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(t||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r="//"===s.substr(0,2),!r||o&&Gt[o]||(s=s.substr(2),this.slashes=!0)),!Gt[o]&&(r||o&&!Ut[o])){let e,t,i=-1;for(let a=0;a127?n+="x":n+=i[e];if(!n.match(Wt)){const n=e.slice(0,t),r=e.slice(t+1),o=i.match(Nt);o&&(n.push(o[1]),r.unshift(o[2])),r.length&&(s=r.join(".")+s),this.hostname=n.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");-1!==a&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return-1!==l&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),Ut[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},qt.prototype.parseHost=function(e){let t=It.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Kt=Object.freeze(Object.defineProperty({__proto__:null,decode:Dt,encode:Lt,format:Xt,parse:Ht},Symbol.toStringTag,{value:"Module"})),Jt=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ei=/[\0-\x1F\x7F-\x9F]/,ti=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ii=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,ni=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ri=Object.freeze(Object.defineProperty({__proto__:null,Any:Jt,Cc:ei,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:ti,S:ii,Z:ni},Symbol.toStringTag,{value:"Module"})),si=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((e=>e.charCodeAt(0)))),oi=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((e=>e.charCodeAt(0))));var ai;const li=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),hi=null!==(ai=String.fromCodePoint)&&void 0!==ai?ai:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};var ci,ui;(ui=ci||(ci={}))[ui.NUM=35]="NUM",ui[ui.SEMI=59]="SEMI",ui[ui.EQUALS=61]="EQUALS",ui[ui.ZERO=48]="ZERO",ui[ui.NINE=57]="NINE",ui[ui.LOWER_A=97]="LOWER_A",ui[ui.LOWER_F=102]="LOWER_F",ui[ui.LOWER_X=120]="LOWER_X",ui[ui.LOWER_Z=122]="LOWER_Z",ui[ui.UPPER_A=65]="UPPER_A",ui[ui.UPPER_F=70]="UPPER_F",ui[ui.UPPER_Z=90]="UPPER_Z";var di,pi,fi,mi,Oi,gi;function vi(e){return e>=ci.ZERO&&e<=ci.NINE}function bi(e){return e>=ci.UPPER_A&&e<=ci.UPPER_F||e>=ci.LOWER_A&&e<=ci.LOWER_F}function yi(e){return e===ci.EQUALS||function(e){return e>=ci.UPPER_A&&e<=ci.UPPER_Z||e>=ci.LOWER_A&&e<=ci.LOWER_Z||vi(e)}(e)}(pi=di||(di={}))[pi.VALUE_LENGTH=49152]="VALUE_LENGTH",pi[pi.BRANCH_LENGTH=16256]="BRANCH_LENGTH",pi[pi.JUMP_TABLE=127]="JUMP_TABLE",(mi=fi||(fi={}))[mi.EntityStart=0]="EntityStart",mi[mi.NumericStart=1]="NumericStart",mi[mi.NumericDecimal=2]="NumericDecimal",mi[mi.NumericHex=3]="NumericHex",mi[mi.NamedEntity=4]="NamedEntity",(gi=Oi||(Oi={}))[gi.Legacy=0]="Legacy",gi[gi.Strict=1]="Strict",gi[gi.Attribute=2]="Attribute";class ki{constructor(e,t,i){this.decodeTree=e,this.emitCodePoint=t,this.errors=i,this.state=fi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Oi.Strict}startEntity(e){this.decodeMode=e,this.state=fi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case fi.EntityStart:return e.charCodeAt(t)===ci.NUM?(this.state=fi.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=fi.NamedEntity,this.stateNamedEntity(e,t));case fi.NumericStart:return this.stateNumericStart(e,t);case fi.NumericDecimal:return this.stateNumericDecimal(e,t);case fi.NumericHex:return this.stateNumericHex(e,t);case fi.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===ci.LOWER_X?(this.state=fi.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=fi.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,i,n){if(t!==i){const r=i-t;this.result=this.result*Math.pow(n,r)+parseInt(e.substr(t,r),n),this.consumed+=r}}stateNumericHex(e,t){const i=t;for(;t=55296&&e<=57343||e>1114111?65533:null!==(t=li.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==ci.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:i}=this;let n=i[this.treeIndex],r=(n&di.VALUE_LENGTH)>>14;for(;t>14,0!==r){if(s===ci.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==Oi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:i}=this,n=(i[t]&di.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,i){const{decodeTree:n}=this;return this.emitCodePoint(1===t?n[e]&~di.VALUE_LENGTH:n[e+1],i),3===t&&this.emitCodePoint(n[e+2],i),i}end(){var e;switch(this.state){case fi.NamedEntity:return 0===this.result||this.decodeMode===Oi.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case fi.NumericDecimal:return this.emitNumericEntity(0,2);case fi.NumericHex:return this.emitNumericEntity(0,3);case fi.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fi.EntityStart:return 0}}}function xi(e){let t="";const i=new ki(e,(e=>t+=hi(e)));return function(e,n){let r=0,s=0;for(;(s=e.indexOf("&",s))>=0;){t+=e.slice(r,s),i.startEntity(n);const o=i.write(e,s+1);if(o<0){r=s+i.end();break}r=s+o,s=0===o?r+1:r}const o=t+e.slice(r);return t="",o}}function wi(e,t,i,n){const r=(t&di.BRANCH_LENGTH)>>7,s=t&di.JUMP_TABLE;if(0===r)return 0!==s&&n===s?i:-1;if(s){const t=n-s;return t<0||t>=r?-1:e[i+t]-1}let o=i,a=o+r-1;for(;o<=a;){const t=o+a>>>1,i=e[t];if(in))return e[t+r];a=t-1}}return-1}const Si=xi(si);function Qi(e,t=Oi.Legacy){return Si(e,t)}function $i(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)}xi(oi);const _i=Object.prototype.hasOwnProperty;function Pi(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(i){e[i]=t[i]}))}})),e}function Ci(e,t,i){return[].concat(e.slice(0,t),i,e.slice(t+1))}function Ti(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function Ai(e){if(e>65535){const t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}const Ei=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Mi=new RegExp(Ei.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),Ri=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Di(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Mi,(function(e,t,i){return t||function(e,t){if(35===t.charCodeAt(0)&&Ri.test(t)){const i="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Ti(i)?Ai(i):e}const i=Qi(e);return i!==e?i:e}(e,i)}))}const Zi=/[&<>"]/,Li=/[&<>"]/g,Xi={"&":"&","<":"<",">":">",'"':"""};function qi(e){return Xi[e]}function Vi(e){return Zi.test(e)?e.replace(Li,qi):e}const Ii=/[.?*+^$[\]\\(){}|-]/g;function zi(e){switch(e){case 9:case 32:return!0}return!1}function ji(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Bi(e){return ti.test(e)||ii.test(e)}function Fi(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Yi(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const Wi={mdurl:Kt,ucmicro:ri},Ni=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Ci,assign:Pi,escapeHtml:Vi,escapeRE:function(e){return e.replace(Ii,"\\$&")},fromCodePoint:Ai,has:function(e,t){return _i.call(e,t)},isMdAsciiPunct:Fi,isPunctChar:Bi,isSpace:zi,isString:$i,isValidEntityCode:Ti,isWhiteSpace:ji,lib:Wi,normalizeReference:Yi,unescapeAll:Di,unescapeMd:function(e){return e.indexOf("\\")<0?e:e.replace(Ei,"$1")}},Symbol.toStringTag,{value:"Module"}));const Gi=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:function(e,t,i){let n,r=t;const s={ok:!1,pos:0,str:""};if(60===e.charCodeAt(r)){for(r++;r32))return s;if(41===n){if(0===o)break;o--}r++}return t===r||0!==o||(s.str=Di(e.slice(t,r)),s.pos=r,s.ok=!0),s},parseLinkLabel:function(e,t,i){let n,r,s,o;const a=e.posMax,l=e.pos;for(e.pos=t+1,n=1;e.pos=i)return o;let n=e.charCodeAt(s);if(34!==n&&39!==n&&40!==n)return o;t++,s++,40===n&&(n=41),o.marker=n}for(;s"+Vi(s.content)+""},Ui.code_block=function(e,t,i,n,r){const s=e[t];return""+Vi(e[t].content)+"\n"},Ui.fence=function(e,t,i,n,r){const s=e[t],o=s.info?Di(s.info).trim():"";let a,l="",h="";if(o){const e=o.split(/(\s+)/g);l=e[0],h=e.slice(2).join("")}if(a=i.highlight&&i.highlight(s.content,l,h)||Vi(s.content),0===a.indexOf("${a}\n`}return`
${a}
\n`},Ui.image=function(e,t,i,n,r){const s=e[t];return s.attrs[s.attrIndex("alt")][1]=r.renderInlineAsText(s.children,i,n),r.renderToken(e,t,i)},Ui.hardbreak=function(e,t,i){return i.xhtmlOut?"
\n":"
\n"},Ui.softbreak=function(e,t,i){return i.breaks?i.xhtmlOut?"
\n":"
\n":"\n"},Ui.text=function(e,t){return Vi(e[t].content)},Ui.html_block=function(e,t){return e[t].content},Ui.html_inline=function(e,t){return e[t].content},Hi.prototype.renderAttrs=function(e){let t,i,n;if(!e.attrs)return"";for(n="",t=0,i=e.attrs.length;t\n":">",r},Hi.prototype.renderInline=function(e,t,i){let n="";const r=this.rules;for(let s=0,o=e.length;s=0&&(i=this.attrs[t][1]),i},Ji.prototype.attrJoin=function(e,t){const i=this.attrIndex(e);i<0?this.attrPush([e,t]):this.attrs[i][1]=this.attrs[i][1]+" "+t},en.prototype.Token=Ji;const tn=/\r\n?|\n/g,nn=/\0/g;function rn(e){return/^<\/a\s*>/i.test(e)}const sn=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,on=/\((c|tm|r)\)/i,an=/\((c|tm|r)\)/gi,ln={c:"©",r:"®",tm:"™"};function hn(e,t){return ln[t.toLowerCase()]}function cn(e){let t=0;for(let i=e.length-1;i>=0;i--){const n=e[i];"text"!==n.type||t||(n.content=n.content.replace(an,hn)),"link_open"===n.type&&"auto"===n.info&&t--,"link_close"===n.type&&"auto"===n.info&&t++}}function un(e){let t=0;for(let i=e.length-1;i>=0;i--){const n=e[i];"text"!==n.type||t||sn.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===n.type&&"auto"===n.info&&t--,"link_close"===n.type&&"auto"===n.info&&t++}}const dn=/['"]/,pn=/['"]/g;function fn(e,t,i){return e.slice(0,t)+i+e.slice(t+1)}function mn(e,t){let i;const n=[];for(let r=0;r=0&&!(n[i].level<=o);i--);if(n.length=i+1,"text"!==s.type)continue;let a=s.content,l=0,h=a.length;e:for(;l=0)f=a.charCodeAt(c.index-1);else for(i=r-1;i>=0&&("softbreak"!==e[i].type&&"hardbreak"!==e[i].type);i--)if(e[i].content){f=e[i].content.charCodeAt(e[i].content.length-1);break}let m=32;if(l=48&&f<=57&&(d=u=!1),u&&d&&(u=O,d=g),u||d){if(d)for(i=n.length-1;i>=0;i--){let u=n[i];if(n[i].level=0;o--){const a=r[o];if("link_close"!==a.type){if("html_inline"===a.type&&(i=a.content,/^\s]/i.test(i)&&s>0&&s--,rn(a.content)&&s++),!(s>0)&&"text"===a.type&&e.md.linkify.test(a.content)){const i=a.content;let s=e.md.linkify.match(i);const l=[];let h=a.level,c=0;s.length>0&&0===s[0].index&&o>0&&"text_special"===r[o-1].type&&(s=s.slice(1));for(let t=0;tc){const t=new e.Token("text","",0);t.content=i.slice(c,a),t.level=h,l.push(t)}const u=new e.Token("link_open","a",1);u.attrs=[["href",r]],u.level=h++,u.markup="linkify",u.info="auto",l.push(u);const d=new e.Token("text","",0);d.content=o,d.level=h,l.push(d);const p=new e.Token("link_close","a",-1);p.level=--h,p.markup="linkify",p.info="auto",l.push(p),c=s[t].lastIndex}if(c=0;t--)"inline"===e.tokens[t].type&&(on.test(e.tokens[t].content)&&cn(e.tokens[t].children),sn.test(e.tokens[t].content)&&un(e.tokens[t].children))}],["smartquotes",function(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&dn.test(e.tokens[t].content)&&mn(e.tokens[t].children,e)}],["text_join",function(e){let t,i;const n=e.tokens,r=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n},vn.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},vn.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;et;)if(!zi(this.src.charCodeAt(--e)))return e+1;return e},vn.prototype.skipChars=function(e,t){for(let i=this.src.length;ei;)if(t!==this.src.charCodeAt(--e))return e+1;return e},vn.prototype.getLines=function(e,t,i,n){if(e>=t)return"";const r=new Array(t-e);for(let s=0,o=e;oi?new Array(e-i+1).join(" ")+this.src.slice(h,l):this.src.slice(h,l)}return r.join("")},vn.prototype.Token=Ji;function bn(e,t){const i=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];return e.src.slice(i,n)}function yn(e){const t=[],i=e.length;let n=0,r=e.charCodeAt(n),s=!1,o=0,a="";for(;n=n)return-1;let s=e.src.charCodeAt(r++);if(s<48||s>57)return-1;for(;;){if(r>=n)return-1;if(s=e.src.charCodeAt(r++),!(s>=48&&s<=57)){if(41===s||46===s)break;return-1}if(r-i>=10)return-1}return r`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",Sn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Qn=new RegExp("^(?:"+wn+"|"+Sn+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),$n=new RegExp("^(?:"+wn+"|"+Sn+")"),_n=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp($n.source+"\\s*$"),/^$/,!1]];const Pn=[["table",function(e,t,i,n){if(t+2>i)return!1;let r=t+1;if(e.sCount[r]=4)return!1;let s=e.bMarks[r]+e.tShift[r];if(s>=e.eMarks[r])return!1;const o=e.src.charCodeAt(s++);if(124!==o&&45!==o&&58!==o)return!1;if(s>=e.eMarks[r])return!1;const a=e.src.charCodeAt(s++);if(124!==a&&45!==a&&58!==a&&!zi(a))return!1;if(45===o&&zi(a))return!1;for(;s=4)return!1;h=yn(l),h.length&&""===h[0]&&h.shift(),h.length&&""===h[h.length-1]&&h.pop();const u=h.length;if(0===u||u!==c.length)return!1;if(n)return!0;const d=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRules("blockquote"),f=[t,0];e.push("table_open","table",1).map=f,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let g=0;g=4)break;if(h=yn(l),h.length&&""===h[0]&&h.shift(),h.length&&""===h[h.length-1]&&h.pop(),O+=u-h.length,O>65536)break;if(r===t+2){e.push("tbody_open","tbody",1).map=m=[t+2,0]}e.push("tr_open","tr",1).map=[r,r+1];for(let t=0;t=4))break;n++,r=n}e.line=r;const s=e.push("code_block","code",0);return s.content=e.getLines(t,r,4+e.blkIndent,!1)+"\n",s.map=[t,e.line],!0}],["fence",function(e,t,i,n){let r=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(r+3>s)return!1;const o=e.src.charCodeAt(r);if(126!==o&&96!==o)return!1;let a=r;r=e.skipChars(r,o);let l=r-a;if(l<3)return!1;const h=e.src.slice(a,r),c=e.src.slice(r,s);if(96===o&&c.indexOf(String.fromCharCode(o))>=0)return!1;if(n)return!0;let u=t,d=!1;for(;(u++,!(u>=i))&&(r=a=e.bMarks[u]+e.tShift[u],s=e.eMarks[u],!(r=4||(r=e.skipChars(r,o),r-a=4)return!1;if(62!==e.src.charCodeAt(r))return!1;if(n)return!0;const a=[],l=[],h=[],c=[],u=e.md.block.ruler.getRules("blockquote"),d=e.parentType;e.parentType="blockquote";let p,f=!1;for(p=t;p=s)break;if(62===e.src.charCodeAt(r++)&&!t){let t,i,n=e.sCount[p]+1;32===e.src.charCodeAt(r)?(r++,n++,i=!1,t=!0):9===e.src.charCodeAt(r)?(t=!0,(e.bsCount[p]+n)%4==3?(r++,n++,i=!1):i=!0):t=!1;let o=n;for(a.push(e.bMarks[p]),e.bMarks[p]=r;r=s,l.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(t?1:0),h.push(e.sCount[p]),e.sCount[p]=o-n,c.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(f)break;let n=!1;for(let r=0,s=u.length;r";const g=[t,0];O.map=g,e.md.block.tokenize(e,t,p),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=o,e.parentType=d,g[1]=e.line;for(let v=0;v=4)return!1;let s=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(s++);if(42!==o&&45!==o&&95!==o)return!1;let a=1;for(;s=4)return!1;if(e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(p=!0),(d=xn(e,l))>=0){if(c=!0,o=e.bMarks[l]+e.tShift[l],u=Number(e.src.slice(o,d-1)),p&&1!==u)return!1}else{if(!((d=kn(e,l))>=0))return!1;c=!1}if(p&&e.skipSpaces(d)>=e.eMarks[l])return!1;if(n)return!0;const f=e.src.charCodeAt(d-1),m=e.tokens.length;c?(a=e.push("ordered_list_open","ol",1),1!==u&&(a.attrs=[["start",u]])):a=e.push("bullet_list_open","ul",1);const O=[l,0];a.map=O,a.markup=String.fromCharCode(f);let g=!1;const v=e.md.block.ruler.getRules("list"),b=e.parentType;for(e.parentType="list";l=r?1:n-t,p>4&&(p=1);const m=t+p;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(f);const O=[l,0];a.map=O,c&&(a.info=e.src.slice(o,d-1));const b=e.tight,y=e.tShift[l],k=e.sCount[l],x=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=m,e.tight=!0,e.tShift[l]=u-e.bMarks[l],e.sCount[l]=n,u>=r&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,i):e.md.block.tokenize(e,l,i,!0),e.tight&&!g||(h=!1),g=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=x,e.tShift[l]=y,e.sCount[l]=k,e.tight=b,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(f),l=e.line,O[1]=l,l>=i)break;if(e.sCount[l]=4)break;let w=!1;for(let r=0,s=v.length;r=4)return!1;if(91!==e.src.charCodeAt(r))return!1;function a(t){const i=e.lineMax;if(t>=i||e.isEmpty(t))return null;let n=!1;if(e.sCount[t]-e.blkIndent>3&&(n=!0),e.sCount[t]<0&&(n=!0),!n){const n=e.md.block.ruler.getRules("reference"),r=e.parentType;e.parentType="reference";let s=!1;for(let o=0,a=n.length;o=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(r))return!1;let o=e.src.slice(r,s),a=0;for(;a<_n.length&&!_n[a][0].test(o);a++);if(a===_n.length)return!1;if(n)return _n[a][2];let l=t+1;if(!_n[a][1].test(o))for(;l=4)return!1;let o=e.src.charCodeAt(r);if(35!==o||r>=s)return!1;let a=1;for(o=e.src.charCodeAt(++r);35===o&&r6||rr&&zi(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;const h=e.push("heading_open","h"+String(a),1);h.markup="########".slice(0,a),h.map=[t,e.line];const c=e.push("inline","",0);return c.content=e.src.slice(r,s).trim(),c.map=[t,e.line],c.children=[],e.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,i){const n=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let s,o=0,a=t+1;for(;a3)continue;if(e.sCount[a]>=e.blkIndent){let t=e.bMarks[a]+e.tShift[a];const i=e.eMarks[a];if(t=i))){o=61===s?1:2;break}}if(e.sCount[a]<0)continue;let t=!1;for(let r=0,s=n.length;r3)continue;if(e.sCount[s]<0)continue;let t=!1;for(let r=0,o=n.length;r=i))&&!(e.sCount[o]=s){e.line=i;break}const t=e.line;let l=!1;for(let s=0;s=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),o=e.line,o0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(r),n},Tn.prototype.scanDelims=function(e,t){const i=this.posMax,n=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let s=e;for(;s?@[]^_`{|}~-".split("").forEach((function(e){Mn[e.charCodeAt(0)]=1}));const Dn={tokenize:function(e,t){const i=e.pos,n=e.src.charCodeAt(i);if(t)return!1;if(126!==n)return!1;const r=e.scanDelims(e.pos,!0);let s=r.length;const o=String.fromCharCode(n);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=o,s--);for(let l=0;l=0;i--){const n=t[i];if(95!==n.marker&&42!==n.marker)continue;if(-1===n.end)continue;const r=t[n.end],s=i>0&&t[i-1].end===n.end+1&&t[i-1].marker===n.marker&&t[i-1].token===n.token-1&&t[n.end+1].token===r.token+1,o=String.fromCharCode(n.marker),a=e.tokens[n.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?o+o:o,a.content="";const l=e.tokens[r.token];l.type=s?"strong_close":"em_close",l.tag=s?"strong":"em",l.nesting=-1,l.markup=s?o+o:o,l.content="",s&&(e.tokens[t[i-1].token].content="",e.tokens[t[n.end+1].token].content="",i--)}}const Ln={tokenize:function(e,t){const i=e.pos,n=e.src.charCodeAt(i);if(t)return!1;if(95!==n&&42!==n)return!1;const r=e.scanDelims(e.pos,42===n);for(let s=0;s\x00-\x20]*)$/;const Vn=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,In=/^&([a-z][a-z0-9]{1,31});/i;function zn(e){const t={},i=e.length;if(!i)return;let n=0,r=-2;const s=[];for(let o=0;oa;l-=s[l]+1){const t=e[l];if(t.marker===i.marker&&(t.open&&t.end<0)){let n=!1;if((t.close||i.open)&&(t.length+i.length)%3==0&&(t.length%3==0&&i.length%3==0||(n=!0)),!n){const n=l>0&&!e[l-1].open?s[l-1]+1:0;s[o]=o-l+n,s[l]=n,i.open=!1,t.end=o,t.close=!1,h=-1,r=-2;break}}}-1!==h&&(t[i.marker][(i.open?3:0)+(i.length||0)%3]=h)}}const jn=[["text",function(e,t){let i=e.pos;for(;i0)return!1;const i=e.pos;if(i+3>e.posMax)return!1;if(58!==e.src.charCodeAt(i))return!1;if(47!==e.src.charCodeAt(i+1))return!1;if(47!==e.src.charCodeAt(i+2))return!1;const n=e.pending.match(En);if(!n)return!1;const r=n[1],s=e.md.linkify.matchAtStart(e.src.slice(i-r.length));if(!s)return!1;let o=s.url;if(o.length<=r.length)return!1;o=o.replace(/\*+$/,"");const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){e.pending=e.pending.slice(0,-r.length);const t=e.push("link_open","a",1);t.attrs=[["href",a]],t.markup="linkify",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(o);const i=e.push("link_close","a",-1);i.markup="linkify",i.info="auto"}return e.pos+=o.length-r.length,!0}],["newline",function(e,t){let i=e.pos;if(10!==e.src.charCodeAt(i))return!1;const n=e.pending.length-1,r=e.posMax;if(!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){let t=n-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(i++;i=n)return!1;let r=e.src.charCodeAt(i);if(10===r){for(t||e.push("hardbreak","br",0),i++;i=55296&&r<=56319&&i+1=56320&&t<=57343&&(s+=e.src[i+1],i++)}const o="\\"+s;if(!t){const t=e.push("text_special","",0);r<256&&0!==Mn[r]?t.content=s:t.content=o,t.markup=o,t.info="escape"}return e.pos=i+1,!0}],["backticks",function(e,t){let i=e.pos;if(96!==e.src.charCodeAt(i))return!1;const n=i;i++;const r=e.posMax;for(;i=u)return!1;if(l=f,r=e.md.helpers.parseLinkDestination(e.src,f,e.posMax),r.ok){for(o=e.md.normalizeLink(r.str),e.md.validateLink(o)?f=r.pos:o="",l=f;f=u||41!==e.src.charCodeAt(f))&&(h=!0),f++}if(h){if(void 0===e.env.references)return!1;if(f=0?n=e.src.slice(l,f++):f=p+1):f=p+1,n||(n=e.src.slice(d,p)),s=e.env.references[Yi(n)],!s)return e.pos=c,!1;o=s.href,a=s.title}if(!t){e.pos=d,e.posMax=p;const t=[["href",o]];e.push("link_open","a",1).attrs=t,a&&t.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=u,!0}],["image",function(e,t){let i,n,r,s,o,a,l,h,c="";const u=e.pos,d=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;const p=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if(s=f+1,s=d)return!1;for(h=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(c=e.md.normalizeLink(a.str),e.md.validateLink(c)?s=a.pos:c=""),h=s;s=d||41!==e.src.charCodeAt(s))return e.pos=u,!1;s++}else{if(void 0===e.env.references)return!1;if(s=0?r=e.src.slice(h,s++):s=f+1):s=f+1,r||(r=e.src.slice(p,f)),o=e.env.references[Yi(r)],!o)return e.pos=u,!1;c=o.href,l=o.title}if(!t){n=e.src.slice(p,f);const t=[];e.md.inline.parse(n,e.md,e.env,t);const i=e.push("image","img",0),r=[["src",c],["alt",""]];i.attrs=r,i.children=t,i.content=n,l&&r.push(["title",l])}return e.pos=s,e.posMax=d,!0}],["autolink",function(e,t){let i=e.pos;if(60!==e.src.charCodeAt(i))return!1;const n=e.pos,r=e.posMax;for(;;){if(++i>=r)return!1;const t=e.src.charCodeAt(i);if(60===t)return!1;if(62===t)break}const s=e.src.slice(n+1,i);if(qn.test(s)){const i=e.md.normalizeLink(s);if(!e.md.validateLink(i))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",i]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const n=e.push("link_close","a",-1);n.markup="autolink",n.info="auto"}return e.pos+=s.length+2,!0}if(Xn.test(s)){const i=e.md.normalizeLink("mailto:"+s);if(!e.md.validateLink(i))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",i]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const n=e.push("link_close","a",-1);n.markup="autolink",n.info="auto"}return e.pos+=s.length+2,!0}return!1}],["html_inline",function(e,t){if(!e.md.options.html)return!1;const i=e.posMax,n=e.pos;if(60!==e.src.charCodeAt(n)||n+2>=i)return!1;const r=e.src.charCodeAt(n+1);if(33!==r&&63!==r&&47!==r&&!function(e){const t=32|e;return t>=97&&t<=122}(r))return!1;const s=e.src.slice(n).match(Qn);if(!s)return!1;if(!t){const t=e.push("html_inline","",0);t.content=s[0],o=t.content,/^\s]/i.test(o)&&e.linkLevel++,function(e){return/^<\/a\s*>/i.test(e)}(t.content)&&e.linkLevel--}var o;return e.pos+=s[0].length,!0}],["entity",function(e,t){const i=e.pos,n=e.posMax;if(38!==e.src.charCodeAt(i))return!1;if(i+1>=n)return!1;if(35===e.src.charCodeAt(i+1)){const n=e.src.slice(i).match(Vn);if(n){if(!t){const t="x"===n[1][0].toLowerCase()?parseInt(n[1].slice(1),16):parseInt(n[1],10),i=e.push("text_special","",0);i.content=Ti(t)?Ai(t):Ai(65533),i.markup=n[0],i.info="entity"}return e.pos+=n[0].length,!0}}else{const n=e.src.slice(i).match(In);if(n){const i=Qi(n[0]);if(i!==n[0]){if(!t){const t=e.push("text_special","",0);t.content=i,t.markup=n[0],t.info="entity"}return e.pos+=n[0].length,!0}}}return!1}]],Bn=[["balance_pairs",function(e){const t=e.tokens_meta,i=e.tokens_meta.length;zn(e.delimiters);for(let n=0;n0&&n++,"text"===r[t].type&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;o||e.pos++,s[t]=e.pos},Fn.prototype.tokenize=function(e){const t=this.ruler.getRules(""),i=t.length,n=e.posMax,r=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}if(o){if(e.pos>=n)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Fn.prototype.parse=function(e,t,i,n){const r=new this.State(e,t,i,n);this.tokenize(r);const s=this.ruler2.getRules(""),o=s.length;for(let a=0;a=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:n.match(i.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,i){const n=e.slice(t);return i.re.mailto||(i.re.mailto=new RegExp("^"+i.re.src_email_name+"@"+i.re.src_host_strict,"i")),i.re.mailto.test(n)?n.match(i.re.mailto)[0].length:0}}},Kn="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Jn(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=Jt.source,t.src_Cc=ei.source,t.src_Z=ni.source,t.src_P=ti.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const i="[><|]";return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+i+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}(e.__opts__),i=e.__tlds__.slice();function n(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||i.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),i.push(t.src_xn),t.src_tlds=i.join("|"),t.email_fuzzy=RegExp(n(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(n(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(n(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(n(t.tpl_host_fuzzy_test),"i");const r=[];function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){const i=e.__schemas__[t];if(null===i)return;const n={validate:null,link:null};if(e.__compiled__[t]=n,"[object Object]"===Wn(i))return!function(e){return"[object RegExp]"===Wn(e)}(i.validate)?Nn(i.validate)?n.validate=i.validate:s(t,i):n.validate=function(e){return function(t,i){const n=t.slice(i);return e.test(n)?n.match(e)[0].length:0}}(i.validate),void(Nn(i.normalize)?n.normalize=i.normalize:i.normalize?s(t,i):n.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===Wn(e)}(i)?s(t,i):r.push(t)})),r.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};const o=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(Gn).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function er(e,t){const i=e.__index__,n=e.__last_index__,r=e.__text_cache__.slice(i,n);this.schema=e.__schema__.toLowerCase(),this.index=i+t,this.lastIndex=n+t,this.raw=r,this.text=r,this.url=r}function tr(e,t){const i=new er(e,t);return e.__compiled__[i.schema].normalize(i,e),i}function ir(e,t){if(!(this instanceof ir))return new ir(e,t);var i;t||(i=e,Object.keys(i||{}).reduce((function(e,t){return e||Un.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=Yn({},Un,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Yn({},Hn,e),this.__compiled__={},this.__tlds__=Kn,this.__tlds_replaced__=!1,this.re={},Jn(this)}ir.prototype.add=function(e,t){return this.__schemas__[e]=t,Jn(this),this},ir.prototype.set=function(e){return this.__opts__=Yn(this.__opts__,e),this},ir.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,i,n,r,s,o,a,l,h;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(t=a.exec(e));)if(r=this.testSchemaAt(e,t[2],a.lastIndex),r){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+r;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&null!==(n=e.match(this.re.email_fuzzy))&&(s=n.index+n[1].length,o=n.index+n[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=o))),this.__index__>=0},ir.prototype.pretest=function(e){return this.re.pretest.test(e)},ir.prototype.testSchemaAt=function(e,t,i){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,i,this):0},ir.prototype.match=function(e){const t=[];let i=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(tr(this,i)),i=this.__last_index__);let n=i?e.slice(i):e;for(;this.test(n);)t.push(tr(this,i)),n=n.slice(this.__last_index__),i+=this.__last_index__;return t.length?t:null},ir.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const i=this.testSchemaAt(e,t[2],t[0].length);return i?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i,tr(this,0)):null},ir.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,i){return e!==i[t-1]})).reverse(),Jn(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Jn(this),this)},ir.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},ir.prototype.onCompile=function(){};const nr=2147483647,rr=36,sr=/^xn--/,or=/[^\0-\x7F]/,ar=/[\x2E\u3002\uFF0E\uFF61]/g,lr={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},hr=Math.floor,cr=String.fromCharCode;function ur(e){throw new RangeError(lr[e])}function dr(e,t){const i=e.split("@");let n="";i.length>1&&(n=i[0]+"@",e=i[1]);const r=function(e,t){const i=[];let n=e.length;for(;n--;)i[n]=t(e[n]);return i}((e=e.replace(ar,".")).split("."),t).join(".");return n+r}function pr(e){const t=[];let i=0;const n=e.length;for(;i=55296&&r<=56319&&i>1,e+=hr(e/t);e>455;n+=rr)e=hr(e/35);return hr(n+36*e/(e+38))},Or=function(e){const t=[],i=e.length;let n=0,r=128,s=72,o=e.lastIndexOf("-");o<0&&(o=0);for(let l=0;l=128&&ur("not-basic"),t.push(e.charCodeAt(l));for(let l=o>0?o+1:0;l=i&&ur("invalid-input");const o=(a=e.charCodeAt(l++))>=48&&a<58?a-48+26:a>=65&&a<91?a-65:a>=97&&a<123?a-97:rr;o>=rr&&ur("invalid-input"),o>hr((nr-n)/t)&&ur("overflow"),n+=o*t;const h=r<=s?1:r>=s+26?26:r-s;if(ohr(nr/c)&&ur("overflow"),t*=c}const h=t.length+1;s=mr(n-o,h,0==o),hr(n/h)>nr-r&&ur("overflow"),r+=hr(n/h),n%=h,t.splice(n++,0,r)}var a;return String.fromCodePoint(...t)},gr=function(e){const t=[],i=(e=pr(e)).length;let n=128,r=0,s=72;for(const l of e)l<128&&t.push(cr(l));const o=t.length;let a=o;for(o&&t.push("-");a=n&&thr((nr-r)/l)&&ur("overflow"),r+=(i-n)*l,n=i;for(const h of e)if(hnr&&ur("overflow"),h===n){let e=r;for(let i=rr;;i+=rr){const n=i<=s?1:i>=s+26?26:i-s;if(e=0))try{t.hostname=vr(t.hostname)}catch(i){}return Lt(Xt(t))}function $r(e){const t=Ht(e,!0);if(t.hostname&&(!t.protocol||Sr.indexOf(t.protocol)>=0))try{t.hostname=br(t.hostname)}catch(i){}return Dt(Xt(t),Dt.defaultChars+"%")}function _r(e,t){if(!(this instanceof _r))return new _r(e,t);t||$i(e)||(t=e||{},e="default"),this.inline=new Fn,this.block=new Cn,this.core=new gn,this.renderer=new Hi,this.linkify=new ir,this.validateLink=wr,this.normalizeLink=Qr,this.normalizeLinkText=$r,this.utils=Ni,this.helpers=Pi({},Gi),this.options={},this.configure(e),t&&this.set(t)}_r.prototype.set=function(e){return Pi(this.options,e),this},_r.prototype.configure=function(e){const t=this;if($i(e)){const t=e;if(!(e=yr[t]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach((function(i){e.components[i].rules&&t[i].ruler.enableOnly(e.components[i].rules),e.components[i].rules2&&t[i].ruler2.enableOnly(e.components[i].rules2)})),this},_r.prototype.enable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){i=i.concat(this[t].ruler.enable(e,!0))}),this),i=i.concat(this.inline.ruler2.enable(e,!0));const n=e.filter((function(e){return i.indexOf(e)<0}));if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},_r.prototype.disable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){i=i.concat(this[t].ruler.disable(e,!0))}),this),i=i.concat(this.inline.ruler2.disable(e,!0));const n=e.filter((function(e){return i.indexOf(e)<0}));if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},_r.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},_r.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");const i=new this.core.State(e,this,t);return this.core.process(i),i.tokens},_r.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},_r.prototype.parseInline=function(e,t){const i=new this.core.State(e,this,t);return i.inlineMode=!0,this.core.process(i),i.tokens},_r.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Pr=new Set([!0,!1,"alt","title"]);function Cr(e,t){return(Array.isArray(e)?e:[]).filter((([e])=>e!==t))}function Tr(e,t){e&&e.attrs&&(e.attrs=Cr(e.attrs,t))}function Ar(e,t){if(!Pr.has(e))throw new TypeError(`figcaption must be one of: ${[...Pr]}.`);if("alt"===e)return t.content;const i=t.attrs.find((([e])=>"title"===e));return Array.isArray(i)&&i[1]?(Tr(t,"title"),i[1]):void 0}function Er(e,t){t=t||{},e.core.ruler.before("linkify","image_figures",(function(i){let n=1;for(let r=1,s=i.tokens.length;rt.match(e))).map((e=>Array.from(e)))}if(t.tabindex&&(i.tokens[r-1].attrPush(["tabindex",n]),n++),t.lazy&&(l.attrs.some((([e])=>"loading"===e))||l.attrs.push(["loading","lazy"])),t.async&&(l.attrs.some((([e])=>"decoding"===e))||l.attrs.push(["decoding","async"])),t.classes&&"string"==typeof t.classes){let e=!1;for(let i=0,n=l.attrs.length;i"src"===e));l.attrs.push(["data-src",e[1]]),Tr(l,"src")}}}))}const Mr=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Rr(e,t){const i=e.posMax,n=e.pos;if(126!==e.src.charCodeAt(n))return!1;if(t)return!1;if(n+2>=i)return!1;e.pos=n+1;let r=!1;for(;e.pos?@[\]^_`{|}~-])/g;function Lr(e,t){const i=e.posMax,n=e.pos;if(94!==e.src.charCodeAt(n))return!1;if(t)return!1;if(n+2>=i)return!1;e.pos=n+1;let r=!1;for(;e.pos{const i=e.split(","),n=i[0].match(/:(.*?);/);if(n){const e=n[1],r=atob(i[1]);let s=r.length;const o=new Uint8Array(s);for(;s--;)o[s]=r.charCodeAt(s);return new File([o],t,{type:e})}return null},Vr=(()=>{let e=0;return()=>++e})(),Ir="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,zr=new Set,jr="object"==typeof process&&process?process:{},Br=(e,t,i,n)=>{"function"==typeof jr.emitWarning&&jr.emitWarning(e,t,i,n)};let Fr=globalThis.AbortController,Yr=globalThis.AbortSignal;if(void 0===Fr){Yr=class{constructor(){K(this,"onabort"),K(this,"_onabort",[]),K(this,"reason"),K(this,"aborted",!1)}addEventListener(e,t){this._onabort.push(t)}},Fr=class{constructor(){K(this,"signal",new Yr),i()}abort(e){var t,i;if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);null==(i=(t=this.signal).onabort)||i.call(t,e)}}};let t="1"!==(null==(e=jr.env)?void 0:e.LRU_CACHE_IGNORE_AC_WARNING);const i=()=>{t&&(t=!1,Br("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",i))}}const Wr=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Nr=e=>Wr(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Gr:null:null;class Gr extends Array{constructor(e){super(e),this.fill(0)}}let Ur=(t=class{constructor(e,n){if(K(this,"heap"),K(this,"length"),!ee(t,i))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Nr(e);if(!n)return[];ie(t,i,!0);const r=new t(e,n);return ie(t,i,!1),r}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},i=new WeakMap,te(t,i,!1),t);const Hr=class e{constructor(t){te(this,T),te(this,s),te(this,o),te(this,a),te(this,l),te(this,h),te(this,c),te(this,u),K(this,"ttl"),K(this,"ttlResolution"),K(this,"ttlAutopurge"),K(this,"updateAgeOnGet"),K(this,"updateAgeOnHas"),K(this,"allowStale"),K(this,"noDisposeOnSet"),K(this,"noUpdateTTL"),K(this,"maxEntrySize"),K(this,"sizeCalculation"),K(this,"noDeleteOnFetchRejection"),K(this,"noDeleteOnStaleGet"),K(this,"allowStaleOnFetchAbort"),K(this,"allowStaleOnFetchRejection"),K(this,"ignoreFetchAbort"),te(this,d),te(this,p),te(this,f),te(this,m),te(this,O),te(this,g),te(this,v),te(this,b),te(this,y),te(this,k),te(this,x),te(this,w),te(this,S),te(this,Q),te(this,$),te(this,_),te(this,P),te(this,C),te(this,E,(()=>{})),te(this,M,(()=>{})),te(this,R,(()=>{})),te(this,D,(()=>!1)),te(this,L,(e=>{})),te(this,X,((e,t,i)=>{})),te(this,q,((e,t,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0})),K(this,n,"LRUCache");const{max:i=0,ttl:r,ttlResolution:V=1,ttlAutopurge:I,updateAgeOnGet:z,updateAgeOnHas:j,allowStale:B,dispose:F,onInsert:Y,disposeAfter:W,noDisposeOnSet:N,noUpdateTTL:G,maxSize:U=0,maxEntrySize:H=0,sizeCalculation:J,fetchMethod:re,memoMethod:se,noDeleteOnFetchRejection:oe,noDeleteOnStaleGet:ae,allowStaleOnFetchRejection:le,allowStaleOnFetchAbort:he,ignoreFetchAbort:ce}=t;if(0!==i&&!Wr(i))throw new TypeError("max option must be a nonnegative integer");const ue=i?Nr(i):Array;if(!ue)throw new Error("invalid max value: "+i);if(ie(this,s,i),ie(this,o,U),this.maxEntrySize=H||ee(this,o),this.sizeCalculation=J,this.sizeCalculation){if(!ee(this,o)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==se&&"function"!=typeof se)throw new TypeError("memoMethod must be a function if defined");if(ie(this,u,se),void 0!==re&&"function"!=typeof re)throw new TypeError("fetchMethod must be a function if specified");if(ie(this,c,re),ie(this,_,!!re),ie(this,f,new Map),ie(this,m,new Array(i).fill(void 0)),ie(this,O,new Array(i).fill(void 0)),ie(this,g,new ue(i)),ie(this,v,new ue(i)),ie(this,b,0),ie(this,y,0),ie(this,k,Ur.create(i)),ie(this,d,0),ie(this,p,0),"function"==typeof F&&ie(this,a,F),"function"==typeof Y&&ie(this,l,Y),"function"==typeof W?(ie(this,h,W),ie(this,x,[])):(ie(this,h,void 0),ie(this,x,void 0)),ie(this,$,!!ee(this,a)),ie(this,C,!!ee(this,l)),ie(this,P,!!ee(this,h)),this.noDisposeOnSet=!!N,this.noUpdateTTL=!!G,this.noDeleteOnFetchRejection=!!oe,this.allowStaleOnFetchRejection=!!le,this.allowStaleOnFetchAbort=!!he,this.ignoreFetchAbort=!!ce,0!==this.maxEntrySize){if(0!==ee(this,o)&&!Wr(ee(this,o)))throw new TypeError("maxSize must be a positive integer if specified");if(!Wr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ne(this,T,Z).call(this)}if(this.allowStale=!!B,this.noDeleteOnStaleGet=!!ae,this.updateAgeOnGet=!!z,this.updateAgeOnHas=!!j,this.ttlResolution=Wr(V)||0===V?V:1,this.ttlAutopurge=!!I,this.ttl=r||0,this.ttl){if(!Wr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ne(this,T,A).call(this)}if(0===ee(this,s)&&0===this.ttl&&0===ee(this,o))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!ee(this,s)&&!ee(this,o)){const t="LRU_CACHE_UNBOUNDED";if((e=>!zr.has(e))(t)){zr.add(t);Br("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e)}}}static unsafeExposeInternals(e){return{starts:ee(e,S),ttls:ee(e,Q),sizes:ee(e,w),keyMap:ee(e,f),keyList:ee(e,m),valList:ee(e,O),next:ee(e,g),prev:ee(e,v),get head(){return ee(e,b)},get tail(){return ee(e,y)},free:ee(e,k),isBackgroundFetch:t=>{var i;return ne(i=e,T,F).call(i,t)},backgroundFetch:(t,i,n,r)=>{var s;return ne(s=e,T,B).call(s,t,i,n,r)},moveToTail:t=>{var i;return ne(i=e,T,W).call(i,t)},indexes:t=>{var i;return ne(i=e,T,V).call(i,t)},rindexes:t=>{var i;return ne(i=e,T,I).call(i,t)},isStale:t=>{var i;return ee(i=e,D).call(i,t)}}}get max(){return ee(this,s)}get maxSize(){return ee(this,o)}get calculatedSize(){return ee(this,p)}get size(){return ee(this,d)}get fetchMethod(){return ee(this,c)}get memoMethod(){return ee(this,u)}get dispose(){return ee(this,a)}get onInsert(){return ee(this,l)}get disposeAfter(){return ee(this,h)}getRemainingTTL(e){return ee(this,f).has(e)?1/0:0}*entries(){for(const e of ne(this,T,V).call(this))void 0===ee(this,O)[e]||void 0===ee(this,m)[e]||ne(this,T,F).call(this,ee(this,O)[e])||(yield[ee(this,m)[e],ee(this,O)[e]])}*rentries(){for(const e of ne(this,T,I).call(this))void 0===ee(this,O)[e]||void 0===ee(this,m)[e]||ne(this,T,F).call(this,ee(this,O)[e])||(yield[ee(this,m)[e],ee(this,O)[e]])}*keys(){for(const e of ne(this,T,V).call(this)){const t=ee(this,m)[e];void 0===t||ne(this,T,F).call(this,ee(this,O)[e])||(yield t)}}*rkeys(){for(const e of ne(this,T,I).call(this)){const t=ee(this,m)[e];void 0===t||ne(this,T,F).call(this,ee(this,O)[e])||(yield t)}}*values(){for(const e of ne(this,T,V).call(this)){void 0===ee(this,O)[e]||ne(this,T,F).call(this,ee(this,O)[e])||(yield ee(this,O)[e])}}*rvalues(){for(const e of ne(this,T,I).call(this)){void 0===ee(this,O)[e]||ne(this,T,F).call(this,ee(this,O)[e])||(yield ee(this,O)[e])}}[(r=Symbol.iterator,n=Symbol.toStringTag,r)](){return this.entries()}find(e,t={}){for(const i of ne(this,T,V).call(this)){const n=ee(this,O)[i],r=ne(this,T,F).call(this,n)?n.__staleWhileFetching:n;if(void 0!==r&&e(r,ee(this,m)[i],this))return this.get(ee(this,m)[i],t)}}forEach(e,t=this){for(const i of ne(this,T,V).call(this)){const n=ee(this,O)[i],r=ne(this,T,F).call(this,n)?n.__staleWhileFetching:n;void 0!==r&&e.call(t,r,ee(this,m)[i],this)}}rforEach(e,t=this){for(const i of ne(this,T,I).call(this)){const n=ee(this,O)[i],r=ne(this,T,F).call(this,n)?n.__staleWhileFetching:n;void 0!==r&&e.call(t,r,ee(this,m)[i],this)}}purgeStale(){let e=!1;for(const t of ne(this,T,I).call(this,{allowStale:!0}))ee(this,D).call(this,t)&&(ne(this,T,N).call(this,ee(this,m)[t],"expire"),e=!0);return e}info(e){const t=ee(this,f).get(e);if(void 0===t)return;const i=ee(this,O)[t],n=ne(this,T,F).call(this,i)?i.__staleWhileFetching:i;if(void 0===n)return;const r={value:n};if(ee(this,Q)&&ee(this,S)){const e=ee(this,Q)[t],i=ee(this,S)[t];if(e&&i){const t=e-(Ir.now()-i);r.ttl=t,r.start=Date.now()}}return ee(this,w)&&(r.size=ee(this,w)[t]),r}dump(){const e=[];for(const t of ne(this,T,V).call(this,{allowStale:!0})){const i=ee(this,m)[t],n=ee(this,O)[t],r=ne(this,T,F).call(this,n)?n.__staleWhileFetching:n;if(void 0===r||void 0===i)continue;const s={value:r};if(ee(this,Q)&&ee(this,S)){s.ttl=ee(this,Q)[t];const e=Ir.now()-ee(this,S)[t];s.start=Math.floor(Date.now()-e)}ee(this,w)&&(s.size=ee(this,w)[t]),e.unshift([i,s])}return e}load(e){this.clear();for(const[t,i]of e){if(i.start){const e=Date.now()-i.start;i.start=Ir.now()-e}this.set(t,i.value,i)}}set(e,t,i={}){var n,r,o,c,u,p,b;if(void 0===t)return this.delete(e),this;const{ttl:w=this.ttl,start:S,noDisposeOnSet:E=this.noDisposeOnSet,sizeCalculation:D=this.sizeCalculation,status:Z}=i;let{noUpdateTTL:V=this.noUpdateTTL}=i;const I=ee(this,q).call(this,e,t,i.size||0,D);if(this.maxEntrySize&&I>this.maxEntrySize)return Z&&(Z.set="miss",Z.maxEntrySizeExceeded=!0),ne(this,T,N).call(this,e,"set"),this;let z=0===ee(this,d)?void 0:ee(this,f).get(e);if(void 0===z)z=0===ee(this,d)?ee(this,y):0!==ee(this,k).length?ee(this,k).pop():ee(this,d)===ee(this,s)?ne(this,T,j).call(this,!1):ee(this,d),ee(this,m)[z]=e,ee(this,O)[z]=t,ee(this,f).set(e,z),ee(this,g)[ee(this,y)]=z,ee(this,v)[z]=ee(this,y),ie(this,y,z),re(this,d)._++,ee(this,X).call(this,z,I,Z),Z&&(Z.set="add"),V=!1,ee(this,C)&&(null==(n=ee(this,l))||n.call(this,t,e,"add"));else{ne(this,T,W).call(this,z);const i=ee(this,O)[z];if(t!==i){if(ee(this,_)&&ne(this,T,F).call(this,i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=i;void 0===t||E||(ee(this,$)&&(null==(r=ee(this,a))||r.call(this,t,e,"set")),ee(this,P)&&(null==(o=ee(this,x))||o.push([t,e,"set"])))}else E||(ee(this,$)&&(null==(c=ee(this,a))||c.call(this,i,e,"set")),ee(this,P)&&(null==(u=ee(this,x))||u.push([i,e,"set"])));if(ee(this,L).call(this,z),ee(this,X).call(this,z,I,Z),ee(this,O)[z]=t,Z){Z.set="replace";const e=i&&ne(this,T,F).call(this,i)?i.__staleWhileFetching:i;void 0!==e&&(Z.oldValue=e)}}else Z&&(Z.set="update");ee(this,C)&&(null==(p=this.onInsert)||p.call(this,t,e,t===i?"update":"replace"))}if(0===w||ee(this,Q)||ne(this,T,A).call(this),ee(this,Q)&&(V||ee(this,R).call(this,z,w,S),Z&&ee(this,M).call(this,Z,z)),!E&&ee(this,P)&&ee(this,x)){const e=ee(this,x);let t;for(;t=null==e?void 0:e.shift();)null==(b=ee(this,h))||b.call(this,...t)}return this}pop(){var e;try{for(;ee(this,d);){const e=ee(this,O)[ee(this,b)];if(ne(this,T,j).call(this,!0),ne(this,T,F).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(ee(this,P)&&ee(this,x)){const t=ee(this,x);let i;for(;i=null==t?void 0:t.shift();)null==(e=ee(this,h))||e.call(this,...i)}}}has(e,t={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=t,r=ee(this,f).get(e);if(void 0!==r){const e=ee(this,O)[r];if(ne(this,T,F).call(this,e)&&void 0===e.__staleWhileFetching)return!1;if(!ee(this,D).call(this,r))return i&&ee(this,E).call(this,r),n&&(n.has="hit",ee(this,M).call(this,n,r)),!0;n&&(n.has="stale",ee(this,M).call(this,n,r))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:i=this.allowStale}=t,n=ee(this,f).get(e);if(void 0===n||!i&&ee(this,D).call(this,n))return;const r=ee(this,O)[n];return ne(this,T,F).call(this,r)?r.__staleWhileFetching:r}async fetch(e,t={}){const{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:v,signal:b}=t;if(!ee(this,_))return v&&(v.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:v});const y={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:v,signal:b};let k=ee(this,f).get(e);if(void 0===k){v&&(v.fetch="miss");const t=ne(this,T,B).call(this,e,k,y,m);return t.__returned=t}{const t=ee(this,O)[k];if(ne(this,T,F).call(this,t)){const e=i&&void 0!==t.__staleWhileFetching;return v&&(v.fetch="inflight",e&&(v.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const r=ee(this,D).call(this,k);if(!g&&!r)return v&&(v.fetch="hit"),ne(this,T,W).call(this,k),n&&ee(this,E).call(this,k),v&&ee(this,M).call(this,v,k),t;const s=ne(this,T,B).call(this,e,k,y,m),o=void 0!==s.__staleWhileFetching&&i;return v&&(v.fetch=r?"stale":"refresh",o&&r&&(v.returnedStale=!0)),o?s.__staleWhileFetching:s.__returned=s}}async forceFetch(e,t={}){const i=await this.fetch(e,t);if(void 0===i)throw new Error("fetch() returned undefined");return i}memo(e,t={}){const i=ee(this,u);if(!i)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:r,...s}=t,o=this.get(e,s);if(!r&&void 0!==o)return o;const a=i(e,o,{options:s,context:n});return this.set(e,a,s),a}get(e,t={}){const{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:s}=t,o=ee(this,f).get(e);if(void 0!==o){const t=ee(this,O)[o],a=ne(this,T,F).call(this,t);return s&&ee(this,M).call(this,s,o),ee(this,D).call(this,o)?(s&&(s.get="stale"),a?(s&&i&&void 0!==t.__staleWhileFetching&&(s.returnedStale=!0),i?t.__staleWhileFetching:void 0):(r||ne(this,T,N).call(this,e,"expire"),s&&i&&(s.returnedStale=!0),i?t:void 0)):(s&&(s.get="hit"),a?t.__staleWhileFetching:(ne(this,T,W).call(this,o),n&&ee(this,E).call(this,o),t))}s&&(s.get="miss")}delete(e){return ne(this,T,N).call(this,e,"delete")}clear(){return ne(this,T,G).call(this,"delete")}};s=new WeakMap,o=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap,f=new WeakMap,m=new WeakMap,O=new WeakMap,g=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,k=new WeakMap,x=new WeakMap,w=new WeakMap,S=new WeakMap,Q=new WeakMap,$=new WeakMap,_=new WeakMap,P=new WeakMap,C=new WeakMap,T=new WeakSet,A=function(){const e=new Gr(ee(this,s)),t=new Gr(ee(this,s));ie(this,Q,e),ie(this,S,t),ie(this,R,((i,n,r=Ir.now())=>{if(t[i]=0!==n?r:0,e[i]=n,0!==n&&this.ttlAutopurge){const e=setTimeout((()=>{ee(this,D).call(this,i)&&ne(this,T,N).call(this,ee(this,m)[i],"expire")}),n+1);e.unref&&e.unref()}})),ie(this,E,(i=>{t[i]=0!==e[i]?Ir.now():0})),ie(this,M,((r,s)=>{if(e[s]){const o=e[s],a=t[s];if(!o||!a)return;r.ttl=o,r.start=a,r.now=i||n();const l=r.now-a;r.remainingTTL=o-l}}));let i=0;const n=()=>{const e=Ir.now();if(this.ttlResolution>0){i=e;const t=setTimeout((()=>i=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=r=>{const s=ee(this,f).get(r);if(void 0===s)return 0;const o=e[s],a=t[s];if(!o||!a)return 1/0;return o-((i||n())-a)},ie(this,D,(r=>{const s=t[r],o=e[r];return!!o&&!!s&&(i||n())-s>o}))},E=new WeakMap,M=new WeakMap,R=new WeakMap,D=new WeakMap,Z=function(){const e=new Gr(ee(this,s));ie(this,p,0),ie(this,w,e),ie(this,L,(t=>{ie(this,p,ee(this,p)-e[t]),e[t]=0})),ie(this,q,((e,t,i,n)=>{if(ne(this,T,F).call(this,t))return 0;if(!Wr(i)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(i=n(t,e),!Wr(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i})),ie(this,X,((t,i,n)=>{if(e[t]=i,ee(this,o)){const i=ee(this,o)-e[t];for(;ee(this,p)>i;)ne(this,T,j).call(this,!0)}ie(this,p,ee(this,p)+e[t]),n&&(n.entrySize=i,n.totalCalculatedSize=ee(this,p))}))},L=new WeakMap,X=new WeakMap,q=new WeakMap,V=function*({allowStale:e=this.allowStale}={}){if(ee(this,d))for(let t=ee(this,y);ne(this,T,z).call(this,t)&&(!e&&ee(this,D).call(this,t)||(yield t),t!==ee(this,b));)t=ee(this,v)[t]},I=function*({allowStale:e=this.allowStale}={}){if(ee(this,d))for(let t=ee(this,b);ne(this,T,z).call(this,t)&&(!e&&ee(this,D).call(this,t)||(yield t),t!==ee(this,y));)t=ee(this,g)[t]},z=function(e){return void 0!==e&&ee(this,f).get(ee(this,m)[e])===e},j=function(e){var t,i;const n=ee(this,b),r=ee(this,m)[n],s=ee(this,O)[n];return ee(this,_)&&ne(this,T,F).call(this,s)?s.__abortController.abort(new Error("evicted")):(ee(this,$)||ee(this,P))&&(ee(this,$)&&(null==(t=ee(this,a))||t.call(this,s,r,"evict")),ee(this,P)&&(null==(i=ee(this,x))||i.push([s,r,"evict"]))),ee(this,L).call(this,n),e&&(ee(this,m)[n]=void 0,ee(this,O)[n]=void 0,ee(this,k).push(n)),1===ee(this,d)?(ie(this,b,ie(this,y,0)),ee(this,k).length=0):ie(this,b,ee(this,g)[n]),ee(this,f).delete(r),re(this,d)._--,n},B=function(e,t,i,n){const r=void 0===t?void 0:ee(this,O)[t];if(ne(this,T,F).call(this,r))return r;const s=new Fr,{signal:o}=i;null==o||o.addEventListener("abort",(()=>s.abort(o.reason)),{signal:s.signal});const a={signal:s.signal,options:i,context:n},l=(n,r=!1)=>{const{aborted:o}=s.signal,l=i.ignoreFetchAbort&&void 0!==n;if(i.status&&(o&&!r?(i.status.fetchAborted=!0,i.status.fetchError=s.signal.reason,l&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),o&&!l&&!r)return h(s.signal.reason);const c=u;return ee(this,O)[t]===u&&(void 0===n?c.__staleWhileFetching?ee(this,O)[t]=c.__staleWhileFetching:ne(this,T,N).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,n,a.options))),n},h=n=>{const{aborted:r}=s.signal,o=r&&i.allowStaleOnFetchAbort,a=o||i.allowStaleOnFetchRejection,l=a||i.noDeleteOnFetchRejection,h=u;if(ee(this,O)[t]===u){!l||void 0===h.__staleWhileFetching?ne(this,T,N).call(this,e,"fetch"):o||(ee(this,O)[t]=h.__staleWhileFetching)}if(a)return i.status&&void 0!==h.__staleWhileFetching&&(i.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw n};i.status&&(i.status.fetchDispatched=!0);const u=new Promise(((t,n)=>{var o;const h=null==(o=ee(this,c))?void 0:o.call(this,e,r,a);h&&h instanceof Promise&&h.then((e=>t(void 0===e?void 0:e)),n),s.signal.addEventListener("abort",(()=>{i.ignoreFetchAbort&&!i.allowStaleOnFetchAbort||(t(void 0),i.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))}))})).then(l,(e=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=e),h(e)))),d=Object.assign(u,{__abortController:s,__staleWhileFetching:r,__returned:void 0});return void 0===t?(this.set(e,d,{...a.options,status:void 0}),t=ee(this,f).get(e)):ee(this,O)[t]=d,d},F=function(e){if(!ee(this,_))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Fr},Y=function(e,t){ee(this,v)[t]=e,ee(this,g)[e]=t},W=function(e){e!==ee(this,y)&&(e===ee(this,b)?ie(this,b,ee(this,g)[e]):ne(this,T,Y).call(this,ee(this,v)[e],ee(this,g)[e]),ne(this,T,Y).call(this,ee(this,y),e),ie(this,y,e))},N=function(e,t){var i,n,r,s;let o=!1;if(0!==ee(this,d)){const r=ee(this,f).get(e);if(void 0!==r)if(o=!0,1===ee(this,d))ne(this,T,G).call(this,t);else{ee(this,L).call(this,r);const s=ee(this,O)[r];if(ne(this,T,F).call(this,s)?s.__abortController.abort(new Error("deleted")):(ee(this,$)||ee(this,P))&&(ee(this,$)&&(null==(i=ee(this,a))||i.call(this,s,e,t)),ee(this,P)&&(null==(n=ee(this,x))||n.push([s,e,t]))),ee(this,f).delete(e),ee(this,m)[r]=void 0,ee(this,O)[r]=void 0,r===ee(this,y))ie(this,y,ee(this,v)[r]);else if(r===ee(this,b))ie(this,b,ee(this,g)[r]);else{const e=ee(this,v)[r];ee(this,g)[e]=ee(this,g)[r];const t=ee(this,g)[r];ee(this,v)[t]=ee(this,v)[r]}re(this,d)._--,ee(this,k).push(r)}}if(ee(this,P)&&(null==(r=ee(this,x))?void 0:r.length)){const e=ee(this,x);let t;for(;t=null==e?void 0:e.shift();)null==(s=ee(this,h))||s.call(this,...t)}return o},G=function(e){var t,i,n;for(const r of ne(this,T,I).call(this,{allowStale:!0})){const n=ee(this,O)[r];if(ne(this,T,F).call(this,n))n.__abortController.abort(new Error("deleted"));else{const s=ee(this,m)[r];ee(this,$)&&(null==(t=ee(this,a))||t.call(this,n,s,e)),ee(this,P)&&(null==(i=ee(this,x))||i.push([n,s,e]))}}if(ee(this,f).clear(),ee(this,O).fill(void 0),ee(this,m).fill(void 0),ee(this,Q)&&ee(this,S)&&(ee(this,Q).fill(0),ee(this,S).fill(0)),ee(this,w)&&ee(this,w).fill(0),ie(this,b,0),ie(this,y,0),ee(this,k).length=0,ie(this,p,0),ie(this,d,0),ee(this,P)&&ee(this,x)){const e=ee(this,x);let t;for(;t=null==e?void 0:e.shift();)null==(n=ee(this,h))||n.call(this,...t)}};const Kr={hljs:`${Me}-hljs`,hlcss:`${Me}-hlCss`,prettier:`${Me}-prettier`,prettierMD:`${Me}-prettierMD`,cropperjs:`${Me}-cropper`,croppercss:`${Me}-cropperCss`,screenfull:`${Me}-screenfull`,mermaidM:`${Me}-mermaid-m`,mermaid:`${Me}-mermaid`,katexjs:`${Me}-katex`,katexcss:`${Me}-katexCss`},Jr=e=>{const t=pe("highlight"),i=ye(Ve.editorExtensions.highlight.instance);return he((()=>{e.noHighlight||i.value||(kt("link",{...t.value.css,rel:"stylesheet",id:Kr.hlcss}),kt("script",{...t.value.js,id:Kr.hljs,onload(){i.value=window.hljs}},"hljs"))})),le((()=>t.value.css),(()=>{e.noHighlight||Ve.editorExtensions.highlight.instance||((e,t)=>{const i=document.getElementById(t.id);null==i||i.remove(),kt(e,t)})("link",{...t.value.css,rel:"stylesheet",id:Kr.hlcss})})),i},es=new Hr({max:1e3,ttl:6e5}),ts=(e,t)=>{const i=e.renderer.rules.fence.bind(e.renderer.rules);e.renderer.rules.fence=(n,r,s,o,a)=>{const l=n[r],h=l.content.trim();if("mermaid"===l.info){let i;n[r].map&&0===n[r].level&&(i=n[r].map[0],n[r].attrSet("data-line",String(i)));const s=es.get(h);return s?`

${s}

`:`
${e.utils.escapeHtml(h)}
`}return i(n,r,s,o,a)}},is=(e,t)=>{const i=e.attrs?e.attrs.slice():[];return t.forEach((t=>{const n=e.attrIndex(t[0]);n<0?i.push(t):(i[n]=i[n].slice(),i[n][1]+=` ${t[1]}`)})),i},ns={block:[{open:"$$",close:"$$"},{open:"\\[",close:"\\]"}],inline:[{open:"$$",close:"$$"},{open:"$",close:"$"},{open:"\\[",close:"\\]"},{open:"\\(",close:"\\)"}]},rs=(e,{katexRef:t,inlineDelimiters:i,blockDelimiters:n})=>{var r;e.inline.ruler.before("escape","math_inline",(r={delimiters:i||ns.inline},(e,t)=>{const i=r.delimiters;let n,s,o;for(const r of i)if(e.src.startsWith(r.open,e.pos)){const i=e.pos+r.open.length;for(n=i;-1!==(n=e.src.indexOf(r.close,n));){for(o=n-1;"\\"===e.src[o];)o-=1;if((n-o)%2==1)break;n+=r.close.length}if(-1===n)return t||(e.pending+=r.open),e.pos=i,!0;if(n-i==0)return t||(e.pending+=r.open+r.close),e.pos=i+r.close.length,!0;if(!t){const t=e.src.slice(i,n);s=e.push("math_inline","math",0),s.markup=r.open,s.content=t}return e.pos=n+r.close.length,!0}return!1})),e.block.ruler.after("blockquote","math_block",(e=>(t,i,n,r)=>{const s=e.delimiters;let o,a,l,h,c=!1,u=t.bMarks[i]+t.tShift[i],d=t.eMarks[i];for(const e of s)if(t.src.slice(u,u+e.open.length)===e.open&&t.src.slice(d-e.close.length,d)===e.close){if(u+=e.open.length,o=t.src.slice(u,d),r)return!0;for(o.trim().slice(-e.close.length)===e.close&&(o=o.trim().slice(0,-e.close.length),c=!0),l=i;!(c||(l++,l>=n)||(u=t.bMarks[l]+t.tShift[l],d=t.eMarks[l],u{const o=e[i],a={attrs:is(o,[["class",`${Me}-katex-inline`]])};if(t.value){const e=t.value.renderToString(o.content,Ve.katexConfig({throwOnError:!1}));return`${e}`}return`${o.content}`},e.renderer.rules.math_block=(e,i,n,r,s)=>{const o=e[i],a={attrs:is(o,[["class",`${Me}-katex-block`]])};if(t.value){const e=t.value.renderToString(o.content,Ve.katexConfig({throwOnError:!1,displayMode:!0}));return`

${e}

`}return`

${o.content}

`}},ss=(e,t)=>{const i=(t=t||{}).marker||"!",n=i.charCodeAt(0),r=i.length;let s="",o="";const a=(e,t,i,n,r)=>{const s=e[t];return"admonition_open"===s.type?e[t].attrPush(["class",`${Me}-admonition ${Me}-admonition-${s.info}`]):"admonition_title_open"===s.type&&e[t].attrPush(["class",`${Me}-admonition-title`]),r.renderToken(e,t,i)};e.block.ruler.before("code","admonition",((e,t,a,l)=>{let h,c,u,d=!1,p=e.bMarks[t]+e.tShift[t],f=e.eMarks[t];if(n!==e.src.charCodeAt(p))return!1;for(h=p+1;h<=f&&i[(h-p)%r]===e.src[h];h++);const m=Math.floor((h-p)/r);if(3!==m)return!1;h-=(h-p)%r;const O=e.src.slice(p,h);if((e=>{const t=e.trim().split(" ",2);o="",s=t[0],t.length>1&&(o=e.substring(s.length+2))})(e.src.slice(h,f)),l)return!0;for(c=t;(c++,!(c>=a))&&(p=e.bMarks[c]+e.tShift[c],f=e.eMarks[c],!(p=4)){for(h=p+1;h<=f&&i[(h-p)%r]===e.src[h];h++);if(!(Math.floor((h-p)/r){e.renderer.rules.heading_open=(i,n)=>{var r;const s=i[n],o=(null==(r=i[n+1].children)?void 0:r.reduce(((e,t)=>e+(["text","code_inline","math_inline"].includes(t.type)&&t.content||"")),""))||"",a=s.markup.length;return t.headsRef.value.push({text:o,level:a,line:s.map[0]}),s.map&&0===s.level&&s.attrSet("id",t.mdHeadingId(o,a,t.headsRef.value.length)),e.renderer.renderToken(i,n,t)},e.renderer.rules.heading_close=(e,t,i,n,r)=>r.renderToken(e,t,i)},as=(e,t)=>{const i=e.renderer.rules.fence,n=e.utils.unescapeAll,r=/\[(\w*)(?::([\w ]*))?\]/,s=/::(open|close)/,o=e=>e.info?n(e.info).trim():"",a=e=>{const t=o(e),[i=null,n=""]=(r.exec(t)||[]).slice(1);return[i,n]},l=e=>{const t=o(e);return t?t.split(/(\s+)/g)[0]:""},h=e=>{const i=e.info.match(s)||[];return{open:"open"===i[1]||"close"!==i[1]&&t.codeFoldable&&e.content.trim().split("\n").length{var d;if(e[n].hidden)return"";const p=null==(d=t.usedLanguageTextRef.value)?void 0:d.copyCode.text,f=t.customIconRef.value.copy||p,m=!!t.customIconRef.value.copy,O=`${bt("collapse-tips",t.customIconRef.value)}`,[g]=a(e[n]);if(null===g){const{open:r,tagContainer:a,tagHeader:l}=h(e[n]),d=[["class",`${Me}-code`]];r&&d.push(["open",""]);const g={attrs:is(e[n],d)};e[n].info=e[n].info.replace(s,"");const v=i(e,n,o,c,u);return`\n <${a} ${u.renderAttrs(g)}>\n <${l} class="${Me}-code-head">\n
\n
\n ${e[n].info.trim()}\n ${f}\n ${t.extraTools||""}\n ${"details"===a?O:""}\n
\n \n ${v}\n \n `}let v,b,y,k,x="",w="",S="";const{open:Q,tagContainer:$,tagHeader:_}=h(e[n]),P=[["class",`${Me}-code`]];Q&&P.push(["open",""]);const C={attrs:is(e[n],P)};for(let h=n;h0?"":"checked",x+=`\n
  • \n \n \n ${y||l(v)}\n \n
  • `,w+=`\n
    \n \n ${i(e,h,o,c,u)}\n
    `,S+=`\n \n ${l(v)}`}return`\n <${$} ${u.renderAttrs(C)}>\n <${_} class="${Me}-code-head">\n
    \n
      ${x}
    \n
    \n
    \n ${S}\n ${f}\n ${t.extraTools||""}\n ${"details"===$?O:""}\n
    \n \n ${w}\n \n `};e.renderer.rules.fence=c,e.renderer.rules.code_block=c},ls=(e,t,i)=>{const n=e.attrIndex(t),r=[t,i];n<0?e.attrPush(r):(e.attrs=e.attrs||[],e.attrs[n]=r)},hs=(e,t)=>"inline"===e[t].type&&(e=>"paragraph_open"===e.type)(e[t-1])&&(e=>"list_item_open"===e.type)(e[t-2])&&(e=>0===e.content.indexOf("[ ] ")||0===e.content.indexOf("[x] ")||0===e.content.indexOf("[X] "))(e[t]),cs=(e,t)=>{const i=e[t].level-1;for(let n=t-1;n>=0;n--)if(e[n].level===i)return n;return-1},us=(e,t,i)=>{if(e.children=e.children||[],e.children.unshift(((e,t,i)=>{const n=new t("html_inline","",0),r=i.enabled?" ":' disabled="" ';return 0===e.content.indexOf("[ ] ")?n.content='':0!==e.content.indexOf("[x] ")&&0!==e.content.indexOf("[X] ")||(n.content=''),n})(e,t,i)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),i.label)if(i.labelAfter){e.children.pop();const i="task-item-"+Math.ceil(1e7*Math.random()-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+i+'">',e.children.push(((e,t,i)=>{const n=new i("html_inline","",0);return n.content='",n.attrs=[{for:t}],n})(e.content,i,t))}else e.children.unshift((e=>{const t=new e("html_inline","",0);return t.content="",t})(t))},ds=(e,t={})=>{e.core.ruler.after("inline","github-task-lists",(e=>{const i=e.tokens;for(let n=2;n{const{editorConfig:i,markdownItPlugins:n,editorExtensions:r}=Ve,s=pe("editorId"),o=pe("language"),a=pe("usedLanguageText"),l=pe("showCodeRowNumber"),h=pe("theme"),c=pe("customIcon"),u=pe("rootRef"),d=ae([]);let p=()=>{};const f=Jr(e),m=(e=>{const t=ye(Ve.editorExtensions.katex.instance);return he((()=>{if(e.noKatex||t.value)return;const{editorExtensions:i}=Ve;kt("script",{src:i.katex.js,id:Kr.katexjs,onload(){t.value=window.katex}},"katex"),kt("link",{rel:"stylesheet",href:i.katex.css,id:Kr.katexcss})})),t})(e),{reRenderRef:O,replaceMermaid:g}=(e=>{const t=pe("editorId"),i=pe("theme"),n=pe("rootRef"),{editorExtensions:r,editorExtensionsAttrs:s,mermaidConfig:o}=Ve;let a=r.mermaid.instance;const l=ye(-1),h=()=>{!e.noMermaid&&a&&(a.initialize(o({startOnLoad:!1,theme:"dark"===i.value?"dark":"default"})),l.value=l.value+1)};return le((()=>i.value),(()=>{es.clear(),h()})),he((()=>{var t,i;if(e.noMermaid||a)return;const n=r.mermaid.js;/\.mjs/.test(n)?(kt("link",{...null==(t=s.mermaid)?void 0:t.js,rel:"modulepreload",href:n,id:Kr.mermaidM}),import(n).then((e=>{a=e.default,h()}))):kt("script",{...null==(i=s.mermaid)?void 0:i.js,src:n,id:Kr.mermaid,onload(){a=window.mermaid,h()}},"mermaid")})),{reRenderRef:l,replaceMermaid:async()=>{if(!e.noMermaid&&a){const i=n.value.querySelectorAll(`div.${Me}-mermaid`),r=document.createElement("div"),s=document.body.offsetWidth>1366?document.body.offsetWidth:1366,o=document.body.offsetHeight>768?document.body.offsetHeight:768;r.style.width=s+"px",r.style.height=o+"px",r.style.position="fixed",r.style.zIndex="-10000",r.style.top="-10000";let l=i.length;l>0&&document.body.appendChild(r),await Promise.allSettled(Array.from(i).map((i=>(async i=>{var n;const s=i.innerText;let o=es.get(s);if(!o){const c=Te();let u={svg:""};try{u=await a.render(c,s,r),o=await e.sanitizeMermaid(u.svg);const t=document.createElement("p");t.className=`${Me}-mermaid`,t.setAttribute("data-processed",""),t.innerHTML=o,null==(n=t.children[0])||n.removeAttribute("height"),es.set(s,t.innerHTML),void 0!==i.dataset.line&&(t.dataset.line=i.dataset.line),i.replaceWith(t)}catch(h){Ne.emit(t,st,{name:"mermaid",message:h.message,error:h})}0==--l&&r.remove()}})(i))))}}}})(e),v=_r({html:!0,breaks:!0,linkify:!0}),b=[{type:"image",plugin:Er,options:{figcaption:!0,classes:"md-zoom"}},{type:"admonition",plugin:ss,options:{}},{type:"taskList",plugin:ds,options:{}},{type:"heading",plugin:os,options:{mdHeadingId:e.mdHeadingId,headsRef:d}},{type:"code",plugin:as,options:{editorId:s,usedLanguageTextRef:a,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold,customIconRef:c}},{type:"sub",plugin:Dr,options:{}},{type:"sup",plugin:Xr,options:{}}];e.noKatex||b.push({type:"katex",plugin:rs,options:{katexRef:m}}),e.noMermaid||b.push({type:"mermaid",plugin:ts,options:{themeRef:h}}),n(b,{editorId:s}).forEach((e=>{v.use(e.plugin,e.options)}));const y=v.options.highlight;v.set({highlight:(t,i,n)=>{if(y){const e=y(t,i,n);if(e)return e}let r;if(!e.noHighlight&&f.value){r=f.value.getLanguage(i)?f.value.highlight(t,{language:i,ignoreIllegals:!0}).value:f.value.highlightAuto(t).value}else r=v.utils.escapeHtml(t);const s=l?((e,t)=>{if(!e)return e;const i=t.split("\n"),n=['"),`${e}${n.join("")}`})(r.replace(/^\n+|\n+$/g,""),t.replace(/^\n+|\n+$/g,"")):`${r.replace(/^\n+|\n+$/g,"")}`;return`
    ${s}
    `}}),(e=>{e.core.ruler.push("init-line-number",(e=>(e.tokens.forEach((e=>{e.map&&(e.attrs||(e.attrs=[]),e.attrs.push(["data-line",e.map[0].toString()]))})),!0)))})(v);const k=ae(`_article-key_${Te()}`),x=ae(e.sanitize(v.render(e.modelValue))),w=()=>{Ne.emit(s,rt,x.value),e.onHtmlChanged(x.value),e.onGetCatalog(d.value),Ne.emit(s,ut,d.value),ke((()=>{g().then((()=>{var e,t;(null==(e=r.mermaid)?void 0:e.enableZoom)&&(p(),p=wt(null==(t=u.value)?void 0:t.querySelectorAll(`#${s} p.${Me}-mermaid`),{customIcon:c.value}))}))}))},S=()=>{d.value=[],x.value=e.sanitize(v.render(e.modelValue)),w()},Q=Oe((()=>(e.noKatex||m.value)&&(e.noHighlight||f.value)));let $=-1;return le([be(e,"modelValue"),Q,O,o],(()=>{$=window.setTimeout((()=>{S()}),t?0:i.renderDelay)})),le((()=>e.setting.preview),(()=>{e.setting.preview&&ke((()=>{g().then((()=>{var e,t;(null==(e=r.mermaid)?void 0:e.enableZoom)&&(p(),p=wt(null==(t=u.value)?void 0:t.querySelectorAll(`#${s} p.${Me}-mermaid`),{customIcon:c.value}))})),Ne.emit(s,ut,d.value)}))})),he(w),he((()=>{Ne.on(s,{name:dt,callback(){Ne.emit(s,ut,d.value)}}),Ne.on(s,{name:pt,callback:()=>{k.value=`_article-key_${Te()}`,S()}})})),ce((()=>{p(),clearTimeout($)})),{html:x,key:k}},fs={checked:{regexp:/- \[x\]/,value:"- [ ]"},unChecked:{regexp:/- \[\s\]/,value:"- [x]"}},ms={modelValue:{type:String,default:""},onChange:{type:Function,default:()=>{}},setting:{type:Object,default:()=>({preview:!0})},onHtmlChanged:{type:Function,default:()=>{}},onGetCatalog:{type:Function,default:()=>{}},mdHeadingId:{type:Function,default:()=>""},noMermaid:{type:Boolean,default:!1},sanitize:{type:Function,default:e=>e},noKatex:{type:Boolean,default:!1},formatCopiedText:{type:Function,default:e=>e},noHighlight:{type:Boolean,default:!1},previewOnly:{type:Boolean,default:!1},noImgZoomIn:{type:Boolean},sanitizeMermaid:{type:Function},codeFoldable:{type:Boolean},autoFoldThreshold:{type:Number},onRemount:{type:Function}},Os={...ms,updateModelValue:{type:Function,default:()=>{}},placeholder:{type:String,default:""},scrollAuto:{type:Boolean},autofocus:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},maxlength:{type:Number},autoDetectCode:{type:Boolean},onBlur:{type:Function,default:()=>{}},onFocus:{type:Function,default:()=>{}},noPrettier:{type:Boolean},completions:{type:Array},catalogVisible:{type:Boolean},theme:{type:String,default:"light"},onInput:{type:Function},onDrop:{type:Function,default:()=>{}},inputBoxWidth:{type:String},oninputBoxWidthChange:{type:Function},transformImgUrl:{type:Function,default:e=>e},catalogLayout:{type:String},catalogMaxDepth:{type:Number}},gs=se({name:"UpdateOnDemand",props:{html:{type:String,required:!0}},setup(e){const t=pe("editorId"),i=pe("previewTheme"),n=pe("showCodeRowNumber"),r=ae(),s=e.html;return le((()=>e.html),(e=>{var t;const i=(e=>{const t=(new DOMParser).parseFromString(e,"text/html");return Array.from(t.body.childNodes)})(e),n=Array.from((null==(t=r.value)?void 0:t.childNodes)||[]),{updates:s,deletes:o}=((e,t)=>{const i=[],n=[];if(e.forEach(((e,n)=>{const r=t[n];r?(e.nodeType!==r.nodeType||e.textContent!==r.textContent||1===e.nodeType&&e.outerHTML!==r.outerHTML)&&i.push({index:n,newNode:e}):i.push({index:n,newNode:e})})),t.length>e.length)for(let r=e.length;r{r.value&&(t.forEach((e=>{e.remove()})),e.forEach((({index:e,newNode:t})=>{var i,n,s;const o=null==(i=r.value)?void 0:i.childNodes[e];o?null==(s=r.value)||s.replaceChild(t.cloneNode(!0),o):null==(n=r.value)||n.appendChild(t.cloneNode(!0))})))})(s,o)})),()=>de("div",{id:`${t}-preview`,class:[`${Me}-preview`,`${null==i?void 0:i.value}-theme`,n&&`${Me}-scrn`],innerHTML:s,ref:r},null)}}),vs=se({name:"ContentPreview",props:ms,setup(e){const t=pe("editorId"),{html:i,key:n}=ps(e,e.previewOnly);return((e,t,i)=>{const n=pe("editorId"),r=pe("rootRef"),s=pe("usedLanguageText"),o=()=>{r.value.querySelectorAll(`#${n} .${Me}-preview .${Me}-code`).forEach((t=>{let i=-1;const n=t.querySelector(`.${Me}-copy-button`);n&&(n.onclick=r=>{r.preventDefault(),clearTimeout(i);const o=(t.querySelector("input:checked + pre code")||t.querySelector("pre code")).textContent,{text:a,successTips:l,failTips:h}=s.value.copyCode;let c=l;Mt(e.formatCopiedText(o)).catch((()=>{c=h})).finally((()=>{n.dataset.isIcon?n.dataset.tips=c:n.innerHTML=c,i=window.setTimeout((()=>{n.dataset.isIcon?n.dataset.tips=a:n.innerHTML=a}),1500)}))})}))},a=e=>{e&&ke(o)};le([t,i],(()=>{ke(o)})),le((()=>e.setting.preview),a),le((()=>e.setting.htmlPreview),a),he(o)})(e,i,n),((e,t)=>{const i=pe("editorId"),{noImgZoomIn:n}=e,r=_e((()=>{const e=document.querySelectorAll(`#${i}-preview img:not(.not-zoom):not(.medium-zoom-image)`);0!==e.length&&Tt(e,{background:"#00000073"})}));he((()=>{!n&&e.setting.preview&&r()})),le([t,be(e.setting,"preview")],(()=>{!n&&e.setting.preview&&r()}))})(e,i),((e,t)=>{const i=pe("editorId"),n=pe("rootRef");let r=()=>{};const s=()=>{if(!n.value)return!1;const t=n.value.querySelectorAll(".task-list-item.enabled"),s=t=>{var n;t.preventDefault();const r=t.target.checked?"unChecked":"checked",s=null==(n=t.target.parentElement)?void 0:n.dataset.line;if(!s)return;const o=Number(s),a=e.modelValue.split("\n"),l=a[Number(o)].replace(fs[r].regexp,fs[r].value);e.previewOnly?(a[Number(o)]=l,e.onChange(a.join("\n"))):Ne.emit(i,mt,o+1,l)};t.forEach((e=>{e.addEventListener("click",s)})),r=()=>{t.forEach((e=>{e.removeEventListener("click",s)}))}};ce((()=>{r()})),le([t],(()=>{r(),ke(s)}),{immediate:!0})})(e,i),((e,t,i)=>{const n=()=>{ke((()=>{var t;null==(t=e.onRemount)||t.call(e)}))},r=e=>{e&&n()};le([t,i],n),le((()=>e.setting.preview),r),le((()=>e.setting.htmlPreview),r),he(n)})(e,i,n),()=>de(ge,null,[e.setting.preview&&de("div",{id:`${t}-preview-wrapper`,class:`${Me}-preview-wrapper`,key:"content-preview-wrapper"},[de(gs,{key:n.value,html:i.value},null)]),!e.previewOnly&&e.setting.htmlPreview&&de("div",{id:`${t}-html-wrapper`,class:`${Me}-preview-wrapper`,key:"html-preview-wrapper"},[de("div",{class:`${Me}-html`},[i.value])])])}}),bs=(e,t)=>{const i=Ve.editorExtensions.highlight,n=Ve.editorExtensionsAttrs.highlight,r=ys(e);me("editorId",r),me("rootRef",t),me("theme",Oe((()=>e.theme))),me("language",Oe((()=>e.language))),me("highlight",Oe((()=>{const{js:t}=i,r={...Ze,...i.css},{js:s,css:o={}}=n||{},a=e.codeStyleReverse&&e.codeStyleReverseList.includes(e.previewTheme)?"dark":e.theme;return{js:{src:t,...s},css:{href:r[e.codeTheme]?r[e.codeTheme][a]:Ze.atom[a],...r[e.codeTheme]&&o[e.codeTheme]?o[e.codeTheme][a]:o.atom?o.atom[a]:{}}}}))),me("showCodeRowNumber",e.showCodeRowNumber);const s=Oe((()=>{const t={...qe,...Ve.editorConfig.languageUserDefined};return Ee($e(qe["en-US"]),t[e.language]||{})}));return me("usedLanguageText",s),me("previewTheme",Oe((()=>e.previewTheme))),me("customIcon",Oe((()=>e.customIcon))),{editorId:r}},ys=e=>{const t=ve();return e.id||e.editorId||`${Me}-${t}`},ks={modelValue:{type:String,default:""},onChange:{type:Function,default:void 0},theme:{type:String,default:"light"},class:{type:String,default:""},language:{type:String,default:"zh-CN"},onHtmlChanged:{type:Function,default:void 0},onGetCatalog:{type:Function,default:void 0},editorId:{type:String,default:void 0},id:{type:String,default:void 0},showCodeRowNumber:{type:Boolean,default:!0},previewTheme:{type:String,default:"default"},style:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:e=>e},sanitize:{type:Function,default:e=>e},noMermaid:{type:Boolean,default:!1},noKatex:{type:Boolean,default:!1},codeTheme:{type:String,default:"atom"},formatCopiedText:{type:Function,default:e=>e},codeStyleReverse:{type:Boolean,default:!0},codeStyleReverseList:{type:Array,default:["default","mk-cute"]},noHighlight:{type:Boolean,default:!1},noImgZoomIn:{type:Boolean,default:!1},customIcon:{type:Object,default:{}},sanitizeMermaid:{type:Function,default:e=>Promise.resolve(e)},codeFoldable:{type:Boolean,default:!0},autoFoldThreshold:{type:Number,default:30},onRemount:{type:Function,default:void 0}},xs={...ks,onSave:{type:Function,default:void 0},onUploadImg:{type:Function,default:void 0},pageFullscreen:{type:Boolean,default:!1},preview:{type:Boolean,default:!0},htmlPreview:{type:Boolean,default:!1},toolbars:{type:Array,default:Le},toolbarsExclude:{type:Array,default:[]},noPrettier:{type:Boolean,default:!1},tabWidth:{type:Number,default:2},tableShape:{type:Array,default:[6,4]},placeholder:{type:String,default:""},defToolbars:{type:[String,Object],default:void 0},onError:{type:Function,default:void 0},footers:{type:Array,default:Xe},scrollAuto:{type:Boolean,default:!0},defFooters:{type:[String,Object],default:void 0},noUploadImg:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},maxLength:{type:Number,default:void 0},autoDetectCode:{type:Boolean,default:!1},onBlur:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},completions:{type:Array,default:void 0},showToolbarName:{type:Boolean,default:!1},onInput:{type:Function,default:void 0},onDrop:{type:Function,default:void 0},inputBoxWidth:{type:String,default:"50%"},oninputBoxWidthChange:{type:Function,default:void 0},transformImgUrl:{type:Function,default:e=>e},catalogLayout:{type:String,default:"fixed"},catalogMaxDepth:{type:Number,default:void 0}},ws=["onHtmlChanged","onGetCatalog","onChange","onRemount","update:modelValue"],Ss=[...ws,"onSave","onUploadImg","onError","onBlur","onFocus","onInput","onDrop","oninputBoxWidthChange"],Qs=se({name:"MdPreview",props:ks,emits:ws,setup(e,t){const{noKatex:i,noMermaid:n,noHighlight:r}=e,s=ae(),{editorId:o}=bs(e,s);return((e,t,i)=>{const{editorId:n}=i,r={rerender(){Ne.emit(n,pt)}};t.expose(r)})(0,t,{editorId:o}),ce((()=>{Ne.clear(o)})),()=>de("div",{id:o,class:[Me,e.class,"dark"===e.theme&&`${Me}-dark`,`${Me}-previewOnly`],style:e.style,ref:s},[de(vs,{modelValue:e.modelValue,onChange:i=>{var n;null==(n=e.onChange)||n.call(e,i),t.emit("onChange",i),t.emit("update:modelValue",i)},onHtmlChanged:i=>{var n;null==(n=e.onHtmlChanged)||n.call(e,i),t.emit("onHtmlChanged",i)},onGetCatalog:i=>{var n;null==(n=e.onGetCatalog)||n.call(e,i),t.emit("onGetCatalog",i)},mdHeadingId:e.mdHeadingId,noMermaid:n,sanitize:e.sanitize,noKatex:i,formatCopiedText:e.formatCopiedText,noHighlight:r,noImgZoomIn:e.noImgZoomIn,previewOnly:!0,sanitizeMermaid:e.sanitizeMermaid,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold,onRemount:()=>{var i;null==(i=e.onRemount)||i.call(e),t.emit("onRemount")}},null)])}});Qs.install=e=>(e.component(Qs.name,Qs),e);var $s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const _s=({size:e,strokeWidth:t=2,absoluteStrokeWidth:i,color:n,iconNode:r,name:s,class:o,...a},{slots:l})=>{return xe("svg",{...$s,width:e||$s.width,height:e||$s.height,stroke:n||$s.stroke,"stroke-width":i?24*Number(t)/Number(e):t,class:["lucide",`lucide-${h=s??"icon",h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`],...a},[...r.map((e=>xe(...e))),...l.default?[l.default()]:[]]);var h},Ps=(e,t)=>(i,{slots:n})=>xe(_s,{...i,iconNode:t,name:e},n),Cs=Ps("BoldIcon",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]),Ts=Ps("ChartAreaIcon",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z",key:"q0gr47"}]]),As=Ps("CodeXmlIcon",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),Es=Ps("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Ms=Ps("ExpandIcon",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]),Rs=Ps("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Ds=Ps("ForwardIcon",[["polyline",{points:"15 17 20 12 15 7",key:"1w3sku"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]),Zs=Ps("HeadingIcon",[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]),Ls=Ps("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),Xs=Ps("ItalicIcon",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),qs=Ps("LinkIcon",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),Vs=Ps("ListOrderedIcon",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]),Is=Ps("ListTodoIcon",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]),zs=Ps("ListTreeIcon",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),js=Ps("ListIcon",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]),Bs=Ps("Maximize2Icon",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),Fs=Ps("Minimize2Icon",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),Ys=Ps("QuoteIcon",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]),Ws=Ps("ReplyIcon",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]),Ns=Ps("SaveIcon",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),Gs=Ps("ShrinkIcon",[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]),Us=Ps("SquareCodeIcon",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Hs=Ps("SquareSigmaIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M16 8.9V7H8l4 5-4 5h8v-1.9",key:"9nih0i"}]]),Ks=Ps("StrikethroughIcon",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),Js=Ps("SubscriptIcon",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]),eo=Ps("SuperscriptIcon",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]),to=Ps("TableIcon",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]),io=Ps("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),no=Ps("UnderlineIcon",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]),ro=Ps("UploadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),so={bold:Cs,underline:no,italic:Xs,"strike-through":Ks,title:Zs,sub:Js,sup:eo,quote:Ys,"unordered-list":js,"ordered-list":Vs,task:Is,"code-row":Es,code:Us,link:qs,image:Ls,table:to,revoke:Ws,next:Ds,save:Ns,prettier:Us,minimize:Fs,maximize:Bs,"fullscreen-exit":Gs,fullscreen:Ms,"preview-only":Ps("ViewIcon",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),preview:Rs,"preview-html":As,catalog:zs,github:()=>de("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-github-icon"},[de("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"},null),de("path",{d:"M9 18c-4.51 2-5-2-7-2"},null)]),mermaid:Ts,formula:Hs,close:Ps("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),delete:io,upload:ro},oo=se({name:`${Me}-icon-set`,props:{name:{type:String,default:""}},setup:e=>()=>xe(so[e.name],{class:`${Me}-icon`})}),ao=se({name:`${Me}-icon`,props:{name:{type:String,default:""}},setup(e){const t=pe("customIcon");return()=>{const i=t.value[e.name];return"object"==typeof i?"object"==typeof i.component?xe(i.component,i.props):de("span",{innerHTML:i.component},null):de(oo,{name:e.name},null)}}}),lo=se({name:"MdModal",props:{title:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},width:{type:String,default:"auto"},height:{type:String,default:"auto"},onClose:{type:Function},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:()=>{}},class:{type:String,default:void 0},style:{type:[Object,String],default:()=>({})},showMask:{type:Boolean,default:!0}},emits:["onClose"],setup(e,t){const i=pe("theme"),n=pe("rootRef"),r=ae(e.visible),s=ae([`${Me}-modal`]),o=ae(),a=ae(),l=ae(),h=ye();let c=()=>{};const u=oe({maskStyle:{zIndex:-1},modalStyle:{zIndex:-1},initPos:{left:"0px",top:"0px"},historyPos:{left:"0px",top:"0px"}}),d=Oe((()=>e.isFullscreen?{width:"100%",height:"100%"}:{width:e.width,height:e.height}));le((()=>e.isFullscreen),(e=>{e?c():ke((()=>{c=yt(a.value,((e,t)=>{u.initPos.left=e+"px",u.initPos.top=t+"px"}))}))})),le((()=>e.visible),(t=>{t?(u.maskStyle.zIndex=Ve.editorConfig.zIndex+Vr(),u.modalStyle.zIndex=Ve.editorConfig.zIndex+Vr(),s.value.push("zoom-in"),r.value=t,ke((()=>{const t=o.value.offsetWidth/2,i=o.value.offsetHeight/2,n=document.documentElement.clientWidth/2,r=document.documentElement.clientHeight/2;u.initPos.left=n-t+"px",u.initPos.top=r-i+"px",e.isFullscreen||(c=yt(a.value,((e,t)=>{u.initPos.left=e+"px",u.initPos.top=t+"px"})))})),setTimeout((()=>{s.value=s.value.filter((e=>"zoom-in"!==e))}),140)):(s.value.push("zoom-out"),c(),setTimeout((()=>{s.value=s.value.filter((e=>"zoom-out"!==e)),r.value=t}),130))}));const p=Oe((()=>({display:r.value?"block":"none"}))),f=Oe((()=>"string"==typeof e.style?[e.style,p.value].join("; "):e.style instanceof Object?{...p.value,...e.style}:p.value));return he((()=>{var e;const t=null==(e=n.value)?void 0:e.getRootNode();l.value=t instanceof Document?document.body:t})),()=>{const n=ze({ctx:t}),r=ze({props:e,ctx:t},"title");return l.value?de(we,{to:l.value},{default:()=>[de("div",{ref:h,class:`${Me}-modal-container`,"data-theme":i.value},[de("div",{class:e.class,style:f.value},[e.showMask&&de("div",{class:`${Me}-modal-mask`,style:u.maskStyle,onClick:()=>{var i;null==(i=e.onClose)||i.call(e),t.emit("onClose")}},null),de("div",{class:s.value,style:{...u.modalStyle,...u.initPos,...d.value},ref:o},[de("div",{class:`${Me}-modal-header`,ref:a},[r||""]),de("div",{class:`${Me}-modal-body`},[n]),de("div",{class:`${Me}-modal-func`},[e.showAdjust&&de("div",{class:`${Me}-modal-adjust`,onClick:t=>{t.stopPropagation(),e.isFullscreen?u.initPos=u.historyPos:(u.historyPos=u.initPos,u.initPos={left:"0",top:"0"}),e.onAdjust(!e.isFullscreen)}},[de(ao,{name:e.isFullscreen?"minimize":"maximize"},null)]),de("div",{class:`${Me}-modal-close`,onClick:i=>{var n;i.stopPropagation(),null==(n=e.onClose)||n.call(e),t.emit("onClose")}},[de(ao,{name:"close"},null)])])])])])]}):""}}});lo.install=e=>(e.component(lo.name,lo),e);const ho=`.${Me}-preview > [data-line]`,co=(e,t)=>+getComputedStyle(e).getPropertyValue(t).replace("px",""),uo=(e,t)=>{const i=_e((()=>{e.removeEventListener("scroll",n),e.addEventListener("scroll",n),t.removeEventListener("scroll",n),t.addEventListener("scroll",n)}),50),n=r=>{const s=e.clientHeight,o=t.clientHeight,a=(e.scrollHeight-s)/(t.scrollHeight-o);r.target===e?(t.removeEventListener("scroll",n),t.scrollTo({top:e.scrollTop/a}),i()):(e.removeEventListener("scroll",n),e.scrollTo({top:t.scrollTop*a}),i())};return[()=>{i().finally((()=>{e.dispatchEvent(new Event("scroll"))}))},()=>{e.removeEventListener("scroll",n),t.removeEventListener("scroll",n)}]},po=(e,t,i)=>{const{view:n}=i,r=Pe(),s=e=>n.lineBlockAt(n.state.doc.line(e+1).from).top,o=e=>n.lineBlockAt(n.state.doc.line(e+1).from).bottom;let a=[],l=[],h=[];const c=(e,t)=>{let i=1;for(let n=l.length-1;n-1>=0;n--){const e=l[n],r=l[n-1];if(e.offsetTop+e.offsetHeight>t&&r.offsetTop=0;n--){const t=o(a[n].end),r=s(a[n].start);if(t>e&&r<=e){i=i{var p;const{scrollDOM:f,contentHeight:m}=n;return!(m<=f.clientHeight||t.firstElementChild.clientHeight<=t.clientHeight)&&(!(n.state.doc.lines<=(null==(p=a[a.length-1])?void 0:p.end))&&void(i.target===e?(()=>{var e,i,l;if(0!==d)return!1;u++;const{scrollDOM:h,contentHeight:p}=n;let f=co(t,"padding-top");const m=n.lineBlockAtHeight(h.scrollTop),{number:O}=n.state.doc.lineAt(m.from),g=a[O-1];if(!g)return!1;let v=1;const b=t.querySelector(`[data-line="${g.start}"]`)||(null==(e=t.firstElementChild)?void 0:e.firstElementChild),y=t.querySelector(`[data-line="${g.end+1}"]`)||(null==(i=t.lastElementChild)?void 0:i.lastElementChild),k=h.scrollHeight-h.clientHeight,x=t.scrollHeight-t.clientHeight;let w=s(g.start),S=o(g.end),Q=b.offsetTop,$=y.offsetTop-Q;0===w&&(Q=0,b===y?(f=0,S=p-h.offsetHeight,$=x):$=y.offsetTop),v=(h.scrollTop-w)/(S-w);const _=y==(null==(l=t.lastElementChild)?void 0:l.lastElementChild)?y.offsetTop+y.clientHeight:y.offsetTop;if(S>=k||_>x){const e=c(k,x);w=s(e),v=(h.scrollTop-w)/(k-w);const i=t.querySelector(`[data-line="${e}"]`);w>0&&i&&(Q=i.offsetTop),$=x-Q+co(t,"padding-top")}r(t,Q-f+$*v,(()=>{u--}))})():(()=>{var i,o,p,f,m,O;if(0!==u)return;d++;const{scrollDOM:g}=n,v=t.scrollTop,b=t.scrollHeight,y=g.scrollHeight-g.clientHeight,k=t.scrollHeight-t.clientHeight;let x=null==(i=t.firstElementChild)?void 0:i.firstElementChild,w=null==(o=t.firstElementChild)?void 0:o.lastElementChild;if(h.length>0){let e=Math.ceil(h[h.length-1]*(v/b)),i=h.findLastIndex((t=>t<=e));i=-1===i?0:i,e=h[i];for(let t=i;t>=0&&tv){if(t-1>=0){t--;continue}e=-1,i=t;break}if(!(t+1y||w.offsetTop+w.offsetHeight>k){const e=c(y,k),i=t.querySelector(`[data-line="${e}"]`);S=i?i.offsetTop-co(i,"margin-top"):S,C=s(e),$=(v-S)/(k-S),A=y-C}else x===(null==(O=t.firstElementChild)?void 0:O.firstElementChild)?(x===w?(Q=w.offsetTop+w.offsetHeight+ +getComputedStyle(w).marginBottom.replace("px",""),A=T):A=T,$=Math.max(v/Q,0)):($=Math.max((v-S)/(Q-S),0),A=T-C);r(e,C+A*$,(()=>{d--}))})()))};return[()=>{(()=>{a=[],l=Array.from(t.querySelectorAll(ho)),h=l.map((e=>Number(e.dataset.line)));const e=[...h],{lines:i}=n.state.doc;let r=e.shift()||0,s=e.shift()||i;for(let t=0;t{e.removeEventListener("scroll",p),t.removeEventListener("scroll",p)}]},fo=se({props:{tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},onActive:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},setup(e){const t=pe("scrollElementRef"),i=pe("roorNodeRef"),n=ae();return le((()=>e.tocItem.active),(t=>{t&&e.onActive(e.tocItem,n.value)})),he((()=>{e.tocItem.active&&e.onActive(e.tocItem,n.value)})),()=>{const{tocItem:r,mdHeadingId:s,onClick:o,scrollElementOffsetTop:a}=e;return de("div",{ref:n,class:[`${Me}-catalog-link`,r.active&&`${Me}-catalog-active`],onClick:e=>{if(e.stopPropagation(),o(e,r),e.defaultPrevented)return;const n=s(r.text,r.level,r.index),l=i.value.getElementById(n),h=t.value;if(l&&h){let e=l.offsetParent,t=l.offsetTop;if(h.contains(e))for(;e&&h!=e;)t+=null==e?void 0:e.offsetTop,e=null==e?void 0:e.offsetParent;let i=0;l.previousElementSibling||(i=co(l,"margin-top")),null==h||h.scrollTo({top:t-a-i,behavior:"smooth"})}}},[de("span",{title:r.text},[r.text]),r.children&&r.children.length>0&&de("div",{class:`${Me}-catalog-wrapper`},[r.children.map((t=>de(fo,{mdHeadingId:s,key:`${r.text}-link-${t.level}-${t.text}`,tocItem:t,onActive:e.onActive,onClick:o,scrollElementOffsetTop:a},null)))])])}}}),mo=se({name:"MdCatalog",props:{editorId:{type:String,default:void 0},class:{type:String,default:""},mdHeadingId:{type:Function,default:e=>e},scrollElement:{type:[String,Object],default:void 0},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0},onClick:{type:Function,default:void 0},onActive:{type:Function,default:void 0},isScrollElementInShadow:{type:Boolean,default:!1},syncWith:{type:String,default:"preview"},catalogMaxDepth:{type:Number,default:void 0}},emits:["onClick","onActive"],setup(e,t){const i=e.editorId,n=`#${i}-preview-wrapper`,r=oe({list:[],show:!1,scrollElement:e.scrollElement||n}),s=ye(),o=ae(),a=ae(),l=ae(),h=ae(),c=ye(),u=ae({});me("scrollElementRef",a),me("roorNodeRef",h);const d=Oe((()=>{const t=[];return r.list.forEach(((i,n)=>{if(e.catalogMaxDepth&&i.level>e.catalogMaxDepth)return;const{text:r,level:o,line:a}=i,l={level:o,text:r,line:a,index:n+1,active:s.value===i};if(0===t.length)t.push(l);else{let e=t[t.length-1];if(l.level>e.level)for(let t=e.level+1;t<=6;t++){const{children:t}=e;if(!t){e.children=[l];break}if(e=t[t.length-1],l.level<=e.level){t.push(l);break}}else t.push(l)}})),t})),p=t=>{if(0===t.length)return s.value=void 0,r.list=[],!1;const{activeHead:i}=t.reduce(((t,i,n)=>{var r;let s=0;if("preview"===e.syncWith){const t=null==(r=h.value)?void 0:r.getElementById(e.mdHeadingId(i.text,i.level,n+1));t instanceof HTMLElement&&(s=((e,t)=>{if(!e||!t)return 0;const i=null==e?void 0:e.getBoundingClientRect();if(t===document.documentElement)return i.top-t.clientTop;const n=null==t?void 0:t.getBoundingClientRect();return i.top-n.top})(t,a.value))}else{const e=c.value;if(e){s=e.lineBlockAt(e.state.doc.line(i.line+1).from).top-e.scrollDOM.scrollTop}}return st.minTop?{activeHead:i,minTop:s}:t}),{activeHead:t[0],minTop:Number.MIN_SAFE_INTEGER});s.value=i,r.list=t},f=(i,n)=>{var r;u.value.top=n.offsetTop+co(n,"padding-top")+"px",null==(r=e.onActive)||r.call(e,i,n),t.emit("onActive",i,n)},m=()=>{p(r.list)},O=t=>{var i,s,h;if(null==(i=l.value)||i.removeEventListener("scroll",m),"editor"===e.syncWith)l.value=null==(s=c.value)?void 0:s.scrollDOM;else{const t=(()=>{var t;if(r.scrollElement instanceof HTMLElement)return r.scrollElement;let i=document;return(r.scrollElement===n||e.isScrollElementInShadow)&&(i=null==(t=o.value)?void 0:t.getRootNode()),i.querySelector(r.scrollElement)})();a.value=t,l.value=t===document.documentElement?document:t}p(t),null==(h=l.value)||h.addEventListener("scroll",m)},g=e=>{c.value=e};return le([()=>e.syncWith,c,()=>e.catalogMaxDepth],(()=>{O(r.list)})),he((()=>{h.value=o.value.getRootNode(),Ne.on(i,{name:ut,callback:O}),Ne.on(i,{name:gt,callback:g}),Ne.emit(i,dt),Ne.emit(i,Ot)})),ce((()=>{var e;Ne.remove(i,ut,O),Ne.remove(i,gt,g),null==(e=l.value)||e.removeEventListener("scroll",m)})),()=>de("div",{class:[`${Me}-catalog`,"dark"===e.theme&&`${Me}-catalog-dark`,e.class||""],ref:o},[d.value.length>0&&de(ge,null,[de("div",{class:`${Me}-catalog-indicator`,style:u.value},null),de("div",{class:`${Me}-catalog-container`},[d.value.map((i=>de(fo,{mdHeadingId:e.mdHeadingId,tocItem:i,key:`link-${i.level}-${i.text}`,onActive:f,onClick:(i,n)=>{var r;null==(r=e.onClick)||r.call(e,i,n),t.emit("onClick",i,n)},scrollElementOffsetTop:e.scrollElementOffsetTop},null)))])])])}});mo.install=e=>(e.component(mo.name,mo),e);let Oo=[],go=[];function vo(e){if(e<768)return!1;for(let t=0,i=Oo.length;;){let n=t+i>>1;if(e=go[n]))return!0;t=n+1}if(t==i)return!1}}function bo(e){return e>=127462&&e<=127487}(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let t=0,i=0;t=0&&bo(wo(e,n));)i++,n-=2;if(i%2==0)break;t+=2}}}return t}function xo(e,t,i){for(;t>0;){let n=ko(e,t-2,i);if(n=56320&&e<57344}function Qo(e){return e>=55296&&e<56320}function $o(e){return e<65536?1:2}class _o{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Zo(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),Co.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Zo(this,e,t);let i=[];return this.decompose(e,t,i,0),Co.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new Eo(this),r=new Eo(e);for(let s=t,o=t;;){if(n.next(s),r.next(s),s=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(o+=n.value.length,n.done||o>=i)return!0}}iter(e=1){return new Eo(this,e)}iterRange(e,t=this.length){return new Mo(this,e,t)}iterLines(e,t){let i;if(null==e)i=this.iter();else{null==t&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ro(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new Po(e):Co.from(Po.split(e,[])):_o.empty}}class Po extends _o{constructor(e,t=function(e){let t=-1;for(let i of e)t+=i.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let r=0;;r++){let s=this.text[r],o=n+s.length;if((t?i:o)>=e)return new Do(n,o,i,s);n=o+1,i++}}decompose(e,t,i,n){let r=e<=0&&t>=this.length?this:new Po(Ao(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&n){let e=i.pop(),t=To(r.text,e.text.slice(),0,r.length);if(t.length<=32)i.push(new Po(t,e.length+r.length));else{let e=t.length>>1;i.push(new Po(t.slice(0,e)),new Po(t.slice(e)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Po))return super.replace(e,t,i);[e,t]=Zo(this,e,t);let n=To(this.text,To(i.text,Ao(this.text,0,e)),t),r=this.length+i.length-(t-e);return n.length<=32?new Po(n,r):Co.from(Po.split(n,[]),r)}sliceString(e,t=this.length,i="\n"){[e,t]=Zo(this,e,t);let n="";for(let r=0,s=0;r<=t&&se&&s&&(n+=i),er&&(n+=o.slice(Math.max(0,e-r),t-r)),r=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let r of e)i.push(r),n+=r.length+1,32==i.length&&(t.push(new Po(i,n)),i=[],n=-1);return n>-1&&t.push(new Po(i,n)),t}}class Co extends _o{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,n){for(let r=0;;r++){let s=this.children[r],o=n+s.length,a=i+s.lines-1;if((t?a:o)>=e)return s.lineInner(e,t,i,n);n=o+1,i=a+1}}decompose(e,t,i,n){for(let r=0,s=0;s<=t&&r=s){let r=n&((s<=e?1:0)|(a>=t?2:0));s>=e&&a<=t&&!r?i.push(o):o.decompose(e-s,t-s,i,r)}s=a+1}}replace(e,t,i){if([e,t]=Zo(this,e,t),i.lines=r&&t<=o){let a=s.replace(e-r,t-r,i),l=this.lines-s.lines+a.lines;if(a.lines>4&&a.lines>l>>6){let r=this.children.slice();return r[n]=a,new Co(r,this.length-(t-e)+i.length)}return super.replace(r,o,a)}r=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i="\n"){[e,t]=Zo(this,e,t);let n="";for(let r=0,s=0;re&&r&&(n+=i),es&&(n+=o.sliceString(e-s,t-s,i)),s=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Co))return 0;let i=0,[n,r,s,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,r+=t){if(n==s||r==o)return i;let a=this.children[n],l=e.children[r];if(a!=l)return i+a.scanIdentical(l,t);i+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let i=[];for(let t of e)t.flatten(i);return new Po(i,t)}let n=Math.max(32,i>>5),r=n<<1,s=n>>1,o=[],a=0,l=-1,h=[];function c(e){let t;if(e.lines>r&&e instanceof Co)for(let i of e.children)c(i);else e.lines>s&&(a>s||!a)?(u(),o.push(e)):e instanceof Po&&a&&(t=h[h.length-1])instanceof Po&&e.lines+t.lines<=32?(a+=e.lines,l+=e.length+1,h[h.length-1]=new Po(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>n&&u(),a+=e.lines,l+=e.length+1,h.push(e))}function u(){0!=a&&(o.push(1==h.length?h[0]:Co.from(h,l)),l=-1,a=h.length=0)}for(let d of e)c(d);return u(),1==o.length?o[0]:new Co(o,t)}}function To(e,t,i=0,n=1e9){for(let r=0,s=0,o=!0;s=i&&(l>n&&(a=a.slice(0,n-r)),r0?1:(e instanceof Po?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],s=r>>1,o=n instanceof Po?n.text.length:n.children.length;if(s==(t>0?o:0)){if(0==i)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[i]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(n instanceof Po){let r=n.text[s+(t<0?-1:0)];if(this.offsets[i]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=n.children[s+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof Po?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Mo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Eo(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Ro{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(_o.prototype[Symbol.iterator]=function(){return this.iter()},Eo.prototype[Symbol.iterator]=Mo.prototype[Symbol.iterator]=Ro.prototype[Symbol.iterator]=function(){return this});let Do=class{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}};function Zo(e,t,i){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,i))]}function Lo(e,t,i=!0,n=!0){return yo(e,t,i,n)}function Xo(e,t){let i=e.charCodeAt(t);if(!(n=i,n>=55296&&n<56320&&t+1!=e.length))return i;var n;let r=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(r)?r-56320+(i-55296<<10)+65536:i}function qo(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Vo(e){return e<65536?1:2}const Io=/\r\n?|\n/;var zo=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(zo||(zo={}));class jo{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-n);r+=o}else{if(i!=zo.Simple&&l>=e&&(i==zo.TrackDel&&ne||i==zo.TrackBefore&&ne))return null;if(l>e||l==e&&t<0&&!o)return e==n||t<0?r:r+a;r+=a}n=l}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return r}touchesRange(e,t=e){for(let i=0,n=0;i=0&&n<=t&&r>=e)return!(nt)||"cover";n=r}return!1}toString(){let e="";for(let t=0;t=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new jo(e)}static create(e){return new jo(e)}}class Bo extends jo{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Wo(this,((t,i,n,r,s)=>e=e.replace(n,n+(i-t),s)),!1),e}mapDesc(e,t=!1){return No(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,r=0;n=0){t[n]=o,t[n+1]=s;let a=n>>1;for(;i.length0&&Yo(i,t,r.text),r.forward(e),o+=e}let l=e[s++];for(;o>1].toJSON()))}return e}static of(e,t,i){let n=[],r=[],s=0,o=null;function a(e=!1){if(!e&&!n.length)return;so||e<0||o>t)throw new RangeError(`Invalid change range ${e} to ${o} (in doc of length ${t})`);let c=h?"string"==typeof h?_o.of(h.split(i||Io)):h:_o.empty,u=c.length;if(e==o&&0==u)return;es&&Fo(n,e-s,-1),Fo(n,o-e,u),Yo(r,n,c),s=o}}(e),a(!o),o}static empty(e){return new Bo(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;nt&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;i.length=0&&i<=0&&i==e[r+1]?e[r]+=t:r>=0&&0==t&&0==e[r]?e[r+1]+=i:n?(e[r]+=t,e[r+1]+=i):e.push(t,i)}function Yo(e,t,i){if(0==i.length)return;let n=t.length-2>>1;if(n>1])),!(i||o==e.sections.length||e.sections[o+1]<0);)a=e.sections[o++],l=e.sections[o++];t(r,h,s,c,u),r=h,s=c}}}function No(e,t,i,n=!1){let r=[],s=n?[]:null,o=new Uo(e),a=new Uo(t);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(-1==o.ins&&-1==a.ins){let e=Math.min(o.len,a.len);Fo(r,e,-1),o.forward(e),a.forward(e)}else if(a.ins>=0&&(o.ins<0||l==o.i||0==o.off&&(a.len=0&&l=0)){if(o.done&&a.done)return s?Bo.createSet(r,s):jo.create(r);throw new Error("Mismatched change set lengths")}{let e=0,t=o.len;for(;t;)if(-1==a.ins){let i=Math.min(t,a.len);e+=i,t-=i,a.forward(i)}else{if(!(0==a.ins&&a.lene||o.ins>=0&&o.len>e)&&(a||n.length>t),s.forward2(e),o.forward(e)}}else Fo(n,0,o.ins,a),r&&Yo(r,n,o.text),o.next()}}class Uo{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?_o.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?_o.empty:t[i].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ho{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new Ho(i,n,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Ko.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Ko.range(this.anchor,i)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Ko.range(e.anchor,e.head)}static create(e,t,i){return new Ho(e,t,i)}}class Ko{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Ko.create(this.ranges.map((i=>i.map(e,t))),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ko(e.ranges.map((e=>Ho.fromJSON(e))),e.main)}static single(e,t=e){return new Ko([Ko.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;ne?8:0)|r)}static normalized(e,t=0){let i=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(i);for(let n=1;ni.head?Ko.range(o,s):Ko.range(s,o))}}return new Ko(e,t)}}function Jo(e,t){for(let i of e.ranges)if(i.to>t)throw new RangeError("Selection points outside of document")}let ea=0;class ta{constructor(e,t,i,n,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=ea++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new ta(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:ia),!!e.static,e.enables)}of(e){return new na([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new na(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new na(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(i=>t(i.field(e))))}}function ia(e,t){return e==t||e.length==t.length&&e.every(((e,i)=>e===t[i]))}class na{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=ea++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,r=this.id,s=e[r]>>1,o=2==this.type,a=!1,l=!1,h=[];for(let c of this.dependencies)"doc"==c?a=!0:"selection"==c?l=!0:1&(null!==(t=e[c.id])&&void 0!==t?t:1)||h.push(e[c.id]);return{create:e=>(e.values[s]=i(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||sa(e,h)){let t=i(e);if(o?!ra(t,e.values[s],n):!n(t,e.values[s]))return e.values[s]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[r];if(null!=l){let r=ya(t,l);if(this.dependencies.every((i=>i instanceof ta?t.facet(i)===e.facet(i):!(i instanceof la)||t.field(i,!1)==e.field(i,!1)))||(o?ra(a=i(e),r,n):n(a=i(e),r)))return e.values[s]=r,0}else a=i(e);return e.values[s]=a,1}}}}function ra(e,t,i){if(e.length!=t.length)return!1;for(let n=0;ne[t.id])),r=i.map((e=>e.type)),s=n.filter((e=>!(1&e))),o=e[t.id]>>1;function a(e){let i=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(aa).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,i)=>{let n=e.values[t],r=this.updateF(n,i);return this.compareF(n,r)?0:(e.values[t]=r,1)},reconfigure:(e,i)=>{let n,r=e.facet(aa),s=i.facet(aa);return(n=r.find((e=>e.field==this)))&&n!=s.find((e=>e.field==this))?(e.values[t]=n.create(e),1):null!=i.config.address[this.id]?(e.values[t]=i.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,aa.of({field:this,create:e})]}get extension(){return this}}const ha=4,ca=3,ua=2,da=1;function pa(e){return t=>new ma(t,e)}const fa={highest:pa(0),high:pa(da),default:pa(ua),low:pa(ca),lowest:pa(ha)};class ma{constructor(e,t){this.inner=e,this.prec=t}}class Oa{of(e){return new ga(this,e)}reconfigure(e){return Oa.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ga{constructor(e,t){this.compartment=e,this.inner=t}}class va{constructor(e,t,i,n,r,s){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let n=[],r=Object.create(null),s=new Map;for(let u of function(e,t,i){let n=[[],[],[],[],[]],r=new Map;function s(e,o){let a=r.get(e);if(null!=a){if(a<=o)return;let t=n[a].indexOf(e);t>-1&&n[a].splice(t,1),e instanceof ga&&i.delete(e.compartment)}if(r.set(e,o),Array.isArray(e))for(let t of e)s(t,o);else if(e instanceof ga){if(i.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=t.get(e.compartment)||e.inner;i.set(e.compartment,n),s(n,o)}else if(e instanceof ma)s(e.inner,e.prec);else if(e instanceof la)n[o].push(e),e.provides&&s(e.provides,o);else if(e instanceof na)n[o].push(e),e.facet.extensions&&s(e.facet.extensions,ua);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(t,o)}}return s(e,ua),n.reduce(((e,t)=>e.concat(t)))}(e,t,s))u instanceof la?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let o=Object.create(null),a=[],l=[];for(let u of n)o[u.id]=l.length<<1,l.push((e=>u.slot(e)));let h=null==i?void 0:i.config.facets;for(let u in r){let e=r[u],t=e[0].facet,n=h&&h[u]||[];if(e.every((e=>0==e.type)))if(o[t.id]=a.length<<1|1,ia(n,e))a.push(i.facet(t));else{let n=t.combine(e.map((e=>e.value)));a.push(i&&t.compare(n,i.facet(t))?i.facet(t):n)}else{for(let t of e)0==t.type?(o[t.id]=a.length<<1|1,a.push(t.value)):(o[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));o[t.id]=l.length<<1,l.push((i=>oa(i,t,e)))}}let c=l.map((e=>e(o)));return new va(e,s,c,o,a,r)}}function ba(e,t){if(1&t)return 2;let i=t>>1,n=e.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;e.status[i]=4;let r=e.computeSlot(e,e.config.dynamicSlots[i]);return e.status[i]=2|r}function ya(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const ka=ta.define(),xa=ta.define({combine:e=>e.some((e=>e)),static:!0}),wa=ta.define({combine:e=>e.length?e[0]:void 0,static:!0}),Sa=ta.define(),Qa=ta.define(),$a=ta.define(),_a=ta.define({combine:e=>!!e.length&&e[0]});class Pa{constructor(e,t){this.type=e,this.value=t}static define(){return new Ca}}class Ca{of(e){return new Pa(this,e)}}class Ta{constructor(e){this.map=e}of(e){return new Aa(this,e)}}class Aa{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new Aa(this.type,t)}is(e){return this.type==e}static define(e={}){return new Ta(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let e=n.map(t);e&&i.push(e)}return i}}Aa.reconfigure=Aa.define(),Aa.appendConfig=Aa.define();class Ea{constructor(e,t,i,n,r,s){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,i&&Jo(i,t.newLength),r.some((e=>e.type==Ea.time))||(this.annotations=r.concat(Ea.time.of(Date.now())))}static create(e,t,i,n,r,s){return new Ea(e,t,i,n,r,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Ea.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function Ma(e,t){let i=[];for(let n=0,r=0;;){let s,o;if(n=e[n]))s=e[n++],o=e[n++];else{if(!(r=0;r--){let s=i[r](e);s&&Object.keys(s).length&&(n=Ra(n,Da(t,s,e.changes.newLength),!0))}return n==e?e:Ea.create(t,e.changes,e.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(e){let t=e.startState,i=!0;for(let r of t.facet(Sa)){let t=r(e);if(!1===t){i=!1;break}Array.isArray(t)&&(i=!0===i?t:Ma(i,t))}if(!0!==i){let n,r;if(!1===i)r=e.changes.invertedDesc,n=Bo.empty(t.doc.length);else{let t=e.changes.filter(i);n=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=Ea.create(t,n,e.selection&&e.selection.map(r),Aa.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let n=t.facet(Qa);for(let r=n.length-1;r>=0;r--){let i=n[r](e);e=i instanceof Ea?i:Array.isArray(i)&&1==i.length&&i[0]instanceof Ea?i[0]:Za(t,Xa(i),!1)}return e}(r):r)}Ea.time=Pa.define(),Ea.userEvent=Pa.define(),Ea.addToHistory=Pa.define(),Ea.remote=Pa.define();const La=[];function Xa(e){return null==e?La:Array.isArray(e)?e:[e]}var qa=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(qa||(qa={}));const Va=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ia;try{Ia=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(_$){}function za(e){return t=>{if(!/\S/.test(t))return qa.Space;if(function(e){if(Ia)return Ia.test(e);for(let t=0;t"€"&&(i.toUpperCase()!=i.toLowerCase()||Va.test(i)))return!0}return!1}(t))return qa.Word;for(let i=0;i-1)return qa.Word;return qa.Other}}class ja{constructor(e,t,i,n,r,s){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=r,s&&(s._state=this);for(let o=0;or.set(t,e))),i=null),r.set(o.value.compartment,o.value.extension)):o.is(Aa.reconfigure)?(i=null,n=o.value):o.is(Aa.appendConfig)&&(i=null,n=Xa(n).concat(o.value));if(i)t=e.startState.values.slice();else{i=va.resolve(n,r,this),t=new ja(i,this.doc,this.selection,i.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values}let s=e.startState.facet(xa)?e.newSelection:e.newSelection.asSingle();new ja(i,e.newDoc,s,t,((t,i)=>i.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:Ko.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),r=[i.range],s=Xa(i.effects);for(let o=1;ot.spec.fromJSON(s,e))))}return ja.create({doc:e.doc,selection:Ko.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=va.resolve(e.extensions||[],new Map),i=e.doc instanceof _o?e.doc:_o.of((e.doc||"").split(t.staticFacet(ja.lineSeparator)||Io)),n=e.selection?e.selection instanceof Ko?e.selection:Ko.single(e.selection.anchor,e.selection.head):Ko.single(0);return Jo(n,i.length),t.staticFacet(xa)||(n=n.asSingle()),new ja(t,i,n,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(ja.tabSize)}get lineBreak(){return this.facet(ja.lineSeparator)||"\n"}get readOnly(){return this.facet(_a)}phrase(e,...t){for(let i of this.facet(ja.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,i)=>{if("$"==i)return"$";let n=+(i||1);return!n||n>t.length?e:t[n-1]}))),e}languageDataAt(e,t,i=-1){let n=[];for(let r of this.facet(ka))for(let s of r(this,t,i))Object.prototype.hasOwnProperty.call(s,e)&&n.push(s[e]);return n}charCategorizer(e){return za(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),r=this.charCategorizer(e),s=e-i,o=e-i;for(;s>0;){let e=Lo(t,s,!1);if(r(t.slice(e,s))!=qa.Word)break;s=e}for(;oe.length?e[0]:4}),ja.lineSeparator=wa,ja.readOnly=_a,ja.phrases=ta.define({compare(e,t){let i=Object.keys(e),n=Object.keys(t);return i.length==n.length&&i.every((i=>e[i]==t[i]))}}),ja.languageData=ka,ja.changeFilter=Sa,ja.transactionFilter=Qa,ja.transactionExtender=$a,Oa.reconfigure=Aa.define();class Fa{eq(e){return this==e}range(e,t=e){return Ya.create(e,t,this)}}Fa.prototype.startSide=Fa.prototype.endSide=0,Fa.prototype.point=!1,Fa.prototype.mapMode=zo.TrackDel;let Ya=class e{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(t,i,n){return new e(t,i,n)}};function Wa(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Na{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,n=0){let r=i?this.to:this.from;for(let s=n,o=r.length;;){if(s==o)return s;let n=s+o>>1,a=r[n]-e||(i?this.value[n].endSide:this.value[n].startSide)-t;if(n==s)return a>=0?s:o;a>=0?o=n:s=n+1}}between(e,t,i,n){for(let r=this.findIndex(t,-1e9,!0),s=this.findIndex(i,1e9,!1,r);rh||l==h&&c.startSide>0&&c.endSide<=0)continue;(h-l||c.endSide-c.startSide)<0||(s<0&&(s=l),c.point&&(o=Math.max(o,h-l)),i.push(c),n.push(l-s),r.push(h-s))}return{mapped:i.length?new Na(n,r,i,o):null,pos:s}}}class Ga{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new Ga(e,t,i,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=e,s=e.filter;if(0==t.length&&!s)return this;if(i&&(t=t.slice().sort(Wa)),this.isEmpty)return t.length?Ga.of(t):this;let o=new Ka(this,null,-1).goto(0),a=0,l=[],h=new Ua;for(;o.value||a=0){let e=t[a++];h.addInner(e.from,e.to,e.value)||l.push(e)}else 1==o.rangeIndex&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ro.to||r=r&&e<=r+s.length&&!1===s.between(r,e-r,t-r,i))return}this.nextLayer.between(e,t,i)}}iter(e=0){return Ja.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ja.from(e).goto(t)}static compare(e,t,i,n,r=-1){let s=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),o=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=Ha(s,o,i),l=new tl(s,a,r),h=new tl(o,a,r);i.iterGaps(((e,t,i)=>il(l,e,h,t,i,n))),i.empty&&0==i.length&&il(l,0,h,0,0,n)}static eq(e,t,i=0,n){null==n&&(n=999999999);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),s=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=s.length)return!1;if(!r.length)return!0;let o=Ha(r,s),a=new tl(r,o,0).goto(i),l=new tl(s,o,0).goto(i);for(;;){if(a.to!=l.to||!nl(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>n)return!0;a.next(),l.next()}}static spans(e,t,i,n,r=-1){let s=new tl(e,null,r).goto(t),o=t,a=s.openStart;for(;;){let e=Math.min(s.to,i);if(s.point){let i=s.activeForPoint(s.to),r=s.pointFromo&&(n.span(o,e,s.active,a),a=s.openEnd(e));if(s.to>i)return a+(s.point&&s.to>i?1:0);o=s.to,s.next()}}static of(e,t=!1){let i=new Ua;for(let n of e instanceof Ya?[e]:t?function(e){if(e.length>1)for(let t=e[0],i=1;i0)return e.slice().sort(Wa);t=n}return e}(e):e)i.add(n.from,n.to,n.value);return i.finish()}static join(e){if(!e.length)return Ga.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let n=e[i];n!=Ga.empty;n=n.nextLayer)t=new Ga(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}}Ga.empty=new Ga([],[],null,-1),Ga.empty.nextLayer=Ga.empty;class Ua{finishChunk(e){this.chunks.push(new Na(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Ua)).add(e,t,i)}addInner(e,t,i){let n=e-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Ga.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Ga.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Ha(e,t,i){let n=new Map;for(let s of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new Ka(s,t,i,r));return 1==n.length?n[0]:new Ja(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)el(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)el(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),el(this.heap,0)}}}function el(e,t){for(let i=e[t];;){let n=1+(t<<1);if(n>=e.length)break;let r=e[n];if(n+1=0&&(r=e[n+1],n++),i.compare(r)<0)break;e[n]=i,e[t]=r,t=n}}class tl{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ja.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){rl(this.active,e),rl(this.activeTo,e),rl(this.activeRank,e),this.minActive=ol(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:r}=this.cursor;for(;t0;)t++;sl(this.active,t,i),sl(this.activeTo,t,n),sl(this.activeRank,t,r),e&&sl(e,t,this.cursor.from),this.minActive=ol(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&rl(i,n)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[t]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function il(e,t,i,n,r,s){e.goto(t),i.goto(n);let o=n+r,a=n,l=n-t;for(;;){let t=e.to+l-i.to,n=t||e.endSide-i.endSide,r=n<0?e.to+l:i.to,h=Math.min(r,o);if(e.point||i.point?e.point&&i.point&&(e.point==i.point||e.point.eq(i.point))&&nl(e.activeForPoint(e.to),i.activeForPoint(i.to))||s.comparePoint(a,h,e.point,i.point):h>a&&!nl(e.active,i.active)&&s.compareRange(a,h,e.active,i.active),r>o)break;(t||e.openEnd!=i.openEnd)&&s.boundChange&&s.boundChange(r),a=r,n<=0&&e.next(),n>=0&&i.next()}}function nl(e,t){if(e.length!=t.length)return!1;for(let i=0;i=t;n--)e[n+1]=e[n];e[t]=i}function ol(e,t){let i=-1,n=1e9;for(let r=0;re.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),o,s);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");r(n(i),o,a,h)}else null!=o&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+o+";")}(a.length||h)&&s.push((!i||l||o?e:e.map(i)).join(", ")+" {"+a.join(" ")+"}")}for(let s in e)r(n(s),e[s],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=cl[ll]||1;return cl[ll]=e+1,"ͼ"+e.toString(36)}static mount(e,t,i){let n=e[hl],r=i&&i.nonce;n?r&&n.setNonce(r):n=new pl(e,r),n.mount(Array.isArray(t)?t:[t],e)}}let dl=new Map;class pl{constructor(e,t){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let t=dl.get(i);if(t)return e[hl]=t;this.sheet=new n.CSSStyleSheet,dl.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[hl]=this}mount(e,t){let i=this.sheet,n=0,r=0;for(let s=0;s-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,t),i)for(let e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ol="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),gl="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),vl=0;vl<10;vl++)fl[48+vl]=fl[96+vl]=String(vl);for(vl=1;vl<=24;vl++)fl[vl+111]="F"+vl;for(vl=65;vl<=90;vl++)fl[vl]=String.fromCharCode(vl+32),ml[vl]=String.fromCharCode(vl);for(var bl in fl)ml.hasOwnProperty(bl)||(ml[bl]=fl[bl]);function yl(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function kl(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function xl(e,t){if(!t.anchorNode)return!1;try{return kl(e,t.anchorNode)}catch(_$){return!1}}function wl(e){return 3==e.nodeType?Zl(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function Sl(e,t,i,n){return!!i&&(_l(e,t,i,n,-1)||_l(e,t,i,n,1))}function Ql(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function $l(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function _l(e,t,i,n,r){for(;;){if(e==i&&t==n)return!0;if(t==(r<0?0:Pl(e))){if("DIV"==e.nodeName)return!1;let i=e.parentNode;if(!i||1!=i.nodeType)return!1;t=Ql(e)+(r<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?Pl(e):0}}}function Pl(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Cl(e,t){let i=t?e.left:e.right;return{left:i,right:i,top:e.top,bottom:e.bottom}}function Tl(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function Al(e,t){let i=t.width/e.offsetWidth,n=t.height/e.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.width-e.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.height-e.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}class El{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Pl(t):0),i,Math.min(e.focusOffset,i?Pl(i):0))}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}let Ml,Rl=null;function Dl(e){if(e.setActive)return e.setActive();if(Rl)return e.focus(Rl);let t=[];for(let i=e;i&&(t.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(e.focus(null==Rl?{get preventScroll(){return Rl={preventScroll:!0},!0}}:void 0),!Rl){Rl=!1;for(let e=0;eMath.max(1,e.scrollHeight-e.clientHeight-4)}function Vl(e,t){for(let i=e,n=t;;){if(3==i.nodeType&&n>0)return{node:i,offset:n};if(1==i.nodeType&&n>0){if("false"==i.contentEditable)return null;i=i.childNodes[n-1],n=Pl(i)}else{if(!i.parentNode||$l(i))return null;n=Ql(i),i=i.parentNode}}}function Il(e,t){for(let i=e,n=t;;){if(3==i.nodeType&&nt)return i.domBoundsAround(e,t,l);if(c>=e&&-1==n&&(n=a,r=l),l>t&&i.dom.parentNode==this.dom){s=a,o=h;break}h=c,l=c+i.breakAfter}return{from:r,to:o<0?i+this.length:o,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=jl){this.markDirty();for(let n=e;nthis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Wl(e,t,i,n,r,s,o,a,l){let{children:h}=e,c=h.length?h[t]:null,u=s.length?s[s.length-1]:null,d=u?u.breakAfter:o;if(!(t==n&&c&&!o&&!d&&s.length<2&&c.merge(i,r,s.length?u:null,0==i,a,l))){if(n0&&(!o&&s.length&&c.merge(i,c.length,s[0],!1,a,0)?c.breakAfter=s.shift().breakAfter:(i2);var oh={mac:sh||/Mac/.test(Gl.platform),windows:/Win/.test(Gl.platform),linux:/Linux|X11/.test(Gl.platform),ie:eh,ie_version:Kl?Ul.documentMode||6:Jl?+Jl[1]:Hl?+Hl[1]:0,gecko:th,gecko_version:th?+(/Firefox\/(\d+)/.exec(Gl.userAgent)||[0,0])[1]:0,chrome:!!ih,chrome_version:ih?+ih[1]:0,ios:sh,android:/Android\b/.test(Gl.userAgent),safari:rh,webkit_version:nh?+(/\bAppleWebKit\/(\d+)/.exec(Gl.userAgent)||[0,0])[1]:0,tabSize:null!=Ul.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class ah extends Bl{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,i){return!(8&this.flags||i&&(!(i instanceof ah)||this.length-(t-e)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new ah(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new zl(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,i){let n=e.nodeValue.length;t>n&&(t=n);let r=t,s=t,o=0;0==t&&i<0||t==n&&i>=0?oh.chrome||oh.gecko||(t?(r--,o=1):s=0)?0:a.length-1];oh.safari&&!o&&0==l.width&&(l=Array.prototype.find.call(a,(e=>e.width))||l);return o?Cl(l,o<0):l||null}(this.dom,e,t)}}class lh extends Bl{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let n of t)n.setParent(this)}setAttrs(e){if(Xl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,n,r,s){return(!i||!(!(i instanceof lh&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(n=r),i=s,r++}let s=this.length-e;return this.length=e,n>-1&&(this.children.length=n,this.markDirty()),new lh(this.mark,t,s)}domAtPos(e){return uh(this,e)}coordsAt(e,t){return ph(this,e,t)}}class hh extends Bl{static create(e,t,i){return new hh(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=hh.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,i,n,r,s){return!(i&&(!(i instanceof hh&&this.widget.compare(i.widget))||e>0&&r<=0||t0)?zl.before(this.dom):zl.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let s=this.side?this.side<0:e>0;for(let o=s?n.length-1:0;r=n[o],!(e>0?0==o:o==n.length-1||r.top0?zl.before(this.dom):zl.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return _o.empty}get isHidden(){return!0}}function uh(e,t){let i=e.dom,{children:n}=e,r=0;for(let s=0;rs&&t0;s--){let e=n[s-1];if(e.dom.parentNode==i)return e.domAtPos(e.length)}for(let s=r;s0&&t instanceof lh&&r.length&&(n=r[r.length-1])instanceof lh&&n.mark.eq(t.mark)?dh(n,t.children[0],i-1):(r.push(t),t.setParent(e)),e.length+=t.length}function ph(e,t,i){let n=null,r=-1,s=null,o=-1;!function e(t,a){for(let l=0,h=0;l=a&&(c.children.length?e(c,a-h):(!s||s.isHidden&&(i>0||fh(s,c)))&&(u>a||h==u&&c.getSide()>0)?(s=c,o=a-h):(h-1?1:0)!=r.length-(i&&r.indexOf(i)>-1?1:0))return!1;for(let s of n)if(s!=i&&(-1==r.indexOf(s)||e[s]!==t[s]))return!1;return!0}function vh(e,t,i){let n=!1;if(t)for(let r in t)i&&r in i||(n=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(i)for(let r in i)t&&t[r]==i[r]||(n=!0,"style"==r?e.style.cssText=i[r]:e.setAttribute(r,i[r]));return n}function bh(e){let t=Object.create(null);for(let i=0;i0?3e8:-4e8:t>0?1e8:-1e8,new Qh(e,t,t,i,e.widget||null,!1)}static replace(e){let t,i,n=!!e.block;if(e.isBlockGap)t=-5e8,i=4e8;else{let{start:r,end:s}=$h(e,n);t=(r?n?-3e8:-1:5e8)-1,i=1+(s?n?2e8:1:-6e8)}return new Qh(e,t,i,n,e.widget||null,!0)}static line(e){return new Sh(e)}static set(e,t=!1){return Ga.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}xh.none=Ga.empty;class wh extends xh{constructor(e){let{start:t,end:i}=$h(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof wh&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(i=e.attrs)||void 0===i?void 0:i.class))&&gh(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}wh.prototype.point=!1;class Sh extends xh{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Sh&&this.spec.class==e.spec.class&&gh(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Sh.prototype.mapMode=zo.TrackBefore,Sh.prototype.point=!0;class Qh extends xh{constructor(e,t,i,n,r,s){super(t,i,r,e),this.block=n,this.isReplace=s,this.mapMode=n?t<=0?zo.TrackBefore:zo.TrackAfter:zo.TrackDel}get type(){return this.startSide!=this.endSide?kh.WidgetRange:this.startSide<=0?kh.WidgetBefore:kh.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Qh&&(t=this.widget,i=e.widget,t==i||!!(t&&i&&t.compare(i)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,i}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function $h(e,t=!1){let{inclusiveStart:i,inclusiveEnd:n}=e;return null==i&&(i=e.inclusive),null==n&&(n=e.inclusive),{start:null!=i?i:t,end:null!=n?n:t}}function _h(e,t,i,n=0){let r=i.length-1;r>=0&&i[r]+n>=e?i[r]=Math.max(i[r],t):i.push(e,t)}Qh.prototype.point=!0;class Ph extends Bl{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,n,r,s){if(i){if(!(i instanceof Ph))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),Nl(this,e,t,i?i.children.slice():[],r,s),!0}split(e){let t=new Ph;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:i,off:n}=this.childPos(e);n&&(t.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){gh(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){dh(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=mh(t,this.attrs||{})),i&&(this.attrs=mh({class:i},this.attrs||{}))}domAtPos(e){return uh(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?4&this.flags&&(Xl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(vh(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let n=this.dom.lastChild;for(;n&&Bl.get(n)instanceof lh;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(i=Bl.get(n))||void 0===i?void 0:i.isEditable)||oh.ios&&this.children.some((e=>e instanceof ah))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let i of this.children){if(!(i instanceof ah)||/[^ -~]/.test(i.text))return null;let n=wl(i.dom);if(1!=n.length)return null;t+=n[0].width,e=n[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let i=ph(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=i.bottom-i.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight=t){if(r instanceof Ph)return r;if(s>t)break}n=s+r.breakAfter}return null}}class Ch extends Bl{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,n,r,s){return!(i&&(!(i instanceof Ch&&this.widget.compare(i.widget))||e>0&&r<=0||t0)}}class Th extends yh{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Ah{constructor(e,t,i,n){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Ch&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ph),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Eh(new ch(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof Ch||this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:i,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw new Error("Ran out of text content when drawing inline views");if(i){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let n=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Eh(new ah(this.text.slice(this.textOff,this.textOff+n)),t),i),this.atCursorPos=!0,this.textOff+=n,e-=n,i=0}}span(e,t,i,n){this.buildText(t-e,i,n),this.pos=t,this.openStart<0&&(this.openStart=n)}point(e,t,i,n,r,s){if(this.disallowBlockEffectsFor[s]&&i instanceof Qh){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=t-e;if(i instanceof Qh)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ch(i.widget||Mh.block,o,i));else{let s=hh.create(i.widget||Mh.inline,o,o?0:i.startSide),a=this.atCursorPos&&!s.isEditable&&r<=n.length&&(e0),l=!s.isEditable&&(en.length||i.startSide<=0),h=this.getLine();2!=this.pendingBuffer||a||s.isEditable||(this.pendingBuffer=0),this.flushBuffer(n),a&&(h.append(Eh(new ch(1),n),r),r=n.length+Math.max(0,r-n.length)),h.append(Eh(s,n),r),this.atCursorPos=l,this.pendingBuffer=l?en.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,n,r){let s=new Ah(e,t,i,r);return s.openEnd=Ga.spans(n,t,i,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function Eh(e,t){for(let i of t)e=new lh(i,[e],e.length);return e}class Mh extends yh{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Mh.inline=new Mh("span"),Mh.block=new Mh("div");var Rh=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(Rh||(Rh={}));const Dh=Rh.LTR,Zh=Rh.RTL;function Lh(e){let t=[];for(let i=0;i=t){if(o.level==i)return s;(r<0||(0!=n?n<0?o.fromt:e[r].level>o.level))&&(r=s)}}if(r<0)throw new RangeError("Index out of range");return r}}function Fh(e,t){if(e.length!=t.length)return!1;for(let i=0;il&&o.push(new Bh(l,f.from,d)),Nh(e,f.direction==Dh!=!(d%2)?n+1:n,r,f.inner,f.from,f.to,o),l=f.to}p=f.to}else{if(p==i||(t?Yh[p]!=a:Yh[p]==a))break;p++}u?Wh(e,l,p,n+1,r,u,o):lt;){let i=!0,c=!1;if(!h||l>s[h-1].to){let e=Yh[l-1];e!=a&&(i=!1,c=16==e)}let u=i||1!=a?null:[],d=i?n:n+1,p=l;e:for(;;)if(h&&p==s[h-1].to){if(c)break e;let f=s[--h];if(!i)for(let e=f.from,i=h;;){if(e==t)break e;if(!i||s[i-1].to!=e){if(Yh[e-1]==a)break e;break}e=s[--i].from}if(u)u.push(f);else{f.to=0;e-=3)if(Ih[e+1]==-i){let t=Ih[e+2],i=2&t?r:4&t?1&t?s:r:0;i&&(Yh[o]=Yh[Ih[e]]=i),a=e;break}}else{if(189==Ih.length)break;Ih[a++]=o,Ih[a++]=t,Ih[a++]=l}else if(2==(n=Yh[o])||1==n){let e=n==r;l=e?0:1;for(let t=a-3;t>=0;t-=3){let i=Ih[t+2];if(2&i)break;if(e)Ih[t+2]|=2;else{if(4&i)break;Ih[t+2]|=4}}}}}(e,r,s,n,a),function(e,t,i,n){for(let r=0,s=n;r<=i.length;r++){let o=r?i[r-1].to:e,a=rl;)t==s&&(t=i[--n].from,s=n?i[n-1].to:e),Yh[--t]=c;l=o}else s=o,l++}}}(r,s,n,a),Wh(e,r,s,t,i,n,o)}function Gh(e){return[new Bh(0,e,0)]}let Uh="";function Hh(e,t,i,n,r){var s;let o=n.head-e.from,a=Bh.find(t,o,null!==(s=n.bidiLevel)&&void 0!==s?s:-1,n.assoc),l=t[a],h=l.side(r,i);if(o==h){let e=a+=r?1:-1;if(e<0||e>=t.length)return null;l=t[a=e],o=l.side(!r,i),h=l.side(r,i)}let c=Lo(e.text,o,l.forward(r,i));(cl.to)&&(c=h),Uh=e.text.slice(Math.min(o,c),Math.max(o,c));let u=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return u&&c==h&&u.level+(r?0:1)e.some((e=>e))}),hc=ta.define({combine:e=>e.some((e=>e))}),cc=ta.define();class uc{constructor(e,t="nearest",i="nearest",n=5,r=5,s=!1){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=s}map(e){return e.empty?this:new uc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new uc(Ko.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const dc=Aa.define({map:(e,t)=>e.map(t)}),pc=Aa.define();function fc(e,t,i){let n=e.facet(ic);n.length?n[0](t):window.onerror&&window.onerror(String(t),i,void 0,void 0,t)}const mc=ta.define({combine:e=>!e.length||e[0]});let Oc=0;const gc=ta.define();class vc{constructor(e,t,i,n,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:n,provide:r,decorations:s}=t||{};return new vc(Oc++,e,i,n,(e=>{let t=[gc.of(e)];return s&&t.push(xc.of((t=>{let i=t.plugin(e);return i?s(i):xh.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return vc.define((t=>new e(t)),t)}}class bc{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(fc(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(_$){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){fc(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(i){fc(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const yc=ta.define(),kc=ta.define(),xc=ta.define(),wc=ta.define(),Sc=ta.define(),Qc=ta.define();function $c(e,t){let i=e.state.facet(Qc);if(!i.length)return i;let n=i.map((t=>t instanceof Function?t(e):t)),r=[];return Ga.spans(n,t.from,t.to,{point(){},span(e,i,n,s){let o=e-t.from,a=i-t.from,l=r;for(let r=n.length-1;r>=0;r--,s--){let e,i=n[r].spec.bidiIsolate;if(null==i&&(i=Kh(t.text,o,a)),s>0&&l.length&&(e=l[l.length-1]).to==o&&e.direction==i)e.to=a,l=e.inner;else{let e={from:o,to:a,direction:i,inner:[]};l.push(e),l=e.inner}}}}),r}const _c=ta.define();function Pc(e){let t=0,i=0,n=0,r=0;for(let s of e.state.facet(_c)){let o=s(e);o&&(null!=o.left&&(t=Math.max(t,o.left)),null!=o.right&&(i=Math.max(i,o.right)),null!=o.top&&(n=Math.max(n,o.top)),null!=o.bottom&&(r=Math.max(r,o.bottom)))}return{left:t,right:i,top:n,bottom:r}}const Cc=ta.define();class Tc{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new Tc(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>i.toA)){if(n.toAh)break;r+=2}if(!a)return i;new Tc(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),s=a.toA,o=a.toB}}}class Ac{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Bo.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let n=[];this.changes.iterChangedRanges(((e,t,i,r)=>n.push(new Tc(e,t,i,r)))),this.changedRanges=n}static create(e,t,i){return new Ac(e,t,i)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class Ec extends Bl{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=xh.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Ph],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Tc(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?n=this.domChanged.newSel.head:function(e,t){let i=!1;t&&e.iterChangedRanges(((e,n)=>{et.from&&(i=!0)}));return i}(e.changes,this.hasComposition)||e.selectionSet||(n=e.state.selection.main.head));let r=n>-1?function(e,t,i){let n=Mc(e,i);if(!n)return null;let{node:r,from:s,to:o}=n,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(n.from,n.to)!=a)return null;let l=t.invertedDesc,h=new Tc(l.mapPos(s),l.mapPos(o),s,o),c=[];for(let u=r.parentNode;;u=u.parentNode){let t=Bl.get(u);if(t instanceof lh)c.push({node:u,deco:t.mark});else{if(t instanceof Ph||"DIV"==u.nodeName&&u.parentNode==e.contentDOM)return{range:h,text:r,marks:c,line:u};if(u==e.contentDOM)return null;c.push({node:u,deco:new wh({inclusive:!0,attributes:bh(u),tagName:u.tagName.toLowerCase()})})}}}(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:n}=this.hasComposition;i=new Tc(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(oh.ie||oh.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=function(e,t,i){let n=new Rc;return Ga.compare(e,t,i,n),n.changes}(this.decorations,this.updateDeco(),e.changes);return i=Tc.extendWithRanges(i,s),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:n}=this.view;n.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=oh.chrome||oh.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||n.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?n[s]:null;if(!e)break;let t,o,a,l,{fromA:h,toA:c,fromB:u,toB:d}=e;if(i&&i.range.fromBu){let e=Ah.build(this.view.state.doc,u,i.range.fromB,this.decorations,this.dynamicDecorationMap),n=Ah.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);o=e.breakAtStart,a=e.openStart,l=n.openEnd;let r=this.compositionView(i);n.breakAtStart?r.breakAfter=1:n.content.length&&r.merge(r.length,r.length,n.content[0],!1,n.openStart,0)&&(r.breakAfter=n.content[0].breakAfter,n.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),t=e.content.concat(r).concat(n.content)}else({content:t,breakAtStart:o,openStart:a,openEnd:l}=Ah.build(this.view.state.doc,u,d,this.decorations,this.dynamicDecorationMap));let{i:p,off:f}=r.findPos(c,1),{i:m,off:O}=r.findPos(h,-1);Wl(this,m,O,p,f,t,o,a,l)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(pc)&&(this.editContextFormatting=e.value)}compositionView(e){let t=new ah(e.text.nodeValue);t.flags|=8;for(let{deco:n}of e.marks)t=new lh(n,[t],t.length);let i=new Ph;return i.append(t,0),i}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let i=Bl.get(e);i&&i!=t&&(i.dom=null),t.setDOM(e)},i=this.childPos(e.range.fromB,1),n=this.children[i.i];t(e.line,n);for(let r=e.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],t(r>=0?e.marks[r].node:e.text,n)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&!(this.view.state.facet(mc)||this.dom.tabIndex>-1)&&xl(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||t||r))return;let s=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),l=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(oh.gecko&&o.empty&&!this.hasComposition&&(1==(h=a).node.nodeType&&h.node.firstChild&&(0==h.offset||"false"==h.node.childNodes[h.offset-1].contentEditable)&&(h.offset==h.node.childNodes.length||"false"==h.node.childNodes[h.offset].contentEditable))){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=l=new zl(e,0),s=!0}var h;let c=this.view.observer.selectionRange;!s&&c.focusNode&&(Sl(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Sl(l.node,l.offset,c.focusNode,c.focusOffset)||this.suppressWidgetCursorChange(c,o))||(this.view.observer.ignore((()=>{oh.android&&oh.chrome&&this.dom.contains(c.focusNode)&&function(e,t){for(let i=e;i&&i!=t;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=yl(this.view.root);if(e)if(o.empty){if(oh.gecko){let e=(t=a.node,n=a.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|(no.head&&([a,l]=[l,a]),t.setEnd(l.node,l.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}else;var t,n;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())})),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new zl(c.anchorNode,c.anchorOffset),this.impreciseHead=l.precise?null:new zl(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Sl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=yl(e.root),{anchorNode:n,anchorOffset:r}=e.observer.selectionRange;if(!(i&&t.empty&&t.assoc&&i.modify))return;let s=Ph.find(this,t.head);if(!s)return;let o=s.posAtStart;if(t.head==o||t.head==o+s.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&i.collapse(n,r)}moveToLine(e){let t,i=this.dom;if(e.node!=i)return e;for(let n=e.offset;!t&&n=0;n--){let e=Bl.get(i.childNodes[n]);e instanceof Ph&&(t=e.domAtPos(e.length))}return t?new zl(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=Bl.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;s--){let o=this.children[s],a=r-o.breakAfter,l=a-o.length;if(ae||o.covers(1))&&(!i||o instanceof Ph&&!(i instanceof Ph&&t>=0)))i=o,n=l;else if(i&&l==e&&a==e&&o instanceof Ch&&Math.abs(t)<2){if(o.deco.startSide<0)break;s&&(i=null)}r=l}return i?i.coordsAt(e-n,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),n=this.children[t];if(!(n instanceof Ph))return null;for(;n.children.length;){let{i:e,off:t}=n.childPos(i,1);for(;;e++){if(e==n.children.length)return null;if((n=n.children[e]).length)break}i=t}if(!(n instanceof ah))return null;let r=Lo(n.text,i);if(r==i)return null;let s=Zl(n.dom,i,r).getClientRects();for(let o=0;oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==Rh.LTR;for(let l=0,h=0;hn)break;if(l>=i){let i=e.dom.getBoundingClientRect();if(t.push(i.height),s){let t=e.dom.lastChild,n=t?wl(t):[];if(n.length){let e=n[n.length-1],t=a?e.right-i.left:i.right-e.left;t>o&&(o=t,this.minWidth=r,this.minWidthFrom=l,this.minWidthTo=c)}}}l=c+e.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?Rh.RTL:Rh.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Ph){let e=r.measureTextSize();if(e)return e}let e,t,i,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(n);let r=wl(n.firstChild)[0];e=n.getBoundingClientRect().height,t=r?r.width/27:7,i=r?r.height:e,n.remove()})),{lineHeight:e,charWidth:t,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Yl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let r=n==t.viewports.length?null:t.viewports[n],s=r?r.from-1:this.length;if(s>i){let n=(t.lineBlockAt(s).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(xh.replace({widget:new Th(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,s))}if(!r)break;i=r.to+1}return xh.set(e)}updateDeco(){let e=1,t=this.view.state.facet(xc).map((t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t)),i=!1,n=this.view.state.facet(wc).map(((e,t)=>{let n="function"==typeof e;return n&&(i=!0),n?e(this.view):e}));for(n.length&&(this.dynamicDecorationMap[e++]=i,t.push(Ga.join(n))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ei.anchor?-1:1);if(!n)return;!i.empty&&(t=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,t.left),top:Math.min(n.top,t.top),right:Math.max(n.right,t.right),bottom:Math.max(n.bottom,t.bottom)});let r=Pc(this.view),s={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;!function(e,t,i,n,r,s,o,a){let l=e.ownerDocument,h=l.defaultView||window;for(let c=e,u=!1;c&&!u;)if(1==c.nodeType){let e,d=c==l.body,p=1,f=1;if(d)e=Tl(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(u=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:p,scaleY:f}=Al(c,t)),e={left:t.left,right:t.left+c.clientWidth*p,top:t.top,bottom:t.top+c.clientHeight*f}}let m=0,O=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+O&&(O=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(O=t.bottom-e.bottom+o,i<0&&t.top-O0&&t.right>e.right+m&&(m=t.right-e.right+s)):t.right>e.right&&(m=t.right-e.right+s,i<0&&t.lefte.bottom||t.lefte.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else{if(11!=c.nodeType)break;c=c.host}}(this.view.scrollDOM,s,i.heade?t.left-e:Math.max(0,e-t.right)}function Zc(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function Lc(e,t){return e.topt.top+1}function Xc(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function Vc(e,t,i){let n,r,s,o,a,l,h,c,u=!1;for(let p=e.firstChild;p;p=p.nextSibling){let e=wl(p);for(let d=0;dO||o==O&&s>m){n=p,r=f,s=m,o=O;let a=O?i0?d0)}0==m?i>f.bottom&&(!h||h.bottomf.top)&&(l=p,c=f):h&&Lc(h,f)?h=qc(h,f.bottom):c&&Lc(c,f)&&(c=Xc(c,f.top))}}if(h&&h.bottom>=i?(n=a,r=h):c&&c.top<=i&&(n=l,r=c),!n)return{node:e,offset:0};let d=Math.max(r.left,Math.min(r.right,t));return 3==n.nodeType?Ic(n,d,i):u&&"false"!=n.contentEditable?Vc(n,d,i):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,n)+(t>=(r.left+r.right)/2?1:0)}}function Ic(e,t,i){let n=e.nodeValue.length,r=-1,s=1e9,o=0;for(let a=0;ai?h.top-i:i-h.bottom)-1;if(h.left-1<=t&&h.right+1>=t&&c=(h.left+h.right)/2,n=i;if(oh.chrome||oh.gecko){Zl(e,a).getBoundingClientRect().left==h.right&&(n=!i)}if(c<=0)return{node:e,offset:a+(n?1:0)};r=a+(n?1:0),s=c}}}return{node:e,offset:r>-1?r:o>0?e.nodeValue.length:0}}function zc(e,t,i,n=-1){var r,s;let o,a=e.contentDOM.getBoundingClientRect(),l=a.top+e.viewState.paddingTop,{docHeight:h}=e.viewState,{x:c,y:u}=t,d=u-l;if(d<0)return 0;if(d>h)return e.state.doc.length;for(let y=e.viewState.heightOracle.textHeight/2,k=!1;o=e.elementAtHeight(d),o.type!=kh.Text;)for(;d=n>0?o.bottom+y:o.top-y,!(d>=0&&d<=h);){if(k)return i?null:0;k=!0,n=-n}u=l+d;let p=o.from;if(pe.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:i?null:jc(e,a,o,c,u);let f=e.dom.ownerDocument,m=e.root.elementFromPoint?e.root:f,O=m.elementFromPoint(c,u);O&&!e.contentDOM.contains(O)&&(O=null),O||(c=Math.max(a.left+1,Math.min(a.right-1,c)),O=m.elementFromPoint(c,u),O&&!e.contentDOM.contains(O)&&(O=null));let g,v=-1;if(O&&0!=(null===(r=e.docView.nearest(O))||void 0===r?void 0:r.isEditable)){if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(c,u);e&&({offsetNode:g,offset:v}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(c,u);t&&(({startContainer:g,startOffset:v}=t),(!e.contentDOM.contains(g)||oh.safari&&function(e,t,i){let n;if(3!=e.nodeType||t!=(n=e.nodeValue.length))return!1;for(let r=e.nextSibling;r;r=r.nextSibling)if(1!=r.nodeType||"BR"!=r.nodeName)return!1;return Zl(e,n-1,n).getBoundingClientRect().left>i}(g,v,c)||oh.chrome&&function(e,t,i){if(0!=t)return!1;for(let r=e;;){let e=r.parentNode;if(!e||1!=e.nodeType||e.firstChild!=r)return!1;if(e.classList.contains("cm-line"))break;r=e}let n=1==e.nodeType?e.getBoundingClientRect():Zl(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return i-n.left>5}(g,v,c))&&(g=void 0))}g&&(v=Math.min(Pl(g),v))}if(!g||!e.docView.dom.contains(g)){let t=Ph.find(e.docView,p);if(!t)return d>o.top+o.height/2?o.to:o.from;({node:g,offset:v}=Vc(t.dom,c,u))}let b=e.docView.nearest(g);if(!b)return null;if(b.isWidget&&1==(null===(s=b.dom)||void 0===s?void 0:s.nodeType)){let e=b.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;s+=Math.floor((r-i.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(i.from,i.to);return i.from+function(e,t,i){for(let n=0,r=0;;){if(r>=t)return n;if(n==e.length)break;r+=9==e.charCodeAt(n)?i-r%i:1,n=Lo(e,n)}return e.length}(o,s,e.state.tabSize)}function Bc(e,t,i){let n=e.lineBlockAt(t);if(Array.isArray(n.type)){let e;for(let r of n.type){if(r.from>t)break;if(!(r.tot)return r;e&&(r.type!=kh.Text||e.type==r.type&&!(i<0?r.fromt))||(e=r)}}return e||n}return n}function Fc(e,t,i,n){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let a=t,l=null;;){let t=Hh(r,s,o,a,i),h=Uh;if(!t){if(r.number==(i?e.state.doc.lines:1))return a;h="\n",r=e.state.doc.line(r.number+(i?1:-1)),s=e.bidiSpans(r),t=e.visualLineSide(r,!i)}if(l){if(!l(h))return a}else{if(!n)return t;l=n(h)}a=t}}function Yc(e,t,i){for(;;){let n=0;for(let r of e)r.between(t-1,t+1,((e,r,s)=>{if(t>e&&tt(e))),i.from,t.head>i.from?-1:1);return n==i.from?i:Ko.cursor(n,ne)&&this.lineBreak(),n=r}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r,s=-1,o=1;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(r=n.exec(t))&&(s=r.index,o=r[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);i=s+o}}readNode(e){if(e.cmIgnore)return;let t=Bl.get(e),i=t&&t.overrideDOMText;if(null!=i){this.findPointInside(e,i.length);for(let e=i.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(3==e.nodeType?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Uc(e,i.node,i.offset)?t:0))}}function Uc(e,t,i){for(;;){if(!t||i-1;let{impreciseHead:r,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let t=r||s?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}=e.observer.selectionRange;i&&(t.push(new Hc(i,n)),r==i&&s==n||t.push(new Hc(r,s)));return t}(e),i=new Gc(t,e.state);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(e,t){if(0==e.length)return null;let i=e[0].pos,n=2==e.length?e[1].pos:i;return i>-1&&n>-1?Ko.single(i+t,n+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,i=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!kl(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),n=s&&s.node==t.anchorNode&&s.offset==t.anchorOffset||!kl(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),o=e.viewport;if((oh.ios||oh.chrome)&&e.state.selection.main.empty&&i!=n&&(o.from>0||o.toDate.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:n,to:o}=t.bounds,a=r.from,l=null;(8===s||oh.android&&t.text.length0&&a>0&&e.charCodeAt(o-1)==t.charCodeAt(a-1);)o--,a--;if("end"==n){i-=o+Math.max(0,s-Math.min(o,a))-s}if(o=o?s-i:0,a=s+(a-o),o=s}else if(a=a?s-i:0,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}(e.state.doc.sliceString(n,o,Nc),t.text,a-n,l);h&&(oh.chrome&&13==s&&h.toB==h.from+2&&t.text.slice(h.from,h.toB)==Nc+Nc&&h.toB--,i={from:n+h.from,to:n+h.toA,insert:_o.of(t.text.slice(h.from,h.toB).split(Nc))})}else n&&(!e.hasFocus&&e.state.facet(mc)||n.main.eq(r))&&(n=null);if(!i&&!n)return!1;if(!i&&t.typeOver&&!r.empty&&n&&n.main.empty?i={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:(oh.mac||oh.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(n&&2==i.insert.length&&(n=Ko.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:_o.of([i.insert.toString().replace("."," ")])}):i&&i.from>=r.from&&i.to<=r.to&&(i.from!=r.from||i.to!=r.to)&&r.to-r.from-(i.to-i.from)<=4?i={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,i.from).append(i.insert).append(e.state.doc.slice(i.to,r.to))}:oh.chrome&&i&&i.from==i.to&&i.from==r.head&&"\n "==i.insert.toString()&&e.lineWrapping&&(n&&(n=Ko.single(n.main.anchor-1,n.main.head-1)),i={from:r.from,to:r.to,insert:_o.of([" "])}),i)return eu(e,i,n,s);if(n&&!n.main.eq(r)){let t=!1,i="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),i=e.inputState.lastSelectionOrigin),e.dispatch({selection:n,scrollIntoView:t,userEvent:i}),!0}return!1}function eu(e,t,i,n=-1){if(oh.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(oh.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&" "==e.state.sliceDoc(t.from,r.from))&&1==t.insert.length&&2==t.insert.lines&&Ll(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&0==t.insert.length||8==n&&t.insert.lengthr.head)&&Ll(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&0==t.insert.length&&Ll(e.contentDOM,"Delete",46)))return!0;let s,o=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>s||(s=function(e,t,i){let n,r=e.state,s=r.selection.main;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let i=s.fromt.to?r.sliceDoc(t.to,s.to):"";n=r.replaceSelection(e.state.toText(i+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=r.changes(t),a=i&&i.main.to<=o.newLength?i.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let l,h=e.state.sliceDoc(t.from,t.to),c=i&&Mc(e,i.main.head);if(c){let e=t.insert.length-(t.to-t.from);l={from:c.from,to:c.to-e}}else l=e.state.doc.lineAt(s.head);let u=s.to-t.to,d=s.to-s.from;n=r.changeByRange((i=>{if(i.from==s.from&&i.to==s.to)return{changes:o,range:a||i.map(o)};let n=i.to-u,c=n-h.length;if(i.to-i.from!=d||e.state.sliceDoc(c,n)!=h||i.to>=l.from&&i.from<=l.to)return{range:i};let p=r.changes({from:c,to:n,insert:t.insert}),f=i.to-s.to;return{changes:p,range:a?Ko.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):i.map(p)}}))}else n={changes:o,selection:a&&r.selection.replaceRange(a)}}let o="input.type";(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,o+=".compose",e.inputState.compositionFirstChange&&(o+=".start",e.inputState.compositionFirstChange=!1));return r.update(n,{userEvent:o,scrollIntoView:!0})}(e,t,i));return e.state.facet(rc).some((i=>i(e,t.from,t.to,o,a)))||e.dispatch(a()),!0}class tu{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){var t;this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,oh.safari&&e.contentDOM.addEventListener("input",(()=>null)),oh.gecko&&(t=e.contentDOM.ownerDocument,_u.has(t)||(_u.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{}))))}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let i,n=t.target;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=Bl.get(n))&&i.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then((()=>this.runHandlers(e.type,e))):this.runHandlers(e.type,e)))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let e of i.observers)e(this.view,t);for(let e of i.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function i(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let n of e){let e=n.spec;if(e&&e.domEventHandlers)for(let t in e.domEventHandlers){let r=e.domEventHandlers[t];r&&i(t).handlers.push(iu(n.value,r))}if(e&&e.domEventObservers)for(let t in e.domEventObservers){let r=e.domEventObservers[t];r&&i(t).observers.push(iu(n.value,r))}}for(let n in lu)i(n).handlers.push(lu[n]);for(let n in hu)i(n).observers.push(hu[n]);return t}(e),i=this.handlers,n=this.view.contentDOM;for(let r in t)if("scroll"!=r){let e=!t[r].handlers.length,s=i[r];s&&e!=!s.handlers.length&&(n.removeEventListener(r,this.handleEvent),s=null),s||n.addEventListener(r,this.handleEvent,{passive:e})}for(let r in i)"scroll"==r||t[r]||n.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&su.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),oh.android&&oh.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!oh.ios||e.synthetic||e.altKey||e.metaKey||!((t=nu.find((t=>t.keyCode==e.keyCode)))&&!e.ctrlKey||ru.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&(!("Enter"==t.key&&e&&e.from0||!!(oh.safari&&!oh.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function iu(e,t){return(i,n)=>{try{return t.call(e,n,i)}catch(r){fc(i.state,r)}}}const nu=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ru="dthko",su=[16,17,18,20,91,92,224,225];function ou(e){return.7*Math.max(0,e)+8}class au{constructor(e,t,i,n){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t,i,n=e.ownerDocument;for(let r=e.parentNode;r&&!(r==n.body||t&&i);)if(1==r.nodeType)!i&&r.scrollHeight>r.clientHeight&&(i=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else{if(11!=r.nodeType)break;r=r.host}return{x:t,y:i}}(e.contentDOM),this.atoms=e.state.facet(Sc).map((t=>t(e)));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ja.allowMultipleSelections)&&function(e,t){let i=e.state.facet(Jh);return i.length?i[0](t):oh.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:i}=e.state.selection;if(i.empty)return!1;let n=yl(e.root);if(!n||0==n.rangeCount)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&e.top<=t.clientY&&e.bottom>=t.clientY)return!0}return!1}(e,t)||1!=ku(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(t=this.startEvent,i=e,Math.max(Math.abs(t.clientX-i.clientX),Math.abs(t.clientY-i.clientY))<10))return;var t,i;this.select(this.lastEvent=e);let n=0,r=0,s=0,o=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:l}=this.scrollParents.y.getBoundingClientRect());let h=Pc(this.view);e.clientX-h.left<=s+6?n=-ou(s-e.clientX):e.clientX+h.right>=a-6&&(n=ou(e.clientX-a)),e.clientY-h.top<=o+6?r=-ou(o-e.clientY):e.clientY+h.bottom>=l-6&&(r=ou(e.clientY-l)),this.setScrollSpeed(n,r)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ie.isUserEvent("input.type")))?this.destroy():this.style.update(e)&&setTimeout((()=>this.select(this.lastEvent)),20)}}const lu=Object.create(null),hu=Object.create(null),cu=oh.ie&&oh.ie_version<15||oh.ios&&oh.webkit_version<604;function uu(e,t,i){for(let n of e.facet(t))i=n(i,e);return i}function du(e,t){t=uu(e.state,oc,t);let i,{state:n}=e,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(null!=wu&&n.selection.ranges.every((e=>e.empty))&&wu==s.toString()){let e=-1;i=n.changeByRange((i=>{let a=n.doc.lineAt(i.from);if(a.from==e)return{range:i};e=a.from;let l=n.toText((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:a.from,insert:l},range:Ko.cursor(i.from+l.length)}}))}else i=o?n.changeByRange((e=>{let t=s.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Ko.cursor(e.from+t.length)}})):n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function pu(e,t,i,n){if(1==n)return Ko.cursor(t,i);if(2==n)return function(e,t,i=1){let n=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(0==r.length)return Ko.cursor(t);0==s?i=1:s==r.length&&(i=-1);let o=s,a=s;i<0?o=Lo(r.text,s,!1):a=Lo(r.text,s);let l=n(r.text.slice(o,a));for(;o>0;){let e=Lo(r.text,o,!1);if(n(r.text.slice(e,o))!=l)break;o=e}for(;a{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},lu.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),hu.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},hu.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},lu.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of e.state.facet(tc))if(i=n(e,t),i)break;if(i||0!=t.button||(i=function(e,t){let i=Ou(e,t),n=ku(t),r=e.state.selection;return{update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),r=r.map(e.changes))},get(t,s,o){let a,l=Ou(e,t),h=pu(e,l.pos,l.bias,n);if(i.pos!=l.pos&&!s){let t=pu(e,i.pos,i.bias,n),r=Math.min(t.from,h.from),s=Math.max(t.to,h.to);h=r1&&(a=function(e,t){for(let i=0;i=t)return Ko.create(e.ranges.slice(0,i).concat(e.ranges.slice(i+1)),e.mainIndex==i?0:e.mainIndex-(e.mainIndex>i?1:0))}return null}(r,l.pos))?a:o?r.addRange(h):Ko.create([h])}}}(e,t)),i){let n=!e.hasFocus;e.inputState.startMouseSelection(new au(e,t,i,n)),n&&e.observer.ignore((()=>{Dl(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()}));let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let fu=(e,t,i)=>t>=i.top&&t<=i.bottom&&e>=i.left&&e<=i.right;function mu(e,t,i,n){let r=Ph.find(e.docView,t);if(!r)return 1;let s=t-r.posAtStart;if(0==s)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&fu(i,n,o))return-1;let a=r.coordsAt(s,1);return a&&fu(i,n,a)?1:o&&o.bottom>=n?-1:1}function Ou(e,t){let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:i,bias:mu(e,i,t.clientX,t.clientY)}}const gu=oh.ie&&oh.ie_version<=11;let vu=null,bu=0,yu=0;function ku(e){if(!gu)return e.detail;let t=vu,i=yu;return vu=e,yu=Date.now(),bu=!t||i>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(bu+1)%3:1}function xu(e,t,i,n){if(!(i=uu(e.state,oc,i)))return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=n&&s&&function(e,t){let i=e.state.facet(ec);return i.length?i[0](t):oh.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:s.from,to:s.to}:null,a={from:r,insert:i},l=e.state.changes(o?[o,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}lu.dragstart=(e,t)=>{let{selection:{main:i}}=e.state;if(t.target.draggable){let n=e.docView.nearest(t.target);if(n&&n.isWidget){let e=n.posAtStart,t=e+n.length;(e>=i.to||t<=i.from)&&(i=Ko.range(e,t))}}let{inputState:n}=e;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,t.dataTransfer&&(t.dataTransfer.setData("Text",uu(e.state,ac,e.state.sliceDoc(i.from,i.to))),t.dataTransfer.effectAllowed="copyMove"),!1},lu.dragend=e=>(e.inputState.draggedContent=null,!1),lu.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let i=t.dataTransfer.files;if(i&&i.length){let n=Array(i.length),r=0,s=()=>{++r==i.length&&xu(e,t,n.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(n[e]=t.result),s()},t.readAsText(i[e])}return!0}{let i=t.dataTransfer.getData("Text");if(i)return xu(e,t,i,!0),!0}return!1},lu.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let i=cu?null:t.clipboardData;return i?(du(e,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{e.focus(),i.remove(),du(e,i.value)}),50)}(e),!1)};let wu=null;lu.copy=lu.cut=(e,t)=>{let{text:i,ranges:n,linewise:r}=function(e){let t=[],i=[],n=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),i.push(r));if(!t.length){let r=-1;for(let{from:n}of e.selection.ranges){let s=e.doc.lineAt(n);s.number>r&&(t.push(s.text),i.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),r=s.number}n=!0}return{text:uu(e,ac,t.join(e.lineBreak)),ranges:i,linewise:n}}(e.state);if(!i&&!r)return!1;wu=r?i:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=cu?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",i),!0):(function(e,t){let i=e.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=t,n.focus(),n.selectionEnd=t.length,n.selectionStart=0,setTimeout((()=>{n.remove(),e.focus()}),50)}(e,i),!1)};const Su=Pa.define();function Qu(e,t){let i=[];for(let n of e.facet(sc)){let r=n(e,t);r&&i.push(r)}return i.length?e.update({effects:i,annotations:Su.of(!0)}):null}function $u(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let i=Qu(e.state,t);i?e.dispatch(i):e.update([])}}),10)}hu.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),$u(e)},hu.blur=e=>{e.observer.clearSelectionRange(),$u(e)},hu.compositionstart=hu.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},hu.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,oh.chrome&&oh.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50))},hu.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},lu.beforeinput=(e,t)=>{var i,n;if("insertReplacementText"==t.inputType&&e.observer.editContext){let n=null===(i=t.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),r=t.getTargetRanges();if(n&&r.length){let t=r[0],i=e.posAtDOM(t.startContainer,t.startOffset),s=e.posAtDOM(t.endContainer,t.endOffset);return eu(e,{from:i,to:s,insert:e.state.toText(n)},null),!0}}let r;if(oh.chrome&&oh.android&&(r=nu.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return oh.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),oh.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout((()=>hu.compositionend(e,t)),20),!1};const _u=new Set;const Pu=["pre-wrap","normal","pre-line","break-spaces"];let Cu=!1;function Tu(){Cu=!1}class Au{constructor(e){this.lineWrapping=e,this.doc=_o.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Pu.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Du&&(Cu=!0),this.height=e)}replace(e,t,i){return Zu.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let r=this,s=i.doc;for(let o=n.length-1;o>=0;o--){let{fromA:a,toA:l,fromB:h,toB:c}=n[o],u=r.lineAt(a,Ru.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=l?u:r.lineAt(l,Ru.ByPosNoHeight,i,0,0);for(c+=d.to-l,l=d.to;o>0&&u.from<=n[o-1].toA;)a=n[o-1].fromA,h=n[o-1].fromB,o--,a2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),i+=1+r.break,n-=r.size}else{if(!(r>2*n))break;{let t=e[i];t.break?e.splice(i,1,t.left,null,t.right):e.splice(i,1,t.left,t.right),i+=2+t.break,r-=t.size}}else if(n=r&&s(this.blockAt(0,i,n,r))}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class qu extends Xu{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,n){return new Mu(n,this.length,i,this.height,this.breaks)}replace(e,t,i){let n=i[0];return 1==i.length&&(n instanceof qu||n instanceof Vu&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof Vu?n=new qu(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):Zu.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Vu extends Zu{constructor(e){super(e,0)}heightMetrics(e,t){let i,n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*s);i=t/s,this.length>s+1&&(o=(this.height-t)/(this.length-s-1))}else i=this.height/s;return{firstLine:n,lastLine:r,perLine:i,perChar:o}}blockAt(e,t,i,n){let{firstLine:r,lastLine:s,perLine:o,perChar:a}=this.heightMetrics(t,n);if(t.lineWrapping){let r=n+(e0){let e=i[i.length-1];e instanceof Vu?i[i.length-1]=new Vu(e.length+n):i.push(null,new Vu(n-1))}if(e>0){let t=i[0];t instanceof Vu?i[0]=new Vu(e+t.length):i.unshift(new Vu(e-1),null)}return Zu.of(i)}decomposeLeft(e,t){t.push(new Vu(e-1),null)}decomposeRight(e,t){t.push(null,new Vu(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let r=t+this.length;if(n&&n.from<=t+this.length&&n.more){let i=[],s=Math.max(t,n.from),o=-1;for(n.from>t&&i.push(new Vu(n.from-t-1).updateHeight(e,t));s<=r&&n.more;){let t=e.doc.lineAt(s).length;i.length&&i.push(null);let r=n.heights[n.index++];-1==o?o=r:Math.abs(r-o)>=Du&&(o=-2);let a=new qu(t,r);a.outdated=!1,i.push(a),s+=t+1}s<=r&&i.push(null,new Vu(r-s).updateHeight(e,s));let a=Zu.of(i);return(o<0||Math.abs(a.height-this.height)>=Du||Math.abs(o-this.heightMetrics(e,t).perLine)>=Du)&&(Cu=!0),Lu(this,a)}return(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Iu extends Zu{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return 1&this.flags}blockAt(e,t,i,n){let r=i+this.left.height;return eo))return l;let h=t==Ru.ByPosNoHeight?Ru.ByPosNoHeight:Ru.ByPos;return a?l.join(this.right.lineAt(o,h,i,s,o)):this.left.lineAt(o,h,i,n,r).join(l)}forEachLine(e,t,i,n,r,s){let o=n+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,o,a,s);else{let l=this.lineAt(a,Ru.ByPos,i,n,r);e=e&&l.from<=t&&s(l),t>l.to&&this.right.forEachLine(l.to+1,t,i,o,a,s)}}replace(e,t,i){let n=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let r=[];e>0&&this.decomposeLeft(e,r);let s=r.length;for(let o of i)r.push(o);if(e>0&&zu(r,s-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e2*t.size||t.size>2*e.size?Zu.of(this.break?[e,null,t]:[e,t]):(this.left=Lu(this.left,e),this.right=Lu(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,n){let{left:r,right:s}=this,o=t+r.length+this.break,a=null;return n&&n.from<=t+r.length&&n.more?a=r=r.updateHeight(e,t,i,n):r.updateHeight(e,t,i),n&&n.from<=o+s.length&&n.more?a=s=s.updateHeight(e,o,i,n):s.updateHeight(e,o,i),a?this.balanced(r,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function zu(e,t){let i,n;null==e[t]&&(i=e[t-1])instanceof Vu&&(n=e[t+1])instanceof Vu&&e.splice(t-1,3,new Vu(i.length+1+n.length))}class ju{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof qu?i.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new qu(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=5)&&this.addLineDeco(n,r,s)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new qu(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new Vu(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof qu)return e;let t=new qu(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof qu||this.isCovered?(this.writtenTot.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=i.overflow){let i=t.getBoundingClientRect();s=Math.max(s,i.left),o=Math.min(o,i.right),a=Math.max(a,i.top),l=Math.min(h==e.parentNode?r.innerHeight:l,i.bottom)}h="absolute"==i.position||"fixed"==i.position?t.offsetParent:t.parentNode}else{if(11!=h.nodeType)break;h=h.host}return{left:s-i.left,right:Math.max(s,o)-i.left,top:a-(i.top+t),bottom:Math.max(a,l)-(i.top+t)}}function Yu(e,t){let i=e.getBoundingClientRect();return{left:0,right:i.right-i.left,top:t,bottom:i.bottom-(i.top+t)}}class Wu{constructor(e,t,i,n){this.from=e,this.to=t,this.size=i,this.displaySize=n}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new Au(t),this.stateDeco=e.facet(xc).filter((e=>"function"!=typeof e)),this.heightMap=Zu.empty().applyChanges(this.stateDeco,_o.empty,this.heightOracle.setDoc(e.doc),[new Tc(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=xh.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let n=i?t.head:t.anchor;if(!e.some((({from:e,to:t})=>n>=e&&n<=t))){let{from:t,to:i}=this.lineBlockAt(n);e.push(new Uu(t,i))}}return this.viewports=e.sort(((e,t)=>e.from-t.from)),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Ju:new ed(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(e=>{this.viewportLines.push(td(e,this.scaler))}))}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(xc).filter((e=>"function"!=typeof e));let n=e.changedRanges,r=Tc.extendWithRanges(n,function(e,t,i){let n=new Bu;return Ga.compare(e,t,i,n,0),n.changes}(i,this.stateDeco,e?e.changes:Bo.empty(this.state.doc.length))),s=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Tu(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=s||Cu)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(l||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(hc)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?Rh.RTL:Rh.LTR;let s=this.heightOracle.mustRefreshForWrapping(r),o=t.getBoundingClientRect(),a=s||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let l=0,h=0;if(o.width&&o.height){let{scaleX:e,scaleY:i}=Al(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||i>.005&&Math.abs(this.scaleY-i)>.005)&&(this.scaleX=e,this.scaleY=i,l|=16,s=a=!0)}let c=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==c&&this.paddingBottom==u||(this.paddingTop=c,this.paddingBottom=u,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=ql(e.scrollDOM);let p=(this.printing?Yu:Fu)(t,this.paddingTop),f=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(a=!0)),!this.inView&&!this.scrollTarget&&!function(e){let t=e.getBoundingClientRect(),i=e.ownerDocument.defaultView||window;return t.left0&&t.top0}(e.dom))return 0;let g=o.width;if(this.contentDOMWidth==g&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(t)&&(s=!0),s||n.lineWrapping&&Math.abs(g-this.contentDOMWidth)>n.charWidth){let{lineHeight:i,charWidth:o,textHeight:a}=e.docView.measureTextSize();s=i>0&&n.refresh(r,i,o,a,g/o,t),s&&(e.docView.minWidth=0,l|=16)}f>0&&m>0?h=Math.max(f,m):f<0&&m<0&&(h=Math.min(f,m)),Tu();for(let i of this.viewports){let r=i.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(i);this.heightMap=(s?Zu.empty().applyChanges(this.stateDeco,_o.empty,this.heightOracle,[new Tc(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,s,new Eu(i.from,r))}Cu&&(l|=2)}let v=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return v&&(2&l&&(l|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),l|=this.updateForViewport()),(2&l||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:s,visibleBottom:o}=this,a=new Uu(n.lineAt(s-1e3*i,Ru.ByHeight,r,0,0).from,n.lineAt(o+1e3*(1-i),Ru.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let i,s=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=n.lineAt(e,Ru.ByPos,r,0,0);i="center"==t.y?(o.top+o.bottom)/2-s/2:"start"==t.y||"nearest"==t.y&&e=o+Math.max(10,Math.min(i,250)))&&n>s-2e3&&r>1,s=n<<1;if(this.defaultTextDirection!=Rh.LTR&&!i)return[];let o=[],a=(n,s,l,h)=>{if(s-nn&&ee.from>=l.from&&e.to<=l.to&&Math.abs(e.from-n)e.fromt))));if(!d){if(se.from<=s&&e.to>=s))){let e=t.moveToLineBoundary(Ko.cursor(s),!1,!0).head;e>n&&(s=e)}let e=this.gapSize(l,n,s,h);d=new Wu(n,s,e,i||e<2e6?e:2e6)}o.push(d)},l=t=>{if(t.lengthr&&(n.push({from:r,to:e}),s+=e-r),r=t}},20),r2e6)for(let n of e)n.from>=t.from&&n.fromt.from&&a(t.from,o,t,r),le.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];Ga.spans(t,this.viewport.from,this.viewport.to,{span(e,t){i.push({from:e,to:t})},point(){}},20);let n=0;if(i.length!=this.visibleRanges.length)n=12;else for(let r=0;r=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||td(this.heightMap.lineAt(e,Ru.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((t=>t.top<=e&&t.bottom>=e))||td(this.heightMap.lineAt(this.scaler.fromDOM(e),Ru.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return td(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Uu{constructor(e,t){this.from=e,this.to=t}}function Hu({total:e,ranges:t},i){if(i<=0)return t[0].from;if(i>=1)return t[t.length-1].to;let n=Math.floor(e*i);for(let r=0;;r++){let{from:e,to:i}=t[r],s=i-e;if(n<=s)return e+n;n-=s}}function Ku(e,t){let i=0;for(let{from:n,to:r}of e.ranges){if(t<=r){i+=t-n;break}i+=r-n}return i/e.total}const Ju={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};class ed{constructor(e,t,i){let n=0,r=0,s=0;this.viewports=i.map((({from:i,to:r})=>{let s=t.lineAt(i,Ru.ByPos,e,0,0).top,o=t.lineAt(r,Ru.ByPos,e,0,0).bottom;return n+=o-s,{from:i,to:r,top:s,bottom:o,domTop:0,domBottom:0}})),this.scale=(7e6-n)/(t.height-n);for(let o of this.viewports)o.domTop=s+(o.top-r)*this.scale,s=o.domBottom=o.domTop+(o.bottom-o.top),r=o.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let r=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to)))}}function td(e,t){if(1==t.scale)return e;let i=t.toDOM(e.top),n=t.toDOM(e.bottom);return new Mu(e.from,e.length,i,n-i,Array.isArray(e._content)?e._content.map((e=>td(e,t))):e._content)}const id=ta.define({combine:e=>e.join(" ")}),nd=ta.define({combine:e=>e.indexOf(!0)>-1}),rd=ul.newName(),sd=ul.newName(),od=ul.newName(),ad={"&light":"."+sd,"&dark":"."+od};function ld(e,t,i){return new ul(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]})):e+" "+t})}const hd=ld("."+rd,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ad),cd={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ud=oh.ie&&oh.ie_version<=11;class dd{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new El,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(oh.ie&&oh.ie_version<=11||oh.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),!window.EditContext||!1===e.constructor.EDIT_CONTEXT||oh.chrome&&oh.chrome_version<126||(this.editContext=new md(e),e.state.facet(mc)&&(e.contentDOM.editContext=this.editContext.editContext)),ud&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,i)=>t!=e[i])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(mc)?i.root.activeElement!=this.dom:!xl(this.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(oh.ie&&oh.ie_version<=11||oh.android&&oh.chrome)&&!i.state.selection.main.empty&&n.focusNode&&Sl(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=yl(e.root);if(!t)return!1;let i=oh.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return fd(e,i)}let i=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),i=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),i?fd(e,i):null}(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let n=xl(this.dom,i);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;if(e){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&Ll(this.dom,e.key,e.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,n=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(n=!0),-1==t?({from:t,to:i}=e):(t=Math.min(e.from,t),i=Math.max(e.to,i)))}return{from:t,to:i,typeOver:n}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),n=this.selectionChanged&&xl(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Kc(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,n=Jc(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let i=pd(t,e.previousSibling||e.target.previousSibling,-1),n=pd(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(mc)!=e.state.facet(mc)&&(e.view.contentDOM.editContext=e.state.facet(mc)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function pd(e,t,i){for(;t;){let n=Bl.get(t);if(n&&n.parent==e)return n;let r=t.parentNode;t=r!=e.dom?r:i>0?t.nextSibling:t.previousSibling}return null}function fd(e,t){let i=t.startContainer,n=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor);return Sl(o.node,o.offset,r,s)&&([i,n,r,s]=[r,s,i,n]),{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}}class md{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=t=>{let i=e.state.selection.main,{anchor:n,head:r}=i,s=this.toEditorPos(t.updateRangeStart),o=this.toEditorPos(t.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:t.updateRangeStart,editorBase:s,drifted:!1});let a={from:s,to:o,insert:_o.of(t.text.split("\n"))};if(a.from==this.from&&nthis.to&&(a.to=n),a.from!=a.to||a.insert.length){if((oh.mac||oh.android)&&a.from==r-1&&/^\. ?$/.test(t.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(a={from:s,to:o,insert:_o.of([t.text.replace("."," ")])}),this.pendingContextChange=a,!e.state.readOnly){let i=this.to-this.from+(a.to-a.from+a.insert.length);eu(e,a,Ko.single(this.toEditorPos(t.selectionStart,i),this.toEditorPos(t.selectionEnd,i)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))}else{let n=Ko.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd));n.main.eq(i)||e.dispatch({selection:n,userEvent:"select"})}},this.handlers.characterboundsupdate=i=>{let n=[],r=null;for(let t=this.toEditorPos(i.rangeStart),s=this.toEditorPos(i.rangeEnd);t{let i=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,n=e.underlineThickness;if("None"!=t&&"None"!=n){let r=this.toEditorPos(e.rangeStart),s=this.toEditorPos(e.rangeEnd);if(r{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=yl(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges(((r,s,o,a,l)=>{if(i)return;let h=l.length-(s-r);if(n&&s>=n.to){if(n.from==r&&n.to==s&&n.insert.eq(l))return n=this.pendingContextChange=null,t+=h,void(this.to+=h);n=null,this.revertPending(e.state)}if(r+=t,(s+=t)<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+l.length>3e4)return void(i=!0);this.editContext.updateText(this.toContextPos(r),this.toContextPos(s),l.toString()),this.to+=h}t+=h})),n&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some((e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to))))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==n||this.editContext.updateSelection(i,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Od{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(e=>e.forEach((e=>i(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new Gu(e.state||ja.create(e)),e.scrollTo&&e.scrollTo.is(dc)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(gc).map((e=>new bc(e)));for(let n of this.plugins)n.update(this);this.observer=new dd(this),this.inputState=new tu(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Ec(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then((()=>this.requestMeasure()))}dispatch(...e){let t=1==e.length&&e[0]instanceof Ea?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,i=!1,n=!1,r=this.state;for(let d of e){if(d.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=d.state}if(this.destroyed)return void(this.viewState.state=r);let s=this.hasFocus,o=0,a=null;e.some((e=>e.annotation(Su)))?(this.inputState.notifiedFocused=s,o=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,a=Qu(r,s),a||(o=1));let l=this.observer.delayedAndroidKey,h=null;if(l?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(ja.phrases)!=this.state.facet(ja.phrases))return this.setState(r);t=Ac.create(this,r,e),t.flags|=o;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(c&&(c=c.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;c=new uc(e.empty?e:Ko.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(dc)&&(c=e.value.clip(this.state))}this.viewState.update(t,c),this.bidiCache=bd.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),i=this.docView.update(t),this.state.facet(Cc)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(id)!=t.state.facet(id)&&(this.viewState.mustMeasureContent=!0),(i||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!t.empty)for(let d of this.state.facet(nc))try{d(t)}catch(u){fc(this.state,u,"update listener")}(a||h)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Jc(this,h)&&l.force&&Ll(this.contentDOM,l.key,l.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new Gu(e),this.plugins=e.facet(gc).map((e=>new bc(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new Ec(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(gc),i=e.state.facet(gc);if(t!=i){let n=[];for(let r of i){let i=t.indexOf(r);if(i<0)n.push(new bc(r));else{let t=this.plugins[i];t.mustUpdate=e,n.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:s}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(s<0)if(ql(i))r=-1,s=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(n);r=e.from,s=e.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5)break;let l=[];4&a||([this.measureRequests,l]=[l,this.measureRequests]);let h=l.map((e=>{try{return e.read(this)}catch(t){return fc(this.state,t),vd}})),c=Ac.create(this,this.state,[]),u=!1;c.flags|=a,t?t.flags|=a:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c),u&&this.docViewUpdate());for(let e=0;e1||e<-1){n+=e,i.scrollTop=n/this.scaleY,s=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(nc))a(t)}get themeClasses(){return rd+" "+(this.state.facet(nd)?od:sd)+" "+this.state.facet(id)}updateAttrs(){let e=yd(this,yc,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(mc)?"true":"false",class:"cm-content",style:`${oh.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),yd(this,kc,t);let i=this.observer.ignore((()=>{let i=vh(this.contentDOM,this.contentAttrs,t),n=vh(this.dom,this.editorAttrs,e);return i||n}));return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let e of i.effects)if(e.is(Od.announce)){t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value}}mountStyles(){this.styleModules=this.state.facet(Cc);let e=this.state.facet(Od.cspNonce);ul.mount(this.root,this.styleModules.concat(hd).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Wc(this,e,Fc(this,e,t,i))}moveByGroup(e,t){return Wc(this,e,Fc(this,e,t,(t=>function(e,t,i){let n=e.state.charCategorizer(t),r=n(i);return e=>{let t=n(e);return r==qa.Space&&(r=t),r==t}}(this,e.head,t))))}visualLineSide(e,t){let i=this.bidiSpans(e),n=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return Ko.cursor(r.side(t,n)+e.from,r.forward(!t,n)?1:-1)}moveToLineBoundary(e,t,i=!0){return function(e,t,i,n){let r=Bc(e,t.head,t.assoc||-1),s=n&&r.type==kh.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(s){let t=e.dom.getBoundingClientRect(),n=e.textDirectionAt(r.from),o=e.posAtCoords({x:i==(n==Rh.LTR)?t.right-1:t.left+1,y:(s.top+s.bottom)/2});if(null!=o)return Ko.cursor(o,i?-1:1)}return Ko.cursor(i?r.to:r.from,i?-1:1)}(this,e,t,i)}moveVertically(e,t,i){return Wc(this,e,function(e,t,i,n){let r=t.head,s=i?1:-1;if(r==(i?e.state.doc.length:0))return Ko.cursor(r,t.assoc);let o,a=t.goalColumn,l=e.contentDOM.getBoundingClientRect(),h=e.coordsAtPos(r,t.assoc||-1),c=e.documentTop;if(h)null==a&&(a=h.left-l.left),o=s<0?h.top:h.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(r-t.from))),o=(s<0?t.top:t.bottom)+c}let u=l.left+a,d=null!=n?n:e.viewState.heightOracle.textHeight>>1;for(let p=0;;p+=10){let t=o+(d+p)*s,i=zc(e,{x:u,y:t},!1,s);if(tl.bottom||(s<0?ir)){let n=e.docView.coordsForChar(i),r=!n||t0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(lc)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>gd)return Gh(e.length);let t,i=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==i&&(r.fresh||Fh(r.isolates,t=$c(this,e))))return r.order;t||(t=$c(this,e));let n=function(e,t,i){if(!e)return[new Bh(0,0,t==Zh?1:0)];if(t==Dh&&!i.length&&!jh.test(e))return Gh(e.length);if(i.length)for(;e.length>Yh.length;)Yh[Yh.length]=256;let n=[],r=t==Dh?0:1;return Nh(e,r,r,i,0,e.length,n),n}(e.text,i,t);return this.bidiCache.push(new bd(e.from,e.to,i,t,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||oh.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{Dl(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return dc.of(new uc("number"==typeof e?Ko.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return dc.of(new uc(Ko.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return vc.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return vc.define((()=>({})),{eventObservers:e})}static theme(e,t){let i=ul.newName(),n=[id.of(i),Cc.of(ld(`.${i}`,e))];return t&&t.dark&&n.push(nd.of(!0)),n}static baseTheme(e){return fa.lowest(Cc.of(ld("."+rd,e,ad)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&Bl.get(i)||Bl.get(e);return(null===(t=null==n?void 0:n.rootView)||void 0===t?void 0:t.view)||null}}Od.styleModule=Cc,Od.inputHandler=rc,Od.clipboardInputFilter=oc,Od.clipboardOutputFilter=ac,Od.scrollHandler=cc,Od.focusChangeEffect=sc,Od.perLineTextDirection=lc,Od.exceptionSink=ic,Od.updateListener=nc,Od.editable=mc,Od.mouseSelectionStyle=tc,Od.dragMovesSelection=ec,Od.clickAddsSelectionRange=Jh,Od.decorations=xc,Od.outerDecorations=wc,Od.atomicRanges=Sc,Od.bidiIsolatedRanges=Qc,Od.scrollMargins=_c,Od.darkTheme=nd,Od.cspNonce=ta.define({combine:e=>e.length?e[0]:""}),Od.contentAttributes=kc,Od.editorAttributes=yc,Od.lineWrapping=Od.contentAttributes.of({class:"cm-lineWrapping"}),Od.announce=Aa.define();const gd=4096,vd={};class bd{constructor(e,t,i,n,r,s){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=r,this.order=s}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let i=[],n=e.length?e[e.length-1].dir:Rh.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=n[r],s="function"==typeof t?t(e):t;s&&mh(s,i)}return i}const kd=oh.mac?"mac":oh.windows?"win":oh.linux?"linux":"key";function xd(e,t,i){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==i&&t.shiftKey&&(e="Shift-"+e),e}const wd=fa.default(Od.domEventHandlers({keydown:(e,t)=>Td($d(t.state),e,t,"editor")})),Sd=ta.define({enables:wd}),Qd=new WeakMap;function $d(e){let t=e.facet(Sd),i=Qd.get(t);return i||Qd.set(t,i=function(e,t=kd){let i=Object.create(null),n=Object.create(null),r=(e,t)=>{let i=n[e];if(null==i)n[e]=t;else if(i!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},s=(e,n,s,o,a)=>{var l,h;let c=i[e]||(i[e]=Object.create(null)),u=n.split(/ (?!$)/).map((e=>function(e,t){const i=e.split(/-(?!$)/);let n,r,s,o,a=i[i.length-1];"Space"==a&&(a=" ");for(let l=0;l{let n=_d={view:t,prefix:i,scope:e};return setTimeout((()=>{_d==n&&(_d=null)}),Pd),!0}]})}let d=u.join(" ");r(d,!1);let p=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null===(h=null===(l=c._any)||void 0===l?void 0:l.run)||void 0===h?void 0:h.slice())||[]});s&&p.run.push(s),o&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let o of e){let e=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let t of e){let e=i[t]||(i[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:n}=o;for(let t in e)e[t].run.push((e=>n(e,Cd)))}let n=o[t]||o.key;if(n)for(let t of e)s(t,n,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(t,"Shift-"+n,o.shift,o.preventDefault,o.stopPropagation)}return i}(t.reduce(((e,t)=>e.concat(t)),[]))),i}let _d=null;const Pd=4e3;let Cd=null;function Td(e,t,i,n){Cd=t;let r=function(e){var t=!(Ol&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||gl&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?ml:fl)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),s=Vo(Xo(r,0))==r.length&&" "!=r,o="",a=!1,l=!1,h=!1;_d&&_d.view==i&&_d.scope==n&&(o=_d.prefix+" ",su.indexOf(t.keyCode)<0&&(l=!0,_d=null));let c,u,d=new Set,p=e=>{if(e){for(let t of e.run)if(!d.has(t)&&(d.add(t),t(i)))return e.stopPropagation&&(h=!0),!0;e.preventDefault&&(e.stopPropagation&&(h=!0),l=!0)}return!1},f=e[n];return f&&(p(f[o+xd(r,t,!s)])?a=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(oh.windows&&t.ctrlKey&&t.altKey)&&(c=fl[t.keyCode])&&c!=r?(p(f[o+xd(c,t,!0)])||t.shiftKey&&(u=ml[t.keyCode])!=r&&u!=c&&p(f[o+xd(u,t,!1)]))&&(a=!0):s&&t.shiftKey&&p(f[o+xd(r,t,!0)])&&(a=!0),!a&&p(f._any)&&(a=!0)),l&&(a=!0),a&&h&&t.stopPropagation(),Cd=null,a}class Ad{constructor(e,t,i,n,r){this.className=e,this.left=t,this.top=i,this.width=n,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let n=e.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let r=Ed(e);return[new Ad(t,n.left-r.left,n.top-r.top,null,n.bottom-n.top)]}return function(e,t,i){if(i.to<=e.viewport.from||i.from>=e.viewport.to)return[];let n=Math.max(i.from,e.viewport.from),r=Math.min(i.to,e.viewport.to),s=e.textDirection==Rh.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),l=Ed(e),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),u=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),p=Bc(e,n,1),f=Bc(e,r,-1),m=p.type==kh.Text?p:null,O=f.type==kh.Text?f:null;m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=Md(e,n,1,m));O&&(e.lineWrapping||f.widgetLineBreaks)&&(O=Md(e,r,-1,O));if(m&&O&&m.from==O.from&&m.to==O.to)return v(b(i.from,i.to,m));{let t=m?b(i.from,null,m):y(p,!1),n=O?b(null,i.to,O):y(f,!0),r=[];return(m||p).to<(O||f).from-(m&&O?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2h&&s.from=r)break;a>n&&l(Math.max(e,n),null==t&&e<=h,Math.min(a,r),null==i&&a>=c,o.dir)}if(n=s.to+1,n>=r)break}return 0==a.length&&l(h,null==t,c,null==i,e.textDirection),{top:r,bottom:o,horizontal:a}}function y(e,t){let i=a.top+(t?e.top:e.bottom);return{top:i,bottom:i,horizontal:[]}}}(e,t,i)}}function Ed(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Rh.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Md(e,t,i,n){let r=e.coordsAtPos(t,2*i);if(!r)return n;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,a=e.posAtCoords({x:s.left+1,y:o}),l=e.posAtCoords({x:s.right-1,y:o});return null==a||null==l?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}class Rd{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Dd)!=e.state.facet(Dd)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Dd);for(;t{return i=e,n=this.drawn[t],!(i.constructor==n.constructor&&i.eq(n));var i,n}))){let t=this.dom.firstChild,i=0;for(let n of e)n.update&&t&&n.constructor&&this.drawn[i].constructor&&n.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(n.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Dd=ta.define();function Zd(e){return[vc.define((t=>new Rd(t,e))),Dd.of(e)]}const Ld=ta.define({combine:e=>Ba(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function Xd(e={}){return[Ld.of(e),Vd,zd,jd,hc.of(!0)]}function qd(e){return e.startState.facet(Ld)!=e.state.facet(Ld)}const Vd=Zd({above:!0,markers(e){let{state:t}=e,i=t.facet(Ld),n=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||i.drawRangeCursor){let t=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=r.empty?r:Ko.cursor(r.head,r.head>r.anchor?-1:1);for(let r of Ad.forRange(e,t,i))n.push(r)}}return n},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let i=qd(e);return i&&Id(e.state,t),e.docChanged||e.selectionSet||i},mount(e,t){Id(t.state,e)},class:"cm-cursorLayer"});function Id(e,t){t.style.animationDuration=e.facet(Ld).cursorBlinkRate+"ms"}const zd=Zd({above:!1,markers:e=>e.state.selection.ranges.map((t=>t.empty?[]:Ad.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t))),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||qd(e),class:"cm-selectionLayer"}),jd=fa.highest(Od.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));class Bd extends yh{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?wl(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),n=Cl(t[0],"rtl"!=i.direction),r=parseInt(i.lineHeight);return n.bottom-n.top>1.5*r?{left:n.left,right:n.right,top:n.top,bottom:n.top+r}:n}ignoreEvent(){return!1}}const Fd="-10000px";class Yd{constructor(e,t,i,n){this.facet=t,this.createTooltipView=i,this.removeTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e));let r=null;this.tooltipViews=this.tooltips.map((e=>r=i(e,r)))}update(e,t){var i;let n=e.state.facet(this.facet),r=n.filter((e=>e));if(n===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let s=[],o=t?[]:null;for(let a=0;at[i]=e)),t.length=o.length),this.input=n,this.tooltips=r,this.tooltipViews=s,!0}}function Wd(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const Nd=ta.define({combine:e=>{var t,i,n;return{position:oh.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(i=e.find((e=>e.parent)))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=e.find((e=>e.tooltipSpace)))||void 0===n?void 0:n.tooltipSpace)||Wd}}}),Gd=new WeakMap,Ud=vc.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(Nd);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver((()=>this.measureSoon())):null,this.manager=new Yd(e,ep,((e,t)=>this.createTooltip(e,t)),(e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()})),this.above=this.manager.tooltips.map((e=>!!e.above)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let i=t||e.geometryChanged,n=e.state.facet(Nd);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(e,t){let i=e.create(this.view),n=t?t.dom:null;if(i.dom.classList.add("cm-tooltip"),e.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",i.dom.appendChild(e)}return i.dom.style.position=this.position,i.dom.style.top=Fd,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var e,t,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),null===(e=n.destroy)||void 0===e||e.call(n);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(oh.gecko)i=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==Fd&&"0px"==e.style.left){let t=e.getBoundingClientRect();i=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(i||"absolute"==this.position)if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=Pc(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(Nd).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{visible:i,space:n,scaleX:r,scaleY:s}=e,o=[];for(let a=0;a=Math.min(i.bottom,n.bottom)||u.rightMath.min(i.right,n.right)+.1)){c.style.top=Fd;continue}let p=l.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,f=p?7:0,m=d.right-d.left,O=null!==(t=Gd.get(h))&&void 0!==t?t:d.bottom-d.top,g=h.offset||Jd,v=this.view.textDirection==Rh.LTR,b=d.width>n.right-n.left?v?n.left:n.right-d.width:v?Math.max(n.left,Math.min(u.left-(p?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(p?14:0)-g.x),n.right-m),y=this.above[a];!l.strictSide&&(y?u.top-O-f-g.yn.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[a]=!y);let k=(y?u.top-n.top:n.bottom-u.bottom)-f;if(kb&&e.topx&&(x=y?e.top-O-2-f:e.bottom+f+2);if("absolute"==this.position?(c.style.top=(x-e.parent.top)/s+"px",Hd(c,(b-e.parent.left)/r)):(c.style.top=x/s+"px",Hd(c,b/r)),p){let e=u.left+(v?g.x:-g.x)-(b+14-7);p.style.left=e/r+"px"}!0!==h.overlap&&o.push({left:b,top:x,right:w,bottom:x+O}),c.classList.toggle("cm-tooltip-above",y),c.classList.toggle("cm-tooltip-below",!y),h.positioned&&h.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Fd}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Hd(e,t){let i=parseInt(e.style.left,10);(isNaN(i)||Math.abs(t-i)>1)&&(e.style.left=t+"px")}const Kd=Od.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Jd={x:0,y:0},ep=ta.define({enables:[Ud,Kd]});function tp(e,t){let i=e.plugin(Ud);if(!i)return null;let n=i.manager.tooltips.indexOf(t);return n<0?null:i.manager.tooltipViews[n]}const ip=ta.define({combine(e){let t,i;for(let n of e)t=t||n.topContainer,i=i||n.bottomContainer;return{topContainer:t,bottomContainer:i}}});function np(e,t){let i=e.plugin(rp),n=i?i.specs.indexOf(t):-1;return n>-1?i.panels[n]:null}const rp=vc.fromClass(class{constructor(e){this.input=e.state.facet(ap),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(ip);this.top=new sp(e,!0,t.topContainer),this.bottom=new sp(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let i of this.panels)i.dom.classList.add("cm-panel"),i.mount&&i.mount()}update(e){let t=e.state.facet(ip);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new sp(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new sp(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=e.state.facet(ap);if(i!=this.input){let t=i.filter((e=>e)),n=[],r=[],s=[],o=[];for(let i of t){let t,a=this.specs.indexOf(i);a<0?(t=i(e.view),o.push(t)):(t=this.panels[a],t.update&&t.update(e)),n.push(t),(t.top?r:s).push(t)}this.specs=t,this.panels=n,this.top.sync(r),this.bottom.sync(s);for(let e of o)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let n of this.panels)n.update&&n.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Od.scrollMargins.of((t=>{let i=t.plugin(e);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}}))});class sp{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=op(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=op(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function op(e){let t=e.nextSibling;return e.remove(),t}const ap=ta.define({enables:rp});class lp extends Fa{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}lp.prototype.elementClass="",lp.prototype.toDOM=void 0,lp.prototype.mapMode=zo.TrackBefore,lp.prototype.startSide=lp.prototype.endSide=-1,lp.prototype.point=!0;const hp=1024;let cp=0;class up{constructor(e,t){this.from=e,this.to=t}}class dp{constructor(e={}){this.id=cp++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=mp.match(e)),t=>{let i=e(t);return void 0===i?null:[this,i]}}}dp.closedBy=new dp({deserialize:e=>e.split(" ")}),dp.openedBy=new dp({deserialize:e=>e.split(" ")}),dp.group=new dp({deserialize:e=>e.split(" ")}),dp.isolate=new dp({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),dp.contextHash=new dp({perNode:!0}),dp.lookAhead=new dp({perNode:!0}),dp.mounted=new dp({perNode:!0});class pp{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[dp.mounted.id]}}const fp=Object.create(null);class mp{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):fp,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),n=new mp(e.name||"",t,e.id,i);if(e.props)for(let r of e.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}return n}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(dp.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let n of i.split(" "))t[n]=e[i];return e=>{for(let i=e.prop(dp.group),n=-1;n<(i?i.length:0);n++){let r=t[n<0?e.name:i[n]];if(r)return r}}}}mp.none=new mp("",Object.create(null),0,8);class Op{constructor(e){this.types=e;for(let t=0;t=t){let o=new _p(e.tree,e.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(Qp(o,t,i,!1))}}return r?Ep(r):n}(this,e,t)}iterate(e){let{enter:t,leave:i,from:n=0,to:r=this.length}=e,s=e.mode||0,o=(s&bp.IncludeAnonymous)>0;for(let a=this.cursor(s|bp.IncludeAnonymous);;){let e=!1;if(a.from<=r&&a.to>=n&&(!o&&a.type.isAnonymous||!1!==t(a))){if(a.firstChild())continue;e=!0}for(;e&&i&&(o||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;e=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Xp(mp.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,i)=>new kp(this.type,e,t,i,this.propValues)),e.makeTree||((e,t,i)=>new kp(mp.none,e,t,i)))}static build(e){return function(e){var t;let{buffer:i,nodeSet:n,maxBufferLength:r=hp,reused:s=[],minRepeatType:o=n.types.length}=e,a=Array.isArray(i)?new xp(i,i.length):i,l=n.types,h=0,c=0;function u(e,t,i,v,b,y){let{id:k,start:x,end:w,size:S}=a,Q=c,$=h;for(;S<0;){if(a.next(),-1==S){let t=s[k];return i.push(t),void v.push(x-e)}if(-3==S)return void(h=k);if(-4==S)return void(c=k);throw new RangeError(`Unrecognized record size: ${S}`)}let _,P,C=l[k],T=x-e;if(w-x<=r&&(P=O(a.pos-t,b))){let t=new Uint16Array(P.size-P.skip),i=a.pos-P.size,r=t.length;for(;a.pos>i;)r=g(P.start,t,r);_=new wp(t,w-P.start,n),T=P.start-e}else{let e=a.pos-S;a.next();let t=[],i=[],n=k>=o?k:-1,s=0,l=w;for(;a.pos>e;)n>=0&&a.id==n&&a.size>=0?(a.end<=l-r&&(f(t,i,x,s,a.end,l,n,Q,$),s=t.length,l=a.end),a.next()):y>2500?d(x,e,t,i):u(x,e,t,i,n,y+1);if(n>=0&&s>0&&s-1&&s>0){let e=p(C,$);_=Xp(C,t,i,0,t.length,0,w-x,e,e)}else _=m(C,t,i,w-x,Q-w,$)}i.push(_),v.push(T)}function d(e,t,i,s){let o=[],l=0,h=-1;for(;a.pos>t;){let{id:e,start:t,end:i,size:n}=a;if(n>4)a.next();else{if(h>-1&&t=0;e-=3)t[i++]=o[e],t[i++]=o[e+1]-r,t[i++]=o[e+2]-r,t[i++]=i;i.push(new wp(t,o[2]-r,n)),s.push(r-e)}}function p(e,t){return(i,n,r)=>{let s,o,a=0,l=i.length-1;if(l>=0&&(s=i[l])instanceof kp){if(!l&&s.type==e&&s.length==r)return s;(o=s.prop(dp.lookAhead))&&(a=n[l]+s.length+o)}return m(e,i,n,r,a,t)}}function f(e,t,i,r,s,o,a,l,h){let c=[],u=[];for(;e.length>r;)c.push(e.pop()),u.push(t.pop()+i-s);e.push(m(n.types[a],c,u,o-s,l-o,h)),t.push(s-i)}function m(e,t,i,n,r,s,o){if(s){let e=[dp.contextHash,s];o=o?[e].concat(o):[e]}if(r>25){let e=[dp.lookAhead,r];o=o?[e].concat(o):[e]}return new kp(e,t,i,n,o)}function O(e,t){let i=a.fork(),n=0,s=0,l=0,h=i.end-r,c={size:0,start:0,skip:0};e:for(let r=i.pos-e;i.pos>r;){let e=i.size;if(i.id==t&&e>=0){c.size=n,c.start=s,c.skip=l,l+=4,n+=4,i.next();continue}let a=i.pos-e;if(e<0||a=o?4:0,d=i.start;for(i.next();i.pos>a;){if(i.size<0){if(-3!=i.size)break e;u+=4}else i.id>=o&&(u+=4);i.next()}s=d,n+=e,l+=u}return(t<0||n==e)&&(c.size=n,c.start=s,c.skip=l),c.size>4?c:void 0}function g(e,t,i){let{id:n,start:r,end:s,size:l}=a;if(a.next(),l>=0&&n4){let n=a.pos-(l-4);for(;a.pos>n;)i=g(e,t,i)}t[--i]=o,t[--i]=s-e,t[--i]=r-e,t[--i]=n}else-3==l?h=n:-4==l&&(c=n);return i}let v=[],b=[];for(;a.pos>0;)u(e.start||0,e.bufferStart||0,v,b,-1,0);let y=null!==(t=e.length)&&void 0!==t?t:v.length?b[0]+v[0].length:0;return new kp(l[e.topID],v.reverse(),b.reverse(),y)}(e)}}kp.empty=new kp(mp.none,[],[],0);class xp{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new xp(this.buffer,this.index)}}class wp{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return mp.none}toString(){let e=[];for(let t=0;t0));a=s[a+3]);return o}slice(e,t,i){let n=this.buffer,r=new Uint16Array(t-e),s=0;for(let o=e,a=0;o=t&&it;case 1:return i<=t&&n>t;case 2:return n>t;case 4:return!0}}function Qp(e,t,i,n){for(var r;e.from==e.to||(i<1?e.from>=t:e.from>t)||(i>-1?e.to<=t:e.to0?o.length:-1;e!=l;e+=t){let l=o[e],h=a[e]+s.from;if(Sp(n,i,h,h+l.length))if(l instanceof wp){if(r&bp.ExcludeBuffers)continue;let o=l.findChild(0,l.buffer.length,t,i-h,n);if(o>-1)return new Ap(new Tp(s,l,e,h),null,o)}else if(r&bp.IncludeAnonymous||!l.type.isAnonymous||Dp(l)){let o;if(!(r&bp.IgnoreMounts)&&(o=pp.get(l))&&!o.overlay)return new _p(o.tree,h,e,s);let a=new _p(l,h,e,s);return r&bp.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?l.children.length-1:0,t,i,n)}}if(r&bp.IncludeAnonymous||!s.type.isAnonymous)return null;if(e=s.index>=0?s.index+t:t<0?-1:s._parent._tree.children.length,s=s._parent,!s)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let n;if(!(i&bp.IgnoreOverlays)&&(n=pp.get(this._tree))&&n.overlay){let i=e-this.from;for(let{from:e,to:r}of n.overlay)if((t>0?e<=i:e=i:r>i))return new _p(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Pp(e,t,i,n){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(null!=i)for(let o=!1;!o;)if(o=r.type.is(i),!r.nextSibling())return s;for(;;){if(null!=n&&r.type.is(n))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return null==n?s:[]}}function Cp(e,t,i=t.length-1){for(let n=e;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(t[i]&&t[i]!=n.name)return!1;i--}}return!0}class Tp{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class Ap extends $p{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Ap(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&bp.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Ap(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Ap(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Ap(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let s=i.buffer[this.index+1];e.push(i.slice(n,r,s)),t.push(0)}return new kp(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ep(e){if(!e.length)return null;let t=0,i=e[0];for(let s=1;si.from||n.to0){if(this.index-1)for(let n=t+e,r=e<0?-1:i._tree.children.length;n!=r;n+=e){let e=i._tree.children[n];if(this.mode&bp.IncludeAnonymous||e instanceof wp||!e.type.isAnonymous||Dp(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==n){if(n==this.index)return s;t=s,i=r+1;break e}n=this.stack[--r]}for(let n=i;n=0;r--){if(r<0)return Cp(this._tree,e,n);let s=i[t.buffer[this.stack[r]]];if(!s.isAnonymous){if(e[n]&&e[n]!=s.name)return!1;n--}}return!0}}function Dp(e){return e.children.some((e=>e instanceof wp||!e.type.isAnonymous||Dp(e)))}const Zp=new WeakMap;function Lp(e,t){if(!e.isAnonymous||t instanceof wp||t.type!=e)return 1;let i=Zp.get(t);if(null==i){i=1;for(let n of t.children){if(n.type!=e||!(n instanceof kp)){i=1;break}i+=Lp(e,n)}Zp.set(t,i)}return i}function Xp(e,t,i,n,r,s,o,a,l){let h=0;for(let p=n;p=c)break;f+=t}if(h==r+1){if(f>c){let e=i[r];t(e.children,e.positions,0,e.children.length,n[r]+a);continue}u.push(i[r])}else{let t=n[h-1]+i[h-1].length-p;u.push(Xp(e,i,n,r,h,p,t,null,l))}d.push(p+a-s)}}(t,i,n,r,0),(a||l)(u,d,o)}class qp{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let n=this.map.get(e);n||this.map.set(e,n=new Map),n.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Ap?this.setBuffer(e.context.buffer,e.index,t):e instanceof _p&&this.map.set(e.tree,t)}get(e){return e instanceof Ap?this.getBuffer(e.context.buffer,e.index):e instanceof _p?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Vp{constructor(e,t,i,n,r=!1,s=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(r?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],i=!1){let n=[new Vp(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&n.push(r);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],r=1,s=e.length?e[0]:null;for(let o=0,a=0,l=0;;o++){let h=o=i)for(;s&&s.from=t.from||c<=t.to||l){let e=Math.max(t.from,a)-l,i=Math.min(t.to,c)-l;t=e>=i?null:new Vp(e,i,t.tree,t.offset+l,o>0,!!h)}if(t&&n.push(t),s.to>c)break;s=rnew up(e.from,e.to))):[new up(0,0)]:[new up(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let e=n.advance();if(e)return e}}}class zp{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function jp(e){return(t,i,n,r)=>new Np(t,e,i,n,r)}class Bp{constructor(e,t,i,n,r){this.parser=e,this.parse=t,this.overlay=i,this.target=n,this.from=r}}function Fp(e){if(!e.length||e.some((e=>e.from>=e.to)))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class Yp{constructor(e,t,i,n,r,s,o){this.parser=e,this.predicate=t,this.mounts=i,this.index=n,this.start=r,this.target=s,this.prev=o,this.depth=0,this.ranges=[]}}const Wp=new dp({perNode:!0});class Np{constructor(e,t,i,n,r){this.nest=t,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return null!=this.stoppedAt&&(e=new kp(e.type,e.children,e.positions,e.length,e.propValues.concat([[Wp,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[dp.mounted.id]=new pp(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)a=!1;else if(e.hasNode(n)){if(t){let e=t.mounts.find((e=>e.frag.from<=n.from&&e.frag.to>=n.to&&e.mount.overlay));if(e)for(let i of e.mount.overlay){let r=i.from+e.pos,s=i.to+e.pos;r>=n.from&&s<=n.to&&!t.ranges.some((e=>e.fromr))&&t.ranges.push({from:r,to:s})}}a=!1}else if(i&&(s=Gp(i.ranges,n.from,n.to)))a=2!=s;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.fromnew up(e.from-n.from,e.to-n.from))):null,n.tree,e.length?e[0].from:n.from)),r.overlay?e.length&&(i={ranges:e,depth:0,prev:i}):a=!1}}else if(t&&(o=t.predicate(n))&&(!0===o&&(o=new up(n.from,n.to)),o.from=0&&t.ranges[e].to==o.from?t.ranges[e]={from:t.ranges[e].from,to:o.to}:t.ranges.push(o)}if(a&&n.firstChild())t&&t.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break e;if(t&&! --t.depth){let e=ef(this.ranges,t.ranges);e.length&&(Fp(e),this.inner.splice(t.index,0,new Bp(t.parser,t.parser.startParse(this.input,nf(t.mounts,e),e),t.ranges.map((e=>new up(e.from-t.start,e.to-t.start))),t.target,e[0].from))),t=t.prev}i&&! --i.depth&&(i=i.prev)}}}}function Gp(e,t,i){for(let n of e){if(n.from>=i)break;if(n.to>t)return n.from<=t&&n.to>=i?2:1}return 0}function Up(e,t,i,n,r,s){if(t=e&&t.enter(i,1,bp.IgnoreOverlays|bp.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(!(t.children.length&&0==t.positions[0]&&t.children[0]instanceof kp))break;t=t.children[0]}return!1}}let Jp=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=null!==(t=i.tree.prop(Wp))&&void 0!==t?t:i.to,this.inner=new Kp(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(Wp))&&void 0!==e?e:t.to,this.inner=new Kp(t.tree,-t.offset)}}findMounts(e,t){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let r=null===(i=e.tree)||void 0===i?void 0:i.prop(dp.mounted);if(r&&r.parser==t)for(let t=this.fragI;t=e.to)break;i.tree==this.curFrag.tree&&n.push({frag:i,pos:e.from-i.offset,mount:r})}}}return n}};function ef(e,t){let i=null,n=t;for(let r=1,s=0;r=a)break;e.to<=o||(i||(n=i=t.slice()),e.froma&&i.splice(s+1,0,new up(a,e.to))):e.to>a?i[s--]=new up(a,e.to):i.splice(s--,1))}}return n}function tf(e,t,i,n){let r=0,s=0,o=!1,a=!1,l=-1e9,h=[];for(;;){let c=r==e.length?1e9:o?e[r].to:e[r].from,u=s==t.length?1e9:a?t[s].to:t[s].from;if(o!=a){let e=Math.max(l,i),t=Math.min(c,u,n);enew up(e.from+n,e.to+n))),a,l);for(let t=0,n=a;;t++){let a=t==o.length,h=a?l:o[t].from;if(h>n&&i.push(new Vp(n,h,r.tree,-e,s.from>=n||s.openStart,s.to<=h||s.openEnd)),a)break;n=o[t].to}}else i.push(new Vp(a,l,r.tree,-e,s.from>=e||s.openStart,s.to<=o||s.openEnd))}return i}let rf=0;class sf{constructor(e,t,i,n){this.name=e,this.set=t,this.base=i,this.modified=n,this.id=rf++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i="string"==typeof e?e:"?";if(e instanceof sf&&(t=e),null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let n=new sf(i,[],null,[]);if(n.set.push(n),t)for(let r of t.set)n.set.push(r);return n}static defineModifier(e){let t=new af(e);return e=>e.modified.indexOf(t)>-1?e:af.get(e.base||e,e.modified.concat(t).sort(((e,t)=>e.id-t.id)))}}let of=0;class af{constructor(e){this.name=e,this.instances=[],this.id=of++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find((i=>{return i.base==e&&(n=t,r=i.modified,n.length==r.length&&n.every(((e,t)=>e==r[t])));var n,r}));if(i)return i;let n=[],r=new sf(e.name,n,e,t);for(let o of t)o.instances.push(r);let s=function(e){let t=[[]];for(let i=0;it.length-e.length))}(t);for(let o of e.set)if(!o.modified.length)for(let e of s)n.push(af.get(o,e));return r}}function lf(e){let t=Object.create(null);for(let i in e){let n=e[i];Array.isArray(n)||(n=[n]);for(let e of i.split(" "))if(e){let i=[],r=2,s=e;for(let t=0;;){if("..."==s&&t>0&&t+3==e.length){r=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!n)throw new RangeError("Invalid path: "+e);if(i.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),t+=n[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&"!"==o){r=0;break}if("/"!=o)throw new RangeError("Invalid path: "+e);s=e.slice(t)}let o=i.length-1,a=i[o];if(!a)throw new RangeError("Invalid path: "+e);let l=new cf(n,r,o>0?i.slice(0,o):null);t[a]=l.sort(t[a])}}return hf.add(t)}const hf=new dp;class cf{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth{let t=r;for(let n of e)for(let e of n.set){let n=i[e.id];if(n){t=t?t+" "+n:n;break}}return t},scope:n}}function df(e,t,i,n=0,r=e.length){let s=new pf(n,Array.isArray(t)?t:[t],i);s.highlightRange(e.cursor(),n,r,"",s.highlighters),s.flush(r)}cf.empty=new cf([],2,null);class pf{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,n,r){let{type:s,from:o,to:a}=e;if(o>=i||a<=t)return;s.isTop&&(r=this.highlighters.filter((e=>!e.scope||e.scope(s))));let l=n,h=function(e){let t=e.type.prop(hf);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||cf.empty,c=function(e,t){let i=null;for(let n of e){let e=n.style(t);e&&(i=i?i+" "+e:e)}return i}(r,h.tags);if(c&&(l&&(l+=" "),l+=c,1==h.mode&&(n+=(n?" ":"")+c)),this.startSpan(Math.max(t,o),l),h.opaque)return;let u=e.tree&&e.tree.prop(dp.mounted);if(u&&u.overlay){let s=e.node.enter(u.overlay[0].from+o,1),h=this.highlighters.filter((e=>!e.scope||e.scope(u.tree.type))),c=e.firstChild();for(let d=0,p=o;;d++){let f=d=m)&&e.nextSibling()););if(!f||m>i)break;p=f.to+o,p>t&&(this.highlightRange(s.cursor(),Math.max(t,f.from+o),Math.min(i,p),"",h),this.startSpan(Math.min(i,p),l))}c&&e.parent()}else if(e.firstChild()){u&&(n="");do{if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,n,r),this.startSpan(Math.min(i,e.to),l)}}while(e.nextSibling());e.parent()}}}const ff=sf.define,mf=ff(),Of=ff(),gf=ff(Of),vf=ff(Of),bf=ff(),yf=ff(bf),kf=ff(bf),xf=ff(),wf=ff(xf),Sf=ff(),Qf=ff(),$f=ff(),_f=ff($f),Pf=ff(),Cf={comment:mf,lineComment:ff(mf),blockComment:ff(mf),docComment:ff(mf),name:Of,variableName:ff(Of),typeName:gf,tagName:ff(gf),propertyName:vf,attributeName:ff(vf),className:ff(Of),labelName:ff(Of),namespace:ff(Of),macroName:ff(Of),literal:bf,string:yf,docString:ff(yf),character:ff(yf),attributeValue:ff(yf),number:kf,integer:ff(kf),float:ff(kf),bool:ff(bf),regexp:ff(bf),escape:ff(bf),color:ff(bf),url:ff(bf),keyword:Sf,self:ff(Sf),null:ff(Sf),atom:ff(Sf),unit:ff(Sf),modifier:ff(Sf),operatorKeyword:ff(Sf),controlKeyword:ff(Sf),definitionKeyword:ff(Sf),moduleKeyword:ff(Sf),operator:Qf,derefOperator:ff(Qf),arithmeticOperator:ff(Qf),logicOperator:ff(Qf),bitwiseOperator:ff(Qf),compareOperator:ff(Qf),updateOperator:ff(Qf),definitionOperator:ff(Qf),typeOperator:ff(Qf),controlOperator:ff(Qf),punctuation:$f,separator:ff($f),bracket:_f,angleBracket:ff(_f),squareBracket:ff(_f),paren:ff(_f),brace:ff(_f),content:xf,heading:wf,heading1:ff(wf),heading2:ff(wf),heading3:ff(wf),heading4:ff(wf),heading5:ff(wf),heading6:ff(wf),contentSeparator:ff(xf),list:ff(xf),quote:ff(xf),emphasis:ff(xf),strong:ff(xf),link:ff(xf),monospace:ff(xf),strikethrough:ff(xf),inserted:ff(),deleted:ff(),changed:ff(),invalid:ff(),meta:Pf,documentMeta:ff(Pf),annotation:ff(Pf),processingInstruction:ff(Pf),definition:sf.defineModifier("definition"),constant:sf.defineModifier("constant"),function:sf.defineModifier("function"),standard:sf.defineModifier("standard"),local:sf.defineModifier("local"),special:sf.defineModifier("special")};for(let P$ in Cf){let e=Cf[P$];e instanceof sf&&(e.name=P$)}var Tf;uf([{tag:Cf.link,class:"tok-link"},{tag:Cf.heading,class:"tok-heading"},{tag:Cf.emphasis,class:"tok-emphasis"},{tag:Cf.strong,class:"tok-strong"},{tag:Cf.keyword,class:"tok-keyword"},{tag:Cf.atom,class:"tok-atom"},{tag:Cf.bool,class:"tok-bool"},{tag:Cf.url,class:"tok-url"},{tag:Cf.labelName,class:"tok-labelName"},{tag:Cf.inserted,class:"tok-inserted"},{tag:Cf.deleted,class:"tok-deleted"},{tag:Cf.literal,class:"tok-literal"},{tag:Cf.string,class:"tok-string"},{tag:Cf.number,class:"tok-number"},{tag:[Cf.regexp,Cf.escape,Cf.special(Cf.string)],class:"tok-string2"},{tag:Cf.variableName,class:"tok-variableName"},{tag:Cf.local(Cf.variableName),class:"tok-variableName tok-local"},{tag:Cf.definition(Cf.variableName),class:"tok-variableName tok-definition"},{tag:Cf.special(Cf.variableName),class:"tok-variableName2"},{tag:Cf.definition(Cf.propertyName),class:"tok-propertyName tok-definition"},{tag:Cf.typeName,class:"tok-typeName"},{tag:Cf.namespace,class:"tok-namespace"},{tag:Cf.className,class:"tok-className"},{tag:Cf.macroName,class:"tok-macroName"},{tag:Cf.propertyName,class:"tok-propertyName"},{tag:Cf.operator,class:"tok-operator"},{tag:Cf.comment,class:"tok-comment"},{tag:Cf.meta,class:"tok-meta"},{tag:Cf.invalid,class:"tok-invalid"},{tag:Cf.punctuation,class:"tok-punctuation"}]);const Af=new dp;function Ef(e){return ta.define({combine:e?t=>t.concat(e):void 0})}const Mf=new dp;class Rf{constructor(e,t,i=[],n=""){this.data=e,this.name=n,ja.prototype.hasOwnProperty("tree")||Object.defineProperty(ja.prototype,"tree",{get(){return Lf(this)}}),this.parser=t,this.extension=[Yf.of(this),ja.languageData.of(((e,t,i)=>{let n=Df(e,t,i),r=n.type.prop(Af);if(!r)return[];let s=e.facet(r),o=n.type.prop(Mf);if(o){let r=n.resolve(t-n.from,i);for(let t of o)if(t.test(r,e)){let i=e.facet(t.facet);return"replace"==t.type?i:i.concat(s)}}return s}))].concat(i)}isActiveAt(e,t,i=-1){return Df(e,t,i).type.prop(Af)==this.data}findRegions(e){let t=e.facet(Yf);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(e,t)=>{if(e.prop(Af)==this.data)return void i.push({from:t,to:t+e.length});let r=e.prop(dp.mounted);if(r){if(r.tree.prop(Af)==this.data){if(r.overlay)for(let e of r.overlay)i.push({from:e.from+t,to:e.to+t});else i.push({from:t,to:t+e.length});return}if(r.overlay){let e=i.length;if(n(r.tree,r.overlay[0].from+t),i.length>e)return}}for(let i=0;ie.isTop?t:void 0))]}),e.name)}configure(e,t){return new Zf(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Lf(e){let t=e.field(Rf.state,!1);return t?t.tree:kp.empty}class Xf{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let qf=null;class Vf{constructor(e,t,i=[],n,r,s,o,a){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=s,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Vf(e,t,[],kp.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Xf(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=kp.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var i;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Vp.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=qf;qf=this;try{return e()}finally{qf=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=If(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:r,viewport:s,skipped:o}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,i,n,r)=>t.push({fromA:e,toA:i,fromB:n,toB:r}))),i=Vp.applyChanges(i,t),n=kp.empty,r=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){o=[];for(let t of this.skipped){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);ie.from&&(this.fragments=If(this.fragments,t,n),this.skipped.splice(i--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ip{createParse(t,i,n){let r=n[0].from,s=n[n.length-1].to;return{parsedPos:r,advance(){let t=qf;if(t){for(let e of n)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=s,new kp(mp.none,[],[],s-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return qf}}function If(e,t,i){return Vp.applyChanges(e,[{fromA:t,toA:i,fromB:t,toB:i}])}class zf{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new zf(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Vf.create(e.facet(Yf).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new zf(i)}}Rf.state=la.define({create:zf.init,update(e,t){for(let i of t.effects)if(i.is(Rf.setState))return i.value;return t.startState.facet(Yf)!=t.state.facet(Yf)?zf.init(t.state):e.apply(t)}});let jf=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(jf=e=>{let t=-1,i=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(i):cancelIdleCallback(t)});const Bf="undefined"!=typeof navigator&&(null===(Tf=navigator.scheduling)||void 0===Tf?void 0:Tf.isInputPending)?()=>navigator.scheduling.isInputPending():null,Ff=vc.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Rf.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Rf.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=jf(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,a=r.context.work((()=>Bf&&Bf()||Date.now()>s),n+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Rf.setState.of(new zf(r.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>fc(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Yf=ta.define({combine:e=>e.length?e[0]:null,enables:e=>[Rf.state,Ff,Od.contentAttributes.compute([e],(t=>{let i=t.facet(e);return i&&i.name?{"data-language":i.name}:{}}))]});class Wf{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Nf{constructor(e,t,i,n,r,s=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((e=>this.support=e),(e=>{throw this.loading=null,e})))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new Nf(e.name,(e.alias||[]).concat(e.name).map((e=>e.toLowerCase())),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let i=/\.([^.]+)$/.exec(t);if(i)for(let n of e)if(n.extensions.indexOf(i[1])>-1)return n;return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some((e=>e==t)))return n;if(i)for(let n of e)for(let e of n.alias){let i=t.indexOf(e);if(i>-1&&(e.length>2||!/\w/.test(t[i-1])&&!/\w/.test(t[i+e.length])))return n}return null}}const Gf=ta.define(),Uf=ta.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function Hf(e){let t=e.facet(Uf);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function Kf(e,t){let i="",n=e.tabSize,r=e.facet(Uf)[0];if("\t"==r){for(;t>=n;)i+="\t",t-=n;r=" "}for(let s=0;s=t?function(e,t,i){let n=t.resolveStack(i),r=t.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(r!=n.node){let e=[];for(let t=r;t&&(t.from!=n.node.from||t.type!=n.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)n={node:e[t],next:n}}return im(n,e,i)}(e,i,t):null}class em{constructor(e,t={}){this.state=e,this.options=t,this.unit=Hf(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return null!=n&&n>=i.from&&n<=i.to?r&&n==e?{text:"",from:e}:(t<0?n-1&&(r+=s-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return al(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(n);if(e>-1)return e}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const tm=new dp;function im(e,t,i){for(let n=e;n;n=n.next){let e=nm(n.node);if(e)return e(sm.create(t,i,n))}return 0}function nm(e){let t=e.type.prop(tm);if(t)return t;let i,n=e.firstChild;if(n&&(i=n.type.prop(dp.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>lm(e,!0,1,void 0,n&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?rm:null}function rm(){return 0}class sm extends em{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new sm(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(om(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return im(this.context.next,this.base,this.pos)}}function om(e,t){for(let i=t;i;i=i.parent)if(e==i)return!0;return!1}function am({closing:e,align:t=!0,units:i=1}){return n=>lm(n,t,i,e)}function lm(e,t,i,n,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||r==e.pos+o,l=t?function(e){let t=e.node,i=t.childAfter(t.from),n=t.lastChild;if(!i)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(i.from),o=null==r||r<=s.from?s.to:Math.min(s.to,r);for(let a=i.to;;){let e=t.childAfter(a);if(!e||e==n)return null;if(!e.type.isSkipped){if(e.from>=o)return null;let t=/^ */.exec(s.text.slice(i.to-s.from))[0].length;return{from:i.from,to:i.to+t}}a=e.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*i)}const hm=e=>e.baseIndent;function cm({except:e,units:t=1}={}){return i=>{let n=e&&e.test(i.textAfter);return i.baseIndent+(n?0:t*i.unit)}}const um=ta.define(),dm=new dp;function pm(e){let t=e.firstChild,i=e.lastChild;return t&&t.toe.prop(Af)==s.data:s?e=>e==s:void 0,this.style=uf(e.map((e=>({tag:e.tag,class:e.class||n(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=i?new ul(i):null,this.themeType=t.themeType}static define(e,t){return new fm(e,t||{})}}const mm=ta.define(),Om=ta.define({combine:e=>e.length?[e[0]]:null});function gm(e){let t=e.facet(mm);return t.length?t:e.facet(Om)}function vm(e,t){let i,n=[ym];return e instanceof fm&&(e.module&&n.push(Od.styleModule.of(e.module)),i=e.themeType),i?n.push(mm.computeN([Od.darkTheme],(t=>t.facet(Od.darkTheme)==("dark"==i)?[e]:[]))):n.push(mm.of(e)),n}class bm{constructor(e){this.markCache=Object.create(null),this.tree=Lf(e.state),this.decorations=this.buildDeco(e,gm(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Lf(e.state),i=gm(e.state),n=i!=gm(e.startState),{viewport:r}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return xh.none;let i=new Ua;for(let{from:n,to:r}of e.visibleRanges)df(this.tree,t,((e,t,n)=>{i.add(e,t,this.markCache[n]||(this.markCache[n]=xh.mark({class:n})))}),n,r);return i.finish()}}const ym=fa.high(vc.fromClass(bm,{decorations:e=>e.decorations})),km=new dp;function xm(e,t,i){let n=e.prop(t<0?dp.openedBy:dp.closedBy);if(n)return n;if(1==e.name.length){let n=i.indexOf(e.name);if(n>-1&&n%2==(t<0?1:0))return[i[n+t]]}return null}function wm(e){let t=e.type.prop(km);return t?t(e.node):e}function Sm(e,t,i,n={}){let r=n.maxScanDistance||1e4,s=n.brackets||"()[]{}",o=Lf(e),a=o.resolveInner(t,i);for(let l=a;l;l=l.parent){let n=xm(l.type,i,s);if(n&&l.from0?t>=r.from&&tr.from&&t<=r.to))return Qm(e,t,i,l,r,n,s)}}return function(e,t,i,n,r,s,o){let a=i<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=o.indexOf(a);if(l<0||l%2==0!=i>0)return null;let h={from:i<0?t-1:t,to:i>0?t+1:t},c=e.doc.iterRange(t,i>0?e.doc.length:0),u=0;for(let d=0;!c.next().done&&d<=s;){let e=c.value;i<0&&(d+=e.length);let s=t+d*i;for(let t=i>0?0:e.length-1,a=i>0?e.length:-1;t!=a;t+=i){let a=o.indexOf(e[t]);if(!(a<0||n.resolveInner(s+t,1).type!=r))if(a%2==0==i>0)u++;else{if(1==u)return{start:h,end:{from:s+t,to:s+t+1},matched:a>>1==l>>1};u--}}i>0&&(d+=e.length)}return c.done?{start:h,matched:!1}:null}(e,t,i,o,a.type,r,s)}function Qm(e,t,i,n,r,s,o){let a=n.parent,l={from:r.from,to:r.to},h=0,c=null==a?void 0:a.cursor();if(c&&(i<0?c.childBefore(n.from):c.childAfter(n.to)))do{if(i<0?c.to<=n.from:c.from>=n.to){if(0==h&&s.indexOf(c.type.name)>-1&&c.from=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?e.toLowerCase():e;return n(this.string.substr(this.pos,e.length))==n(e)?(!1!==t&&(this.pos+=e.length),!0):null}{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function Pm(e){if("object"!=typeof e)return e;let t={};for(let i in e){let n=e[i];t[i]=n instanceof Array?n.slice():n}return t}const Cm=new WeakMap;class Tm extends Rf{constructor(e){let t,i=Ef(e.languageData),n={name:(r=e).name||"",token:r.token,blankLine:r.blankLine||(()=>{}),startState:r.startState||(()=>!0),copyState:r.copyState||Pm,indent:r.indent||(()=>null),languageData:r.languageData||{},tokenTable:r.tokenTable||Dm,mergeTokens:!1!==r.mergeTokens};var r;super(i,new class extends Ip{createParse(e,i,n){return new Mm(t,e,i,n)}},[],e.name),this.topNode=function(e,t){let i=mp.define({id:Zm.length,name:"Document",props:[Af.add((()=>e)),tm.add((()=>e=>t.getIndent(e)))],top:!0});return Zm.push(i),i}(i,this),t=this,this.streamParser=n,this.stateAfter=new dp({perNode:!0}),this.tokenTable=e.tokenTable?new Im(n.tokenTable):zm}static define(e){return new Tm(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=Cm.get(e.state),null!=t&&t1e4)return null;for(;n=n&&i+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:i+t.length};for(let o=t.children.length-1;o>=0;o--){let s=t.children[o],a=i+t.positions[o],l=s instanceof kp&&a=t.length)return t;r||0!=i||t.type!=e.topNode||(r=!0);for(let s=t.children.length-1;s>=0;s--){let o,a=t.positions[s],l=t.children[s];if(ai&&Am(e,s.tree,0-s.offset,i,o);if(a&&a.pos<=n&&(t=Em(e,s.tree,i+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:t}}return{state:e.streamParser.startState(r?Hf(r):4),tree:kp.empty}}(e,i,s,this.to,null==r?void 0:r.state);this.state=o,this.parsedPos=this.chunkStart=s+a.length;for(let l=0;le.from<=r.viewport.from&&e.to>=r.viewport.from))&&(this.state=this.lang.streamParser.startState(Hf(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=Vf.get(),t=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+2048);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{let e=t.indexOf("\n");e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let n=this.rangeIndex;;){let e=this.ranges[n].to;if(e>=i)break;if(t=t.slice(0,e-(i-t.length)),n++,n==this.ranges.length)break;let r=this.ranges[n].from,s=this.lineAfter(r);t+=s,i=r+s.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?n>r:n>=r)break;t+=this.ranges[++this.rangeIndex].from-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){t+=n=this.skipGapsTo(t,n,1);let e=this.chunk.length;i+=n=this.skipGapsTo(i,n,-1),r+=this.chunk.length-e}let s=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&4==r&&s>=0&&this.chunk[s]==e&&this.chunk[s+2]==t?this.chunk[s+2]=i:this.chunk.push(e,t,i,r),n}parseLine(e){let{line:t,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,s=new _m(t,e?e.state.tabSize:4,e?Hf(e.state):2);if(s.eol())r.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let e=Rm(r.token,s,this.state);if(e&&(n=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+s.start,this.parsedPos+s.pos,n)),s.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return n}throw new Error("Stream parser failed to advance stream.")}const Dm=Object.create(null),Zm=[mp.none],Lm=new Op(Zm),Xm=[],qm=Object.create(null),Vm=Object.create(null);for(let[P$,C$]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Vm[P$]=Bm(Dm,C$);class Im{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Vm)}resolve(e){return e?this.table[e]||(this.table[e]=Bm(this.extra,e)):0}}const zm=new Im(Dm);function jm(e,t){Xm.indexOf(e)>-1||Xm.push(e)}function Bm(e,t){let i=[];for(let a of t.split(" ")){let t=[];for(let i of a.split(".")){let n=e[i]||Cf[i];n?"function"==typeof n?t.length?t=t.map(n):jm(i):t.length?jm(i):t=Array.isArray(n)?n:[n]:jm(i)}for(let e of t)i.push(e)}if(!i.length)return 0;let n=t.replace(/ /g,"_"),r=n+" "+i.map((e=>e.id)),s=qm[r];if(s)return s.id;let o=qm[r]=mp.define({id:Zm.length,name:n,props:[lf({[n]:i})]});return Zm.push(o),o.id}Rh.RTL,Rh.LTR;function Fm(e,t){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=e(t,i);return!!r&&(n(i.update(r)),!0)}}const Ym=Fm(Km,0),Wm=Fm(Hm,0),Nm=Fm(((e,t)=>Hm(e,t,function(e){let t=[];for(let i of e.selection.ranges){let n=e.doc.lineAt(i.from),r=i.to<=n.to?n:e.doc.lineAt(i.to);r.from>n.from&&r.from==i.to&&(r=i.to==n.to+1?n:e.doc.lineAt(i.to-1));let s=t.length-1;s>=0&&t[s].to>n.from?t[s].to=r.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return t}(t))),0);function Gm(e,t){let i=e.languageDataAt("commentTokens",t,1);return i.length?i[0]:{}}const Um=50;function Hm(e,t,i=t.selection.ranges){let n=i.map((e=>Gm(t,e.from).block));if(!n.every((e=>e)))return null;let r=i.map(((e,i)=>function(e,{open:t,close:i},n,r){let s,o,a=e.sliceDoc(n-Um,n),l=e.sliceDoc(r,r+Um),h=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,u=a.length-h;if(a.slice(u-t.length,u)==t&&l.slice(c,c+i.length)==i)return{open:{pos:n-h,margin:h&&1},close:{pos:r+c,margin:c&&1}};r-n<=2*Um?s=o=e.sliceDoc(n,r):(s=e.sliceDoc(n,n+Um),o=e.sliceDoc(r-Um,r));let d=/^\s*/.exec(s)[0].length,p=/\s*$/.exec(o)[0].length,f=o.length-p-i.length;return s.slice(d,d+t.length)==t&&o.slice(f,f+i.length)==i?{open:{pos:n+d+t.length,margin:/\s/.test(s.charAt(d+t.length))?1:0},close:{pos:r-p-i.length,margin:/\s/.test(o.charAt(f-1))?1:0}}:null}(t,n[i],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(i.map(((e,t)=>r[t]?[]:[{from:e.from,insert:n[t].open+" "},{from:e.to,insert:" "+n[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,i=0;ir&&(s==o||o>l.from)){r=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,s=l.text.slice(e,e+a.length)==a?e:-1;ee.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:r,indent:s,empty:o,single:a}of n)!a&&o||e.push({from:t.from+s,insert:r+" "});let i=t.changes(e);return{changes:i,selection:t.selection.map(i,1)}}if(1!=e&&n.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:i,token:r}of n)if(i>=0){let n=t.from+i,s=n+r.length;" "==t.text[s-t.from]&&s++,e.push({from:n,to:s})}return{changes:e}}return null}const Jm=Pa.define(),eO=Pa.define(),tO=ta.define(),iO=ta.define({combine:e=>Ba(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}),nO=la.define({create:()=>yO.empty,update(e,t){let i=t.state.facet(iO),n=t.annotation(Jm);if(n){let r=cO.fromTransaction(t,n.selection),s=n.side,o=0==s?e.undone:e.done;return o=r?uO(o,o.length,i.minDepth,r):mO(o,t.startState.selection),new yO(0==s?n.rest:o,0==s?o:n.rest)}let r=t.annotation(eO);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(Ea.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=cO.fromTransaction(t),o=t.annotation(Ea.time),a=t.annotation(Ea.userEvent);return s?e=e.addChanges(s,o,a,i,t):t.selection&&(e=e.addSelection(t.startState.selection,o,a,i.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new yO(e.done.map(cO.fromJSON),e.undone.map(cO.fromJSON))});function rO(e={}){return[nO,iO.of(e),Od.domEventHandlers({beforeinput(e,t){let i="historyUndo"==e.inputType?oO:"historyRedo"==e.inputType?aO:null;return!!i&&(e.preventDefault(),i(t))}})]}function sO(e,t){return function({state:i,dispatch:n}){if(!t&&i.readOnly)return!1;let r=i.field(nO,!1);if(!r)return!1;let s=r.pop(e,i,t);return!!s&&(n(s),!0)}}const oO=sO(0,!1),aO=sO(1,!1),lO=sO(0,!0),hO=sO(1,!0);class cO{constructor(e,t,i,n,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(e){return new cO(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new cO(e.changes&&Bo.fromJSON(e.changes),[],e.mapped&&jo.fromJSON(e.mapped),e.startSelection&&Ko.fromJSON(e.startSelection),e.selectionsAfter.map(Ko.fromJSON))}static fromTransaction(e,t){let i=pO;for(let n of e.startState.facet(tO)){let t=n(e);t.length&&(i=i.concat(t))}return!i.length&&e.changes.empty?null:new cO(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,pO)}static selection(e){return new cO(void 0,pO,void 0,void 0,e)}}function uO(e,t,i,n){let r=t+1>i+20?t-i-1:0,s=e.slice(r,t);return s.push(n),s}function dO(e,t){return e.length?t.length?e.concat(t):e:t}const pO=[],fO=200;function mO(e,t){if(e.length){let i=e[e.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-fO));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),uO(e,e.length-1,1e9,i.setSelAfter(n)))}return[cO.selection([t])]}function OO(e){let t=e[e.length-1],i=e.slice();return i[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),i}function gO(e,t){if(!e.length)return e;let i=e.length,n=pO;for(;i;){let r=vO(e[i-1],t,n);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,i);return t[i-1]=r,t}t=r.mapped,i--,n=r.selectionsAfter}return n.length?[cO.selection(n)]:pO}function vO(e,t,i){let n=dO(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):pO,i);if(!e.changes)return cO.selection(n);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new cO(r,Aa.mapEffects(e.effects,t),o,e.startSelection.map(s),n)}const bO=/^(input\.type|delete)($|\.)/;class yO{constructor(e,t,i=0,n=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new yO(this.done,this.undone):this}addChanges(e,t,i,n,r){let s=this.done,o=s[s.length-1];return s=o&&o.changes&&!o.changes.empty&&e.changes&&(!i||bO.test(i))&&(!o.selectionsAfter.length&&t-this.prevTimei.push(e,t))),t.iterChangedRanges(((e,t,r,s)=>{for(let o=0;o=e&&r<=t&&(n=!0)}})),n}(o.changes,e.changes))||"input.type.compose"==i)?uO(s,s.length-1,n.minDepth,new cO(e.changes.compose(o.changes),dO(Aa.mapEffects(e.effects,o.changes),o.effects),o.mapped,o.startSelection,pO)):uO(s,s.length,n.minDepth,e),new yO(s,pO,t,i)}addSelection(e,t,i,n){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:pO;return r.length>0&&t-this.prevTimee.empty!=o.ranges[t].empty)).length)?this:new yO(mO(this.done,e),this.undone,t,i);var s,o}addMapping(e){return new yO(gO(this.done,e),gO(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let n=0==e?this.done:this.undone;if(0==n.length)return null;let r=n[n.length-1],s=r.selectionsAfter[0]||t.selection;if(i&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Jm.of({side:e,rest:OO(n),selection:s}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let i=1==n.length?pO:n.slice(0,n.length-1);return r.mapped&&(i=gO(i,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Jm.of({side:e,rest:i,selection:s}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}yO.empty=new yO(pO,pO);const kO=[{key:"Mod-z",run:oO,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:aO,preventDefault:!0},{linux:"Ctrl-Shift-z",run:aO,preventDefault:!0},{key:"Mod-u",run:lO,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:hO,preventDefault:!0}];function xO(e,t){return Ko.create(e.ranges.map(t),e.mainIndex)}function wO(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function SO({state:e,dispatch:t},i){let n=xO(e.selection,i);return!n.eq(e.selection,!0)&&(t(wO(e,n)),!0)}function QO(e,t){return Ko.cursor(t?e.to:e.from)}function $O(e,t){return SO(e,(i=>i.empty?e.moveByChar(i,t):QO(i,t)))}function _O(e){return e.textDirectionAt(e.state.selection.main.head)==Rh.LTR}const PO=e=>$O(e,!_O(e)),CO=e=>$O(e,_O(e));function TO(e,t){return SO(e,(i=>i.empty?e.moveByGroup(i,t):QO(i,t)))}function AO(e,t,i){if(t.type.prop(i))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function EO(e,t,i){let n,r,s=Lf(e).resolveInner(t.head),o=i?dp.closedBy:dp.openedBy;for(let a=t.head;;){let t=i?s.childAfter(a):s.childBefore(a);if(!t)break;AO(e,t,o)?s=t:a=i?t.to:t.from}return r=s.type.prop(o)&&(n=i?Sm(e,s.from,1):Sm(e,s.to,-1))&&n.matched?i?n.end.to:n.end.from:i?s.to:s.from,Ko.cursor(r,i?-1:1)}function MO(e,t){return SO(e,(i=>{if(!i.empty)return QO(i,t);let n=e.moveVertically(i,t);return n.head!=i.head?n:e.moveToLineBoundary(i,t)}))}const RO=e=>MO(e,!1),DO=e=>MO(e,!0);function ZO(e){let t,i=e.scrollDOM.clientHeighti.empty?e.moveVertically(i,t,n.height):QO(i,t)));if(s.eq(r.selection))return!1;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),a=o.top+n.marginTop,l=o.bottom-n.marginBottom;t&&t.top>a&&t.bottomLO(e,!1),qO=e=>LO(e,!0);function VO(e,t,i){let n=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,i);if(r.head==t.head&&r.head!=(i?n.to:n.from)&&(r=e.moveToLineBoundary(t,i,!1)),!i&&r.head==n.from&&n.length){let i=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&t.head!=n.from+i&&(r=Ko.cursor(n.from+i))}return r}function IO(e,t){let i=xO(e.state.selection,(e=>{let i=t(e);return Ko.range(e.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)}));return!i.eq(e.state.selection)&&(e.dispatch(wO(e.state,i)),!0)}function zO(e,t){return IO(e,(i=>e.moveByChar(i,t)))}const jO=e=>zO(e,!_O(e)),BO=e=>zO(e,_O(e));function FO(e,t){return IO(e,(i=>e.moveByGroup(i,t)))}function YO(e,t){return IO(e,(i=>e.moveVertically(i,t)))}const WO=e=>YO(e,!1),NO=e=>YO(e,!0);function GO(e,t){return IO(e,(i=>e.moveVertically(i,t,ZO(e).height)))}const UO=e=>GO(e,!1),HO=e=>GO(e,!0),KO=({state:e,dispatch:t})=>(t(wO(e,{anchor:0})),!0),JO=({state:e,dispatch:t})=>(t(wO(e,{anchor:e.doc.length})),!0),eg=({state:e,dispatch:t})=>(t(wO(e,{anchor:e.selection.main.anchor,head:0})),!0),tg=({state:e,dispatch:t})=>(t(wO(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function ig(e,t){if(e.state.readOnly)return!1;let i="delete.selection",{state:n}=e,r=n.changeByRange((n=>{let{from:r,to:s}=n;if(r==s){let o=t(n);or&&(i="delete.forward",o=ng(e,o,!0)),r=Math.min(r,o),s=Math.max(s,o)}else r=ng(e,r,!1),s=ng(e,s,!0);return r==s?{range:n}:{changes:{from:r,to:s},range:Ko.cursor(r,rt(e))))n.between(t,t,((e,n)=>{et&&(t=i?n:e)}));return t}const rg=(e,t,i)=>ig(e,(n=>{let r,s,o=n.from,{state:a}=e,l=a.doc.lineAt(o);if(i&&!t&&o>l.from&&org(e,!1,!0),og=e=>rg(e,!0,!1),ag=(e,t)=>ig(e,(i=>{let n=i.head,{state:r}=e,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let e=null;;){if(n==(t?s.to:s.from)){n==i.head&&s.number!=(t?r.doc.lines:1)&&(n+=t?1:-1);break}let a=Lo(s.text,n-s.from,t)+s.from,l=s.text.slice(Math.min(n,a)-s.from,Math.max(n,a)-s.from),h=o(l);if(null!=e&&h!=e)break;" "==l&&n==i.head||(e=h),n=a}return n})),lg=e=>ag(e,!1);function hg(e){let t=[],i=-1;for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),s=e.doc.lineAt(n.to);if(n.empty||n.to!=s.from||(s=e.doc.lineAt(n.to-1)),i>=r.number){let e=t[t.length-1];e.to=s.to,e.ranges.push(n)}else t.push({from:r.from,to:s.to,ranges:[n]});i=s.number+1}return t}function cg(e,t,i){if(e.readOnly)return!1;let n=[],r=[];for(let s of hg(e)){if(i?s.to==e.doc.length:0==s.from)continue;let t=e.doc.lineAt(i?s.to+1:s.from-1),o=t.length+1;if(i){n.push({from:s.to,to:t.to},{from:s.from,insert:t.text+e.lineBreak});for(let t of s.ranges)r.push(Ko.range(Math.min(e.doc.length,t.anchor+o),Math.min(e.doc.length,t.head+o)))}else{n.push({from:t.from,to:s.from},{from:s.to,insert:e.lineBreak+t.text});for(let e of s.ranges)r.push(Ko.range(e.anchor-o,e.head-o))}}return!!n.length&&(t(e.update({changes:n,scrollIntoView:!0,selection:Ko.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function ug(e,t,i){if(e.readOnly)return!1;let n=[];for(let r of hg(e))i?n.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):n.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const dg=e=>{if(e.state.readOnly)return!1;let{state:t}=e,i=t.changes(hg(t).map((({from:e,to:i})=>(e>0?e--:i{let i;if(e.lineWrapping){let n=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(i=n.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,i)})).map(i);return e.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};const pg=fg(!1);function fg(e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=t.changeByRange((i=>{let{from:n,to:r}=i,s=t.doc.lineAt(n),o=!e&&n==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let i,n=Lf(e).resolveInner(t),r=n.childBefore(t),s=n.childAfter(t);return r&&s&&r.to<=t&&s.from>=t&&(i=r.type.prop(dp.closedBy))&&i.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}(t,n);e&&(n=r=(r<=s.to?s:t.doc.lineAt(r)).to);let a=new em(t,{simulateBreak:n,simulateDoubleBreak:!!o}),l=Jf(a,n);for(null==l&&(l=al(/^\s*/.exec(t.doc.lineAt(n).text)[0],t.tabSize));rs.from&&n{let r=[];for(let o=n.from;o<=n.to;){let s=e.doc.lineAt(o);s.number>i&&(n.empty||n.to>s.from)&&(t(s,r,n),i=s.number),o=s.to+1}let s=e.changes(r);return{changes:r,range:Ko.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}}))}const Og=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(mg(e,((t,i)=>{i.push({from:t.from,insert:e.facet(Uf)})})),{userEvent:"input.indent"})),!0),gg=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(mg(e,((t,i)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let r=al(n,e.tabSize),s=0,o=Kf(e,Math.max(0,r-Hf(e)));for(;sSO(e,(t=>EO(e.state,t,!_O(e)))),shift:e=>IO(e,(t=>EO(e.state,t,!_O(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>SO(e,(t=>EO(e.state,t,_O(e)))),shift:e=>IO(e,(t=>EO(e.state,t,_O(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>cg(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>ug(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>cg(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>ug(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let i=e.selection,n=null;return i.ranges.length>1?n=Ko.create([i.main]):i.main.empty||(n=Ko.create([Ko.cursor(i.main.head)])),!!n&&(t(wO(e,n)),!0)}},{key:"Mod-Enter",run:fg(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let i=hg(e).map((({from:t,to:i})=>Ko.range(t,Math.min(i+1,e.doc.length))));return t(e.update({selection:Ko.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let i=xO(e.selection,(t=>{let i=Lf(e),n=i.resolveStack(t.from,1);if(t.empty){let e=i.resolveStack(t.from,-1);e.node.from>=n.node.from&&e.node.to<=n.node.to&&(n=e)}for(let e=n;e;e=e.next){let{node:i}=e;if((i.from=t.to||i.to>t.to&&i.from<=t.from)&&e.next)return Ko.range(i.to,i.from)}return t}));return!i.eq(e.selection)&&(t(wO(e,i)),!0)},preventDefault:!0},{key:"Mod-[",run:gg},{key:"Mod-]",run:Og},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=Object.create(null),n=new em(e,{overrideIndentation:e=>{let t=i[e];return null==t?-1:t}}),r=mg(e,((t,r,s)=>{let o=Jf(n,t.from);if(null==o)return;/\S/.test(t.text)||(o=0);let a=/^\s*/.exec(t.text)[0],l=Kf(e,o);(a!=l||s.fromfunction(e,t){let i=!1,n=xO(e.selection,(t=>{let n=Sm(e,t.head,-1)||Sm(e,t.head,1)||t.head>0&&Sm(e,t.head-1,1)||t.head{let{state:t}=e,i=t.doc.lineAt(t.selection.main.from),n=Gm(e.state,i.from);return n.line?Ym(e):!!n.block&&Nm(e)}},{key:"Alt-A",run:Wm},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:PO,shift:jO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>TO(e,!_O(e)),shift:e=>FO(e,!_O(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>SO(e,(t=>VO(e,t,!_O(e)))),shift:e=>IO(e,(t=>VO(e,t,!_O(e)))),preventDefault:!0},{key:"ArrowRight",run:CO,shift:BO,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>TO(e,_O(e)),shift:e=>FO(e,_O(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>SO(e,(t=>VO(e,t,_O(e)))),shift:e=>IO(e,(t=>VO(e,t,_O(e)))),preventDefault:!0},{key:"ArrowUp",run:RO,shift:WO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:KO,shift:eg},{mac:"Ctrl-ArrowUp",run:XO,shift:UO},{key:"ArrowDown",run:DO,shift:NO,preventDefault:!0},{mac:"Cmd-ArrowDown",run:JO,shift:tg},{mac:"Ctrl-ArrowDown",run:qO,shift:HO},{key:"PageUp",run:XO,shift:UO},{key:"PageDown",run:qO,shift:HO},{key:"Home",run:e=>SO(e,(t=>VO(e,t,!1))),shift:e=>IO(e,(t=>VO(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:KO,shift:eg},{key:"End",run:e=>SO(e,(t=>VO(e,t,!0))),shift:e=>IO(e,(t=>VO(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:JO,shift:tg},{key:"Enter",run:pg,shift:pg},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:sg,shift:sg},{key:"Delete",run:og},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lg},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>ag(e,!0)},{mac:"Mod-Backspace",run:e=>ig(e,(t=>{let i=e.moveToLineBoundary(t,!1).head;return t.head>i?i:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>ig(e,(t=>{let i=e.moveToLineBoundary(t,!0).head;return t.headSO(e,(t=>Ko.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>IO(e,(t=>Ko.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>SO(e,(t=>Ko.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>IO(e,(t=>Ko.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:og},{key:"Ctrl-h",run:sg},{key:"Ctrl-k",run:e=>ig(e,(t=>{let i=e.lineBlockAt(t.head).to;return t.head{if(e.readOnly)return!1;let i=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:_o.of(["",""])},range:Ko.cursor(e.from)})));return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let i=t.from,n=e.doc.lineAt(i),r=i==n.from?i-1:Lo(n.text,i-n.from,!1)+n.from,s=i==n.to?i+1:Lo(n.text,i-n.from,!0)+n.from;return{changes:{from:r,to:s,insert:e.doc.slice(i,s).append(e.doc.slice(r,i))},range:Ko.cursor(s)}}));return!i.changes.empty&&(t(e.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:qO}].map((e=>({mac:e.key,run:e.run,shift:e.shift}))))),bg={key:"Tab",run:Og,shift:gg};function yg(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];"string"==typeof r?e.setAttribute(n,r):null!=r&&(e[n]=r)}t++}for(;te.normalize("NFKD"):e=>e;class wg{constructor(e,t,i=0,n=e.length,r,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=r?e=>r(xg(e)):xg,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Xo(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=qo(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Vo(e);let n=this.normalize(t);if(n.length)for(let r=0,s=i;;r++){let e=n.charCodeAt(r),o=this.match(e,s,this.bufferPos+this.bufferStart);if(r==n.length-1){if(o)return this.value=o,this;break}s==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=Tg(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=i||n.to<=t){let n=new Pg(t,e.sliceString(t,i));return _g.set(e,n),n}if(n.from==t&&n.to==i)return n;let{text:r,from:s}=n;return s>t&&(r=e.sliceString(t,s)+r,s=t),n.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,i=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,i,t)))return this.value={from:e,to:i,match:t},this.matchPos=Tg(this.text,i+(e==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Pg.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Tg(e,t){if(t>=e.length)return t;let i,n=e.lineAt(t);for(;t=56320&&i<57344;)t++;return t}function Ag(e){let t=yg("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function i(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!i)return;let{state:n}=e,r=n.doc.lineAt(n.selection.main.head),[,s,o,a,l]=i,h=a?+a.slice(1):0,c=o?+o:r.number;if(o&&l){let e=c/100;s&&(e=e*("-"==s?-1:1)+r.number/n.doc.lines),c=Math.round(n.doc.lines*e)}else o&&s&&(c=c*("-"==s?-1:1)+r.number);let u=n.doc.line(Math.max(1,Math.min(n.doc.lines,c))),d=Ko.cursor(u.from+Math.max(0,Math.min(h,u.length)));e.dispatch({effects:[Eg.of(!1),Od.scrollIntoView(d.from,{y:"center"})],selection:d}),e.focus()}return{dom:yg("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:Eg.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),i())},onsubmit:e=>{e.preventDefault(),i()}},yg("label",e.state.phrase("Go to line"),": ",t)," ",yg("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),yg("button",{name:"close",onclick:()=>{e.dispatch({effects:Eg.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]))}}"undefined"!=typeof Symbol&&($g.prototype[Symbol.iterator]=Cg.prototype[Symbol.iterator]=function(){return this});const Eg=Aa.define(),Mg=la.define({create:()=>!0,update(e,t){for(let i of t.effects)i.is(Eg)&&(e=i.value);return e},provide:e=>ap.from(e,(e=>e?Ag:null))}),Rg=Od.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}});const Dg=ta.define({combine:e=>Ba(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new cv(e),scrollToMatch:e=>Od.scrollIntoView(e)})});class Zg{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Qg),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new jg(this):new qg(this)}getCursor(e,t=0,i){let n=e.doc?e:ja.create({doc:e});return null==i&&(i=n.doc.length),this.regexp?Vg(this,n,t,i):Xg(this,n,t,i)}}class Lg{constructor(e){this.spec=e}}function Xg(e,t,i,n){return new wg(t.doc,e.unquoted,i,n,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,i,n)=>((n>e||n+i.length=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Xg(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function Vg(e,t,i,n){return new $g(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,i)=>!i[0].length||(r(Ig(i.input,i.index))!=qa.Word||r(zg(i.input,i.index))!=qa.Word)&&(r(zg(i.input,i.index+i[0].length))!=qa.Word||r(Ig(i.input,i.index+i[0].length))!=qa.Word)):void 0},i,n);var r}function Ig(e,t){return e.slice(Lo(e,t,!1),t)}function zg(e,t){return e.slice(t,Lo(e,t))}class jg extends Lg{nextMatch(e,t,i){let n=Vg(this.spec,e,i,e.doc.length).next();return n.done&&(n=Vg(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let r=Math.max(t,i-1e4*n),s=Vg(this.spec,e,r,i),o=null;for(;!s.next().done;)o=s.value;if(o&&(r==t||o.from>r+10))return o;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,((t,i)=>{if("&"==i)return e.match[0];if("$"==i)return"$";for(let n=i.length;n>0;n--){let t=+i.slice(0,n);if(t>0&&t=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Vg(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Bg=Aa.define(),Fg=Aa.define(),Yg=la.define({create:e=>new Wg(rv(e).create(),null),update(e,t){for(let i of t.effects)i.is(Bg)?e=new Wg(i.value.create(),e.panel):i.is(Fg)&&(e=new Wg(e.query,i.value?nv:null));return e},provide:e=>ap.from(e,(e=>e.panel))});class Wg{constructor(e,t){this.query=e,this.panel=t}}const Ng=xh.mark({class:"cm-searchMatch"}),Gg=xh.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Ug=vc.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Yg))}update(e){let t=e.state.field(Yg);(t!=e.startState.field(Yg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return xh.none;let{view:i}=this,n=new Ua;for(let r=0,s=i.visibleRanges,o=s.length;rs[r+1].from-500;)a=s[++r].to;e.highlight(i.state,t,a,((e,t)=>{let r=i.state.selection.ranges.some((i=>i.from==e&&i.to==t));n.add(e,t,r?Gg:Ng)}))}return n.finish()}},{decorations:e=>e.decorations});function Hg(e){return t=>{let i=t.state.field(Yg,!1);return i&&i.query.spec.valid?e(t,i):av(t)}}const Kg=Hg(((e,{query:t})=>{let{to:i}=e.state.selection.main,n=t.nextMatch(e.state,i,i);if(!n)return!1;let r=Ko.single(n.from,n.to),s=e.state.facet(Dg);return e.dispatch({selection:r,effects:[fv(e,n),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),ov(e),!0})),Jg=Hg(((e,{query:t})=>{let{state:i}=e,{from:n}=i.selection.main,r=t.prevMatch(i,n,n);if(!r)return!1;let s=Ko.single(r.from,r.to),o=e.state.facet(Dg);return e.dispatch({selection:s,effects:[fv(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),ov(e),!0})),ev=Hg(((e,{query:t})=>{let i=t.matchAll(e.state,1e3);return!(!i||!i.length)&&(e.dispatch({selection:Ko.create(i.map((e=>Ko.range(e.from,e.to)))),userEvent:"select.search.matches"}),!0)})),tv=Hg(((e,{query:t})=>{let{state:i}=e,{from:n,to:r}=i.selection.main;if(i.readOnly)return!1;let s=t.nextMatch(i,n,n);if(!s)return!1;let o,a,l=s,h=[],c=[];if(l.from==n&&l.to==r&&(a=i.toText(t.getReplacement(l)),h.push({from:l.from,to:l.to,insert:a}),l=t.nextMatch(i,l.from,l.to),c.push(Od.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+"."))),l){let t=0==h.length||h[0].from>=s.to?0:s.to-s.from-a.length;o=Ko.single(l.from-t,l.to-t),c.push(fv(e,l)),c.push(i.facet(Dg).scrollToMatch(o.main,e))}return e.dispatch({changes:h,selection:o,effects:c,userEvent:"input.replace"}),!0})),iv=Hg(((e,{query:t})=>{if(e.state.readOnly)return!1;let i=t.matchAll(e.state,1e9).map((e=>{let{from:i,to:n}=e;return{from:i,to:n,insert:t.getReplacement(e)}}));if(!i.length)return!1;let n=e.state.phrase("replaced $ matches",i.length)+".";return e.dispatch({changes:i,effects:Od.announce.of(n),userEvent:"input.replace.all"}),!0}));function nv(e){return e.state.facet(Dg).createPanel(e)}function rv(e,t){var i,n,r,s,o;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let h=e.facet(Dg);return new Zg({search:(null!==(i=null==t?void 0:t.literal)&&void 0!==i?i:h.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(n=null==t?void 0:t.caseSensitive)&&void 0!==n?n:h.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:h.literal,regexp:null!==(s=null==t?void 0:t.regexp)&&void 0!==s?s:h.regexp,wholeWord:null!==(o=null==t?void 0:t.wholeWord)&&void 0!==o?o:h.wholeWord})}function sv(e){let t=np(e,nv);return t&&t.dom.querySelector("[main-field]")}function ov(e){let t=sv(e);t&&t==e.root.activeElement&&t.select()}const av=e=>{let t=e.state.field(Yg,!1);if(t&&t.panel){let i=sv(e);if(i&&i!=e.root.activeElement){let n=rv(e.state,t.query.spec);n.valid&&e.dispatch({effects:Bg.of(n)}),i.focus(),i.select()}}else e.dispatch({effects:[Fg.of(!0),t?Bg.of(rv(e.state,t.query.spec)):Aa.appendConfig.of(Ov)]});return!0},lv=e=>{let t=e.state.field(Yg,!1);if(!t||!t.panel)return!1;let i=np(e,nv);return i&&i.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Fg.of(!1)}),!0},hv=[{key:"Mod-f",run:av,scope:"editor search-panel"},{key:"F3",run:Kg,shift:Jg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Kg,shift:Jg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:lv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let i=e.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:r}=i.main,s=[],o=0;for(let a=new wg(e.doc,e.sliceDoc(n,r));!a.next().done;){if(s.length>1e3)return!1;a.value.from==n&&(o=s.length),s.push(Ko.range(a.value.from,a.value.to))}return t(e.update({selection:Ko.create(s,o),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=np(e,Ag);if(!t){let i=[Eg.of(!0)];null==e.state.field(Mg,!1)&&i.push(Aa.appendConfig.of([Mg,Rg])),e.dispatch({effects:i}),t=np(e,Ag)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:i}=e.selection;if(i.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:i}=e,n=Ko.create(i.ranges.map((t=>e.wordAt(t.head)||Ko.cursor(t.head))),i.mainIndex);return!n.eq(i)&&(t(e.update({selection:n})),!0)})({state:e,dispatch:t});let n=e.sliceDoc(i[0].from,i[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=n)))return!1;let r=function(e,t){let{main:i,ranges:n}=e.selection,r=e.wordAt(i.head),s=r&&r.from==i.from&&r.to==i.to;for(let o=!1,a=new wg(e.doc,t,n[n.length-1].to);;){if(a.next(),!a.done){if(o&&n.some((e=>e.from==a.value.from)))continue;if(s){let t=e.wordAt(a.value.from);if(!t||t.from!=a.value.from||t.to!=a.value.to)continue}return a.value}if(o)return null;a=new wg(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),o=!0}}(e,n);return!!r&&(t(e.update({selection:e.selection.addRange(Ko.range(r.from,r.to),!1),effects:Od.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class cv{constructor(e){this.view=e;let t=this.query=e.state.field(Yg).query.spec;function i(e,t,i){return yg("button",{class:"cm-button",name:e,onclick:t,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=yg("input",{value:t.search,placeholder:uv(e,"Find"),"aria-label":uv(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=yg("input",{value:t.replace,placeholder:uv(e,"Replace"),"aria-label":uv(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=yg("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=yg("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=yg("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=yg("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,i("next",(()=>Kg(e)),[uv(e,"next")]),i("prev",(()=>Jg(e)),[uv(e,"previous")]),i("select",(()=>ev(e)),[uv(e,"all")]),yg("label",null,[this.caseField,uv(e,"match case")]),yg("label",null,[this.reField,uv(e,"regexp")]),yg("label",null,[this.wordField,uv(e,"by word")]),...e.state.readOnly?[]:[yg("br"),this.replaceField,i("replace",(()=>tv(e)),[uv(e,"replace")]),i("replaceAll",(()=>iv(e)),[uv(e,"replace all")])],yg("button",{name:"close",onclick:()=>lv(e),"aria-label":uv(e,"close"),type:"button"},["×"])])}commit(){let e=new Zg({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Bg.of(e)}))}keydown(e){var t,i,n;t=this.view,i=e,n="search-panel",Td($d(t.state),i,t,n)?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Jg:Kg)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),tv(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Bg)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Dg).top}}function uv(e,t){return e.state.phrase(t)}const dv=30,pv=/[\s\.,:;?!]/;function fv(e,{from:t,to:i}){let n=e.state.doc.lineAt(t),r=e.state.doc.lineAt(i).to,s=Math.max(n.from,t-dv),o=Math.min(r,i+dv),a=e.state.sliceDoc(s,o);if(s!=n.from)for(let l=0;la.length-dv;l--)if(!pv.test(a[l-1])&&pv.test(a[l])){a=a.slice(0,l);break}return Od.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${n.number}.`)}const mv=Od.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Ov=[Yg,fa.low(Ug),mv];class gv{constructor(e,t,i,n){this.state=e,this.pos=t,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Lf(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),i=Math.max(t.from,this.pos-250),n=t.text.slice(i-t.from,this.pos-t.from),r=n.search(wv(e,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,i){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function vv(e){let t=Object.keys(e).join(""),i=/\w/.test(t);return i&&(t=t.replace(/\w/g,"")),`[${i?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function bv(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[i,n]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),i=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let r=e.matchBefore(n);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:i}:null}}function yv(e,t){return i=>{for(let t=Lf(i.state).resolveInner(i.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(i)}}class kv{constructor(e,t,i,n){this.completion=e,this.source=t,this.match=i,this.score=n}}function xv(e){return e.selection.main.from}function wv(e,t){var i;let{source:n}=e,r=t&&"^"!=n[0],s="$"!=n[n.length-1];return r||s?new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,null!==(i=e.flags)&&void 0!==i?i:e.ignoreCase?"i":""):e}const Sv=Pa.define();const Qv=new WeakMap;function $v(e){if(!Array.isArray(e))return e;let t=Qv.get(e);return t||Qv.set(e,t=bv(e)),t}const _v=Aa.define(),Pv=Aa.define();class Cv{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=48&&n<=57||n>=97&&n<=122?2:n>=65&&n<=90?1:0:(l=qo(n))!=l.toLowerCase()?1:l!=l.toUpperCase()?2:0;(!g||1==v&&m||0==b&&0!=v)&&(t[c]==n||i[c]==n&&(u=!0)?s[c++]=g:s.length&&(O=!1)),b=v,g+=Vo(n)}return c==a&&0==s[0]&&O?this.result((u?-200:0)-100,s,e):d==a&&0==p?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):d==a?this.ret(-900-e.length,[p,f]):c==a?this.result((u?-200:0)-100-700+(O?0:-1100),s,e):2==t.length?null:this.result((n[0]?-700:0)-200-1100,n,e)}result(e,t,i){let n=[],r=0;for(let s of t){let e=s+(this.astral?Vo(Xo(i,s)):1);r&&n[r-1]==s?n[r-1]=e:(n[r++]=s,n[r++]=e)}return this.ret(e-i.length,n)}}class Tv{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.lengthBa(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:Mv,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Ev(e(i),t(i)),optionClass:(e,t)=>i=>Ev(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function Ev(e,t){return e?t?e+" "+t:e:t}function Mv(e,t,i,n,r,s){let o,a,l=e.textDirection==Rh.RTL,h=l,c=!1,u="top",d=t.left-r.left,p=r.right-t.right,f=n.right-n.left,m=n.bottom-n.top;if(h&&d=m||e>t.top?o=i.bottom-t.top:(u="bottom",o=t.bottom-i.top)}return{style:`${u}: ${o/((t.bottom-t.top)/s.offsetHeight)}px; max-width: ${a/((t.right-t.left)/s.offsetWidth)}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":h?"left":"right")}}function Rv(e,t,i){if(e<=i)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/i);return{from:e*i,to:(e+1)*i}}let n=Math.floor((e-t)/i);return{from:e-(n+1)*i,to:e-n*i}}class Dv{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let n=e.state.field(t),{options:r,selected:s}=n.open,o=e.state.facet(Av);this.optionContent=function(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,i,n){let r=document.createElement("span");r.className="cm-completionLabel";let s=e.displayLabel||e.label,o=0;for(let a=0;ao&&r.appendChild(document.createTextNode(s.slice(o,e)));let i=r.appendChild(document.createElement("span"));i.appendChild(document.createTextNode(s.slice(e,t))),i.className="cm-completionMatchedText",o=t}return oe.position-t.position)).map((e=>e.render))}(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Rv(r.length,s,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(i=>{let{options:n}=e.state.field(t).open;for(let t,r=i.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]{let i=e.state.field(this.stateField,!1);i&&i.tooltip&&e.state.facet(Av).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:Pv.of(null)})})),this.showOptions(r,n.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){var t;let i=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=n){let{options:r,selected:s,disabled:o}=i.open;n.open&&n.open.options==r||(this.range=Rv(r.length,s,e.state.facet(Av).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),o!=(null===(t=n.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}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;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Rv(t.options.length,t.selected,this.view.state.facet(Av).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:n}=i;if(!n)return;let r="string"==typeof n?document.createTextNode(n):n(i);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,i)})).catch((e=>fc(this.view.state,e,"completion info"))):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=e.nodeType)i.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:n}=e;i.appendChild(t),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected"):n--;return t&&function(e,t){let i=e.getBoundingClientRect(),n=t.getBoundingClientRect(),r=i.height/e.offsetHeight;n.topi.bottom&&(e.scrollTop+=(n.bottom-i.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return n.top>Math.min(r.bottom,t.bottom)-10||n.bottom{e.target==n&&e.preventDefault()}));let r=null;for(let s=i.from;si.from||0==i.from))if(r=e,"string"!=typeof l&&l.header)n.appendChild(l.header(l));else{n.appendChild(document.createElement("completion-section")).textContent=e}}const h=n.appendChild(document.createElement("li"));h.id=t+"-"+s,h.setAttribute("role","option");let c=this.optionClass(o);c&&(h.className=c);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,a);t&&h.appendChild(t)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.tonew Dv(i,e,t)}function Lv(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class Xv{constructor(e,t,i,n,r,s){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=n,this.selected=r,this.disabled=s}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Xv(this.options,zv(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,n,r,s){if(n&&!s&&e.some((e=>e.isPending)))return n.setDisabled();let o=function(e,t){let i=[],n=null,r=e=>{i.push(e);let{section:t}=e.completion;if(t){n||(n=[]);let e="string"==typeof t?t:t.name;n.some((t=>t.name==e))||n.push("string"==typeof t?{name:e}:t)}},s=t.facet(Av);for(let h of e)if(h.hasResult()){let e=h.result.getMatch;if(!1===h.result.filter)for(let t of h.result.options)r(new kv(t,h.source,e?e(t):[],1e9-i.length));else{let i,n=t.sliceDoc(h.from,h.to),o=s.filterStrict?new Tv(n):new Cv(n);for(let t of h.result.options)if(i=o.match(t.label)){let n=t.displayLabel?e?e(t,i.matched):[]:i.matched;r(new kv(t,h.source,n,i.score+(t.boost||0)))}}}if(n){let e=Object.create(null),t=0,r=(e,t)=>{var i,n;return(null!==(i=e.rank)&&void 0!==i?i:1e9)-(null!==(n=t.rank)&&void 0!==n?n:1e9)||(e.namet.score-e.score||l(e.completion,t.completion)))){let e=h.completion;!a||a.label!=e.label||a.detail!=e.detail||null!=a.type&&null!=e.type&&a.type!=e.type||a.apply!=e.apply||a.boost!=e.boost?o.push(h):Lv(h.completion)>Lv(a)&&(o[o.length-1]=h),a=h.completion}return o}(e,t);if(!o.length)return n&&e.some((e=>e.isPending))?n.setDisabled():null;let a=t.facet(Av).selectOnOpen?0:-1;if(n&&n.selected!=a&&-1!=n.selected){let e=n.options[n.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:Hv,above:r.aboveCursor},n?n.timestamp:Date.now(),a,!1)}map(e){return new Xv(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new Xv(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class qv{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new qv(jv,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Av),n=(i.override||t.languageDataAt("autocomplete",xv(t)).map($v)).map((t=>(this.active.find((e=>e.source==t))||new Fv(t,this.active.some((e=>0!=e.state))?1:0)).update(e,i)));n.length==this.active.length&&n.every(((e,t)=>e==this.active[t]))&&(n=this.active);let r=this.open,s=e.effects.some((e=>e.is(Wv)));r&&e.docChanged&&(r=r.map(e.changes)),e.selection||n.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let i=0,n=0;;){for(;ie.isPending))&&(r=null),!r&&n.every((e=>!e.isPending))&&n.some((e=>e.hasResult()))&&(n=n.map((e=>e.hasResult()?new Fv(e.source,0):e)));for(let o of e.effects)o.is(Nv)&&(r=r&&r.setSelected(o.value,this.id));return n==this.active&&r==this.open?this:new qv(n,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Vv:Iv}}const Vv={"aria-autocomplete":"list"},Iv={};function zv(e,t){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(i["aria-activedescendant"]=e+"-"+t),i}const jv=[];function Bv(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(Sv);if(i&&t.activateOnCompletion(i))return 12}let i=e.isUserEvent("input.type");return i&&t.activateOnTyping?5:i?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Fv{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let i=Bv(e,t),n=this;(8&i||16&i&&this.touches(e))&&(n=new Fv(n.source,0)),4&i&&0==n.state&&(n=new Fv(this.source,1)),n=n.updateFor(e,i);for(let r of e.effects)if(r.is(_v))n=new Fv(n.source,1,r.value);else if(r.is(Pv))n=new Fv(n.source,0);else if(r.is(Wv))for(let e of r.value)e.source==n.source&&(n=e);return n}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(xv(e.state))}}class Yv extends Fv{constructor(e,t,i,n,r,s){super(e,3,t),this.limit=i,this.result=n,this.from=r,this.to=s}hasResult(){return!0}updateFor(e,t){var i;if(!(3&t))return this.map(e.changes);let n=this.result;n.map&&!e.changes.empty&&(n=n.map(n,e.changes));let r=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),o=xv(e.state);if(o>s||!n||2&t&&(xv(e.startState)==this.from||oe.map((e=>e.map(t)))}),Nv=Aa.define(),Gv=la.define({create:()=>qv.start(),update:(e,t)=>e.update(t),provide:e=>[ep.from(e,(e=>e.tooltip)),Od.contentAttributes.from(e,(e=>e.attrs))]});function Uv(e,t){const i=t.completion.apply||t.completion.label;let n=e.state.field(Gv).active.find((e=>e.source==t.source));return n instanceof Yv&&("string"==typeof i?e.dispatch(Object.assign(Object.assign({},function(e,t,i,n){let{main:r}=e.selection,s=i-r.from,o=n-r.from;return Object.assign(Object.assign({},e.changeByRange((a=>{if(a!=r&&i!=n&&e.sliceDoc(a.from+s,a.from+o)!=e.sliceDoc(i,n))return{range:a};let l=e.toText(t);return{changes:{from:a.from+s,to:n==r.from?a.to:a.from+o,insert:l},range:Ko.cursor(a.from+s+l.length)}}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,i,n.from,n.to)),{annotations:Sv.of(t.completion)})):i(e,t.completion,n.from,n.to),!0)}const Hv=Zv(Gv,Uv);function Kv(e,t="option"){return i=>{let n=i.state.field(Gv,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+s*(e?1:-1):e?0:o-1;return a<0?a="page"==t?0:o-1:a>=o&&(a="page"==t?o-1:0),i.dispatch({effects:Nv.of(a)}),!0}}const Jv=e=>!!e.state.field(Gv,!1)&&(e.dispatch({effects:_v.of(!0)}),!0);class eb{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const tb=vc.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(Gv).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Gv),i=e.state.facet(Av);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Gv)==t)return;let n=e.transactions.some((e=>{let t=Bv(e,i);return 8&t||(e.selection||e.docChanged)&&!(3&t)}));for(let o=0;o50&&Date.now()-t.time>1e3){for(let e of t.context.abortListeners)try{e()}catch(s){fc(this.view.state,s)}t.context.abortListeners=null,this.running.splice(o--,1)}else t.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some((e=>e.effects.some((e=>e.is(_v)))))&&(this.pendingStart=!0);let r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=t.active.some((e=>e.isPending&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),r):-1,0!=this.composing)for(let o of e.transactions)o.isUserEvent("input.type")?this.composing=2:2==this.composing&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Gv);for(let i of t.active)i.isPending&&!this.running.some((e=>e.active.source==i.source))&&this.startQuery(i);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(Av).updateSyncTime))}startQuery(e){let{state:t}=this.view,i=xv(t),n=new gv(t,i,e.explicit,this.view),r=new eb(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:Pv.of(null)}),fc(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(Av).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],i=this.view.state.facet(Av),n=this.view.state.field(Gv);for(let r=0;re.source==s.active.source));if(o&&o.isPending)if(null==s.done){let e=new Fv(s.active.source,0);for(let t of s.updates)e=e.update(t,i);e.isPending||t.push(e)}else this.startQuery(o)}(t.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:Wv.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Gv,!1);if(t&&t.tooltip&&this.view.state.facet(Av).closeOnBlur){let i=t.open&&tp(this.view,t.open.tooltip);i&&i.dom.contains(e.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:Pv.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:_v.of(!1)})),20),this.composing=0}}}),ib="object"==typeof navigator&&/Win/.test(navigator.platform),nb=fa.highest(Od.domEventHandlers({keydown(e,t){let i=t.state.field(Gv,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||e.key.length>1||e.ctrlKey&&(!ib||!e.altKey)||e.metaKey)return!1;let n=i.open.options[i.open.selected],r=i.active.find((e=>e.source==n.source)),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&Uv(t,n),!1}})),rb=Od.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"},".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"}}});class sb{constructor(e,t,i,n){this.field=e,this.line=t,this.from=i,this.to=n}}class ob{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,zo.TrackDel),i=e.mapPos(this.to,1,zo.TrackDel);return null==t||null==i?null:new ob(this.field,t,i)}}class ab{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],n=[t],r=e.doc.lineAt(t),s=/^\s*/.exec(r.text)[0];for(let o of this.lines){if(i.length){let i=s,r=/^\t*/.exec(o)[0].length;for(let t=0;tnew ob(e.field,n[e.line]+e.from,n[e.line]+e.to)))}}static parse(e){let t,i=[],n=[],r=[];for(let s of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(s);){let e=t[1]?+t[1]:null,o=t[2]||t[3]||"",a=-1,l=o.replace(/\\[{}]/g,(e=>e[1]));for(let t=0;t=a&&e.field++}r.push(new sb(a,n.length,t.index,t.index+l.length)),s=s.slice(0,t.index)+o+s.slice(t.index+t[0].length)}s=s.replace(/\\([{}])/g,((e,t,i)=>{for(let s of r)s.line==n.length&&s.from>i&&(s.from--,s.to--);return t})),n.push(s)}return new ab(n,r)}}let lb=xh.widget({widget:new class extends yh{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),hb=xh.mark({class:"cm-snippetField"});class cb{constructor(e,t){this.ranges=e,this.active=t,this.deco=xh.set(e.map((e=>(e.from==e.to?lb:hb).range(e.from,e.to))))}map(e){let t=[];for(let i of this.ranges){let n=i.map(e);if(!n)return null;t.push(n)}return new cb(t,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))))}}const ub=Aa.define({map:(e,t)=>e&&e.map(t)}),db=Aa.define(),pb=la.define({create:()=>null,update(e,t){for(let i of t.effects){if(i.is(ub))return i.value;if(i.is(db)&&e)return new cb(e.ranges,i.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Od.decorations.from(e,(e=>e?e.deco:xh.none))});function fb(e,t){return Ko.create(e.filter((e=>e.field==t)).map((e=>Ko.range(e.from,e.to))))}function mb(e){let t=ab.parse(e);return(e,i,n,r)=>{let{text:s,ranges:o}=t.instantiate(e.state,n),{main:a}=e.state.selection,l={changes:{from:n,to:r==a.from?a.to:r,insert:_o.of(s)},scrollIntoView:!0,annotations:i?[Sv.of(i),Ea.userEvent.of("input.complete")]:void 0};if(o.length&&(l.selection=fb(o,0)),o.some((e=>e.field>0))){let t=new cb(o,0),i=l.effects=[ub.of(t)];void 0===e.state.field(pb,!1)&&i.push(Aa.appendConfig.of([pb,bb,kb,rb]))}e.dispatch(e.state.update(l))}}function Ob(e){return({state:t,dispatch:i})=>{let n=t.field(pb,!1);if(!n||e<0&&0==n.active)return!1;let r=n.active+e,s=e>0&&!n.ranges.some((t=>t.field==r+e));return i(t.update({selection:fb(n.ranges,r),effects:ub.of(s?null:new cb(n.ranges,r)),scrollIntoView:!0})),!0}}const gb=[{key:"Tab",run:Ob(1),shift:Ob(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(pb,!1)&&(t(e.update({effects:ub.of(null)})),!0)}],vb=ta.define({combine:e=>e.length?e[0]:gb}),bb=fa.highest(Sd.compute([vb],(e=>e.facet(vb))));function yb(e,t){return Object.assign(Object.assign({},t),{apply:mb(e)})}const kb=Od.domEventHandlers({mousedown(e,t){let i,n=t.state.field(pb,!1);if(!n||null==(i=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=n.ranges.find((e=>e.from<=i&&e.to>=i));return!(!r||r.field==n.active)&&(t.dispatch({selection:fb(n.ranges,r.field),effects:ub.of(n.ranges.some((e=>e.field>r.field))?new cb(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),xb=new class extends Fa{};xb.startSide=1,xb.endSide=-1;const wb=[{key:"Ctrl-Space",run:Jv},{mac:"Alt-`",run:Jv},{key:"Escape",run:e=>{let t=e.state.field(Gv,!1);return!(!t||!t.active.some((e=>0!=e.state)))&&(e.dispatch({effects:Pv.of(null)}),!0)}},{key:"ArrowDown",run:Kv(!0)},{key:"ArrowUp",run:Kv(!1)},{key:"PageDown",run:Kv(!0,"page")},{key:"PageUp",run:Kv(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(Gv,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.facet(Av).defaultKeymap?[wb]:[])));function Qb(e){return new Wf(Tm.define(e))}function $b(e){return Se((()=>import("./index-C3NItWbX.js")),__vite__mapDeps([0,1,2]),import.meta.url).then((t=>t.sql({dialect:t[e]})))}const _b=[Nf.of({name:"C",extensions:["c","h","ino"],load:()=>Se((()=>import("./index-DA118ti0.js")),__vite__mapDeps([3,1,2]),import.meta.url).then((e=>e.cpp()))}),Nf.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>Se((()=>import("./index-DA118ti0.js")),__vite__mapDeps([3,1,2]),import.meta.url).then((e=>e.cpp()))}),Nf.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>$b("Cassandra")}),Nf.of({name:"CSS",extensions:["css"],load:()=>Se((()=>Promise.resolve().then((()=>Ex))),void 0,import.meta.url).then((e=>e.css()))}),Nf.of({name:"Go",extensions:["go"],load:()=>Se((()=>import("./index-CVdKItNW.js")),__vite__mapDeps([4,1,2]),import.meta.url).then((e=>e.go()))}),Nf.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>Se((()=>Promise.resolve().then((()=>Nw))),void 0,import.meta.url).then((e=>e.html()))}),Nf.of({name:"Java",extensions:["java"],load:()=>Se((()=>import("./index-HbrSBKa6.js")),__vite__mapDeps([5,1,2]),import.meta.url).then((e=>e.java()))}),Nf.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>Se((()=>Promise.resolve().then((()=>bw))),void 0,import.meta.url).then((e=>e.javascript()))}),Nf.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>Se((()=>import("./index-CJZijCqE.js")),__vite__mapDeps([6,1,2]),import.meta.url).then((e=>e.json()))}),Nf.of({name:"JSX",extensions:["jsx"],load:()=>Se((()=>Promise.resolve().then((()=>bw))),void 0,import.meta.url).then((e=>e.javascript({jsx:!0})))}),Nf.of({name:"LESS",extensions:["less"],load:()=>Se((()=>import("./index-BRLpoAL3.js")),__vite__mapDeps([7,1,2]),import.meta.url).then((e=>e.less()))}),Nf.of({name:"Liquid",extensions:["liquid"],load:()=>Se((()=>import("./index-CoAQ05zQ.js")),__vite__mapDeps([8,1,2]),import.meta.url).then((e=>e.liquid()))}),Nf.of({name:"MariaDB SQL",load:()=>$b("MariaSQL")}),Nf.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>Se((()=>Promise.resolve().then((()=>bS))),void 0,import.meta.url).then((e=>e.markdown()))}),Nf.of({name:"MS SQL",load:()=>$b("MSSQL")}),Nf.of({name:"MySQL",load:()=>$b("MySQL")}),Nf.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>Se((()=>import("./index-lXyw_eK-.js")),__vite__mapDeps([9,1,2]),import.meta.url).then((e=>e.php()))}),Nf.of({name:"PLSQL",extensions:["pls"],load:()=>$b("PLSQL")}),Nf.of({name:"PostgreSQL",load:()=>$b("PostgreSQL")}),Nf.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>Se((()=>import("./index-BFJf1VL1.js")),__vite__mapDeps([10,1,2]),import.meta.url).then((e=>e.python()))}),Nf.of({name:"Rust",extensions:["rs"],load:()=>Se((()=>import("./index-BKsxNJi6.js")),__vite__mapDeps([11,1,2]),import.meta.url).then((e=>e.rust()))}),Nf.of({name:"Sass",extensions:["sass"],load:()=>Se((()=>import("./index-Dgty_-Sl.js")),__vite__mapDeps([12,1,2]),import.meta.url).then((e=>e.sass({indented:!0})))}),Nf.of({name:"SCSS",extensions:["scss"],load:()=>Se((()=>import("./index-Dgty_-Sl.js")),__vite__mapDeps([12,1,2]),import.meta.url).then((e=>e.sass()))}),Nf.of({name:"SQL",extensions:["sql"],load:()=>$b("StandardSQL")}),Nf.of({name:"SQLite",load:()=>$b("SQLite")}),Nf.of({name:"TSX",extensions:["tsx"],load:()=>Se((()=>Promise.resolve().then((()=>bw))),void 0,import.meta.url).then((e=>e.javascript({jsx:!0,typescript:!0})))}),Nf.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>Se((()=>Promise.resolve().then((()=>bw))),void 0,import.meta.url).then((e=>e.javascript({typescript:!0})))}),Nf.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>Se((()=>import("./index-BS70MvZz.js")),__vite__mapDeps([13,1,2]),import.meta.url).then((e=>e.wast()))}),Nf.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>Se((()=>import("./index-Bz6lYfzJ.js")),__vite__mapDeps([14,1,2]),import.meta.url).then((e=>e.xml()))}),Nf.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>Se((()=>import("./index-B1pFhXfc.js")),__vite__mapDeps([15,1,2]),import.meta.url).then((e=>e.yaml()))}),Nf.of({name:"APL",extensions:["dyalog","apl"],load:()=>Se((()=>import("./apl-CXdQSnD-.js")),[],import.meta.url).then((e=>Qb(e.apl)))}),Nf.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>Se((()=>import("./asciiarmor-D5V0T9Cu.js")),[],import.meta.url).then((e=>Qb(e.asciiArmor)))}),Nf.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>Se((()=>import("./asn1-DWPaVWf6.js")),[],import.meta.url).then((e=>Qb(e.asn1({}))))}),Nf.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>Se((()=>import("./asterisk-B46aRdXb.js")),[],import.meta.url).then((e=>Qb(e.asterisk)))}),Nf.of({name:"Brainfuck",extensions:["b","bf"],load:()=>Se((()=>import("./brainfuck-CtZaYBKt.js")),[],import.meta.url).then((e=>Qb(e.brainfuck)))}),Nf.of({name:"Cobol",extensions:["cob","cpy"],load:()=>Se((()=>import("./cobol-stawOqaz.js")),[],import.meta.url).then((e=>Qb(e.cobol)))}),Nf.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>Se((()=>import("./clike-BgBwzOhw.js")),[],import.meta.url).then((e=>Qb(e.csharp)))}),Nf.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>Se((()=>import("./clojure-DR_hEDJv.js")),[],import.meta.url).then((e=>Qb(e.clojure)))}),Nf.of({name:"ClojureScript",extensions:["cljs"],load:()=>Se((()=>import("./clojure-DR_hEDJv.js")),[],import.meta.url).then((e=>Qb(e.clojure)))}),Nf.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>Se((()=>import("./css-ZjFoif2m.js")),[],import.meta.url).then((e=>Qb(e.gss)))}),Nf.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>Se((()=>import("./cmake-DXn5xaP-.js")),[],import.meta.url).then((e=>Qb(e.cmake)))}),Nf.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>Se((()=>import("./coffeescript-BTDxI-eT.js")),[],import.meta.url).then((e=>Qb(e.coffeeScript)))}),Nf.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>Se((()=>import("./commonlisp-vq6DHwts.js")),[],import.meta.url).then((e=>Qb(e.commonLisp)))}),Nf.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>Se((()=>import("./cypher-gJDei3ni.js")),[],import.meta.url).then((e=>Qb(e.cypher)))}),Nf.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>Se((()=>import("./python-DD-Q2bae.js")),[],import.meta.url).then((e=>Qb(e.cython)))}),Nf.of({name:"Crystal",extensions:["cr"],load:()=>Se((()=>import("./crystal-CRzZ78HM.js")),[],import.meta.url).then((e=>Qb(e.crystal)))}),Nf.of({name:"D",extensions:["d"],load:()=>Se((()=>import("./d-BShv7fp-.js")),[],import.meta.url).then((e=>Qb(e.d)))}),Nf.of({name:"Dart",extensions:["dart"],load:()=>Se((()=>import("./clike-BgBwzOhw.js")),[],import.meta.url).then((e=>Qb(e.dart)))}),Nf.of({name:"diff",extensions:["diff","patch"],load:()=>Se((()=>import("./diff-UJJ5BM9S.js")),[],import.meta.url).then((e=>Qb(e.diff)))}),Nf.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>Se((()=>import("./dockerfile-knGOOxt4.js")),__vite__mapDeps([16,17]),import.meta.url).then((e=>Qb(e.dockerFile)))}),Nf.of({name:"DTD",extensions:["dtd"],load:()=>Se((()=>import("./dtd-DI9Herc-.js")),[],import.meta.url).then((e=>Qb(e.dtd)))}),Nf.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>Se((()=>import("./dylan-CHJ5qNM_.js")),[],import.meta.url).then((e=>Qb(e.dylan)))}),Nf.of({name:"EBNF",load:()=>Se((()=>import("./ebnf-B-Df8AvO.js")),[],import.meta.url).then((e=>Qb(e.ebnf)))}),Nf.of({name:"ECL",extensions:["ecl"],load:()=>Se((()=>import("./ecl-DPFc0Uaf.js")),[],import.meta.url).then((e=>Qb(e.ecl)))}),Nf.of({name:"edn",extensions:["edn"],load:()=>Se((()=>import("./clojure-DR_hEDJv.js")),[],import.meta.url).then((e=>Qb(e.clojure)))}),Nf.of({name:"Eiffel",extensions:["e"],load:()=>Se((()=>import("./eiffel-DR5c0IrL.js")),[],import.meta.url).then((e=>Qb(e.eiffel)))}),Nf.of({name:"Elm",extensions:["elm"],load:()=>Se((()=>import("./elm-D7xaZ7Da.js")),[],import.meta.url).then((e=>Qb(e.elm)))}),Nf.of({name:"Erlang",extensions:["erl"],load:()=>Se((()=>import("./erlang-BuqgqA5h.js")),[],import.meta.url).then((e=>Qb(e.erlang)))}),Nf.of({name:"Esper",load:()=>Se((()=>import("./sql-B3SPsWL6.js")),[],import.meta.url).then((e=>Qb(e.esper)))}),Nf.of({name:"Factor",extensions:["factor"],load:()=>Se((()=>import("./factor-CFXhaUWb.js")),__vite__mapDeps([18,17]),import.meta.url).then((e=>Qb(e.factor)))}),Nf.of({name:"FCL",load:()=>Se((()=>import("./fcl-CVaBTCzQ.js")),[],import.meta.url).then((e=>Qb(e.fcl)))}),Nf.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>Se((()=>import("./forth-Dri_5nFc.js")),[],import.meta.url).then((e=>Qb(e.forth)))}),Nf.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>Se((()=>import("./fortran-DL7KluxX.js")),[],import.meta.url).then((e=>Qb(e.fortran)))}),Nf.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>Se((()=>import("./mllike-3c2dg9RT.js")),[],import.meta.url).then((e=>Qb(e.fSharp)))}),Nf.of({name:"Gas",extensions:["s"],load:()=>Se((()=>import("./gas-5kEe4nk0.js")),[],import.meta.url).then((e=>Qb(e.gas)))}),Nf.of({name:"Gherkin",extensions:["feature"],load:()=>Se((()=>import("./gherkin-B6X1vGSW.js")),[],import.meta.url).then((e=>Qb(e.gherkin)))}),Nf.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>Se((()=>import("./groovy-DnIzCrpZ.js")),[],import.meta.url).then((e=>Qb(e.groovy)))}),Nf.of({name:"Haskell",extensions:["hs"],load:()=>Se((()=>import("./haskell-CmdsSjFB.js")),[],import.meta.url).then((e=>Qb(e.haskell)))}),Nf.of({name:"Haxe",extensions:["hx"],load:()=>Se((()=>import("./haxe-D25e-2l-.js")),[],import.meta.url).then((e=>Qb(e.haxe)))}),Nf.of({name:"HXML",extensions:["hxml"],load:()=>Se((()=>import("./haxe-D25e-2l-.js")),[],import.meta.url).then((e=>Qb(e.hxml)))}),Nf.of({name:"HTTP",load:()=>Se((()=>import("./http-BKJkqRj4.js")),[],import.meta.url).then((e=>Qb(e.http)))}),Nf.of({name:"IDL",extensions:["pro"],load:()=>Se((()=>import("./idl-pcmmZuaN.js")),[],import.meta.url).then((e=>Qb(e.idl)))}),Nf.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>Se((()=>import("./javascript-D48wDJXV.js")),[],import.meta.url).then((e=>Qb(e.jsonld)))}),Nf.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load:()=>Se((()=>import("./jinja2-DhgKlfW7.js")),[],import.meta.url).then((e=>Qb(e.jinja2)))}),Nf.of({name:"Julia",extensions:["jl"],load:()=>Se((()=>import("./julia-DjdwvFuI.js")),[],import.meta.url).then((e=>Qb(e.julia)))}),Nf.of({name:"Kotlin",extensions:["kt","kts"],load:()=>Se((()=>import("./clike-BgBwzOhw.js")),[],import.meta.url).then((e=>Qb(e.kotlin)))}),Nf.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>Se((()=>import("./livescript-HO6ttBFx.js")),[],import.meta.url).then((e=>Qb(e.liveScript)))}),Nf.of({name:"Lua",extensions:["lua"],load:()=>Se((()=>import("./lua-8DXOpKDz.js")),[],import.meta.url).then((e=>Qb(e.lua)))}),Nf.of({name:"mIRC",extensions:["mrc"],load:()=>Se((()=>import("./mirc-DkvFAiy5.js")),[],import.meta.url).then((e=>Qb(e.mirc)))}),Nf.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>Se((()=>import("./mathematica-IIbmv7SK.js")),[],import.meta.url).then((e=>Qb(e.mathematica)))}),Nf.of({name:"Modelica",extensions:["mo"],load:()=>Se((()=>import("./modelica-DSrSSXCg.js")),[],import.meta.url).then((e=>Qb(e.modelica)))}),Nf.of({name:"MUMPS",extensions:["mps"],load:()=>Se((()=>import("./mumps-zvxmGV4l.js")),[],import.meta.url).then((e=>Qb(e.mumps)))}),Nf.of({name:"Mbox",extensions:["mbox"],load:()=>Se((()=>import("./mbox-DoeuZPxA.js")),[],import.meta.url).then((e=>Qb(e.mbox)))}),Nf.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>Se((()=>import("./nginx-B4hAVlXN.js")),[],import.meta.url).then((e=>Qb(e.nginx)))}),Nf.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>Se((()=>import("./nsis-BvKfQ9lQ.js")),__vite__mapDeps([19,17]),import.meta.url).then((e=>Qb(e.nsis)))}),Nf.of({name:"NTriples",extensions:["nt","nq"],load:()=>Se((()=>import("./ntriples-FFvkTduk.js")),[],import.meta.url).then((e=>Qb(e.ntriples)))}),Nf.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>Se((()=>import("./clike-BgBwzOhw.js")),[],import.meta.url).then((e=>Qb(e.objectiveC)))}),Nf.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>Se((()=>import("./clike-BgBwzOhw.js")),[],import.meta.url).then((e=>Qb(e.objectiveCpp)))}),Nf.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>Se((()=>import("./mllike-3c2dg9RT.js")),[],import.meta.url).then((e=>Qb(e.oCaml)))}),Nf.of({name:"Octave",extensions:["m"],load:()=>Se((()=>import("./octave-C4hdQ5Hf.js")),[],import.meta.url).then((e=>Qb(e.octave)))}),Nf.of({name:"Oz",extensions:["oz"],load:()=>Se((()=>import("./oz-qQq7irPq.js")),[],import.meta.url).then((e=>Qb(e.oz)))}),Nf.of({name:"Pascal",extensions:["p","pas"],load:()=>Se((()=>import("./pascal-CafrKXZF.js")),[],import.meta.url).then((e=>Qb(e.pascal)))}),Nf.of({name:"Perl",extensions:["pl","pm"],load:()=>Se((()=>import("./perl-tdMlh9QA.js")),[],import.meta.url).then((e=>Qb(e.perl)))}),Nf.of({name:"Pig",extensions:["pig"],load:()=>Se((()=>import("./pig-CwGJVRC4.js")),[],import.meta.url).then((e=>Qb(e.pig)))}),Nf.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>Se((()=>import("./powershell-D1ly3AHC.js")),[],import.meta.url).then((e=>Qb(e.powerShell)))}),Nf.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>Se((()=>import("./properties-_nPj978X.js")),[],import.meta.url).then((e=>Qb(e.properties)))}),Nf.of({name:"ProtoBuf",extensions:["proto"],load:()=>Se((()=>import("./protobuf-B4y9do6W.js")),[],import.meta.url).then((e=>Qb(e.protobuf)))}),Nf.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>Se((()=>import("./pug-_kJOm_E2.js")),__vite__mapDeps([20,21]),import.meta.url).then((e=>Qb(e.pug)))}),Nf.of({name:"Puppet",extensions:["pp"],load:()=>Se((()=>import("./puppet-Bc-yJKzi.js")),[],import.meta.url).then((e=>Qb(e.puppet)))}),Nf.of({name:"Q",extensions:["q"],load:()=>Se((()=>import("./q-B0kTJ4cI.js")),[],import.meta.url).then((e=>Qb(e.q)))}),Nf.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>Se((()=>import("./r-BA4EbLKE.js")),[],import.meta.url).then((e=>Qb(e.r)))}),Nf.of({name:"RPM Changes",load:()=>Se((()=>import("./rpm-DI_rRufH.js")),[],import.meta.url).then((e=>Qb(e.rpmChanges)))}),Nf.of({name:"RPM Spec",extensions:["spec"],load:()=>Se((()=>import("./rpm-DI_rRufH.js")),[],import.meta.url).then((e=>Qb(e.rpmSpec)))}),Nf.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>Se((()=>import("./ruby-CR-u2WLS.js")),[],import.meta.url).then((e=>Qb(e.ruby)))}),Nf.of({name:"SAS",extensions:["sas"],load:()=>Se((()=>import("./sas-Bqaci40L.js")),[],import.meta.url).then((e=>Qb(e.sas)))}),Nf.of({name:"Scala",extensions:["scala"],load:()=>Se((()=>import("./clike-BgBwzOhw.js")),[],import.meta.url).then((e=>Qb(e.scala)))}),Nf.of({name:"Scheme",extensions:["scm","ss"],load:()=>Se((()=>import("./scheme-qjP0V5Ag.js")),[],import.meta.url).then((e=>Qb(e.scheme)))}),Nf.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>Se((()=>import("./shell-BLav31RL.js")),[],import.meta.url).then((e=>Qb(e.shell)))}),Nf.of({name:"Sieve",extensions:["siv","sieve"],load:()=>Se((()=>import("./sieve-r025o_jW.js")),[],import.meta.url).then((e=>Qb(e.sieve)))}),Nf.of({name:"Smalltalk",extensions:["st"],load:()=>Se((()=>import("./smalltalk-C7J3IyEP.js")),[],import.meta.url).then((e=>Qb(e.smalltalk)))}),Nf.of({name:"Solr",load:()=>Se((()=>import("./solr-78MBEUkU.js")),[],import.meta.url).then((e=>Qb(e.solr)))}),Nf.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>Se((()=>import("./mllike-3c2dg9RT.js")),[],import.meta.url).then((e=>Qb(e.sml)))}),Nf.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>Se((()=>import("./sparql-BRLJFz69.js")),[],import.meta.url).then((e=>Qb(e.sparql)))}),Nf.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>Se((()=>import("./spreadsheet-CGlWr0eM.js")),[],import.meta.url).then((e=>Qb(e.spreadsheet)))}),Nf.of({name:"Squirrel",extensions:["nut"],load:()=>Se((()=>import("./clike-BgBwzOhw.js")),[],import.meta.url).then((e=>Qb(e.squirrel)))}),Nf.of({name:"Stylus",extensions:["styl"],load:()=>Se((()=>import("./stylus-OdhglgkO.js")),[],import.meta.url).then((e=>Qb(e.stylus)))}),Nf.of({name:"Swift",extensions:["swift"],load:()=>Se((()=>import("./swift-B_XXVlXX.js")),[],import.meta.url).then((e=>Qb(e.swift)))}),Nf.of({name:"sTeX",load:()=>Se((()=>import("./stex-Ba7Sj9VR.js")),[],import.meta.url).then((e=>Qb(e.stex)))}),Nf.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>Se((()=>import("./stex-Ba7Sj9VR.js")),[],import.meta.url).then((e=>Qb(e.stex)))}),Nf.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>Se((()=>import("./verilog-B4LBqg_1.js")),[],import.meta.url).then((e=>Qb(e.verilog)))}),Nf.of({name:"Tcl",extensions:["tcl"],load:()=>Se((()=>import("./tcl-B2fODqDH.js")),[],import.meta.url).then((e=>Qb(e.tcl)))}),Nf.of({name:"Textile",extensions:["textile"],load:()=>Se((()=>import("./textile-BuVhTOzU.js")),[],import.meta.url).then((e=>Qb(e.textile)))}),Nf.of({name:"TiddlyWiki",load:()=>Se((()=>import("./tiddlywiki-BgR6AEZu.js")),[],import.meta.url).then((e=>Qb(e.tiddlyWiki)))}),Nf.of({name:"Tiki wiki",load:()=>Se((()=>import("./tiki-CI-ztowC.js")),[],import.meta.url).then((e=>Qb(e.tiki)))}),Nf.of({name:"TOML",extensions:["toml"],load:()=>Se((()=>import("./toml-BQXy8elZ.js")),[],import.meta.url).then((e=>Qb(e.toml)))}),Nf.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>Se((()=>import("./troff-Ce85hlLp.js")),[],import.meta.url).then((e=>Qb(e.troff)))}),Nf.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>Se((()=>import("./ttcn-BxnYHtq8.js")),[],import.meta.url).then((e=>Qb(e.ttcn)))}),Nf.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>Se((()=>import("./ttcn-cfg-CKJxb-l2.js")),[],import.meta.url).then((e=>Qb(e.ttcnCfg)))}),Nf.of({name:"Turtle",extensions:["ttl"],load:()=>Se((()=>import("./turtle-BkSuIpt-.js")),[],import.meta.url).then((e=>Qb(e.turtle)))}),Nf.of({name:"Web IDL",extensions:["webidl"],load:()=>Se((()=>import("./webidl-CGwyPRYs.js")),[],import.meta.url).then((e=>Qb(e.webIDL)))}),Nf.of({name:"VB.NET",extensions:["vb"],load:()=>Se((()=>import("./vb-BHgjm0DN.js")),[],import.meta.url).then((e=>Qb(e.vb)))}),Nf.of({name:"VBScript",extensions:["vbs"],load:()=>Se((()=>import("./vbscript-Dawdd5GZ.js")),[],import.meta.url).then((e=>Qb(e.vbScript)))}),Nf.of({name:"Velocity",extensions:["vtl"],load:()=>Se((()=>import("./velocity-BdD_26Jv.js")),[],import.meta.url).then((e=>Qb(e.velocity)))}),Nf.of({name:"Verilog",extensions:["v"],load:()=>Se((()=>import("./verilog-B4LBqg_1.js")),[],import.meta.url).then((e=>Qb(e.verilog)))}),Nf.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>Se((()=>import("./vhdl-CWWH2SUo.js")),[],import.meta.url).then((e=>Qb(e.vhdl)))}),Nf.of({name:"XQuery",extensions:["xy","xquery"],load:()=>Se((()=>import("./xquery-CVDBqZPY.js")),[],import.meta.url).then((e=>Qb(e.xQuery)))}),Nf.of({name:"Yacas",extensions:["ys"],load:()=>Se((()=>import("./yacas-I8QjZlxf.js")),[],import.meta.url).then((e=>Qb(e.yacas)))}),Nf.of({name:"Z80",extensions:["z80"],load:()=>Se((()=>import("./z80-D8p3gKXp.js")),[],import.meta.url).then((e=>Qb(e.z80)))}),Nf.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>Se((()=>import("./mscgen-B2igx18G.js")),[],import.meta.url).then((e=>Qb(e.mscgen)))}),Nf.of({name:"Xù",extensions:["xu"],load:()=>Se((()=>import("./mscgen-B2igx18G.js")),[],import.meta.url).then((e=>Qb(e.xu)))}),Nf.of({name:"MsGenny",extensions:["msgenny"],load:()=>Se((()=>import("./mscgen-B2igx18G.js")),[],import.meta.url).then((e=>Qb(e.msgenny)))}),Nf.of({name:"Vue",extensions:["vue"],load:()=>Se((()=>import("./index-s5oNnYH8.js")),__vite__mapDeps([22,1,2]),import.meta.url).then((e=>e.vue()))}),Nf.of({name:"Angular Template",load:()=>Se((()=>import("./index-Ba5HOdXi.js")),__vite__mapDeps([23,1,2]),import.meta.url).then((e=>e.angular()))})];class Pb{static create(e,t,i,n,r){return new Pb(e,t,i,n+(n<<8)+e+(t<<4)|0,r,[],[])}constructor(e,t,i,n,r,s,o){this.type=e,this.value=t,this.from=i,this.hash=n,this.end=r,this.children=s,this.positions=o,this.hashProp=[[dp.contextHash,n]]}addChild(e,t){e.prop(dp.contextHash)!=this.hash&&(e=new kp(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let i=this.children.length-1;return i>=0&&(t=Math.max(t,this.positions[i]+this.children[i].length+this.from)),new kp(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,i)=>new kp(mp.none,e,t,i,this.hashProp)})}}var Cb,Tb;(Tb=Cb||(Cb={}))[Tb.Document=1]="Document",Tb[Tb.CodeBlock=2]="CodeBlock",Tb[Tb.FencedCode=3]="FencedCode",Tb[Tb.Blockquote=4]="Blockquote",Tb[Tb.HorizontalRule=5]="HorizontalRule",Tb[Tb.BulletList=6]="BulletList",Tb[Tb.OrderedList=7]="OrderedList",Tb[Tb.ListItem=8]="ListItem",Tb[Tb.ATXHeading1=9]="ATXHeading1",Tb[Tb.ATXHeading2=10]="ATXHeading2",Tb[Tb.ATXHeading3=11]="ATXHeading3",Tb[Tb.ATXHeading4=12]="ATXHeading4",Tb[Tb.ATXHeading5=13]="ATXHeading5",Tb[Tb.ATXHeading6=14]="ATXHeading6",Tb[Tb.SetextHeading1=15]="SetextHeading1",Tb[Tb.SetextHeading2=16]="SetextHeading2",Tb[Tb.HTMLBlock=17]="HTMLBlock",Tb[Tb.LinkReference=18]="LinkReference",Tb[Tb.Paragraph=19]="Paragraph",Tb[Tb.CommentBlock=20]="CommentBlock",Tb[Tb.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",Tb[Tb.Escape=22]="Escape",Tb[Tb.Entity=23]="Entity",Tb[Tb.HardBreak=24]="HardBreak",Tb[Tb.Emphasis=25]="Emphasis",Tb[Tb.StrongEmphasis=26]="StrongEmphasis",Tb[Tb.Link=27]="Link",Tb[Tb.Image=28]="Image",Tb[Tb.InlineCode=29]="InlineCode",Tb[Tb.HTMLTag=30]="HTMLTag",Tb[Tb.Comment=31]="Comment",Tb[Tb.ProcessingInstruction=32]="ProcessingInstruction",Tb[Tb.Autolink=33]="Autolink",Tb[Tb.HeaderMark=34]="HeaderMark",Tb[Tb.QuoteMark=35]="QuoteMark",Tb[Tb.ListMark=36]="ListMark",Tb[Tb.LinkMark=37]="LinkMark",Tb[Tb.EmphasisMark=38]="EmphasisMark",Tb[Tb.CodeMark=39]="CodeMark",Tb[Tb.CodeText=40]="CodeText",Tb[Tb.CodeInfo=41]="CodeInfo",Tb[Tb.LinkTitle=42]="LinkTitle",Tb[Tb.LinkLabel=43]="LinkLabel",Tb[Tb.URL=44]="URL";class Ab{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class Eb{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 Zb(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,i=0){for(let n=t;n=t.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;let n=(e.type==Cb.OrderedList?jb:zb)(i,t,!1);return n>0&&(e.type!=Cb.BulletList||Vb(i,t,!1)<0)&&i.text.charCodeAt(i.pos+n-1)==e.value}const Rb={[Cb.Blockquote]:(e,t,i)=>62==i.next&&(i.markers.push(gy(Cb.QuoteMark,t.lineStart+i.pos,t.lineStart+i.pos+1)),i.moveBase(i.pos+(Db(i.text.charCodeAt(i.pos+1))?2:1)),e.end=t.lineStart+i.text.length,!0),[Cb.ListItem]:(e,t,i)=>!(i.indent-1)&&(i.moveBaseColumn(i.baseIndent+e.value),!0),[Cb.OrderedList]:Mb,[Cb.BulletList]:Mb,[Cb.Document]:()=>!0};function Db(e){return 32==e||9==e||10==e||13==e}function Zb(e,t=0){for(;ti&&Db(e.charCodeAt(t-1));)t--;return t}function Xb(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(ny.SetextHeading)>-1||n<3?-1:1}function Ib(e,t){for(let i=e.stack.length-1;i>=0;i--)if(e.stack[i].type==t)return!0;return!1}function zb(e,t,i){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!Db(e.text.charCodeAt(e.pos+1))||!(!i||Ib(t,Cb.BulletList)||e.skipSpace(e.pos+2)=48&&r<=57;){if(n++,n==e.text.length)return-1;r=e.text.charCodeAt(n)}return n==e.pos||n>e.pos+9||46!=r&&41!=r||ne.pos+1||49!=e.next)?-1:n+1-e.pos}function Bb(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t6?-1:i}function Fb(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,Nb=/\?>/,Gb=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(s)return e.append(gy(Cb.Comment,i,i+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return e.append(gy(Cb.ProcessingInstruction,i,i+1+o[0].length));let a=/^(?:![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(n);return a?e.append(gy(Cb.HTMLTag,i,i+1+a[0].length)):-1},Emphasis(e,t,i){if(95!=t&&42!=t)return-1;let n=i+1;for(;e.char(n)==t;)n++;let r=e.slice(i-1,i),s=e.slice(n,n+1),o=Sy.test(r),a=Sy.test(s),l=/\s|^$/.test(r),h=/\s|^$/.test(s),c=!h&&(!a||l||o),u=!l&&(!o||h||a),d=c&&(42==t||!u||o),p=u&&(42==t||!c||a);return e.append(new xy(95==t?vy:by,i,n,(d?1:0)|(p?2:0)))},HardBreak(e,t,i){if(92==t&&10==e.char(i+1))return e.append(gy(Cb.HardBreak,i,i+2));if(32==t){let t=i+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=i+2)return e.append(gy(Cb.HardBreak,i,t+1))}return-1},Link:(e,t,i)=>91==t?e.append(new xy(yy,i,i+1,1)):-1,Image:(e,t,i)=>33==t&&91==e.char(i+1)?e.append(new xy(ky,i,i+2,1)):-1,LinkEnd(e,t,i){if(93!=t)return-1;for(let n=e.parts.length-1;n>=0;n--){let t=e.parts[n];if(t instanceof xy&&(t.type==yy||t.type==ky)){if(!t.side||e.skipSpace(t.to)==i&&!/[(\[]/.test(e.slice(i+1,i+2)))return e.parts[n]=null,-1;let r=e.takeContent(n),s=e.parts[n]=$y(e,r,t.type==yy?Cb.Link:Cb.Image,t.from,i+1);if(t.type==yy)for(let t=0;tt?gy(Cb.URL,t+i,r+i):r==e.length&&null}}function Py(e,t,i){let n=e.charCodeAt(t);if(39!=n&&34!=n&&40!=n)return!1;let r=40==n?41:n;for(let s=t+1,o=!1;s=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,i,n,r){return this.append(new xy(e,t,i,(n?1:0)|(r?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof xy&&(t.type==yy||t.type==ky))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let i=e;i=e;o--){let e=this.parts[o];if(e instanceof xy&&1&e.side&&e.type==t.type&&!(r&&(1&t.side||2&e.side)&&(e.to-e.from+s)%3==0&&((e.to-e.from)%3||s%3))){n=e;break}}if(!n)continue;let a=t.type.resolve,l=[],h=n.from,c=t.to;if(r){let e=Math.min(2,n.to-n.from,s);h=n.to-e,c=t.from+e,a=1==e?"Emphasis":"StrongEmphasis"}n.type.mark&&l.push(this.elt(n.type.mark,h,n.to));for(let e=o+1;e=0;t--){let i=this.parts[t];if(i instanceof xy&&i.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return Zb(this.text,e-this.offset)+this.offset}elt(e,t,i,n){return"string"==typeof e?gy(this.parser.getNodeType(e),t,i,n):new Oy(e,t)}}function Ay(e,t){if(!t.length)return e;if(!e.length)return t;let i=e.slice(),n=0;for(let r of t){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let n=e+this.fragment.offset;for(;i.to<=n;)if(!i.parent())return!1;for(;;){if(i.from>=n)return this.fragment.from<=t;if(!i.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(dp.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),r=e.absoluteLineStart,s=r,o=e.block.children.length,a=s,l=o;for(;;){if(t.to-i>n){if(t.type.isAnonymous&&t.firstChild())continue;break}let r=Ry(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,r);else{let i=new kp(e.parser.nodeSet.types[Cb.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(i,t.tree),e.addNode(i,r)}if(t.type.is("Block")&&(Ey.indexOf(t.type.id)<0?(s=t.to-i,o=e.block.children.length):(s=a,o=l,a=t.to-i,l=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return s-r}};function Ry(e,t){let i=e;for(let n=1;nJb[e])),Object.keys(Jb).map((e=>ny[e])),Object.keys(Jb),ry,Rb,Object.keys(Qy).map((e=>Qy[e])),Object.keys(Qy),[]);function Ly(e,t,i){let n=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let e=r?r.from:i;if(e>s&&n.push({from:s,to:e}),!r)break;s=r.to}return n}const Xy={resolve:"Strikethrough",mark:"StrikethroughMark"},qy={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":Cf.strikethrough}},{name:"StrikethroughMark",style:Cf.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,i){if(126!=t||126!=e.char(i+1)||126==e.char(i+2))return-1;let n=e.slice(i-1,i),r=e.slice(i+2,i+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),a=Sy.test(n),l=Sy.test(r);return e.addDelimiter(Xy,i,i+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function Vy(e,t,i=0,n,r=0){let s=0,o=!0,a=-1,l=-1,h=!1,c=()=>{n.push(e.elt("TableCell",r+a,r+l,e.parser.parseInline(t.slice(a,l),r+a)))};for(let u=i;u-1)&&s++,o=!1,n&&(a>-1&&c(),n.push(e.elt("TableDelimiter",u+r,u+r+1))),a=l=-1),h=!h&&92==i}return a>-1&&(s++,n&&c()),s}function Iy(e,t){for(let i=t;iIy(t.content,0)?new jy:null,endLeaf(e,t,i){if(i.parsers.some((e=>e instanceof jy))||!Iy(t.text,t.basePos))return!1;let n=e.peekLine();return zy.test(n)&&Vy(e,t.text,t.basePos)==Vy(e,n,t.basePos)},before:"SetextHeading"}]};class Fy{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}}const Yy={defineNodes:[{name:"Task",block:!0,style:Cf.list},{name:"TaskMarker",style:Cf.atom}],parseBlock:[{name:"TaskList",leaf:(e,t)=>/^\[[ xX]\][ \t]/.test(t.content)&&"ListItem"==e.parentType().name?new Fy:null,after:"SetextHeading"}]},Wy=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Ny=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Gy=/[\w-]+\.[\w-]+($|\/)/,Uy=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Hy=/\/[a-zA-Z\d@.]+/gy;function Ky(e,t,i,n){let r=0;for(let s=t;s-1)return-1;let n=t+i[0].length;for(;;){let i,r=e[n-1];if(/[?!.,:*_~]/.test(r)||")"==r&&Ky(e,t,n,")")>Ky(e,t,n,"("))n--;else{if(";"!=r||!(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,n))))break;n=t+i.index}}return n}(e.text,n+r[0].length),s>-1&&e.hasOpenLink){s=n+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(n,s))[0].length}}else r[3]?s=Jy(e.text,n):(s=Jy(e.text,n+r[0].length),s>-1&&"xmpp:"==r[0]&&(Hy.lastIndex=s,r=Hy.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",i,s+e.offset)),s+e.offset)}}]}];function tk(e,t,i){return(n,r,s)=>{if(r!=e||n.char(s+1)==e)return-1;let o=[n.elt(i,s,s+1)];for(let a=s+1;at%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new ok(e,[],t,i,i,0,[],0,n?new ak(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,n=65535&e,{parser:r}=this.p,s=this.reducePos=2e3&&!(null===(t=this.p.parser.nodeSet.types[n])||void 0===t?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(n,l)}storeNode(e,t,i,n=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4]){let e=!1;for(let t=r;t>0&&this.buffer[t-2]>i;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i,n){if(131072&e)this.pushState(65535&e,this.pos);else if(262144&e)this.pos=n,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,n,4);else{let r=e,{parser:s}=this.p;(n>this.pos||t<=s.maxNode)&&(this.pos=n,s.stateFlag(r,1)||(this.reducePos=n)),this.pushState(r,i),this.shiftContext(t,i),t<=s.maxNode&&this.buffer.push(t,i,n,4)}}apply(e,t,i,n){65536&e?this.reduce(e):this.shift(e,t,i,n)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new ok(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new lk(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==i)return!1;if(!(65536&i))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let n=0;n>19,n=65535&t,r=this.stack.length-3*i;if(r<0||e.getGoto(this.stack[r],n,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(n,r)=>{if(!t.includes(n))return t.push(n),e.allActions(n,(t=>{if(393216&t);else if(65536&t){let i=(t>>19)-r;if(i>1){let n=65535&t,r=this.stack.length-3*i;if(r>=0&&e.getGoto(this.stack[r],n,!1)>=0)return i<<19|65536|n}}else{let e=i(t,r+1);if(null!=e)return e}}))};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class ak{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class lk{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class hk{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new hk(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new hk(this.stack,this.pos,this.index)}}function ck(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),s+=r,i)break;s*=46}i?i[r++]=s:i=new t(s)}return i}class uk{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const dk=new uk;class pk{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=dk,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=dk,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class fk{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;gk(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}fk.prototype.contextual=fk.prototype.fallback=fk.prototype.extend=!1;class mk{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data="string"==typeof e?ck(e):e}token(e,t){let i=e.pos,n=0;for(;;){let i=e.next<0,r=e.resolveOffset(1,1);if(gk(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(i||n++,null==r)break;e.reset(r,e.token)}n&&(e.reset(i,e.token),e.acceptToken(this.elseToken,n))}}mk.prototype.contextual=fk.prototype.fallback=fk.prototype.extend=!1;class Ok{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function gk(e,t,i,n,r,s){let o=0,a=1<0){let i=e[u];if(l.allows(i)&&(-1==t.token.value||t.token.value==i||bk(i,t.token.value,r,s))){t.acceptToken(i);break}}let n=t.next,h=0,c=e[o+2];if(!(t.next<0&&c>h&&65535==e[i+3*c-3])){for(;h>1,s=i+r+(r<<1),a=e[s],l=e[s+1]||65536;if(n=l)){o=e[s+2],t.advance();continue e}h=r+1}}break}o=e[i+3*c-1]}}function vk(e,t,i){for(let n,r=t;65535!=(n=e[r]);r++)if(n==i)return r-t;return-1}function bk(e,t,i,n){let r=vk(i,n,t);return r<0||vk(i,n,e)t)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:e.length}}class wk{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?xk(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xk(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof kp){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class Sk{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new uk))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,s=n.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let l=0;lh.end+25&&(a=Math.max(h.lookAhead,a)),0!=h.value)){let r=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!n.extend&&(i=h,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),i||e.pos!=this.stream.end||(i=new uk,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new uk,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){let n=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(n,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(r>>1)){1&r?e.extended=r>>1:e.value=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(n+1)}putAction(e,t,i,n){for(let r=0;r4*e.bufferLength?new wk(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[e]=i;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(o);else{if(this.advanceStack(o,r,i))continue;{e||(e=[],t=[]),e.push(o);let i=this.tokens.getMainToken(o);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1){e:for(let e=0;e500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;sthis.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let s=this.fragments.nodeAt(n);s;){let n=this.parser.nodeSet.types[s.type.id]==s.type?r.getGoto(e.state,s.type.id):-1;if(n>-1&&s.length&&(!t||(s.prop(dp.contextHash)||0)==i))return e.useNode(s,n),!0;if(!(s instanceof kp)||0==s.children.length||s.positions[0]>0)break;let o=s.children[0];if(!(o instanceof kp&&0==s.positions[0]))break;s=o}}let s=r.stateSlot(e.state,4);if(s>0)return e.reduce(s),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let a=0;an?t.push(c):i.push(c)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return $k(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let s=0;s ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),this.advanceFully(o,i))continue}let c=o.split(),u=h;for(let e=0;c.forceReduce()&&e<10;e++){if(this.advanceFully(c,i))break;yk&&(u=this.stackID(c)+" -> ")}for(let e of o.recoverByInsert(a))this.advanceFully(e,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),$k(o,i)):(!n||n.scoree;class Ck{constructor(e){this.start=e.start,this.shift=e.shift||Pk,this.reduce=e.reduce||Pk,this.reuse=e.reuse||Pk,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}class Tk extends Ip{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;oe.topRules[t][1])),n=[];for(let o=0;o=0)r(i,e,o[t++]);else{let n=o[t+-i];for(let s=-i;s>0;s--)r(o[t++],e,n);t++}}}this.nodeSet=new Op(t.map(((t,r)=>mp.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:n[r],top:i.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=hp;let s=ck(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o"number"==typeof e?new fk(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new Qk(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],s=1&t,o=n[r++];if(s&&i)return o;for(let i=r+(t>>1);r0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let i=this.stateSlot(e,4),n=i?t(i):void 0;for(let r=this.stateSlot(e,1);null==n;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=Ak(this.data,r+2)}n=t(Ak(this.data,r+1))}return n}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=Ak(this.data,i+2)}if(!(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}configure(e){let t=Object.assign(Object.create(Tk.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((i,n)=>{let r=e.specializers.find((e=>e.from==i.external));if(!r)return i;let s=Object.assign(Object.assign({},i),{external:r.to});return t.specializers[n]=Ek(s),s}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(i[e]=!0)}let n=null;for(let r=0;re.external(i,n)<<1|t}return e.get}const Mk={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Rk={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Dk={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Zk(e){return 9==e||10==e||13==e||32==e}let Lk=null,Xk=null,qk=0;function Vk(e,t){let i=e.pos+t;if(qk==i&&Xk==e)return Lk;let n=e.peek(t);for(;Zk(n);)n=e.peek(++t);let r="";for(;45==(s=n)||46==s||58==s||s>=65&&s<=90||95==s||s>=97&&s<=122||s>=161;)r+=String.fromCharCode(n),n=e.peek(++t);var s;return Xk=e,qk=i,Lk=r?r.toLowerCase():n==Ik||n==zk?void 0:null}const Ik=63,zk=33;function jk(e,t){this.name=e,this.parent=t}const Bk=[6,10,7,8,9],Fk=new Ck({start:null,shift:(e,t,i,n)=>Bk.indexOf(t)>-1?new jk(Vk(n,1)||"",e):e,reduce:(e,t)=>20==t&&e?e.parent:e,reuse(e,t,i,n){let r=t.type.id;return 6==r||36==r?new jk(Vk(n,1)||"",e):e},strict:!1}),Yk=new Ok(((e,t)=>{if(60!=e.next)return void(e.next<0&&t.context&&e.acceptToken(57));e.advance();let i=47==e.next;i&&e.advance();let n=Vk(e,0);if(void 0===n)return;if(!n)return e.acceptToken(i?14:6);let r=t.context?t.context.name:null;if(i){if(n==r)return e.acceptToken(11);if(r&&Rk[r])return e.acceptToken(57,-2);if(t.dialectEnabled(0))return e.acceptToken(12);for(let e=t.context;e;e=e.parent)if(e.name==n)return;e.acceptToken(13)}else{if("script"==n)return e.acceptToken(7);if("style"==n)return e.acceptToken(8);if("textarea"==n)return e.acceptToken(9);if(Mk.hasOwnProperty(n))return e.acceptToken(10);r&&Dk[r]&&Dk[r][n]?e.acceptToken(57,-1):e.acceptToken(6)}}),{contextual:!0}),Wk=new Ok((e=>{for(let t=0,i=0;;i++){if(e.next<0){i&&e.acceptToken(58);break}if(45==e.next)t++;else{if(62==e.next&&t>=2){i>=3&&e.acceptToken(58,-2);break}t=0}e.advance()}}));const Nk=new Ok(((e,t)=>{if(47==e.next&&62==e.peek(1)){let i=t.dialectEnabled(1)||function(e){for(;e;e=e.parent)if("svg"==e.name||"math"==e.name)return!0;return!1}(t.context);e.acceptToken(i?5:4,2)}else 62==e.next&&e.acceptToken(4,1)}));function Gk(e,t,i){let n=2+e.length;return new Ok((r=>{for(let s=0,o=0,a=0;;a++){if(r.next<0){a&&r.acceptToken(t);break}if(0==s&&60==r.next||1==s&&47==r.next||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(i,-(o-2));break}if((10==r.next||13==r.next)&&a){r.acceptToken(t,1);break}s=o=0}else o++;r.advance()}}))}const Uk=Gk("script",54,1),Hk=Gk("style",55,2),Kk=Gk("textarea",56,3),Jk=lf({"Text RawText":Cf.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Cf.angleBracket,TagName:Cf.tagName,"MismatchedCloseTag/TagName":[Cf.tagName,Cf.invalid],AttributeName:Cf.attributeName,"AttributeValue UnquotedAttributeValue":Cf.attributeValue,Is:Cf.definitionOperator,"EntityReference CharacterReference":Cf.character,Comment:Cf.blockComment,ProcessingInst:Cf.processingInstruction,DoctypeDecl:Cf.documentMeta}),ex=Tk.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Fk,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[Jk],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let a=e.type.id;if(28==a)return nx(e,t,i);if(31==a)return nx(e,t,n);if(34==a)return nx(e,t,r);if(20==a&&s.length){let i,n=e.node,r=n.firstChild,o=r&&ix(r,t);if(o)for(let e of s)if(e.tag==o&&(!e.attrs||e.attrs(i||(i=tx(r,t))))){let t=n.lastChild,i=37==t.type.id?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}if(o&&23==a){let i,n=e.node;if(i=n.firstChild){let e=o[t.read(i.from,i.to)];if(e)for(let i of e){if(i.tagName&&i.tagName!=ix(n.parent,t))continue;let e=n.lastChild;if(26==e.type.id){let t=e.from+1,n=e.lastChild,r=e.to-(n&&n.isError?0:1);if(r>t)return{parser:i.parser,overlay:[{from:t,to:r}]}}else if(27==e.type.id)return{parser:i.parser,overlay:[{from:e.from,to:e.to}]}}}}return null}))}const sx=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function ox(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function ax(e){return e>=48&&e<=57}const lx=new Ok(((e,t)=>{for(let i=!1,n=0,r=0;;r++){let{next:s}=e;if(ox(s)||45==s||95==s||i&&ax(s))!i&&(45!=s||r>0)&&(i=!0),n===r&&45==s&&n++,e.advance();else{if(92!=s||10==e.peek(1)){i&&e.acceptToken(40==s?102:2==n&&t.canShift(2)?2:103);break}e.advance(),e.next>-1&&e.advance(),i=!0}}})),hx=new Ok((e=>{if(sx.includes(e.peek(-1))){let{next:t}=e;(ox(t)||95==t||35==t||46==t||91==t||58==t&&ox(e.peek(1))||45==t||38==t)&&e.acceptToken(101)}})),cx=new Ok((e=>{if(!sx.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),ox(t)){do{e.advance()}while(ox(e.next)||ax(e.next));e.acceptToken(1)}}})),ux=lf({"AtKeyword import charset namespace keyframes media supports":Cf.definitionKeyword,"from to selector":Cf.keyword,NamespaceName:Cf.namespace,KeyframeName:Cf.labelName,KeyframeRangeName:Cf.operatorKeyword,TagName:Cf.tagName,ClassName:Cf.className,PseudoClassName:Cf.constant(Cf.className),IdName:Cf.labelName,"FeatureName PropertyName":Cf.propertyName,AttributeName:Cf.attributeName,NumberLiteral:Cf.number,KeywordQuery:Cf.keyword,UnaryQueryOp:Cf.operatorKeyword,"CallTag ValueName":Cf.atom,VariableName:Cf.variableName,Callee:Cf.operatorKeyword,Unit:Cf.unit,"UniversalSelector NestingSelector":Cf.definitionOperator,MatchOp:Cf.compareOperator,"ChildOp SiblingOp, LogicOp":Cf.logicOperator,BinOp:Cf.arithmeticOperator,Important:Cf.modifier,Comment:Cf.blockComment,ColorLiteral:Cf.color,"ParenthesizedContent StringLiteral":Cf.string,":":Cf.punctuation,"PseudoOp #":Cf.derefOperator,"; ,":Cf.separator,"( )":Cf.paren,"[ ]":Cf.squareBracket,"{ }":Cf.brace}),dx={__proto__:null,lang:34,"nth-child":34,"nth-last-child":34,"nth-of-type":34,"nth-last-of-type":34,dir:34,"host-context":34,url:62,"url-prefix":62,domain:62,regexp:62,selector:140},px={__proto__:null,"@import":120,"@media":144,"@charset":148,"@namespace":152,"@keyframes":158,"@supports":170},fx={__proto__:null,not:134,only:134},mx=Tk.deserialize({version:14,states:":|QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$[QXO'#CaO$fQ[O'#CiO$qQ[O'#DUO$vQ[O'#DXOOQP'#Eo'#EoO${QdO'#DhO%jQ[O'#DuO${QdO'#DwO%{Q[O'#DyO&WQ[O'#D|O&`Q[O'#ESO&nQ[O'#EUOOQS'#En'#EnOOQS'#EX'#EXQYQ[OOO&uQXO'#CdO'jQWO'#DdO'oQWO'#EtO'zQ[O'#EtQOQWOOP(UO#tO'#C_POOO)C@^)C@^OOQP'#Ch'#ChOOQP,59Q,59QO#kQ[O,59QO(aQ[O,59TO$qQ[O,59pO$vQ[O,59sO(lQ[O,59vO(lQ[O,59xO(lQ[O,59yO(lQ[O'#E^O)WQWO,58{O)`Q[O'#DcOOQS,58{,58{OOQP'#Cl'#ClOOQO'#DS'#DSOOQP,59T,59TO)gQWO,59TO)lQWO,59TOOQP'#DW'#DWOOQP,59p,59pOOQO'#DY'#DYO)qQ`O,59sOOQS'#Cq'#CqO${QdO'#CrO)yQvO'#CtO+ZQtO,5:SOOQO'#Cy'#CyO)lQWO'#CxO+oQWO'#CzO+tQ[O'#DPOOQS'#Eq'#EqOOQO'#Dk'#DkO+|Q[O'#DrO,[QWO'#EuO&`Q[O'#DpO,jQWO'#DsOOQO'#Ev'#EvO)ZQWO,5:aO,oQpO,5:cOOQS'#D{'#D{O,wQWO,5:eO,|Q[O,5:eOOQO'#EO'#EOO-UQWO,5:hO-ZQWO,5:nO-cQWO,5:pOOQS-E8V-E8VO-kQdO,5:OO-{Q[O'#E`O.YQWO,5;`O.YQWO,5;`POOO'#EW'#EWP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lOOQP1G.o1G.oO)gQWO1G.oO)lQWO1G.oOOQP1G/[1G/[O.pQ`O1G/_O/ZQXO1G/bO/qQXO1G/dO0XQXO1G/eO0oQXO,5:xOOQO-E8[-E8[OOQS1G.g1G.gO0yQWO,59}O1OQ[O'#DTO1VQdO'#CpOOQP1G/_1G/_O${QdO1G/_O1^QpO,59^OOQS,59`,59`O${QdO,59bO1fQWO1G/nOOQS,59d,59dO1kQ!bO,59fOOQS'#DQ'#DQOOQS'#EZ'#EZO1vQ[O,59kOOQS,59k,59kO2OQWO'#DkO2ZQWO,5:WO2`QWO,5:^O&`Q[O,5:YO2hQ[O'#EaO3PQWO,5;aO3[QWO,5:[O(lQ[O,5:_OOQS1G/{1G/{OOQS1G/}1G/}OOQS1G0P1G0PO3mQWO1G0PO3rQdO'#EPOOQS1G0S1G0SOOQS1G0Y1G0YOOQS1G0[1G0[O3}QtO1G/jOOQO1G/j1G/jOOQO,5:z,5:zO4eQ[O,5:zOOQO-E8^-E8^O4rQWO1G0zPOOO-E8U-E8UPOOO1G.e1G.eOOQP7+$Z7+$ZOOQP7+$y7+$yO${QdO7+$yOOQS1G/i1G/iO4}QXO'#EsO5XQWO,59oO5^QtO'#EYO6UQdO'#EpO6`QWO,59[O6eQpO7+$yOOQS1G.x1G.xOOQS1G.|1G.|OOQS7+%Y7+%YOOQS1G/Q1G/QO6mQWO1G/QOOQS-E8X-E8XOOQS1G/V1G/VO${QdO1G/rOOQO1G/x1G/xOOQO1G/t1G/tO6rQWO,5:{OOQO-E8_-E8_O7QQXO1G/yOOQS7+%k7+%kO7XQYO'#CtOOQO'#ER'#ERO7dQ`O'#EQOOQO'#EQ'#EQO7oQWO'#EbO7wQdO,5:kOOQS,5:k,5:kO8SQtO'#E_O${QdO'#E_O9TQdO7+%UOOQO7+%U7+%UOOQO1G0f1G0fO9hQpO<PAN>PO;nQXO,5:wOOQO-E8Z-E8ZO;xQdO,5:vOOQO-E8Y-E8YOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUp`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYp`#f[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[p`#f[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSu^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWkWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VUZQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTkWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSp`#^~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#f[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU^QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S_Qp`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Z^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS}SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!PQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!PQp`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!]Qp`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSr^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSq^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUp`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!cQp`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!UUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!T^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!SQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[hx,cx,lx,1,2,3,4,new mk("m~RRYZ[z{a~~g~aO#`~~dP!P!Qg~lO#a~~",28,107)],topRules:{StyleSheet:[0,4],Styles:[1,87]},specialized:[{term:102,get:e=>dx[e]||-1},{term:59,get:e=>px[e]||-1},{term:103,get:e=>fx[e]||-1}],tokenPrec:1246});let Ox=null;function gx(){if(!Ox&&"object"==typeof document&&document.body){let{style:e}=document.body,t=[],i=new Set;for(let n in e)"cssText"!=n&&"cssFloat"!=n&&"string"==typeof e[n]&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))),i.has(n)||(t.push(n),i.add(n)));Ox=t.sort().map((e=>({type:"property",label:e,apply:e+": "})))}return Ox||[]}const vx=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map((e=>({type:"class",label:e}))),bx=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((e=>({type:"keyword",label:e}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((e=>({type:"constant",label:e})))),yx=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((e=>({type:"type",label:e}))),kx=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map((e=>({type:"keyword",label:e}))),xx=/^(\w[\w-]*|-\w[\w-]*|)$/,wx=/^-(-[\w-]*)?$/;const Sx=new qp,Qx=["Declaration"];function $x(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function _x(e,t,i){if(t.to-t.from>4096){let n=Sx.get(t);if(n)return n;let r=[],s=new Set,o=t.cursor(bp.IncludeAnonymous);if(o.firstChild())do{for(let t of _x(e,o.node,i))s.has(t.label)||(s.add(t.label),r.push(t))}while(o.nextSibling());return Sx.set(t,r),r}{let n=[],r=new Set;return t.cursor().iterate((t=>{var s;if(i(t)&&t.matchContext(Qx)&&":"==(null===(s=t.node.nextSibling)||void 0===s?void 0:s.name)){let i=e.sliceString(t.from,t.to);r.has(i)||(r.add(i),n.push({label:i,type:"variable"}))}})),n}}const Px=e=>t=>{let{state:i,pos:n}=t,r=Lf(i).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&"-"==i.doc.sliceString(r.from,r.to);if("PropertyName"==r.name||(s||"TagName"==r.name)&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:gx(),validFor:xx};if("ValueName"==r.name)return{from:r.from,options:bx,validFor:xx};if("PseudoClassName"==r.name)return{from:r.from,options:vx,validFor:xx};if(e(r)||(t.explicit||s)&&function(e,t){var i;if(("("==e.name||e.type.isError)&&(e=e.parent||e),"ArgList"!=e.name)return!1;let n=null===(i=e.parent)||void 0===i?void 0:i.firstChild;return"Callee"==(null==n?void 0:n.name)&&"var"==t.sliceString(n.from,n.to)}(r,i.doc))return{from:e(r)||s?r.from:n,options:_x(i.doc,$x(r),e),validFor:wx};if("TagName"==r.name){for(let{parent:e}=r;e;e=e.parent)if("Block"==e.name)return{from:r.from,options:gx(),validFor:xx};return{from:r.from,options:yx,validFor:xx}}if("AtKeyword"==r.name)return{from:r.from,options:kx,validFor:xx};if(!t.explicit)return null;let o=r.resolve(n),a=o.childBefore(n);return a&&":"==a.name&&"PseudoClassSelector"==o.name?{from:n,options:vx,validFor:xx}:a&&":"==a.name&&"Declaration"==o.name||"ArgList"==o.name?{from:n,options:bx,validFor:xx}:"Block"==o.name||"Styles"==o.name?{from:n,options:gx(),validFor:xx}:null},Cx=Px((e=>"VariableName"==e.name)),Tx=Zf.define({name:"css",parser:mx.configure({props:[tm.add({Declaration:cm()}),dm.add({"Block KeyframeList":pm})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Ax(){return new Wf(Tx,Tx.data.of({autocomplete:Cx}))}const Ex=Object.freeze(Object.defineProperty({__proto__:null,css:Ax,cssCompletionSource:Cx,cssLanguage:Tx,defineCSSCompletionSource:Px},Symbol.toStringTag,{value:"Module"})),Mx=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Rx=new Ck({start:!1,shift:(e,t)=>5==t||6==t||319==t?e:320==t,strict:!1}),Dx=new Ok(((e,t)=>{let{next:i}=e;(125==i||-1==i||t.context)&&e.acceptToken(317)}),{contextual:!0,fallback:!0}),Zx=new Ok(((e,t)=>{let i,{next:n}=e;Mx.indexOf(n)>-1||(47!=n||47!=(i=e.peek(1))&&42!=i)&&(125==n||59==n||-1==n||t.context||e.acceptToken(315))}),{contextual:!0}),Lx=new Ok(((e,t)=>{91!=e.next||t.context||e.acceptToken(316)}),{contextual:!0}),Xx=new Ok(((e,t)=>{let{next:i}=e;if(43==i||45==i){if(e.advance(),i==e.next){e.advance();let i=!t.context&&t.canShift(1);e.acceptToken(i?1:2)}}else 63==i&&46==e.peek(1)&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(3))}),{contextual:!0});function qx(e,t){return e>=65&&e<=90||e>=97&&e<=122||95==e||e>=192||!t&&e>=48&&e<=57}const Vx=new Ok(((e,t)=>{if(60!=e.next||!t.dialectEnabled(0))return;if(e.advance(),47==e.next)return;let i=0;for(;Mx.indexOf(e.next)>-1;)e.advance(),i++;if(qx(e.next,!0)){for(e.advance(),i++;qx(e.next,!1);)e.advance(),i++;for(;Mx.indexOf(e.next)>-1;)e.advance(),i++;if(44==e.next)return;for(let t=0;;t++){if(7==t){if(!qx(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),i++}}e.acceptToken(4,-i)})),Ix=lf({"get set async static":Cf.modifier,"for while do if else switch try catch finally return throw break continue default case":Cf.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":Cf.operatorKeyword,"let var const using function class extends":Cf.definitionKeyword,"import export from":Cf.moduleKeyword,"with debugger new":Cf.keyword,TemplateString:Cf.special(Cf.string),super:Cf.atom,BooleanLiteral:Cf.bool,this:Cf.self,null:Cf.null,Star:Cf.modifier,VariableName:Cf.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Cf.function(Cf.variableName),VariableDefinition:Cf.definition(Cf.variableName),Label:Cf.labelName,PropertyName:Cf.propertyName,PrivatePropertyName:Cf.special(Cf.propertyName),"CallExpression/MemberExpression/PropertyName":Cf.function(Cf.propertyName),"FunctionDeclaration/VariableDefinition":Cf.function(Cf.definition(Cf.variableName)),"ClassDeclaration/VariableDefinition":Cf.definition(Cf.className),"NewExpression/VariableName":Cf.className,PropertyDefinition:Cf.definition(Cf.propertyName),PrivatePropertyDefinition:Cf.definition(Cf.special(Cf.propertyName)),UpdateOp:Cf.updateOperator,"LineComment Hashbang":Cf.lineComment,BlockComment:Cf.blockComment,Number:Cf.number,String:Cf.string,Escape:Cf.escape,ArithOp:Cf.arithmeticOperator,LogicOp:Cf.logicOperator,BitOp:Cf.bitwiseOperator,CompareOp:Cf.compareOperator,RegExp:Cf.regexp,Equals:Cf.definitionOperator,Arrow:Cf.function(Cf.punctuation),": Spread":Cf.punctuation,"( )":Cf.paren,"[ ]":Cf.squareBracket,"{ }":Cf.brace,"InterpolationStart InterpolationEnd":Cf.special(Cf.brace),".":Cf.derefOperator,", ;":Cf.separator,"@":Cf.meta,TypeName:Cf.typeName,TypeDefinition:Cf.definition(Cf.typeName),"type enum interface implements namespace module declare":Cf.definitionKeyword,"abstract global Privacy readonly override":Cf.modifier,"is keyof unique infer asserts":Cf.operatorKeyword,JSXAttributeValue:Cf.attributeValue,JSXText:Cf.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Cf.angleBracket,"JSXIdentifier JSXNameSpacedName":Cf.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Cf.attributeName,"JSXBuiltin/JSXIdentifier":Cf.standard(Cf.tagName)}),zx={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,for:474,of:483,while:486,with:490,do:494,if:498,else:500,switch:504,case:510,try:516,catch:520,finally:524,return:528,throw:532,break:536,continue:540,debugger:544},jx={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Bx={__proto__:null,"<":193},Fx=Tk.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Ik'#IkO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JqO6[Q!0MxO'#JrO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO7eQMhO'#F|O9[Q`O'#F{OOQ!0Lf'#Jr'#JrOOQ!0Lb'#Jq'#JqO9aQ`O'#GwOOQ['#K^'#K^O9lQ`O'#IXO9qQ!0LrO'#IYOOQ['#J_'#J_OOQ['#I^'#I^Q`QlOOQ`QlOOO9yQ!L^O'#DvO:QQlO'#EOO:XQlO'#EQO9gQ`O'#GsO:`QMhO'#CoO:nQ`O'#EnO:yQ`O'#EyO;OQMhO'#FeO;mQ`O'#GsOOQO'#K_'#K_O;rQ`O'#K_O`Q`O'#CeO>pQ`O'#HbO>xQ`O'#HhO>xQ`O'#HjO`QlO'#HlO>xQ`O'#HnO>xQ`O'#HqO>}Q`O'#HwO?SQ!0LsO'#H}O%[QlO'#IPO?_Q!0LsO'#IRO?jQ!0LsO'#ITO9qQ!0LrO'#IVO?uQ!0MxO'#CiO@wQpO'#DlQOQ`OOO%[QlO'#EQOA_Q`O'#ETO:`QMhO'#EnOAjQ`O'#EnOAuQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Ju'#JuO%[QlO'#JuOOQO'#Jx'#JxOOQO'#Ig'#IgOBuQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J|'#J|OCqQ!0MSO'#EgOC{QpO'#EWOOQO'#Jw'#JwODaQpO'#JxOEnQpO'#EWOC{QpO'#EgPE{O&2DjO'#CbPOOO)CD|)CD|OOOO'#I_'#I_OFWO#tO,59UOOQ!0Lh,59U,59UOOOO'#I`'#I`OFfO&jO,59UOFtQ!L^O'#DcOOOO'#Ib'#IbOF{O#@ItO,59{OOQ!0Lf,59{,59{OGZQlO'#IcOGnQ`O'#JsOImQ!fO'#JsO+}QlO'#JsOItQ`O,5:ROJ[Q`O'#EpOJiQ`O'#KSOJtQ`O'#KROJtQ`O'#KROJ|Q`O,5;^OKRQ`O'#KQOOQ!0Ln,5:^,5:^OKYQlO,5:^OMWQ!0MxO,5:fOMwQ`O,5:nONbQ!0LrO'#KPONiQ`O'#KOO9aQ`O'#KOON}Q`O'#KOO! VQ`O,5;]O! [Q`O'#KOO!#aQ!fO'#JrOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$PQ!fO,5:sOOQS'#Jy'#JyOOQO-EsOOQ['#Jg'#JgOOQ[,5>t,5>tOOQ[-E<[-E<[O!nQ!0MxO,5:jO%[QlO,5:jO!AUQ!0MxO,5:lOOQO,5@y,5@yO!AuQMhO,5=_O!BTQ!0LrO'#JhO9[Q`O'#JhO!BfQ!0LrO,59ZO!BqQpO,59ZO!ByQMhO,59ZO:`QMhO,59ZO!CUQ`O,5;ZO!C^Q`O'#HaO!CrQ`O'#KcO%[QlO,5;}O!9xQpO,5}Q`O'#HWO9gQ`O'#HYO!EZQ`O'#HYO:`QMhO'#H[O!E`Q`O'#H[OOQ[,5=p,5=pO!EeQ`O'#H]O!EvQ`O'#CoO!E{Q`O,59PO!FVQ`O,59PO!H[QlO,59POOQ[,59P,59PO!HlQ!0LrO,59PO%[QlO,59PO!JwQlO'#HdOOQ['#He'#HeOOQ['#Hf'#HfO`QlO,5=|O!K_Q`O,5=|O`QlO,5>SO`QlO,5>UO!KdQ`O,5>WO`QlO,5>YO!KiQ`O,5>]O!KnQlO,5>cOOQ[,5>i,5>iO%[QlO,5>iO9qQ!0LrO,5>kOOQ[,5>m,5>mO# xQ`O,5>mOOQ[,5>o,5>oO# xQ`O,5>oOOQ[,5>q,5>qO#!fQpO'#D_O%[QlO'#JuO##XQpO'#JuO##cQpO'#DmO##tQpO'#DmO#&VQlO'#DmO#&^Q`O'#JtO#&fQ`O,5:WO#&kQ`O'#EtO#&yQ`O'#KTO#'RQ`O,5;_O#'WQpO'#DmO#'eQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#'lQ`O,5:oO>}Q`O,5;YO!BqQpO,5;YO!ByQMhO,5;YO:`QMhO,5;YO#'tQ`O,5@aO#'yQ07dO,5:sOOQO-E}O+}QlO,5>}OOQO,5?T,5?TO#+RQlO'#IcOOQO-EOO$5PQ`O,5>OOOQ[1G3h1G3hO`QlO1G3hOOQ[1G3n1G3nOOQ[1G3p1G3pO>xQ`O1G3rO$5UQlO1G3tO$9YQlO'#HsOOQ[1G3w1G3wO$9gQ`O'#HyO>}Q`O'#H{OOQ[1G3}1G3}O$9oQlO1G3}O9qQ!0LrO1G4TOOQ[1G4V1G4VOOQ!0Lb'#G_'#G_O9qQ!0LrO1G4XO9qQ!0LrO1G4ZO$=vQ`O,5@aO!)PQlO,5;`O9aQ`O,5;`O>}Q`O,5:XO!)PQlO,5:XO!BqQpO,5:XO$={Q?MtO,5:XOOQO,5;`,5;`O$>VQpO'#IdO$>mQ`O,5@`OOQ!0Lf1G/r1G/rO$>uQpO'#IjO$?PQ`O,5@oOOQ!0Lb1G0y1G0yO##tQpO,5:XOOQO'#If'#IfO$?XQpO,5:qOOQ!0Ln,5:q,5:qO#'oQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO>}Q`O1G0tO!BqQpO1G0tO!ByQMhO1G0tOOQ!0Lb1G5{1G5{O!BfQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$?`Q!0LrO1G0mO$?kQ!0LrO1G0mO!BqQpO1G0^OC{QpO1G0^O$?yQ!0LrO1G0mOOQO1G0^1G0^O$@_Q!0MxO1G0mPOOO-E}O$@{Q`O1G5yO$ATQ`O1G6XO$A]Q!fO1G6YO9aQ`O,5?TO$AgQ!0MxO1G6VO%[QlO1G6VO$AwQ!0LrO1G6VO$BYQ`O1G6UO$BYQ`O1G6UO9aQ`O1G6UO$BbQ`O,5?WO9aQ`O,5?WOOQO,5?W,5?WO$BvQ`O,5?WO$){Q`O,5?WOOQO-E_OOQ[,5>_,5>_O%[QlO'#HtO%>RQ`O'#HvOOQ[,5>e,5>eO9aQ`O,5>eOOQ[,5>g,5>gOOQ[7+)i7+)iOOQ[7+)o7+)oOOQ[7+)s7+)sOOQ[7+)u7+)uO%>WQpO1G5{O%>rQ?MtO1G0zO%>|Q`O1G0zOOQO1G/s1G/sO%?XQ?MtO1G/sO>}Q`O1G/sO!)PQlO'#DmOOQO,5?O,5?OOOQO-E}Q`O7+&`O!BqQpO7+&`OOQO7+%x7+%xO$@_Q!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%?cQ!0LrO7+&XO!BfQ!0LrO7+%xO!BqQpO7+%xO%?nQ!0LrO7+&XO%?|Q!0MxO7++qO%[QlO7++qO%@^Q`O7++pO%@^Q`O7++pOOQO1G4r1G4rO9aQ`O1G4rO%@fQ`O1G4rOOQS7+%}7+%}O#'oQ`O<`OOQ[,5>b,5>bO&=hQ`O1G4PO9aQ`O7+&fO!)PQlO7+&fOOQO7+%_7+%_O&=mQ?MtO1G6YO>}Q`O7+%_OOQ!0Lf<}Q`O<SQ!0MxO<= ]O&>dQ`O<= [OOQO7+*^7+*^O9aQ`O7+*^OOQ[ANAkANAkO&>lQ!fOANAkO!&oQMhOANAkO#'oQ`OANAkO4UQ!fOANAkO&>sQ`OANAkO%[QlOANAkO&>{Q!0MzO7+'zO&A^Q!0MzO,5?`O&CiQ!0MzO,5?bO&EtQ!0MzO7+'|O&HVQ!fO1G4kO&HaQ?MtO7+&aO&JeQ?MvO,5=XO&LlQ?MvO,5=ZO&L|Q?MvO,5=XO&M^Q?MvO,5=ZO&MnQ?MvO,59uO' tQ?MvO,5}Q`O7+)kO'-dQ`O<QPPP!>YHxPPPPPPPPP!AiP!BvPPHx!DXPHxPHxHxHxHxHxPHx!EkP!HuP!K{P!LP!LZ!L_!L_P!HrP!Lc!LcP# iP# mHxPHx# s#$xCW@zP@zP@z@zP#&V@z@z#(i@z#+a@z#-m@z@z#.]#0q#0q#0v#1P#0q#1[PP#0qP@z#1t@z#5s@z@z6bPPP#9xPPP#:c#:cP#:cP#:y#:cPP#;PP#:vP#:v#;d#:v#S#>Y#>d#>j#>t#>z#?[#?b#@S#@f#@l#@r#AQ#Ag#C[#Cj#Cq#E]#Ek#G]#Gk#Gq#Gw#G}#HX#H_#He#Ho#IR#IXPPPPPPPPPPP#I_PPPPPPP#JS#MZ#Ns#Nz$ SPPP$&nP$&w$)p$0Z$0^$0a$1`$1c$1j$1rP$1x$1{P$2i$2m$3e$4s$4x$5`PP$5e$5k$5o$5r$5v$5z$6v$7_$7v$7z$7}$8Q$8W$8Z$8_$8cR!|RoqOXst!Z#d%l&p&r&s&u,n,s2S2VY!vQ'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:379,context:Rx,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,236,242,244,246,248,251,257,263,265,267,269,271,273,274,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Ix],skippedNodes:[0,5,6,277],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Y!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Y!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(VpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(VpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Vp(Y!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Vp(Y!b'{0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(W#S$i&j'|0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Vp(Y!b'|0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(U':f$i&j(Y!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Y!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Y!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Y!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Y!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Vp(Y!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Y!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(VpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(VpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Vp(Y!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Y!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Y!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Y!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Y!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Y!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Vp(Y!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Vp(Y!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Vp(Y!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Vp(Y!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Vp(Y!b'{0/l$]#t(S,2j(d$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Vp(Y!b'|0/l$]#t(S,2j(d$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Zx,Lx,Xx,Vx,2,3,4,5,6,7,8,9,10,11,12,13,14,Dx,new mk("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(b~~",141,339),new mk("j~RQYZXz{^~^O(P~~aP!P!Qd~iO(Q~~",25,322)],topRules:{Script:[0,7],SingleExpression:[1,275],SingleClassItem:[2,276]},dialects:{jsx:0,ts:15098},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:326,get:e=>zx[e]||-1},{term:342,get:e=>jx[e]||-1},{term:95,get:e=>Bx[e]||-1}],tokenPrec:15124}),Yx=[yb("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),yb("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),yb("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),yb("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),yb("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),yb("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),yb("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),yb("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),yb("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),yb('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),yb('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Wx=Yx.concat([yb("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),yb("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),yb("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Nx=new qp,Gx=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ux(e){return(t,i)=>{let n=t.node.getChild("VariableDefinition");return n&&i(n,e),!0}}const Hx=["FunctionDeclaration"],Kx={FunctionDeclaration:Ux("function"),ClassDeclaration:Ux("class"),ClassExpression:()=>!0,EnumDeclaration:Ux("constant"),TypeAliasDeclaration:Ux("type"),NamespaceDeclaration:Ux("namespace"),VariableDefinition(e,t){e.matchContext(Hx)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function Jx(e,t){let i=Nx.get(t);if(i)return i;let n=[],r=!0;function s(t,i){let r=e.sliceString(t.from,t.to);n.push({label:r,type:i})}return t.cursor(bp.IncludeAnonymous).iterate((t=>{if(r)r=!1;else if(t.name){let e=Kx[t.name];if(e&&e(t,s)||Gx.has(t.name))return!1}else if(t.to-t.from>8192){for(let i of Jx(e,t.node))n.push(i);return!1}})),Nx.set(t,n),n}const ew=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,tw=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function iw(e){let t=Lf(e.state).resolveInner(e.pos,-1);if(tw.indexOf(t.name)>-1)return null;let i="VariableName"==t.name||t.to-t.from<20&&ew.test(e.state.sliceDoc(t.from,t.to));if(!i&&!e.explicit)return null;let n=[];for(let r=t;r;r=r.parent)Gx.has(r.name)&&(n=n.concat(Jx(e.state.doc,r)));return{options:n,from:i?t.from:e.pos,validFor:ew}}function nw(e,t,i){var n;let r=[];for(;;){let s,o=t.firstChild;if("VariableName"==(null==o?void 0:o.name))return r.push(e(o)),{path:r.reverse(),name:i};if("MemberExpression"!=(null==o?void 0:o.name)||"PropertyName"!=(null===(n=s=o.lastChild)||void 0===n?void 0:n.name))return null;r.push(e(s)),t=o}}function rw(e){let t=t=>e.state.doc.sliceString(t.from,t.to),i=Lf(e.state).resolveInner(e.pos,-1);return"PropertyName"==i.name?nw(t,i.parent,t(i)):"."!=i.name&&"?."!=i.name||"MemberExpression"!=i.parent.name?tw.indexOf(i.name)>-1?null:"VariableName"==i.name||i.to-i.from<20&&ew.test(t(i))?{path:[],name:t(i)}:"MemberExpression"==i.name?nw(t,i,""):e.explicit?{path:[],name:""}:null:nw(t,i.parent,"")}const sw=Zf.define({name:"javascript",parser:Fx.configure({props:[tm.add({IfStatement:cm({except:/^\s*({|else\b)/}),TryStatement:cm({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:hm,SwitchBody:e=>{let t=e.textAfter,i=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(i?0:n?1:2)*e.unit},Block:am({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":cm({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),dm.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":pm,BlockComment:e=>({from:e.from+2,to:e.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),ow={test:e=>/^JSX/.test(e.name),facet:Ef({commentTokens:{block:{open:"{/*",close:"*/}"}}})},aw=sw.configure({dialect:"ts"},"typescript"),lw=sw.configure({dialect:"jsx",props:[Mf.add((e=>e.isTop?[ow]:void 0))]}),hw=sw.configure({dialect:"jsx ts",props:[Mf.add((e=>e.isTop?[ow]:void 0))]},"typescript");let cw=e=>({label:e,type:"keyword"});const uw="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(cw),dw=uw.concat(["declare","implements","private","protected","public"].map(cw));function pw(e={}){let t=e.jsx?e.typescript?hw:lw:e.typescript?aw:sw,i=e.typescript?Wx.concat(dw):Yx.concat(uw);return new Wf(t,[sw.data.of({autocomplete:yv(tw,bv(i))}),sw.data.of({autocomplete:iw}),e.jsx?Ow:[]])}function fw(e,t,i=e.length){for(let n=null==t?void 0:t.firstChild;n;n=n.nextSibling)if("JSXIdentifier"==n.name||"JSXBuiltin"==n.name||"JSXNamespacedName"==n.name||"JSXMemberExpression"==n.name)return e.sliceString(n.from,Math.min(n.to,i));return""}const mw="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Ow=Od.inputHandler.of(((e,t,i,n,r)=>{if((mw?e.composing:e.compositionStarted)||e.state.readOnly||t!=i||">"!=n&&"/"!=n||!sw.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,a=o.changeByRange((e=>{var t;let i,{head:r}=e,s=Lf(o).resolveInner(r-1,-1);if("JSXStartTag"==s.name&&(s=s.parent),o.doc.sliceString(r-1,r)!=n||"JSXAttributeValue"==s.name&&s.to>r);else{if(">"==n&&"JSXFragmentTag"==s.name)return{range:e,changes:{from:r,insert:""}};if("/"==n&&"JSXStartCloseTag"==s.name){let e=s.parent,n=e.parent;if(n&&e.from==r-2&&((i=fw(o.doc,n.firstChild,r))||"JSXFragmentTag"==(null===(t=n.firstChild)||void 0===t?void 0:t.name))){let e=`${i}>`;return{range:Ko.cursor(r+e.length,-1),changes:{from:r,insert:e}}}}else if(">"==n){let t=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(s);if(t&&"JSXOpenTag"==t.name&&!/^\/?>|^<\//.test(o.doc.sliceString(r,r+2))&&(i=fw(o.doc,t,r)))return{range:e,changes:{from:r,insert:``}}}}return{range:e}}));return!a.changes.empty&&(e.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));function gw(e,t,i,n){return i.line(e+n.line).from+t+(1==e?n.col-1:-1)}function vw(e,t,i){let n=gw(e.line,e.column,t,i),r={from:n,to:null!=e.endLine&&1!=e.endColumn?gw(e.endLine,e.endColumn,t,i):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:1==e.severity?"warning":"error"};if(e.fix){let{range:t,text:s}=e.fix,o=t[0]+i.pos-n,a=t[1]+i.pos-n;r.actions=[{name:"fix",apply(e,t){e.dispatch({changes:{from:t+o,to:t+a,insert:s},scrollIntoView:!0})}}]}return r}const bw=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Ow,completionPath:rw,esLint:function(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach(((e,i)=>{e.meta.docs.recommended&&(t.rules[i]=2)}))),i=>{let{state:n}=i,r=[];for(let{from:s,to:o}of sw.findRegions(n)){let i=n.doc.lineAt(s),a={line:i.number-1,col:s-i.from,pos:s};for(let l of e.verify(n.sliceDoc(s,o),t))r.push(vw(l,n.doc,a))}return r}},javascript:pw,javascriptLanguage:sw,jsxLanguage:lw,localCompletionSource:iw,scopeCompletionSource:function(e){let t=new Map;return i=>{let n=rw(i);if(!n)return null;let r=e;for(let e of n.path)if(r=r[e],!r)return null;let s=t.get(r);return s||t.set(r,s=function(e,t){let i=[],n=new Set;for(let r=0;;r++){for(let o of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||n.has(o))continue;let s;n.add(o);try{s=e[o]}catch(_$){continue}i.push({label:o,type:"function"==typeof s?/^[A-Z]/.test(o)?"class":t?"function":"method":t?"variable":"property",boost:-r})}let s=Object.getPrototypeOf(e);if(!s)return i;e=s}}(r,!n.path.length)),{from:i.pos-n.name.length,options:s,validFor:ew}}},snippets:Yx,tsxLanguage:hw,typescriptLanguage:aw,typescriptSnippets:Wx},Symbol.toStringTag,{value:"Module"})),yw=["_blank","_self","_top","_parent"],kw=["ascii","utf-8","utf-16","latin1","latin1"],xw=["get","post","put","delete"],ww=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Sw=["true","false"],Qw={},$w={a:{attrs:{href:null,ping:null,type:null,media:null,target:yw,hreflang:null}},abbr:Qw,address:Qw,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Qw,aside:Qw,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Qw,base:{attrs:{href:null,target:yw}},bdi:Qw,bdo:Qw,blockquote:{attrs:{cite:null}},body:Qw,br:Qw,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:ww,formmethod:xw,formnovalidate:["novalidate"],formtarget:yw,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Qw,center:Qw,cite:Qw,code:Qw,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Qw,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Qw,div:Qw,dl:Qw,dt:Qw,em:Qw,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Qw,figure:Qw,footer:Qw,form:{attrs:{action:null,name:null,"accept-charset":kw,autocomplete:["on","off"],enctype:ww,method:xw,novalidate:["novalidate"],target:yw}},h1:Qw,h2:Qw,h3:Qw,h4:Qw,h5:Qw,h6:Qw,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Qw,hgroup:Qw,hr:Qw,html:{attrs:{manifest:null}},i:Qw,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:ww,formmethod:xw,formnovalidate:["novalidate"],formtarget:yw,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Qw,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Qw,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Qw,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:kw,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Qw,noscript:Qw,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Qw,param:{attrs:{name:null,value:null}},pre:Qw,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Qw,rt:Qw,ruby:Qw,samp:Qw,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:kw}},section:Qw,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Qw,source:{attrs:{src:null,type:null,media:null}},span:Qw,strong:Qw,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Qw,summary:Qw,sup:Qw,table:Qw,tbody:Qw,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Qw,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Qw,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Qw,time:{attrs:{datetime:null}},title:Qw,tr:Qw,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Qw,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Qw},_w={accesskey:null,class:null,contenteditable:Sw,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Sw,autocorrect:Sw,autocapitalize:Sw,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Sw,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Sw,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Sw,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Sw,"aria-hidden":Sw,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Sw,"aria-multiselectable":Sw,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Sw,"aria-relevant":null,"aria-required":Sw,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Pw="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((e=>"on"+e));for(let P$ of Pw)_w[P$]=null;class Cw{constructor(e,t){this.tags=Object.assign(Object.assign({},$w),e),this.globalAttrs=Object.assign(Object.assign({},_w),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}function Tw(e,t,i=e.length){if(!t)return"";let n=t.firstChild,r=n&&n.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,i)):""}function Aw(e,t=!1){for(;e;e=e.parent)if("Element"==e.name){if(!t)return e;t=!1}return null}function Ew(e,t,i){let n=i.tags[Tw(e,Aw(t))];return(null==n?void 0:n.children)||i.allTags}function Mw(e,t){let i=[];for(let n=Aw(t);n&&!n.type.isTop;n=Aw(n.parent)){let r=Tw(e,n);if(r&&"CloseTag"==n.lastChild.name)break;r&&i.indexOf(r)<0&&("EndTag"==t.name||t.from>=n.firstChild.to)&&i.push(r)}return i}Cw.default=new Cw;const Rw=/^[:\-\.\w\u00b7-\uffff]*$/;function Dw(e,t,i,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=Aw(i,!0);return{from:n,to:r,options:Ew(e.doc,o,t).map((e=>({label:e,type:"type"}))).concat(Mw(e.doc,i).map(((e,t)=>({label:"/"+e,apply:"/"+e+s,type:"type",boost:99-t})))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Zw(e,t,i,n){let r=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:Mw(e.doc,t).map(((e,t)=>({label:e,apply:e+r,type:"type",boost:99-t}))),validFor:Rw}}function Lw(e,t){let{state:i,pos:n}=t,r=Lf(i).resolveInner(n,-1),s=r.resolve(n);for(let o,a=n;s==r&&(o=r.childBefore(a));){let e=o.lastChild;if(!e||!e.type.isError||e.from({label:e,type:"property"}))),validFor:Rw}}(i,e,r,"AttributeName"==r.name?r.from:n,n):"Is"==r.name||"AttributeValue"==r.name||"UnquotedAttributeValue"==r.name?function(e,t,i,n,r){var s;let o,a=null===(s=i.parent)||void 0===s?void 0:s.getChild("AttributeName"),l=[];if(a){let s=e.sliceDoc(a.from,a.to),h=t.globalAttrs[s];if(!h){let n=Aw(i),r=n?t.tags[Tw(e.doc,n)]:null;h=(null==r?void 0:r.attrs)&&r.attrs[s]}if(h){let t=e.sliceDoc(n,r).toLowerCase(),i='"',s='"';/^['"]/.test(t)?(o='"'==t[0]?/^[^"]*$/:/^[^']*$/,i="",s=e.sliceDoc(r,r+1)==t[0]?"":t[0],t=t.slice(1),n++):o=/^[^\s<>='"]*$/;for(let e of h)l.push({label:e,apply:i+e+s,type:"constant"})}}return{from:n,to:r,options:l,validFor:o}}(i,e,r,"Is"==r.name?n:r.from,n):!t.explicit||"Element"!=s.name&&"Text"!=s.name&&"Document"!=s.name?null:function(e,t,i,n){let r=[],s=0;for(let o of Ew(e.doc,i,t))r.push({label:"<"+o,type:"type"});for(let o of Mw(e.doc,i))r.push({label:"",type:"type",boost:99-s++});return{from:n,to:n,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(i,e,r,n)}function Xw(e){return Lw(Cw.default,e)}function qw(e){let{extraTags:t,extraGlobalAttributes:i}=e,n=i||t?new Cw(t,i):Cw.default;return e=>Lw(n,e)}const Vw=sw.parser.configure({top:"SingleExpression"}),Iw=[{tag:"script",attrs:e=>"text/typescript"==e.type||"ts"==e.lang,parser:aw.parser},{tag:"script",attrs:e=>"text/babel"==e.type||"text/jsx"==e.type,parser:lw.parser},{tag:"script",attrs:e=>"text/typescript-jsx"==e.type,parser:hw.parser},{tag:"script",attrs:e=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type),parser:Vw},{tag:"script",attrs:e=>!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type),parser:sw.parser},{tag:"style",attrs:e=>(!e.lang||"css"==e.lang)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type)),parser:Tx.parser}],zw=[{name:"style",parser:Tx.parser.configure({top:"Styles"})}].concat(Pw.map((e=>({name:e,parser:sw.parser})))),jw=Zf.define({name:"html",parser:ex.configure({props:[tm.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag":e=>e.column(e.node.from)+e.unit,Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Bw=jw.configure({wrap:rx(Iw,zw)});function Fw(e={}){let t,i="";!1===e.matchClosingTags&&(i="noMatch"),!0===e.selfClosingTags&&(i=(i?i+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(t=rx((e.nestedLanguages||[]).concat(Iw),(e.nestedAttributes||[]).concat(zw)));let n=t?jw.configure({wrap:t,dialect:i}):i?Bw.configure({dialect:i}):Bw;return new Wf(n,[Bw.data.of({autocomplete:qw(e)}),!1!==e.autoCloseTags?Ww:[],pw().support,Ax().support])}const Yw=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Ww=Od.inputHandler.of(((e,t,i,n,r)=>{if(e.composing||e.state.readOnly||t!=i||">"!=n&&"/"!=n||!Bw.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,a=o.changeByRange((e=>{var t,i,r;let s,a=o.doc.sliceString(e.from-1,e.to)==n,{head:l}=e,h=Lf(o).resolveInner(l,-1);if(a&&">"==n&&"EndTag"==h.name){let n=h.parent;if("CloseTag"!=(null===(i=null===(t=n.parent)||void 0===t?void 0:t.lastChild)||void 0===i?void 0:i.name)&&(s=Tw(o.doc,n.parent,l))&&!Yw.has(s)){return{range:e,changes:{from:l,to:l+(">"===o.doc.sliceString(l,l+1)?1:0),insert:``}}}}else if(a&&"/"==n&&"IncompleteCloseTag"==h.name){let e=h.parent;if(h.from==l-2&&"CloseTag"!=(null===(r=e.lastChild)||void 0===r?void 0:r.name)&&(s=Tw(o.doc,e,l))&&!Yw.has(s)){let e=l+(">"===o.doc.sliceString(l,l+1)?1:0),t=`${s}>`;return{range:Ko.cursor(l+t.length,-1),changes:{from:l,to:e,insert:t}}}}return{range:e}}));return!a.changes.empty&&(e.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),Nw=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Ww,html:Fw,htmlCompletionSource:Xw,htmlCompletionSourceWith:qw,htmlLanguage:Bw,htmlPlain:jw},Symbol.toStringTag,{value:"Module"})),Gw=Ef({commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}}}),Uw=new dp,Hw=Zy.configure({props:[dm.add((e=>!e.is("Block")||e.is("Document")||null!=Kw(e)||function(e){return"OrderedList"==e.name||"BulletList"==e.name}(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to}))),Uw.add(Kw),tm.add({Document:()=>null}),Af.add({Document:Gw})]});function Kw(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Jw(e,t){let i=e;for(;;){let e,n=i.nextSibling;if(!n||null!=(e=Kw(n.type))&&e<=t)break;i=n}return i.to}const eS=um.of(((e,t,i)=>{for(let n=Lf(e).resolveInner(i,-1);n&&!(n.fromi)return{from:i,to:t}}return null}));function tS(e){return new Rf(Gw,e,[eS],"markdown")}const iS=tS(Hw),nS=tS(Hw.configure([ek,nk,ik,rk,{props:[dm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));class rS{constructor(e,t,i,n,r,s,o){this.node=e,this.from=t,this.to=i,this.spaceBefore=n,this.spaceAfter=r,this.type=s,this.item=o}blank(e,t=!0){let i=this.spaceBefore+("Blockquote"==this.node.name?">":"");if(null!=e){for(;i.length0;n--)i+=" ";return i+(t?this.spaceAfter:"")}marker(e,t){let i="OrderedList"==this.node.name?String(+oS(this.item,e)[2]+t):"";return this.spaceBefore+i+this.type+this.spaceAfter}}function sS(e,t){let i=[],n=[];for(let r=e;r;r=r.parent){if("FencedCode"==r.name)return n;"ListItem"!=r.name&&"Blockquote"!=r.name||i.push(r)}for(let r=i.length-1;r>=0;r--){let e,s=i[r],o=t.lineAt(s.from),a=s.from-o.from;if("Blockquote"==s.name&&(e=/^ *>( ?)/.exec(o.text.slice(a))))n.push(new rS(s,a,a+e[0].length,"",e[1],">",null));else if("ListItem"==s.name&&"OrderedList"==s.parent.name&&(e=/^( *)\d+([.)])( *)/.exec(o.text.slice(a)))){let t=e[3],i=e[0].length;t.length>=4&&(t=t.slice(0,t.length-4),i-=4),n.push(new rS(s.parent,a,a+i,e[1],t,e[2],s))}else if("ListItem"==s.name&&"BulletList"==s.parent.name&&(e=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(a)))){let t=e[4],i=e[0].length;t.length>4&&(t=t.slice(0,t.length-4),i-=4);let r=e[2];e[3]&&(r+=e[3].replace(/[xX]/," ")),n.push(new rS(s.parent,a,a+i,e[1],t,r,s))}}return n}function oS(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function aS(e,t,i,n=0){for(let r=-1,s=e;;){if("ListItem"==s.name){let e=oS(s,t),o=+e[2];if(r>=0){if(o!=r+1)return;i.push({from:s.from+e[1].length,to:s.from+e[0].length,insert:String(r+2+n)})}r=o}let e=s.nextSibling;if(!e)break;s=e}}function lS(e,t){let i=/^[ \t]*/.exec(e)[0].length;if(!i||"\t"!=t.facet(Uf))return e;let n="";for(let r=al(e,4,i);r>0;)r>=4?(n+="\t",r-=4):(n+=" ",r--);return n+e.slice(i)}const hS=({state:e,dispatch:t})=>{let i=Lf(e),{doc:n}=e,r=null,s=e.changeByRange((t=>{if(!t.empty||!nS.isActiveAt(e,t.from,0))return r={range:t};let s=t.from,o=n.lineAt(s),a=sS(i.resolveInner(s,-1),n);for(;a.length&&a[a.length-1].from>s-o.from;)a.pop();if(!a.length)return r={range:t};let l=a[a.length-1];if(l.to-l.spaceAfter.length>s-o.from)return r={range:t};let h=s>=l.to-l.spaceAfter.length&&!/\S/.test(o.text.slice(l.to));if(l.item&&h){let t=l.node.firstChild,i=l.node.getChild("ListItem","ListItem");if(t.to>=s||i&&i.to0&&!/[^\s>]/.test(n.lineAt(o.from-1).text)){let e,t=a.length>1?a[a.length-2]:null,i="";t&&t.item?(e=o.from+t.from,i=t.marker(n,1)):e=o.from+(t?t.to:0);let r=[{from:e,to:s,insert:i}];return"OrderedList"==l.node.name&&aS(l.item,n,r,-2),t&&"OrderedList"==t.node.name&&aS(t.item,n,r),{range:Ko.cursor(e+i.length),changes:r}}{let t=uS(a,e,o);return{range:Ko.cursor(s+t.length+1),changes:{from:o.from,insert:t+e.lineBreak}}}}if("Blockquote"==l.node.name&&h&&o.from){let i=n.lineAt(o.from-1),r=/>\s*$/.exec(i.text);if(r&&r.index==l.from){let n=e.changes([{from:i.from+r.index,to:i.to},{from:o.from+l.from,to:o.to}]);return{range:t.map(n),changes:n}}}let c=[];"OrderedList"==l.node.name&&aS(l.item,n,c);let u=l.item&&l.item.from]*/.exec(o.text)[0].length>=l.to)for(let e=0,i=a.length-1;e<=i;e++)d+=e!=i||u?a[e].blank(eo.from&&/\s/.test(o.text.charAt(p-o.from-1));)p--;return d=lS(d,e),function(e,t){if("OrderedList"!=e.name&&"BulletList"!=e.name)return!1;let i=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let r=t.lineAt(i.to),s=t.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let i=Lf(e),n=null,r=e.changeByRange((t=>{let r=t.from,{doc:s}=e;if(t.empty&&nS.isActiveAt(e,t.from)){let t=s.lineAt(r),n=sS(function(e,t){let i=e.resolveInner(t,-1),n=t;cS(i)&&(n=i.from,i=i.parent);for(let r;r=i.childBefore(n);)if(cS(r))n=r.from;else{if("OrderedList"!=r.name&&"BulletList"!=r.name)break;i=r.lastChild,n=i.to}return i}(i,r),s);if(n.length){let i=n[n.length-1],s=i.to-i.spaceAfter.length+(i.spaceAfter?1:0);if(r-t.from>s&&!/\S/.test(t.text.slice(s,r-t.from)))return{range:Ko.cursor(t.from+s),changes:{from:t.from+s,to:r}};if(r-t.from==s&&(!i.item||t.from<=i.item.from||!/\S/.test(t.text.slice(0,i.to)))){let n=t.from+i.from;if(i.item&&i.node.from{if(e&&u){let t=null;if(e=/\S*/.exec(e)[0],t="function"==typeof u?u(e):Nf.matchLanguageName(u,e,!0),t instanceof Nf)return t.support?t.support.language.parser:Vf.getSkippingParser(t.load());if(t)return t.parser}return d?d.parser:null}):void 0;var u,d;l.push(function(e){let{codeParser:t,htmlParser:i}=e;return{wrap:jp(((e,n)=>{let r=e.type.id;if(!t||r!=Cb.CodeBlock&&r!=Cb.FencedCode){if(i&&(r==Cb.HTMLBlock||r==Cb.HTMLTag||r==Cb.CommentBlock))return{parser:i,overlay:Ly(e.node,e.from,e.to)}}else{let i="";if(r==Cb.FencedCode){let t=e.node.getChild(Cb.CodeInfo);t&&(i=n.read(t.from,t.to))}let s=t(i);if(s)return{parser:s,overlay:e=>e.type.id==Cb.CodeText}}return null}))}}({codeParser:c,htmlParser:o.language.parser})),n&&h.push(fa.high(Sd.of(pS)));let p=tS(r.configure(l));return s&&h.push(p.data.of({autocomplete:OS})),new Wf(p,h)}function OS(e){let{state:t,pos:i}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(i-25,i));if(!n)return null;let r=Lf(t).resolveInner(i,-1);for(;r&&!r.type.isTop;){if("CodeBlock"==r.name||"FencedCode"==r.name||"ProcessingInstructionBlock"==r.name||"CommentBlock"==r.name||"Link"==r.name||"Image"==r.name)return null;r=r.parent}return{from:i-n[0].length,to:i,options:vS(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let gS=null;function vS(){if(gS)return gS;let e=Xw(new gv(ja.create({extensions:fS}),0,!0));return gS=e?e.options:[]}const bS=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:iS,deleteMarkupBackward:dS,insertNewlineContinueMarkup:hS,markdown:mS,markdownKeymap:pS,markdownLanguage:nS},Symbol.toStringTag,{value:"Module"})),yS=se({name:"NormalToolbar",props:{title:{type:String,default:""},trigger:{type:[String,Object],default:void 0},onClick:{type:Function,default:void 0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},emits:["onClick"],setup:(e,t)=>()=>{const i=ze({props:e,ctx:t},"trigger"),n=ze({props:e,ctx:t});return de("div",{class:[`${Me}-toolbar-item`,e.disabled&&`${Me}-disabled`],title:e.title,onClick:i=>{var n;e.disabled||(null==(n=e.onClick)||n.call(e,i),t.emit("onClick",i))}},[n||i])}});yS.install=e=>(e.component(yS.name,yS),e);const kS=se({name:"ModalToolbar",props:{title:{type:String,default:""},modalTitle:{type:[String,Object],default:""},visible:{type:Boolean,default:void 0},width:{type:String,default:"auto"},height:{type:String,default:"auto"},trigger:{type:[String,Object],default:void 0},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:void 0},class:{type:String,default:void 0},style:{type:[Object,String],default:void 0},showMask:{type:Boolean,default:!0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},emits:["onClick","onClose","onAdjust"],setup:(e,t)=>()=>{const i=ze({props:e,ctx:t},"trigger"),n=ze({props:e,ctx:t},"modalTitle"),r=ze({props:e,ctx:t});return de(ge,null,[de("div",{class:[`${Me}-toolbar-item`,e.disabled&&`${Me}-disabled`],title:e.title,onClick:()=>{var i;e.disabled||(null==(i=e.onClick)||i.call(e),t.emit("onClick"))}},[i]),de(lo,{style:e.style,class:e.class,width:e.width,height:e.height,title:n,visible:e.visible,showMask:e.showMask,onClose:()=>{var i;null==(i=e.onClose)||i.call(e),t.emit("onClose")},showAdjust:e.showAdjust,isFullscreen:e.isFullscreen,onAdjust:i=>{var n;null==(n=e.onAdjust)||n.call(e,i),t.emit("onAdjust",i)}},(s=r,"function"==typeof s||"[object Object]"===Object.prototype.toString.call(s)&&!Qe(s)?r:{default:()=>[r]}))]);var s}});kS.install=e=>(e.component(kS.name,kS),e);var xS=Object.defineProperty,wS=(e,t,i)=>((e,t,i)=>t in e?xS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i);const SS=se({name:`${Me}-divider`,setup:()=>()=>de("div",{class:`${Me}-divider`},null)}),QS={noPrettier:{type:Boolean},toolbars:{type:Array,default:()=>[]},toolbarsExclude:{type:Array,default:()=>[]},setting:{type:Object,default:()=>({})},screenfull:{type:Object,default:null},screenfullJs:{type:String,default:""},updateSetting:{type:Function,default:()=>{}},tableShape:{type:Array,default:()=>[6,4]},defToolbars:{type:Object},noUploadImg:{type:Boolean},showToolbarName:{type:Boolean},catalogVisible:{type:Boolean},codeTheme:{type:String}},$S=se({name:"TableShape",props:{tableShape:{type:Array,default:()=>[6,4]},onSelected:{type:Function,default:()=>{}}},setup(e){const t=oe({x:-1,y:-1}),i=Oe((()=>JSON.stringify(e.tableShape))),n=()=>{const e=[...JSON.parse(i.value)];return(!e[2]||e[2]{r.value=n()})),()=>de("div",{class:`${Me}-table-shape`,onMouseleave:()=>{r.value=n(),t.x=-1,t.y=-1}},[new Array(r.value[1]).fill("").map(((i,n)=>de("div",{class:`${Me}-table-shape-row`,key:`table-shape-row-${n}`},[new Array(r.value[0]).fill("").map(((i,s)=>de("div",{class:`${Me}-table-shape-col`,key:`table-shape-col-${s}`,onMouseenter:()=>{t.x=n,t.y=s,s+1===r.value[0]&&s+1e.tableShape[0]&&r.value[0]--,n+1===r.value[1]&&n+1e.tableShape[1]&&r.value[1]--},onClick:()=>{e.onSelected(t)}},[de("div",{class:[`${Me}-table-shape-col-default`,n<=t.x&&s<=t.y&&`${Me}-table-shape-col-include`]},null)])))])))])}}),_S={type:{type:String,default:"link"},visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},PS=se({name:`${Me}-modal-link`,props:_S,setup(e){const t=pe("usedLanguageText"),i=pe("editorId"),n=Oe((()=>{var i,n;switch(e.type){case"link":return null==(i=t.value.linkModalTips)?void 0:i.linkTitle;case"image":return null==(n=t.value.linkModalTips)?void 0:n.imageTitle;default:return""}})),r=oe({desc:"",url:""});return le((()=>e.visible),(e=>{e||setTimeout((()=>{r.desc="",r.url=""}),200)})),()=>de(lo,{title:n.value,visible:e.visible,onClose:e.onCancel},{default:()=>{var n,s,o,a,l;return[de("div",{class:`${Me}-form-item`},[de("label",{class:`${Me}-label`,for:`link-desc-${i}`},[null==(n=t.value.linkModalTips)?void 0:n.descLabel]),de("input",{placeholder:null==(s=t.value.linkModalTips)?void 0:s.descLabelPlaceHolder,class:`${Me}-input`,id:`link-desc-${i}`,type:"text",value:r.desc,onChange:e=>{r.desc=e.target.value},autocomplete:"off"},null)]),de("div",{class:`${Me}-form-item`},[de("label",{class:`${Me}-label`,for:`link-url-${i}`},[null==(o=t.value.linkModalTips)?void 0:o.urlLabel]),de("input",{placeholder:null==(a=t.value.linkModalTips)?void 0:a.urlLabelPlaceHolder,class:`${Me}-input`,id:`link-url-${i}`,type:"text",value:r.url,onChange:e=>{r.url=e.target.value},autocomplete:"off"},null)]),de("div",{class:`${Me}-form-item`},[de("button",{class:[`${Me}-btn`,`${Me}-btn-row`],type:"button",onClick:()=>{e.onOk(r),r.desc="",r.url=""}},[null==(l=t.value.linkModalTips)?void 0:l.buttonOK])])]}})}}),CS={visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},TS=se({name:`${Me}-modal-clip`,props:CS,setup(e){const t=pe("usedLanguageText"),i=pe("editorId"),n=pe("rootRef");let r=Ve.editorExtensions.cropper.instance;const s=ae(),o=ae(),a=ae(),l=oe({cropperInited:!1,imgSelected:!1,imgSrc:"",isFullscreen:!1});let h=null;le((()=>e.visible),(()=>{e.visible&&!l.cropperInited&&(r=r||window.Cropper,s.value.onchange=()=>{if(!r)return void Ne.emit(i,st,{name:"Cropper",message:"Cropper is undefined"});const e=s.value.files||[];if(l.imgSelected=!0,(null==e?void 0:e.length)>0){const t=new FileReader;t.onload=e=>{l.imgSrc=e.target.result},t.readAsDataURL(e[0])}})})),le((()=>[l.imgSelected]),(()=>{a.value.style=""})),le([be((()=>l.isFullscreen)),be((()=>l.imgSrc))],(()=>{l.imgSrc&&ke((()=>{null==h||h.destroy(),a.value.style="",o.value&&(h=new r(o.value,{viewMode:2,preview:n.value.getRootNode().querySelector(`.${Me}-clip-preview-target`)}))}))}));const c=()=>{h.clear(),h.destroy(),h=null,s.value.value="",l.imgSelected=!1};return()=>{var n;return de(lo,{class:`${Me}-modal-clip`,title:null==(n=t.value.clipModalTips)?void 0:n.title,visible:e.visible,onClose:e.onCancel,showAdjust:!0,isFullscreen:l.isFullscreen,onAdjust:e=>{l.isFullscreen=e},width:"668px",height:"421px"},{default:()=>{var n,r,u;return[de("div",{class:`${Me}-form-item ${Me}-clip`},[de("div",{class:`${Me}-clip-main`},[l.imgSelected?de("div",{class:`${Me}-clip-cropper`},[de("img",{src:l.imgSrc,ref:o,style:{display:"none"},alt:""},null),de("div",{class:`${Me}-clip-delete`,onClick:c},[de(ao,{name:"delete"},null)])]):de("div",{class:`${Me}-clip-upload`,onClick:()=>{s.value.click()},role:"button",tabindex:"0","aria-label":null==(n=t.value.imgTitleItem)?void 0:n.upload},[de(ao,{name:"upload"},null)])]),de("div",{class:`${Me}-clip-preview`},[de("div",{class:`${Me}-clip-preview-target`,ref:a},null)])]),de("div",{class:`${Me}-form-item`},[de("button",{class:`${Me}-btn`,type:"button",onClick:()=>{if(h){const t=h.getCroppedCanvas();Ne.emit(i,at,[qr(t.toDataURL("image/png"))],e.onOk),c()}}},[(null==(r=t.value.clipModalTips)?void 0:r.buttonUpload)||(null==(u=t.value.linkModalTips)?void 0:u.buttonOK)])]),de("input",{ref:s,accept:"image/*",type:"file",multiple:!1,style:{display:"none"},"aria-hidden":"true"},null)]}})}}}),AS={type:{type:String,default:"link"},linkVisible:{type:Boolean,default:!1},clipVisible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},ES=se({name:`${Me}-modals`,props:AS,setup:e=>()=>de(ge,null,[de(PS,{type:e.type,visible:e.linkVisible,onOk:e.onOk,onCancel:e.onCancel},null),de(TS,{visible:e.clipVisible,onOk:e.onOk,onCancel:e.onCancel},null)])}),MS=se({name:"MDEditorToolbar",props:QS,setup(e){const t=pe("editorId"),i=pe("usedLanguageText"),n=pe("theme"),r=pe("previewTheme"),s=pe("language"),o=pe("disabled"),{fullscreenHandler:a}=(e=>{const t=pe("editorId"),{editorExtensions:i,editorExtensionsAttrs:n}=Ve;let r=i.screenfull.instance;const s=ae(!1),o=e=>{r?r.isEnabled&&(s.value=!0,(void 0===e?!r.isFullscreen:e)?r.request():r.exit()):Ne.emit(t,st,{name:"fullscreen",message:"fullscreen is undefined"})},a=()=>{r&&r.isEnabled&&r.on("change",(()=>{(s.value||e.setting.fullscreen)&&(s.value=!1,e.updateSetting("fullscreen"))}))},l=()=>{r=window.screenfull,a()};return he((()=>{var e;a(),r||kt("script",{...null==(e=n.screenfull)?void 0:e.js,src:i.screenfull.js,id:Kr.screenfull,onload:l},"screenfull")})),he((()=>{Ne.on(t,{name:He,callback:o})})),{fullscreenHandler:o}})(e),l=`${t}-toolbar-wrapper`,h=ae(),c=oe({title:!1,catalog:!1,image:!1,table:!1,mermaid:!1,katex:!1}),u=(e,i)=>{if(null==o?void 0:o.value)return!1;Ne.emit(t,ot,e,i)},d=oe({type:"link",linkVisible:!1,clipVisible:!1}),p=ae();he((()=>{Ne.on(t,{name:lt,callback(e){d.type=e,d.linkVisible=!0}})}));const f=Oe((()=>{const t=e.toolbars.filter((t=>!e.toolbarsExclude.includes(t))),i=t.indexOf("=");return[-1===i?t:t.slice(0,i+1),-1===i?[]:t.slice(i,Number.MAX_SAFE_INTEGER)]})),m=ae(),O=()=>{Ne.emit(t,at,Array.from(m.value.files||[])),m.value.value=""};he((()=>{m.value.addEventListener("change",O)}));const g=h=>{var p,f,O,g,v,b,y,k,x,w,S,Q,$,_,P,C,T,A,E,M,R,D,Z,L,X,q,V,I,z,j,B,F,Y,W,N,G,U,H,K,J,ee,te,ie,ne,re,se,oe,ae,le,he,ce,pe,fe,me,Oe,ge,ve,be,ye,ke,xe,we,Se,Qe,$e,_e,Pe,Ce,Te,Ae,Ee,Re,De,Ze,Xe,qe,Ve,Ie,ze,je,Fe;if(!Le.includes(h)){if(e.defToolbars instanceof Array){const i=e.defToolbars[h];if(i){return ue(i,{theme:(null==(Ae=i.props)?void 0:Ae.theme)||n.value,previewTheme:(null==(Ee=i.props)?void 0:Ee.theme)||r.value,language:(null==(Re=i.props)?void 0:Re.theme)||s.value,codeTheme:(null==(De=i.props)?void 0:De.codeTheme)||e.codeTheme,disabled:(null==(Ze=i.props)?void 0:Ze.disabled)||(null==o?void 0:o.value),showToolbarName:(null==(Xe=i.props)?void 0:Xe.showToolbarName)||e.showToolbarName,insert(e){Ne.emit(t,ot,"universal",{generate:e})}})}return""}if(e.defToolbars&&e.defToolbars.children instanceof Array){const i=e.defToolbars.children[h];if(i){return ue(i,{theme:(null==(qe=i.props)?void 0:qe.theme)||n.value,previewTheme:(null==(Ve=i.props)?void 0:Ve.theme)||r.value,language:(null==(Ie=i.props)?void 0:Ie.theme)||s.value,codeTheme:(null==(ze=i.props)?void 0:ze.codeTheme)||e.codeTheme,disabled:(null==(je=i.props)?void 0:je.disabled)||(null==o?void 0:o.value),showToolbarName:(null==(Fe=i.props)?void 0:Fe.showToolbarName)||e.showToolbarName,insert(e){Ne.emit(t,ot,"universal",{generate:e})}})}return""}return""}switch(h){case"-":return de(SS,null,null);case"bold":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(p=i.value.toolbarTips)?void 0:p.bold,onClick:()=>{u("bold")}},[de(ao,{name:"bold"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(f=i.value.toolbarTips)?void 0:f.bold])]);case"underline":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(O=i.value.toolbarTips)?void 0:O.underline,onClick:()=>{u("underline")}},[de(ao,{name:"underline"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(g=i.value.toolbarTips)?void 0:g.underline])]);case"italic":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(v=i.value.toolbarTips)?void 0:v.italic,onClick:()=>{u("italic")}},[de(ao,{name:"italic"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(b=i.value.toolbarTips)?void 0:b.italic])]);case"strikeThrough":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(y=i.value.toolbarTips)?void 0:y.strikeThrough,onClick:()=>{u("strikeThrough")}},[de(ao,{name:"strike-through"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(k=i.value.toolbarTips)?void 0:k.strikeThrough])]);case"title":return de(Be,{relative:`#${l}`,visible:c.title,onChange:e=>{c.title=e},disabled:null==o?void 0:o.value,overlay:de("ul",{class:`${Me}-menu`,onClick:()=>{c.title=!1},role:"menu"},[de("li",{class:`${Me}-menu-item ${Me}-menu-item-title`,onClick:()=>{u("h1")},role:"menuitem",tabindex:"0"},[null==(x=i.value.titleItem)?void 0:x.h1]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-title`,onClick:()=>{u("h2")},role:"menuitem",tabindex:"0"},[null==(w=i.value.titleItem)?void 0:w.h2]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-title`,onClick:()=>{u("h3")},role:"menuitem",tabindex:"0"},[null==(S=i.value.titleItem)?void 0:S.h3]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-title`,onClick:()=>{u("h4")},role:"menuitem",tabindex:"0"},[null==(Q=i.value.titleItem)?void 0:Q.h4]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-title`,onClick:()=>{u("h5")},role:"menuitem",tabindex:"0"},[null==($=i.value.titleItem)?void 0:$.h5]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-title`,onClick:()=>{u("h6")},role:"menuitem",tabindex:"0"},[null==(_=i.value.titleItem)?void 0:_.h6])])},{default:()=>{var t,n;return[de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(t=i.value.toolbarTips)?void 0:t.title},[de(ao,{name:"title"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(n=i.value.toolbarTips)?void 0:n.title])])]}});case"sub":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(P=i.value.toolbarTips)?void 0:P.sub,onClick:()=>{u("sub")}},[de(ao,{name:"sub"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(C=i.value.toolbarTips)?void 0:C.sub])]);case"sup":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(T=i.value.toolbarTips)?void 0:T.sup,onClick:()=>{u("sup")}},[de(ao,{name:"sup"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(A=i.value.toolbarTips)?void 0:A.sup])]);case"quote":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(E=i.value.toolbarTips)?void 0:E.quote,onClick:()=>{u("quote")}},[de(ao,{name:"quote"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(M=i.value.toolbarTips)?void 0:M.quote])]);case"unorderedList":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(R=i.value.toolbarTips)?void 0:R.unorderedList,onClick:()=>{u("unorderedList")}},[de(ao,{name:"unordered-list"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(D=i.value.toolbarTips)?void 0:D.unorderedList])]);case"orderedList":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(Z=i.value.toolbarTips)?void 0:Z.orderedList,onClick:()=>{u("orderedList")}},[de(ao,{name:"ordered-list"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(L=i.value.toolbarTips)?void 0:L.orderedList])]);case"task":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(X=i.value.toolbarTips)?void 0:X.task,onClick:()=>{u("task")}},[de(ao,{name:"task"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(q=i.value.toolbarTips)?void 0:q.task])]);case"codeRow":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(V=i.value.toolbarTips)?void 0:V.codeRow,onClick:()=>{u("codeRow")}},[de(ao,{name:"code-row"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(I=i.value.toolbarTips)?void 0:I.codeRow])]);case"code":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(z=i.value.toolbarTips)?void 0:z.code,onClick:()=>{u("code")}},[de(ao,{name:"code"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(j=i.value.toolbarTips)?void 0:j.code])]);case"link":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(B=i.value.toolbarTips)?void 0:B.link,onClick:()=>{if(null==o?void 0:o.value)return!1;d.type="link",d.linkVisible=!0}},[de(ao,{name:"link"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(F=i.value.toolbarTips)?void 0:F.link])]);case"image":return e.noUploadImg?de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(Y=i.value.toolbarTips)?void 0:Y.image,onClick:()=>{if(null==o?void 0:o.value)return!1;d.type="image",d.linkVisible=!0}},[de(ao,{name:"image"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(W=i.value.toolbarTips)?void 0:W.image])]):de(Be,{relative:`#${l}`,visible:c.image,onChange:e=>{c.image=e},disabled:null==o?void 0:o.value,overlay:de("ul",{class:`${Me}-menu`,onClick:()=>{c.title=!1},role:"menu"},[de("li",{class:`${Me}-menu-item ${Me}-menu-item-image`,onClick:()=>{d.type="image",d.linkVisible=!0},role:"menuitem",tabindex:"0"},[null==(N=i.value.imgTitleItem)?void 0:N.link]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-image`,onClick:()=>{m.value.click()},role:"menuitem",tabindex:"0"},[null==(G=i.value.imgTitleItem)?void 0:G.upload]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-image`,onClick:()=>{d.clipVisible=!0},role:"menuitem",tabindex:"0"},[null==(U=i.value.imgTitleItem)?void 0:U.clip2upload])])},{default:()=>{var t,n;return[de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(t=i.value.toolbarTips)?void 0:t.image},[de(ao,{name:"image"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(n=i.value.toolbarTips)?void 0:n.image])])]}});case"table":return de(Be,{relative:`#${l}`,visible:c.table,onChange:e=>{c.table=e},disabled:null==o?void 0:o.value,key:"bar-table",overlay:de($S,{tableShape:e.tableShape,onSelected:e=>{u("table",{selectedShape:e})}},null)},{default:()=>{var t,n;return[de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(t=i.value.toolbarTips)?void 0:t.table},[de(ao,{name:"table"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(n=i.value.toolbarTips)?void 0:n.table])])]}});case"revoke":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(H=i.value.toolbarTips)?void 0:H.revoke,onClick:()=>{if(null==o?void 0:o.value)return!1;Ne.emit(t,ht)}},[de(ao,{name:"revoke"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(K=i.value.toolbarTips)?void 0:K.revoke])]);case"next":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(J=i.value.toolbarTips)?void 0:J.next,onClick:()=>{if(null==o?void 0:o.value)return!1;Ne.emit(t,ct)}},[de(ao,{name:"next"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(ee=i.value.toolbarTips)?void 0:ee.next])]);case"save":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(te=i.value.toolbarTips)?void 0:te.save,onClick:()=>{if(null==o?void 0:o.value)return!1;Ne.emit(t,Ge)}},[de(ao,{name:"save"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(ie=i.value.toolbarTips)?void 0:ie.save])]);case"prettier":return e.noPrettier?"":de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(ne=i.value.toolbarTips)?void 0:ne.prettier,onClick:()=>{u("prettier")}},[de(ao,{name:"prettier"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(re=i.value.toolbarTips)?void 0:re.prettier])]);case"pageFullscreen":return!e.setting.fullscreen&&de("div",{class:[`${Me}-toolbar-item`,e.setting.pageFullscreen&&`${Me}-toolbar-active`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(se=i.value.toolbarTips)?void 0:se.pageFullscreen,onClick:()=>{if(null==o?void 0:o.value)return!1;e.updateSetting("pageFullscreen")}},[de(ao,{name:e.setting.pageFullscreen?"minimize":"maximize"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(oe=i.value.toolbarTips)?void 0:oe.pageFullscreen])]);case"fullscreen":return de("div",{class:[`${Me}-toolbar-item`,e.setting.fullscreen&&`${Me}-toolbar-active`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(ae=i.value.toolbarTips)?void 0:ae.fullscreen,onClick:()=>{if(null==o?void 0:o.value)return!1;a()}},[de(ao,{name:e.setting.fullscreen?"fullscreen-exit":"fullscreen"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(le=i.value.toolbarTips)?void 0:le.fullscreen])]);case"preview":return de("div",{class:[`${Me}-toolbar-item`,e.setting.preview&&`${Me}-toolbar-active`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(he=i.value.toolbarTips)?void 0:he.preview,onClick:()=>{if(null==o?void 0:o.value)return!1;e.updateSetting("preview")}},[de(ao,{name:"preview"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(ce=i.value.toolbarTips)?void 0:ce.preview])]);case"previewOnly":return de("div",{class:[`${Me}-toolbar-item`,e.setting.previewOnly&&`${Me}-toolbar-active`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(pe=i.value.toolbarTips)?void 0:pe.previewOnly,onClick:()=>{if(null==o?void 0:o.value)return!1;e.updateSetting("previewOnly")}},[de(ao,{name:"preview-only"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(fe=i.value.toolbarTips)?void 0:fe.previewOnly])]);case"htmlPreview":return de("div",{class:[`${Me}-toolbar-item`,e.setting.htmlPreview&&`${Me}-toolbar-active`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(me=i.value.toolbarTips)?void 0:me.htmlPreview,onClick:()=>{if(null==o?void 0:o.value)return!1;e.updateSetting("htmlPreview")}},[de(ao,{name:"preview-html"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(Oe=i.value.toolbarTips)?void 0:Oe.htmlPreview])]);case"catalog":return de("div",{class:[`${Me}-toolbar-item`,e.catalogVisible&&`${Me}-toolbar-active`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(ge=i.value.toolbarTips)?void 0:ge.catalog,onClick:()=>{if(null==o?void 0:o.value)return!1;Ne.emit(t,Ue)},key:"bar-catalog"},[de(ao,{name:"catalog"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(ve=i.value.toolbarTips)?void 0:ve.catalog])]);case"github":return de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(be=i.value.toolbarTips)?void 0:be.github,onClick:()=>{if(null==o?void 0:o.value)return!1;((e,t={_blank:!0,nofollow:!0})=>{const i=document.createElement("a");i.href=e,t._blank&&(i.target="_blank"),t.nofollow&&(i.rel="noopener noreferrer"),i.click()})("https://github.com/imzbf/md-editor-v3")}},[de(ao,{name:"github"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(ye=i.value.toolbarTips)?void 0:ye.github])]);case"mermaid":return de(Be,{relative:`#${l}`,visible:c.mermaid,onChange:e=>{c.mermaid=e},disabled:null==o?void 0:o.value,overlay:de("ul",{class:`${Me}-menu`,onClick:()=>{c.mermaid=!1},role:"menu"},[de("li",{class:`${Me}-menu-item ${Me}-menu-item-mermaid`,onClick:()=>{u("flow")},role:"menuitem",tabindex:"0"},[null==(ke=i.value.mermaid)?void 0:ke.flow]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-mermaid`,onClick:()=>{u("sequence")},role:"menuitem",tabindex:"0"},[null==(xe=i.value.mermaid)?void 0:xe.sequence]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-mermaid`,onClick:()=>{u("gantt")},role:"menuitem",tabindex:"0"},[null==(we=i.value.mermaid)?void 0:we.gantt]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-mermaid`,onClick:()=>{u("class")},role:"menuitem",tabindex:"0"},[null==(Se=i.value.mermaid)?void 0:Se.class]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-mermaid`,onClick:()=>{u("state")},role:"menuitem",tabindex:"0"},[null==(Qe=i.value.mermaid)?void 0:Qe.state]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-mermaid`,onClick:()=>{u("pie")},role:"menuitem",tabindex:"0"},[null==($e=i.value.mermaid)?void 0:$e.pie]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-mermaid`,onClick:()=>{u("relationship")},role:"menuitem",tabindex:"0"},[null==(_e=i.value.mermaid)?void 0:_e.relationship]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-mermaid`,onClick:()=>{u("journey")},role:"menuitem",tabindex:"0"},[null==(Pe=i.value.mermaid)?void 0:Pe.journey])]),key:"bar-mermaid"},{default:()=>{var t,n;return[de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(t=i.value.toolbarTips)?void 0:t.mermaid},[de(ao,{name:"mermaid"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(n=i.value.toolbarTips)?void 0:n.mermaid])])]}});case"katex":return de(Be,{relative:`#${l}`,visible:c.katex,onChange:e=>{c.katex=e},disabled:null==o?void 0:o.value,overlay:de("ul",{class:`${Me}-menu`,onClick:()=>{c.katex=!1},role:"menu"},[de("li",{class:`${Me}-menu-item ${Me}-menu-item-katex`,onClick:()=>{u("katexInline")},role:"menuitem",tabindex:"0"},[null==(Ce=i.value.katex)?void 0:Ce.inline]),de("li",{class:`${Me}-menu-item ${Me}-menu-item-katex`,onClick:()=>{u("katexBlock")},role:"menuitem",tabindex:"0"},[null==(Te=i.value.katex)?void 0:Te.block])]),key:"bar-katex"},{default:()=>{var t,n;return[de("div",{class:[`${Me}-toolbar-item`,(null==o?void 0:o.value)&&`${Me}-disabled`],title:null==(t=i.value.toolbarTips)?void 0:t.katex},[de(ao,{name:"formula"},null),e.showToolbarName&&de("div",{class:`${Me}-toolbar-item-name`},[null==(n=i.value.toolbarTips)?void 0:n.katex])])]}})}};return le((()=>e.toolbars),(()=>{ke((()=>{h.value&&(e=>{const t=t=>{const{scrollHeight:i,scrollWidth:n,offsetHeight:r,offsetWidth:s,scrollLeft:o,scrollTop:a}=e,l=t.x,h=t.y,c=t=>{const c=a+h-t.y,u=o+l-t.x,d=i-r,p={};u>=0&&u<=n-s&&(p.left=u),c>=0&&c<=d&&(p.top=c),e.scroll(p)};document.addEventListener("mousemove",c);const u=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mouseup",u)};e.addEventListener("mousedown",t)})(h.value)}))}),{immediate:!0}),()=>{var t;const n=f.value[0].map((e=>g(e))),r=f.value[1].map((e=>g(e)));return de(ge,null,[e.toolbars.length>0&&de("div",{class:`${Me}-toolbar-wrapper`,ref:h,id:l},[de("div",{class:[`${Me}-toolbar`,e.showToolbarName&&`${Me}-stn`]},[de("div",{class:`${Me}-toolbar-left`,ref:p},[n]),de("div",{class:`${Me}-toolbar-right`},[r])])]),de("label",{for:`${l}_label`,style:{display:"none"},"aria-label":null==(t=i.value.imgTitleItem)?void 0:t.upload},null),de("input",{id:`${l}_label`,ref:m,accept:"image/*",type:"file",multiple:!0,style:{display:"none"}},null),de(ES,{linkVisible:d.linkVisible,clipVisible:d.clipVisible,type:d.type,onCancel:()=>{d.linkVisible=!1,d.clipVisible=!1},onOk:e=>{e&&u(d.type,{desc:e.desc,url:e.url,transform:"image"===d.type}),d.linkVisible=!1,d.clipVisible=!1}},null)])}}}),RS=async(e,t,i)=>{if(/^h[1-6]$/.test(e))return DS(e,t);if("prettier"===e)return await ZS(t,i);switch(e){case"bold":case"underline":case"italic":case"strikeThrough":case"sub":case"sup":case"codeRow":case"katexInline":case"katexBlock":return XS(e,t);case"quote":case"orderedList":case"unorderedList":case"task":return VS(e,t);case"code":return IS(i,t);case"table":return BS(i);case"link":return{text:`[${i.desc}](${i.url})`,options:{select:!1}};case"image":return jS(i);case"flow":case"sequence":case"gantt":case"class":case"state":case"pie":case"relationship":case"journey":return zS(e);case"universal":return FS(t.getSelectedText(),i);default:return{text:"",options:{}}}},DS=(e,t)=>{const i=e.slice(1),n="#".repeat(Number(i)),[r,s,o]=YS(t,{wholeLine:!0});return{text:`${n} ${r}`,options:{deviationStart:n.length+1,replaceStart:s,replaceEnd:o}}},ZS=async(e,t)=>{var i,n,r;const s=window.prettier||(null==(i=Ve.editorExtensions.prettier)?void 0:i.prettierInstance),o=[(null==(n=window.prettierPlugins)?void 0:n.markdown)||(null==(r=Ve.editorExtensions.prettier)?void 0:r.parserMarkdownInstance)];return s&&o[0]?{text:await s.format(e.getValue(),{parser:"markdown",plugins:o}),options:{select:!1,replaceAll:!0}}:(Ne.emit(t.editorId,st,{name:"prettier",message:"prettier is undefined"}),{text:e.getValue(),options:{select:!1,replaceAll:!0}})},LS={bold:["**","**",2,-2],underline:["","",3,-4],italic:["*","*",1,-1],strikeThrough:["~~","~~",2,-2],sub:["~","~",1,-1],sup:["^","^",1,-1],codeRow:["`","`",1,-1],katexInline:["$","$",1,-1],katexBlock:["\n$$\n","\n$$\n",4,-4]},XS=(e,t)=>{const i=t.getSelectedText(),[n,r,s,o]=LS[e];return{text:`${n}${i}${r}`,options:{deviationStart:s,deviationEnd:o}}},qS={quote:"> ",unorderedList:"- ",orderedList:1,task:"- [ ] "},VS=(e,t)=>{const[i,n,r]=YS(t,{wholeLine:!0}),s=i.split("\n"),o=qS[e],a="orderedList"===e?s.map(((e,t)=>`${o+t}. ${e}`)):s.map((e=>`${o}${e}`)),l="orderedList"===e?"1. ":o.toString(),h=1===s.length?l.length:0;return{text:a.join("\n"),options:{deviationStart:h,replaceStart:n,replaceEnd:r}}},IS=(e,t)=>{const[i,n,r]=YS(t),s=e.mode||"language",o=`\n\`\`\`${s}\n${e.text||i||""}\n\`\`\`\n`;return{text:o,options:{deviationStart:4,deviationEnd:4+s.length-o.length,replaceStart:n,replaceEnd:r}}},zS=e=>({text:`\n\`\`\`mermaid\n${{flow:"flowchart TD \n Start --\x3e Stop",sequence:"sequenceDiagram\n A->>B: hello!\n B--\x3e>A: hi!",gantt:"gantt\ntitle Gantt Chart\ndateFormat YYYY-MM-DD",class:"classDiagram\n class Animal",state:"stateDiagram-v2\n s1 --\x3e s2",pie:'pie\n "Dogs" : 386\n "Cats" : 85\n "Rats" : 15',relationship:"erDiagram\n CAR ||--o{ NAMED-DRIVER : allows",journey:"journey\n title My Journey",...Ve.editorConfig.mermaidTemplate}[e]}\n\`\`\`\n`,options:{deviationStart:12,deviationEnd:-5}}),jS=e=>{const{desc:t,url:i,urls:n}=e;let r="";return r=n instanceof Array?n.reduce(((e,t)=>{const{url:i="",alt:n="",title:r=""}="object"==typeof t?t:{url:t};return e+`![${n}](${i}${r?" '"+r+"'":""})\n`}),""):`![${t}](${i})\n`,{text:r,options:{select:!1}}},BS=e=>{const{selectedShape:t={x:1,y:1}}=e,{x:i,y:n}=t;let r="\n| Column";for(let s=0;s<=n;s++)r+=" |";r+="\n|";for(let s=0;s<=n;s++)r+=" - |";for(let s=0;s<=i;s++){r+="\n|";for(let e=0;e<=n;e++)r+=" |"}return r+="\n",{text:r,options:{deviationStart:3,deviationEnd:10-r.length}}},FS=(e,t)=>{const{generate:i}=t,n=i(e);return{text:n.targetValue,options:{select:n.select??!0,deviationStart:n.deviationStart||0,deviationEnd:n.deviationEnd||0}}},YS=(e,t={wholeLine:!1})=>{const i=e.view.state,n=i.selection.main;if(n.empty){const e=i.doc.lineAt(n.from);return[i.doc.lineAt(n.from).text,e.from,e.to]}if(t.wholeLine){const e=i.doc.lineAt(n.from),t=i.doc.lineAt(n.to);return[i.doc.sliceString(e.from,t.to),e.from,t.to]}return[i.doc.sliceString(n.from,n.to),n.from,n.to]},WS="var(--md-color)",NS="var(--md-color)",GS="#e5c07b",US="#d19a66",HS="var(--md-bk-color)",KS="var(--md-bk-color)",JS="#528bff",eQ=[Od.theme({"&":{color:NS,backgroundColor:HS},".cm-content":{caretColor:JS},".cm-cursor, .cm-dropCursor":{borderLeftColor:JS},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#ceedfa33"},".cm-panels":{backgroundColor:"#21252b",color:NS},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:HS,color:NS,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:"#2c313a"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:KS},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:KS,borderBottomColor:KS},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:NS}}},{dark:!0}),vm(fm.define([{tag:Cf.keyword,color:"#c678dd"},{tag:[Cf.name,Cf.deleted,Cf.character,Cf.propertyName,Cf.macroName],color:WS},{tag:[Cf.function(Cf.variableName),Cf.labelName],color:"#e5c07b"},{tag:[Cf.color,Cf.constant(Cf.name),Cf.standard(Cf.name)],color:US},{tag:[Cf.definition(Cf.name),Cf.separator],color:NS},{tag:[Cf.typeName,Cf.className,Cf.number,Cf.changed,Cf.annotation,Cf.modifier,Cf.self,Cf.namespace],color:"#e5c07b"},{tag:[Cf.operator,Cf.operatorKeyword,Cf.url,Cf.escape,Cf.regexp,Cf.link,Cf.special(Cf.string)],color:"#56b6c2"},{tag:[Cf.meta,Cf.comment],color:GS},{tag:Cf.strong,fontWeight:"bold"},{tag:Cf.emphasis,fontStyle:"italic"},{tag:Cf.strikethrough,textDecoration:"line-through"},{tag:Cf.link,color:GS,textDecoration:"underline"},{tag:Cf.heading,fontWeight:"bold",color:WS},{tag:[Cf.atom,Cf.bool,Cf.special(Cf.variableName)],color:US},{tag:[Cf.processingInstruction,Cf.string,Cf.inserted],color:"var(--md-color)"},{tag:Cf.invalid,color:"#ffffff"}]))],tQ="var(--md-color)",iQ="#3f4a54",nQ="#2d8cf0",rQ="#d19a66",sQ="var(--md-bk-color)",oQ="var(--md-bk-color)",aQ="#3f4a54",lQ=[Od.theme({"&":{color:iQ,backgroundColor:sQ},".cm-content":{caretColor:aQ},".cm-cursor, .cm-dropCursor":{borderLeftColor:aQ},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#bad5fa"},".cm-panels":{backgroundColor:"#f6f6f6",color:iQ},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:sQ,color:iQ,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:"#ceedfa33"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:oQ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:oQ,borderBottomColor:oQ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:iQ}}}),vm(fm.define([{tag:Cf.keyword,color:"#c678dd"},{tag:[Cf.name,Cf.deleted,Cf.character,Cf.propertyName,Cf.macroName],color:tQ},{tag:[Cf.function(Cf.variableName),Cf.labelName],color:"#2d8cf0"},{tag:[Cf.color,Cf.constant(Cf.name),Cf.standard(Cf.name)],color:rQ},{tag:[Cf.definition(Cf.name),Cf.separator],color:iQ},{tag:[Cf.typeName,Cf.className,Cf.number,Cf.changed,Cf.annotation,Cf.modifier,Cf.self,Cf.namespace],color:"#e5c07b"},{tag:[Cf.operator,Cf.operatorKeyword,Cf.url,Cf.escape,Cf.regexp,Cf.link,Cf.special(Cf.string)],color:"#56b6c2"},{tag:[Cf.meta,Cf.comment],color:nQ},{tag:Cf.strong,fontWeight:"bold"},{tag:Cf.emphasis,fontStyle:"italic"},{tag:Cf.strikethrough,textDecoration:"line-through"},{tag:Cf.link,color:nQ,textDecoration:"underline"},{tag:Cf.heading,fontWeight:"bold",color:tQ},{tag:[Cf.atom,Cf.bool,Cf.special(Cf.variableName)],color:rQ},{tag:[Cf.processingInstruction,Cf.string,Cf.inserted],color:"#3f4a54"},{tag:Cf.invalid,color:"#fff"}]))],hQ=(e,t,i,n,r)=>(s,o,a,l)=>{const h=`${e}${t}`.slice(l-a);s.dispatch(s.state.replaceSelection(`${h}${i}${n}`));const c=a+o.label.length+("title"===r?i.length:0);s.dispatch({selection:Ko.create([Ko.range(a+o.label.length+("title"===r?1:-t.length),c),Ko.cursor(c)],1)}),s.focus()},cQ=e=>(t,i,n,r)=>{const s=e.slice(r-n);t.dispatch(t.state.replaceSelection(`${s} `))},uQ=e=>{const t=e=>{const t=e.matchBefore(/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|\$\$?|!+\s*\w*/);return null===t||t.from==t.to&&e.explicit?null:{from:t.from,options:[...["h2","h3","h4","h5","h6"].map(((e,t)=>{const i=new Array(t+2).fill("#").join("");return{label:i,type:"text",apply:cQ(i)}})),...["unchecked","checked"].map((e=>{const t="checked"===e?"- [x]":"- [ ]";return{label:t,type:"text",apply:cQ(t)}})),...[["`",""],["```","language"],["```mermaid\n",""]].map((e=>({label:`${e[0]}${e[1]}`,type:"text",apply:hQ(e[0],e[1],"","`"===e[0]?"`":"\n```","type")}))),{label:"[]()",type:"text"},{label:"![]()",type:"text"},{label:"| |",type:"text",detail:"table",apply:"| col | col | col |\n| - | - | - |\n| content | content | content |\n| content | content | content |"},{label:"$",type:"text",apply:hQ("$","","","$","type")},{label:"$$",type:"text",apply:hQ("$$","","\n","\n$$","title")},...["note","abstract","info","tip","success","question","warning","failure","danger","bug","example","quote","hint","caution","error","attention"].map((e=>({label:`!!! ${e}`,type:"text",apply:hQ("!!!",` ${e}`," Title","\n\n!!!","title")})))]}};return function(e={}){return[nb,Gv,Av.of(e),tb,Sb,rb]}({override:e?[t,...e]:[t]})},dQ=e=>{const t=new Oa;return i=>(t.get(e.state)?e.dispatch({effects:t.reconfigure(i)}):e.dispatch({effects:Aa.appendConfig.of(t.of(i))}),!0)};class pQ{constructor(e){wS(this,"view"),wS(this,"maxLength",Number.MAX_SAFE_INTEGER),wS(this,"toggleTabSize"),wS(this,"togglePlaceholder"),wS(this,"setExtensions"),wS(this,"toggleDisabled"),wS(this,"toggleReadOnly"),wS(this,"toggleMaxlength"),this.view=e,this.toggleTabSize=dQ(this.view),this.togglePlaceholder=dQ(this.view),this.setExtensions=dQ(this.view),this.toggleDisabled=dQ(this.view),this.toggleReadOnly=dQ(this.view),this.toggleMaxlength=dQ(this.view)}getValue(){return this.view.state.doc.toString()}setValue(e,t=0,i=this.view.state.doc.length){this.view.dispatch({changes:{from:t,to:i,insert:e}})}getSelectedText(){const{from:e,to:t}=this.view.state.selection.main;return this.view.state.sliceDoc(e,t)}replaceSelectedText(e,t,i){const n={select:!0,deviationStart:0,deviationEnd:0,replaceAll:!1,replaceStart:-1,replaceEnd:-1,...t};try{if(n.replaceAll){if(this.setValue(e),e.length>this.maxLength)throw new Error("The input text is too long");return}if(this.view.state.doc.length-this.getSelectedText().length+e.length>this.maxLength)throw new Error("The input text is too long");const{from:t}=this.view.state.selection.main;-1!==n.replaceStart?this.view.dispatch({changes:{from:n.replaceStart,to:n.replaceEnd,insert:e}}):this.view.dispatch(this.view.state.replaceSelection(e)),n.select&&this.view.dispatch({selection:{anchor:-1===n.replaceStart?t+n.deviationStart:n.replaceStart+n.deviationStart,head:-1===n.replaceStart?t+e.length+n.deviationEnd:n.replaceStart+e.length+n.deviationEnd}}),this.view.focus()}catch(r){if("The input text is too long"!==r.message)throw r;Ne.emit(i,st,{name:"overlength",message:r.message,data:e})}}setTabSize(e){this.toggleTabSize([ja.tabSize.of(e),Uf.of(" ".repeat(e))])}setPlaceholder(e){this.togglePlaceholder(function(e){let t=vc.fromClass(class{constructor(t){this.view=t,this.placeholder=e?xh.set([xh.widget({widget:new Bd(e),side:1}).range(0)]):xh.none}get decorations(){return this.view.state.doc.length?xh.none:this.placeholder}},{decorations:e=>e.decorations});return"string"==typeof e?[t,Od.contentAttributes.of({"aria-placeholder":e})]:t}(e))}focus(e){if(this.view.focus(),!e)return;let t=0,i=0,n=0;switch(e){case"start":break;case"end":t=i=n=this.getValue().length;break;default:t=e.rangeAnchor||e.cursorPos,i=e.rangeHead||e.cursorPos,n=e.cursorPos}this.view.dispatch({scrollIntoView:!0,selection:Ko.create([Ko.range(t,i),Ko.cursor(n)],1)})}setDisabled(e){this.toggleDisabled([Od.editable.of(!e)])}setReadOnly(e){this.toggleReadOnly([ja.readOnly.of(e)])}setMaxLength(e){this.maxLength=e,this.toggleMaxlength([ja.changeFilter.of((t=>t.newDoc.length<=e))])}}Od.EDIT_CONTEXT=!1;const fQ=e=>{const t=pe("tabWidth"),i=pe("editorId"),n=pe("theme"),r=ae(),s=ye(),o=ae(!1),a=new Oa,l=new Oa,h=new Oa,c=new Oa,u=new Oa,d=(p=i,f=e,[{key:"Ctrl-b",mac:"Cmd-b",run:()=>(Ne.emit(p,ot,"bold"),!0)},{key:"Ctrl-d",mac:"Cmd-d",run:dg,preventDefault:!0},{key:"Ctrl-s",mac:"Cmd-s",run:e=>(Ne.emit(p,Ge,e.state.doc.toString()),!0),shift:()=>(Ne.emit(p,ot,"strikeThrough"),!0)},{key:"Ctrl-u",mac:"Cmd-u",preventDefault:!0,run:()=>(Ne.emit(p,ot,"underline"),!0),shift:()=>(Ne.emit(p,ot,"unorderedList"),!0)},{key:"Ctrl-i",mac:"Cmd-i",preventDefault:!0,run:()=>(Ne.emit(p,ot,"italic"),!0),shift:()=>(Ne.emit(p,lt,"image"),!0)},{key:"Ctrl-1",mac:"Cmd-1",run:()=>(Ne.emit(p,ot,"h1"),!0)},{key:"Ctrl-2",mac:"Cmd-2",run:()=>(Ne.emit(p,ot,"h2"),!0)},{key:"Ctrl-3",mac:"Cmd-3",run:()=>(Ne.emit(p,ot,"h3"),!0)},{key:"Ctrl-4",mac:"Cmd-4",run:()=>(Ne.emit(p,ot,"h4"),!0)},{key:"Ctrl-5",mac:"Cmd-5",run:()=>(Ne.emit(p,ot,"h5"),!0)},{key:"Ctrl-6",mac:"Cmd-6",run:()=>(Ne.emit(p,ot,"h6"),!0)},{key:"Ctrl-ArrowUp",mac:"Cmd-ArrowUp",run:()=>(Ne.emit(p,ot,"sup"),!0)},{key:"Ctrl-ArrowDown",mac:"Cmd-ArrowDown",run:()=>(Ne.emit(p,ot,"sub"),!0)},{key:"Ctrl-o",mac:"Cmd-o",run:()=>(Ne.emit(p,ot,"orderedList"),!0)},{key:"Ctrl-c",mac:"Cmd-c",shift:()=>(Ne.emit(p,ot,"code"),!0),any:(e,t)=>!(!t.ctrlKey&&!t.metaKey||!t.altKey||"KeyC"!==t.code||(Ne.emit(p,ot,"codeRow"),0))},{key:"Ctrl-l",mac:"Cmd-l",run:()=>(Ne.emit(p,lt,"link"),!0)},{key:"Ctrl-f",mac:"Cmd-f",shift:()=>!f.noPrettier&&(Ne.emit(p,ot,"prettier"),!0)},{any:(e,t)=>!(!t.ctrlKey&&!t.metaKey||!t.altKey||!t.shiftKey||"KeyT"!==t.code||(Ne.emit(p,ot,"table"),0))},...hv]);var p,f;const m=()=>[...d,...vg,...kO,bg],O=((e,t)=>{const i=pe("editorId"),n=e=>{e instanceof Promise?e.then((e=>{Ne.emit(i,ot,"universal",{generate:()=>({targetValue:e})})})).catch((e=>{})):Ne.emit(i,ot,"universal",{generate:()=>({targetValue:e})})};return r=>{var s,o,a;if(!r.clipboardData)return;if(r.clipboardData.files.length>0){const{files:e}=r.clipboardData;return Ne.emit(i,at,Array.from(e).filter((e=>/image\/.*/.test(e.type)))),void r.preventDefault()}const l=r.clipboardData.getData("text/plain"),h=(null==(s=t.value)?void 0:s.view.state.selection.main.to)||0,c=(null==(o=t.value)?void 0:o.view.state.doc.lineAt(h).from)||0,u=(null==(a=t.value)?void 0:a.view.state.doc.sliceString(c,h))||"",d=/!\[.*\]\(\s*$/.test(u),p=/!\[.*\]\((.*)\s?.*\)/.test(l);if(d){const t=e.transformImgUrl(l);return n(t),void r.preventDefault()}if(p){const t=l.match(new RegExp("(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?[\"']?.*[\"']?\\))","g"));return t?Promise.all(t.map((t=>e.transformImgUrl(t)))).then((e=>{n(e.reduce(((e,i,n)=>e.replace(t[n],i)),l))})):n(l),void r.preventDefault()}if(e.autoDetectCode&&r.clipboardData.types.includes("vscode-editor-data")){const e=JSON.parse(r.clipboardData.getData("vscode-editor-data"));return Ne.emit(i,ot,"code",{mode:e.mode,text:r.clipboardData.getData("text/plain")}),void r.preventDefault()}e.maxlength&&l.length+e.modelValue.length>e.maxlength&&Ne.emit(i,st,{name:"overlength",message:"The input text is too long",data:l})}})(e,s),g={paste:O,blur:e.onBlur,focus:e.onFocus,drop:e.onDrop,compositionstart:()=>{o.value=!0},compositionend:(t,i)=>{o.value=!1,e.updateModelValue(i.state.doc.toString())},input:t=>{e.onInput&&e.onInput(t);const{data:n}=t;e.maxlength&&e.modelValue.length+n.length>e.maxlength&&Ne.emit(i,st,{name:"overlength",message:"The input text is too long",data:n})}},v=[Sd.of(m()),c.of(rO()),a.of(mS({codeLanguages:_b})),Od.lineWrapping,Od.updateListener.of((t=>{t.docChanged&&(e.onChange(t.state.doc.toString()),o.value||e.updateModelValue(t.state.doc.toString()))})),u.of(Od.domEventHandlers(g)),Xd()],b=()=>{const t=[...v,l.of("light"===n.value?lQ:eQ),h.of(uQ(e.completions))];return Ve.codeMirrorExtensions(n.value,t,m(),{editorId:i})};return he((()=>{const n=new Od({doc:e.modelValue,parent:r.value,extensions:[b()]}),o=new pQ(n);s.value=o,setTimeout((()=>{o.setTabSize(t),o.setDisabled(e.disabled),o.setReadOnly(e.readonly),e.placeholder&&o.setPlaceholder(e.placeholder),"number"==typeof e.maxlength&&o.setMaxLength(e.maxlength),e.autofocus&&n.focus()}),0),Ne.on(i,{name:ht,callback(){oO(n)}}),Ne.on(i,{name:ct,callback(){aO(n)}}),Ne.on(i,{name:ot,async callback(t,n={}){var r,o;if("image"===t&&n.transform){const o=e.transformImgUrl(n.url);if(o instanceof Promise)o.then((async e=>{var r;const{text:o,options:a}=await RS(t,s.value,{...n,url:e});null==(r=s.value)||r.replaceSelectedText(o,a,i)})).catch((e=>{}));else{const{text:e,options:a}=await RS(t,s.value,{...n,url:o});null==(r=s.value)||r.replaceSelectedText(e,a,i)}}else{const{text:e,options:r}=await RS(t,s.value,n);null==(o=s.value)||o.replaceSelectedText(e,r,i)}}}),Ne.on(i,{name:ft,callback:Ce((e=>{var t;const i={...g},n=Object.keys(g);for(const r in e){const t=r;n.includes(t)?i[t]=(i,n)=>{e[t](i,n),i.defaultPrevented||g[t](i,n)}:i[t]=e[t]}null==(t=s.value)||t.view.dispatch({effects:u.reconfigure(Od.domEventHandlers(i))})}))}),Ne.on(i,{name:mt,callback:(e,t)=>{const i=n.state.doc.line(e);n.dispatch(n.state.update({changes:{from:i.from,to:i.to,insert:t}}))}}),Ne.on(i,{name:Ot,callback(){Ne.emit(i,gt,n)}}),Ne.emit(i,gt,n)})),le(n,(()=>{var e;null==(e=s.value)||e.view.dispatch({effects:l.reconfigure("light"===n.value?lQ:eQ)})}),{deep:!0}),le((()=>e.completions),(()=>{var t;null==(t=s.value)||t.view.dispatch({effects:h.reconfigure(uQ(e.completions))})}),{deep:!0}),le((()=>e.modelValue),(()=>{var t,i;(null==(t=s.value)?void 0:t.getValue())!==e.modelValue&&(null==(i=s.value)||i.setValue(e.modelValue))})),le((()=>e.placeholder),(()=>{var t;null==(t=s.value)||t.setPlaceholder(e.placeholder)})),le((()=>e.disabled),(()=>{var t;null==(t=s.value)||t.setDisabled(e.disabled)})),le((()=>e.readonly),(()=>{var t;null==(t=s.value)||t.setDisabled(e.readonly)})),le((()=>e.maxlength),(()=>{var t;e.maxlength&&(null==(t=s.value)||t.setMaxLength(e.maxlength))})),{inputWrapperRef:r,codeMirrorUt:s,resetHistory(){var e,t;null==(e=s.value)||e.view.dispatch({effects:c.reconfigure([])}),null==(t=s.value)||t.view.dispatch({effects:c.reconfigure(rO())})}}},mQ=Pe(),OQ=se({name:"MDEditorContent",props:Os,setup(e,t){const i=pe("editorId"),n=ae(""),r=ae(),s=ae(),{inputWrapperRef:o,codeMirrorUt:a,resetHistory:l}=fQ(e),{inputWrapperStyle:h,resizeOperateStyle:c}=((e,t,i)=>{const n=Oe((()=>/px$/.test(`${e.inputBoxWidth}`)?"50%":e.inputBoxWidth)),r=oe({resizedWidth:n.value}),s=oe({width:n.value}),o=oe({left:n.value,display:"initial"}),a=i=>{var n,a,l;const h=(null==(n=t.value)?void 0:n.offsetWidth)||0,c=(null==(a=t.value)?void 0:a.getBoundingClientRect().x)||0;let u=i.x-c;u/hh-h*Ie&&(u=h-h*Ie);const d=u/h*100+"%";s.width=d,o.left=d,r.resizedWidth=d,null==(l=e.oninputBoxWidthChange)||l.call(e,d)},l=e=>{e.target===i.value&&document.addEventListener("mousemove",a)},h=()=>{document.removeEventListener("mousemove",a)};return le([i],(()=>{document.removeEventListener("mousedown",l),document.removeEventListener("mouseup",h),document.addEventListener("mousedown",l),document.addEventListener("mouseup",h)})),he((()=>{document.addEventListener("mousedown",l),document.addEventListener("mouseup",h)})),ce((()=>{document.removeEventListener("mousedown",l),document.removeEventListener("mouseup",h)})),le([n],(([e])=>{r.resizedWidth=e,s.width=e,o.left=e})),le([be(e.setting,"htmlPreview"),be(e.setting,"preview"),be(e.setting,"previewOnly")],(()=>{e.setting.previewOnly?(s.width="0%",o.display="none"):e.setting.htmlPreview||e.setting.preview?(s.width=r.resizedWidth,o.display="initial"):(s.width="100%",o.display="none")}),{immediate:!0}),{inputWrapperStyle:s,resizeOperateStyle:o}})(e,r,s);return((e,t,i)=>{const n=pe("editorId");let r=()=>{},s=()=>{};const o=()=>{var t;r();const o=null==(t=i.value)?void 0:t.view.contentDOM.getRootNode(),a=o.querySelector(`#${n} .cm-scroller`),l=o.querySelector(`[id="${n}-preview-wrapper"]`),h=o.querySelector(`[id="${n}-html-wrapper"]`);if(l||h){const t=l?po:uo,n=l||h;[s,r]=t(a,n,i.value),e.scrollAuto&&s()}};le([t,be(e.setting,"preview"),be(e.setting,"htmlPreview"),be(e.setting,"fullscreen"),be(e.setting,"pageFullscreen")],(()=>{ke(o)})),le((()=>e.scrollAuto),(e=>{e?s():r()})),le((()=>e.setting.previewOnly),(e=>{e?r():s()})),he(o)})(e,n,a),t.expose({getSelectedText(){var e;return null==(e=a.value)?void 0:e.getSelectedText()},focus(e){var t;null==(t=a.value)||t.focus(e)},resetHistory:l,getEditorView(){var e;return null==(e=a.value)?void 0:e.view}}),()=>de("div",{class:`${Me}-content`},[de("div",{class:`${Me}-content-wrapper`,ref:r},[de("div",{class:`${Me}-input-wrapper`,style:h,ref:o},null),(e.setting.htmlPreview||e.setting.preview)&&de("div",{class:`${Me}-resize-operate`,style:c,ref:s},null),de(vs,{modelValue:e.modelValue,onChange:e.onChange,setting:e.setting,onHtmlChanged:t=>{n.value=t,e.onHtmlChanged(t)},onGetCatalog:e.onGetCatalog,mdHeadingId:e.mdHeadingId,noMermaid:e.noMermaid,sanitize:e.sanitize,noKatex:e.noKatex,formatCopiedText:e.formatCopiedText,noHighlight:e.noHighlight,noImgZoomIn:e.noImgZoomIn,sanitizeMermaid:e.sanitizeMermaid,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold,onRemount:e.onRemount},null)]),e.catalogVisible&&de(mo,{theme:e.theme,class:`${Me}-catalog-editor ${Me}-catalog-${e.catalogLayout}`,editorId:i,mdHeadingId:e.mdHeadingId,key:"internal-catalog",scrollElementOffsetTop:2,syncWith:e.setting.preview?"preview":"editor",onClick:(t,i)=>{var n,r;if(!e.setting.preview&&void 0!==i.line){t.preventDefault();const e=null==(n=a.value)?void 0:n.view;if(e){const t=e.state.doc.line(i.line+1),n=null==(r=e.lineBlockAt(t.from))?void 0:r.top,s=e.scrollDOM;mQ(s,n)}}},catalogMaxDepth:e.catalogMaxDepth},null)])}}),gQ=se({props:{modelValue:{type:String,default:""}},setup(e){const t=pe("usedLanguageText");return()=>{var i,n;return de("div",{class:`${Me}-footer-item`},[de("label",{class:`${Me}-footer-label`},[`${null==(i=t.value.footer)?void 0:i.markdownTotal}:`]),de("span",null,[(null==(n=e.modelValue)?void 0:n.length)||0])])}}}),vQ={checked:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},disabled:{type:Boolean,default:void 0}},bQ=se({name:`${Me}-checkbox`,props:vQ,setup:e=>()=>de("div",{class:[`${Me}-checkbox`,e.checked&&`${Me}-checkbox-checked`,e.disabled&&`${Me}-disabled`],onClick:()=>{e.disabled||e.onChange(!e.checked)}},null)}),yQ=se({props:{scrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}}},setup(e){const t=pe("usedLanguageText"),i=pe("disabled");return()=>{var n;return de("div",{class:[`${Me}-footer-item`,(null==i?void 0:i.value)&&`${Me}-disabled`]},[de("label",{class:`${Me}-footer-label`,onClick:()=>{e.onScrollAutoChange(!e.scrollAuto)}},[null==(n=null==t?void 0:t.value.footer)?void 0:n.scrollAuto]),de(bQ,{checked:e.scrollAuto,onChange:e.onScrollAutoChange,disabled:null==i?void 0:i.value},null)])}}}),kQ=se({name:"MDEditorFooter",props:{modelValue:{type:String,default:""},footers:{type:Array,default:[]},scrollAuto:{type:Boolean},noScrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}},defFooters:{type:Object}},setup(e){const t=pe("theme"),i=pe("language"),n=pe("disabled"),r=Oe((()=>{const t=e.footers.indexOf("=");return[-1===t?e.footers:e.footers.slice(0,t),-1===t?[]:e.footers.slice(t,Number.MAX_SAFE_INTEGER)]})),s=r=>{var s,o,a,l,h,c;if(!Xe.includes(r)){if(e.defFooters instanceof Array){const l=e.defFooters[r];if(l){return ue(l,{theme:(null==(s=l.props)?void 0:s.theme)||t.value,language:(null==(o=l.props)?void 0:o.language)||i.value,disabled:(null==(a=l.props)?void 0:a.disabled)||(null==n?void 0:n.value)})}return""}if(e.defFooters&&e.defFooters.children instanceof Array){const s=e.defFooters.children[r];if(s){return ue(s,{theme:(null==(l=s.props)?void 0:l.theme)||t.value,language:(null==(h=s.props)?void 0:h.language)||i.value,disabled:(null==(c=s.props)?void 0:c.disabled)||(null==n?void 0:n.value)})}return""}return""}switch(r){case"markdownTotal":return de(gQ,{modelValue:e.modelValue},null);case"scrollSwitch":return!e.noScrollAuto&&de(yQ,{scrollAuto:e.scrollAuto,onScrollAutoChange:e.onScrollAutoChange},null)}};return()=>{const e=r.value[0].map((e=>s(e))),t=r.value[1].map((e=>s(e)));return de("div",{class:`${Me}-footer`},[de("div",{class:`${Me}-footer-left`},[e]),de("div",{class:`${Me}-footer-right`},[t])])}}}),xQ=se({name:"MdEditorV3",props:xs,emits:Ss,setup(e,t){const{noKatex:i,noMermaid:n,noPrettier:r,noUploadImg:s,noHighlight:o}=e,a=oe({scrollAuto:e.scrollAuto}),l=ae(),h=ae(),{editorId:c}=((e,t)=>(me("tabWidth",e.tabWidth),me("disabled",Oe((()=>e.disabled))),bs(e,t)))(e,l),[u,d]=((e,t,i)=>{const{editorId:n}=i,r=oe({pageFullscreen:e.pageFullscreen,fullscreen:!1,preview:e.preview,htmlPreview:!e.preview&&e.htmlPreview,previewOnly:!1}),s=oe({...r});let o="";const a=()=>{r.pageFullscreen||r.fullscreen?document.body.style.overflow="hidden":document.body.style.overflow=o};return le((()=>[r.pageFullscreen,r.fullscreen]),a),he((()=>{Ne.on(n,{name:at,callback(i,r){const s=e=>{Ne.emit(n,ot,"image",{desc:"",urls:e}),null==r||r()};e.onUploadImg?e.onUploadImg(i,s):t.emit("onUploadImg",i,s)}}),o=document.body.style.overflow,a()})),[r,(e,t)=>{const i=void 0===t?!r[e]:t;switch(e){case"preview":r.htmlPreview=!1,r.previewOnly=!1;break;case"htmlPreview":r.preview=!1,r.previewOnly=!1;break;case"previewOnly":i?r.preview||r.htmlPreview||(r.preview=!0):(s.preview||(r.preview=!1),s.htmlPreview||(r.htmlPreview=!1))}s[e]=i,r[e]=i}]})(e,t,{editorId:c}),p=((e,t)=>{const{editorId:i}=t,n=ae(!1);return he((()=>{Ne.on(i,{name:Ue,callback:e=>{n.value=void 0===e?!n.value:e}})})),n})(0,{editorId:c});return((e,t,i)=>{const{editorId:n}=i,r=oe({buildFinished:!1,html:""});le((()=>e.modelValue),(()=>{r.buildFinished=!1})),he((()=>{Ne.on(n,{name:rt,callback(e){r.buildFinished=!0,r.html=e}}),Ne.on(n,{name:Ge,callback(){const i=new Promise((e=>{if(r.buildFinished)e(r.html);else{const t=i=>{e(i),Ne.remove(n,rt,t)};Ne.on(n,{name:rt,callback:t})}}));e.onSave?e.onSave(e.modelValue,i):t.emit("onSave",e.modelValue,i)}})}))})(e,t,{editorId:c}),(e=>{const{noPrettier:t,noUploadImg:i}=e,{editorExtensions:n,editorExtensionsAttrs:r}=Ve,s=t||n.prettier.prettierInstance,o=t||n.prettier.parserMarkdownInstance,a=i||n.cropper.instance;he((()=>{if(!a){const{js:e={},css:t={}}=r.cropper||{};kt("link",{...t,rel:"stylesheet",href:n.cropper.css,id:Kr.croppercss}),kt("script",{...e,src:n.cropper.js,id:Kr.cropperjs})}if(!s){const{standaloneJs:e={}}=r.prettier||{};kt("script",{...e,src:n.prettier.standaloneJs,id:Kr.prettier})}if(!o){const{parserMarkdownJs:e={}}=r.prettier||{};kt("script",{...e,src:n.prettier.parserMarkdownJs,id:Kr.prettierMD})}}))})(e),((e,t,i)=>{const{editorId:n}=i;he((()=>{Ne.on(n,{name:st,callback:i=>{var n;null==(n=e.onError)||n.call(e,i),t.emit("onError",i)}})}))})(e,t,{editorId:c}),((e,t,i)=>{const{editorId:n,catalogVisible:r,setting:s,updateSetting:o,codeRef:a}=i;le((()=>s.pageFullscreen),(e=>{Ne.emit(n,Ke,e)})),le((()=>s.fullscreen),(e=>{Ne.emit(n,Je,e)})),le((()=>s.preview),(e=>{Ne.emit(n,et,e)})),le((()=>s.previewOnly),(e=>{Ne.emit(n,tt,e)})),le((()=>s.htmlPreview),(e=>{Ne.emit(n,it,e)})),le(r,(e=>{Ne.emit(n,nt,e)}));const l={on(e,t){switch(e){case"pageFullscreen":Ne.on(n,{name:Ke,callback(e){t(e)}});break;case"fullscreen":Ne.on(n,{name:Je,callback(e){t(e)}});break;case"preview":Ne.on(n,{name:et,callback(e){t(e)}});break;case"previewOnly":Ne.on(n,{name:tt,callback(e){t(e)}});break;case"htmlPreview":Ne.on(n,{name:it,callback(e){t(e)}});break;case"catalog":Ne.on(n,{name:nt,callback(e){t(e)}})}},togglePageFullscreen(e){o("pageFullscreen",e)},toggleFullscreen(e){Ne.emit(n,He,e)},togglePreview(e){o("preview",e)},togglePreviewOnly(e){o("previewOnly",e)},toggleHtmlPreview(e){o("htmlPreview",e)},toggleCatalog(e){Ne.emit(n,Ue,e)},triggerSave(){Ne.emit(n,Ge)},insert(e){Ne.emit(n,ot,"universal",{generate:e})},focus(e){var t;null==(t=a.value)||t.focus(e)},rerender(){Ne.emit(n,pt)},getSelectedText(){var e;return null==(e=a.value)?void 0:e.getSelectedText()},resetHistory(){var e;null==(e=a.value)||e.resetHistory()},domEventHandlers(e){Ne.emit(n,ft,e)},execCommand(e){Ne.emit(n,ot,e)},getEditorView(){var e;return null==(e=a.value)?void 0:e.getEditorView()}};t.expose(l)})(0,t,{editorId:c,catalogVisible:p,setting:u,updateSetting:d,codeRef:h}),ce((()=>{Ne.clear(c)})),()=>{const f=ze({props:e,ctx:t},"defToolbars"),m=ze({props:e,ctx:t},"defFooters");return de("div",{id:c,class:[Me,e.class,"dark"===e.theme&&`${Me}-dark`,u.fullscreen||u.pageFullscreen?`${Me}-fullscreen`:""],style:e.style,ref:l},[e.toolbars.length>0&&de(MS,{noPrettier:r,toolbars:e.toolbars,toolbarsExclude:e.toolbarsExclude,setting:u,updateSetting:d,tableShape:e.tableShape,defToolbars:f,noUploadImg:s,showToolbarName:e.showToolbarName,catalogVisible:p.value,codeTheme:e.codeTheme},null),de(OQ,{ref:h,modelValue:e.modelValue,setting:u,mdHeadingId:e.mdHeadingId,noMermaid:n,noPrettier:r,sanitize:e.sanitize,placeholder:e.placeholder,noKatex:i,scrollAuto:a.scrollAuto,formatCopiedText:e.formatCopiedText,autofocus:e.autoFocus,disabled:e.disabled,readonly:e.readOnly,maxlength:e.maxLength,autoDetectCode:e.autoDetectCode,noHighlight:o,updateModelValue:e=>{t.emit("update:modelValue",e)},onChange:i=>{var n;null==(n=e.onChange)||n.call(e,i),t.emit("onChange",i)},onHtmlChanged:i=>{var n;null==(n=e.onHtmlChanged)||n.call(e,i),t.emit("onHtmlChanged",i)},onGetCatalog:i=>{var n;null==(n=e.onGetCatalog)||n.call(e,i),t.emit("onGetCatalog",i)},onBlur:i=>{var n;null==(n=e.onBlur)||n.call(e,i),t.emit("onBlur",i)},onFocus:i=>{var n;null==(n=e.onFocus)||n.call(e,i),t.emit("onFocus",i)},onInput:i=>{var n;null==(n=e.onInput)||n.call(e,i),t.emit("onInput",i)},completions:e.completions,catalogVisible:p.value,theme:e.theme,noImgZoomIn:e.noImgZoomIn,onDrop:i=>{var n;null==(n=e.onDrop)||n.call(e,i),t.emit("onDrop",i)},inputBoxWidth:e.inputBoxWidth,oninputBoxWidthChange:i=>{var n;null==(n=e.oninputBoxWidthChange)||n.call(e,i),t.emit("oninputBoxWidthChange",i)},sanitizeMermaid:e.sanitizeMermaid,transformImgUrl:e.transformImgUrl,codeFoldable:e.codeFoldable,autoFoldThreshold:e.autoFoldThreshold,onRemount:()=>{var i;null==(i=e.onRemount)||i.call(e),t.emit("onRemount")},catalogLayout:e.catalogLayout,catalogMaxDepth:e.catalogMaxDepth},null),e.footers.length>0&&de(kQ,{modelValue:e.modelValue,footers:e.footers,defFooters:m,noScrollAuto:!u.preview&&!u.htmlPreview||u.previewOnly,scrollAuto:a.scrollAuto,onScrollAutoChange:e=>a.scrollAuto=e},null)])}}});xQ.install=e=>(e.component(xQ.name,xQ),e.use(yS).use(Fe).use(kS).use(mo).use(Qs),e);const wQ=se({name:"NormalFooterToolbar",props:{onClick:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0}},emits:["onClick"],setup:(e,t)=>()=>{const i=ze({props:e,ctx:t});return de("div",{class:[`${Me}-footer-item`,e.disabled&&`${Me}-disabled`],onClick:i=>{var n;e.disabled||(null==(n=e.onClick)||n.call(e,i),t.emit("onClick",i))}},[i])}});wQ.install=e=>(e.component(wQ.name,wQ),e);var SQ={exports:{}},QQ={},$Q={exports:{}},_Q={};function PQ(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var CQ=/javascript\s*\:/gim;_Q.whiteList=PQ(),_Q.getDefaultWhiteList=PQ,_Q.onAttr=function(e,t,i){},_Q.onIgnoreAttr=function(e,t,i){},_Q.safeAttrValue=function(e,t){return CQ.test(t)?"":t};var TQ={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i/g,NQ=/"/g,GQ=/"/g,UQ=/&#([a-zA-Z0-9]*);?/gim,HQ=/:?/gim,KQ=/&newline;?/gim,JQ=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,e$=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,t$=/u\s*r\s*l\s*\(.*/gi;function i$(e){return e.replace(NQ,""")}function n$(e){return e.replace(GQ,'"')}function r$(e){return e.replace(UQ,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function s$(e){return e.replace(HQ,":").replace(KQ," ")}function o$(e){for(var t="",i=0,n=e.length;i0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}}function g$(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}h$.parseTag=function(e,t,i){var n="",r=0,s=!1,o=!1,a=0,l=e.length,h="",c="";e:for(a=0;a"===u||a===l-1){n+=i(e.slice(r,s)),h=u$(c=e.slice(s,a+1)),n+=t(s,n.length,h,c,d$(c)),r=a+1,s=!1;continue}if('"'===u||"'"===u)for(var d=1,p=e.charAt(a-d);""===p.trim()||"="===p;){if("="===p){o=u;continue e}p=e.charAt(a-++d)}}else if(u===o){o=!1;continue}}return r";var O=function(e){var t=w$.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=w$.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=w$.trim(e.slice(0,-1))),{html:e,closing:i}}(d),g=n[i],v=x$(O.html,(function(e,t){var n=-1!==w$.indexOf(g,e),r=o(i,e,t,n);return S$(r)?n?(t=l(i,e,t,u))?e+"="+c+t+c:e:S$(r=a(i,e,t,n))?void 0:r:r}));return d="<"+i,v&&(d+=" "+v),O.closing&&(d+=" /"),d+=">"}return S$(m=s(i,d,f))?h(d):m}),h);return d&&(p=d.remove(p)),p};var $$=Q$;!function(e,t){var i=QQ,n=h$,r=$$;function s(e,t){return new r(t).process(e)}(t=e.exports=s).filterXSS=s,t.FilterXSS=r,function(){for(var e in i)t[e]=i[e];for(var r in n)t[r]=n[r]}(),"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}(SQ,SQ.exports);export{Ck as C,xQ as E,bp as I,Zf as L,qp as N,Tk as a,Wf as b,cm as c,Ok as d,yv as e,dm as f,bv as g,Lf as h,tm as i,am as j,hm as k,pm as l,mk as m,yb as n,Px as o,Od as p,Ko as q,Fw as r,lf as s,Cf as t,jp as u,km as v,sw as w};