1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7907],{6167:function(t,e,n){n.d(e,{ZP:function(){return te}});var i=n(18966),r=n(46505),s=n(39638),o=n(8693),l=n(64451),a=n(67594),h=n(86017),c=n(17561),u=n(83982),f=n(16914);class d{constructor(t,e,n){this.from=t,this.to=e,this.diagnostic=n}}class p{constructor(t,e,n){this.diagnostics=t,this.panel=e,this.selected=n}static init(t,e,n){let i=t,r=n.facet(A).markerFilter;r&&(i=r(i,n));let s=l.p.set(i.map(t=>t.from==t.to||t.from==t.to-1&&n.doc.lineAt(t.from).to==t.from?l.p.widget({widget:new M(t),diagnostic:t}).range(t.from):l.p.mark({attributes:{class:"cm-lintRange cm-lintRange-"+t.severity+(t.markClass?" "+t.markClass:"")},diagnostic:t}).range(t.from,t.to)),!0);return new p(s,e,m(s))}}function m(t,e=null,n=0){let i=null;return t.between(n,1e9,(t,n,{spec:r})=>{if(!e||r.diagnostic==e)return i=new d(t,n,r.diagnostic),!1}),i}function g(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(A).hideOn(t,n,i);if(null!=r)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(t=>t.is(v))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}let v=o.Py.define(),y=o.Py.define(),x=o.Py.define(),b=o.QQ.define({create:()=>new p(l.p.none,null,null),update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let r=e.changes.mapPos(t.selected.from,1);i=m(n,t.selected.diagnostic,r)||m(n,null,r)}!n.size&&r&&e.state.facet(A).autoPanel&&(r=null),t=new p(n,r,i)}for(let n of e.effects)if(n.is(v)){let i=e.state.facet(A).autoPanel?n.value.length?O.open:null:t.panel;t=p.init(n.value,i,e.state)}else n.is(y)?t=new p(t.diagnostics,n.value?O.open:null,t.selected):n.is(x)&&(t=new p(t.diagnostics,t.panel,n.value));return t},provide:t=>[l.mH.from(t,t=>t.panel),l.tk.decorations.from(t,t=>t.diagnostics)]}),w=l.p.mark({class:"cm-lintRange cm-lintRange-active"}),k=t=>{let e=t.state.field(b,!1);return!!e&&!!e.panel&&(t.dispatch({effects:y.of(!1)}),!0)},S=[{key:"Mod-Shift-m",run:t=>{var e,n;let i=t.state.field(b,!1);i&&i.panel||t.dispatch({effects:(e=t.state,n=[y.of(!0)],e.field(b,!1)?n:n.concat(o.Py.appendConfig.of(N)))});let r=(0,l.Sd)(t,O.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(b,!1);if(!e)return!1;let n=t.state.selection.main,i=e.diagnostics.iter(n.to+1);return(!!i.value||!!(i=e.diagnostics.iter(0)).value&&(i.from!=n.from||i.to!=n.to))&&(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)}}],A=o.r$.define({combine:t=>Object.assign({sources:t.map(t=>t.source).filter(t=>null!=t)},(0,o.BO)(t.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(t,e)=>t?e?n=>t(n)||e(n):t:e}))});function C(t){let e=[];
1if(t)t:for(let{name:n}of t){for(let t=0;t<n.length;t++){let i=n[t];if(/[a-zA-Z]/.test(i)&&!e.some(t=>t.toLowerCase()==i.toLowerCase())){e.push(i);continue t}}e.push("")}return e}function I(t,e,n){var i;let r=n?C(e.actions):[];return(0,f.Z)("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},(0,f.Z)("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(i=e.actions)||void 0===i?void 0:i.map((n,i)=>{let s=!1,o=i=>{if(i.preventDefault(),s)return;s=!0;let r=m(t.state.field(b).diagnostics,e);r&&n.apply(t,r.from,r.to)},{name:l}=n,a=r[i]?l.indexOf(r[i]):-1,h=a<0?l:[l.slice(0,a),(0,f.Z)("u",l.slice(a,a+1)),l.slice(a+1)];return(0,f.Z)("button",{type:"button",class:"cm-diagnosticAction",onclick:o,onmousedown:o,"aria-label":` Action: ${l}${a<0?"":` (access key "${r[i]})"`}.`},h)}),e.source&&(0,f.Z)("div",{class:"cm-diagnosticSource"},e.source))}class M extends l.l9{constructor(t){super(),this.diagnostic=t}eq(t){return t.diagnostic==this.diagnostic}toDOM(){return(0,f.Z)("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class T{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=I(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class O{constructor(t){this.view=t,this.items=[],this.list=(0,f.Z)("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e=>{if(27==e.keyCode)k(this.view),this.view.focus();else if(38==e.keyCode||33==e.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==e.keyCode||34==e.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==e.keyCode)this.moveSelection(0);else if(35==e.keyCode)this.moveSelection(this.items.length-1);else if(13==e.keyCode)this.view.focus();else{if(!(e.keyCode>=65)||!(e.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],i=C(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==e.keyCode){let e=m(this.view.state.field(b).diagnostics,n);e&&n.actions[r].apply(t,e.from,e.to)}}e.preventDefault()},onclick:t=>{for(let e=0;e<this.items.length;e++)this.items[e].dom.contains(t.target)&&this.moveSelection(e)}}),this.dom=(0,f.Z)("div",{class:"cm-panel-lint"},this.list,(0,f.Z)("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>k(this.view)},"\xd7")),this.update()}get selectedIndex(){let t=this.view.state.field(b).selected;if(!t)return -1;for(let e=0;e<this.items.length;e++)if(this.items[e].diagnostic==t.diagnostic)return e;return -1}update(){let{diagnostics:t,selected:e}=this.view.state.field(b),n=0,i=!1,r=null;for(t.between(0,this.view.state.doc.length,(t,s,{spec:o})=>{let l=-1,a;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==o.diagnostic){l=t;break}l<0?(a=new T(this.view,o.diagnostic),this.items.splice(n,0,a),i=!0):(a=this.items[l],l>n&&(this.items.splice(n,l-n),i=!0)),e&&a.diagnostic==e.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new T(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:t,panel:e})=>{let n=e.height/this.list.offsetHeight;t.top<e.top?this.list.scrollTop-=(e.top-t.top)/n:t.bottom>e.bottom&&(this.list.scrollTop+=(t.bottom-e.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function e(){let e=t;t=e.nextSibling,e.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;t!=n.dom;)e();t=n.dom.nextSibling}else this.list.insertBefore(n.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=m(this.view.state.field(b).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:x.of(e)})}static open(t){return new O(t)}}function P(t){return function(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let D=l.tk.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:P("#d11")},".cm-lintRange-warning":{backgroundImage:P("orange")},".cm-lintRange-info":{backgroundImage:P("#999")},".cm-lintRange-hint":{backgroundImage:P("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});l.SJ;let E=o.Py.define(),N=[b,l.tk.decorations.compute([b],t=>{let{selected:e,panel:n}=t.field(b);return e&&n&&e.from!=e.to?l.p.set([w.range(e.from,e.to)]):l.p.none}),(0,l.bF)(function(t,e,n){let{diagnostics:i}=t.state.field(b),r=[],s=2e8,o=0;i.between(e-(n<0?1:0),e+(n>0?1:0),(t,i,{spec:l})=>{e>=t&&e<=i&&(t==i||(e>t||n>0)&&(e<i||n<0))&&(r.push(l.diagnostic),s=Math.min(t,s),o=Math.max(i,o))});let l=t.state.facet(A).tooltipFilter;return(l&&(r=l(r,t.state)),r.length)?{pos:s,end:o,above:t.state.doc.lineAt(s).to<o,create:()=>{var e,n;return{dom:(e=t,n=r,(0,f.Z)("ul",{class:"cm-tooltip-lint"},n.map(t=>I(e,t,!1))))}}}:null},{hideOn:g}),D];var B=function(t){void 0===t&&(t={});var{crosshairCursor:e=!1}=t,n=[];!1!==t.closeBracketsKeymap&&(n=n.concat(c.GA)),!1!==t.defaultKeymap&&(n=n.concat(a.wQ)),!1!==t.searchKeymap&&(n=n.concat(h.Lp)),!1!==t.historyKeymap&&(n=n.concat(a.f$)),!1!==t.foldKeymap&&(n=n.concat(u.e7)),!1!==t.completionKeymap&&(n=n.concat(c.B1)),!1!==t.lintKeymap&&(n=n.concat(S));var i=[];return!1!==t.lineNumbers&&i.push((0,l.Eu)()),!1!==t.highlightActiveLineGutter&&i.push((0,l.HQ)()),!1!==t.highlightSpecialChars&&i.push((0,l.AE)()),!1!==t.history&&i.push((0,a.m8)()),!1!==t.foldGutter&&i.push((0,u.mi)()),!1!==t.drawSelection&&i.push((0,l.Uw)()),!1!==t.dropCursor&&i.push((0,l.qr)()),!1!==t.allowMultipleSelections&&i.push(o.yy.allowMultipleSelections.of(!0)),!1!==t.indentOnInput&&i.push((0,u.nY)()),!1!==t.syntaxHighlighting&&i.push((0,u.nF)(u.R_,{fallback:!0})),!1!==t.bracketMatching&&i.push((0,u.n$)()),!1!==t.closeBrackets&&i.push((0,c.vQ)()),!1!==t.autocompletion&&i.push((0,c.ys)()),!1!==t.rectangularSelection&&i.push((0,l.Zs)()),!1!==e&&i.push((0,l.S2)()),!1!==t.highlightActiveLine&&i.push((0,l.ZO)()),!1!==t.highlightSelectionMatches&&i.push((0,h.sW)()),t.tabSize&&"number"==typeof t.tabSize&&i.push(u.c.of(" ".repeat(t.tabSize))),i.concat([l.$f.of(n.flat())]).filter(
1Boolean)},R=n(38397);let L="#e06c75",J="#abb2bf",j="#7d8799",F="#d19a66",q="#2c313a",$="#282c34",_="#353a42",W="#528bff",z=l.tk.theme({"&":{color:J,backgroundColor:$},".cm-content":{caretColor:W},".cm-cursor, .cm-dropCursor":{borderLeftColor:W},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:J},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:$,color:j,border:"none"},".cm-activeLineGutter":{backgroundColor:q},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:_},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:_,borderBottomColor:_},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:q,color:J}}},{dark:!0}),U=u.Qf.define([{tag:R.pJ.keyword,color:"#c678dd"},{tag:[R.pJ.name,R.pJ.deleted,R.pJ.character,R.pJ.propertyName,R.pJ.macroName],color:L},{tag:[R.pJ.function(R.pJ.variableName),R.pJ.labelName],color:"#61afef"},{tag:[R.pJ.color,R.pJ.constant(R.pJ.name),R.pJ.standard(R.pJ.name)],color:F},{tag:[R.pJ.definition(R.pJ.name),R.pJ.separator],color:J},{tag:[R.pJ.typeName,R.pJ.className,R.pJ.number,R.pJ.changed,R.pJ.annotation,R.pJ.modifier,R.pJ.self,R.pJ.namespace],color:"#e5c07b"},{tag:[R.pJ.operator,R.pJ.operatorKeyword,R.pJ.url,R.pJ.escape,R.pJ.regexp,R.pJ.link,R.pJ.special(R.pJ.string)],color:"#56b6c2"},{tag:[R.pJ.meta,R.pJ.comment],color:j},{tag:R.pJ.strong,fontWeight:"bold"},{tag:R.pJ.emphasis,fontStyle:"italic"},{tag:R.pJ.strikethrough,textDecoration:"line-through"},{tag:R.pJ.link,color:j,textDecoration:"underline"},{tag:R.pJ.heading,fontWeight:"bold",color:L},{tag:[R.pJ.atom,R.pJ.bool,R.pJ.special(R.pJ.variableName)],color:F},{tag:[R.pJ.processingInstruction,R.pJ.string,R.pJ.inserted],color:"#98c379"},{tag:R.pJ.invalid,color:"#ffffff"}]),V=[z,(0,u.nF)(U)];var Z=l.tk.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),H=function(t){void 0===t&&(t={});var{indentWithTab:e=!0,editable:n=!0,readOnly:i=!1,theme:r="light",placeholder:s="",basicSetup:h=!0}=t,c=[];switch(e&&c.unshift(l.$f.of([a.oc])),h&&("boolean"==typeof h?c.unshift(B()):c.unshift(B(h))),s&&c.unshift((0,l.W$)(s)),r){case"light":c.push(Z);break;case"dark":c.push(V);break;case"none":break;default:c.push(r)}return!1===n&&c.push(l.tk.editable.of(!1)),i&&c.push(o.yy.readOnly.of(!0)),[...c]},Q=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(t=>!t.empty)}),K=o.q6.define(),G=[],Y=n(30382),X=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],tt=(0,s.forwardRef)((t,e)=>{var{className:n,value:a="",selection:h,extensions:c=[],onChange:u,onStatistics:f,onCreateEditor:d,onUpdate:p,autoFocus:m,theme:g="light",height:v,minHeight:y,maxHeight:x,width:b,minWidth:w,maxWidth:k,basicSetup:S,placeholder:A,indentWithTab:C,editable:I,readOnly:M,root:T,initialState:O}=t,P=(0,r.Z)(t,X),D=(0,s.useRef)(null),{state:E,view:N,container:B}=function(t){var{value:e,selection:n,onChange:i,onStatistics:r,onCreateEditor:a,onUp
1date:h,extensions:c=G,autoFocus:u,theme:f="light",height:d=null,minHeight:p=null,maxHeight:m=null,width:g=null,minWidth:v=null,maxWidth:y=null,placeholder:x="",editable:b=!0,readOnly:w=!1,indentWithTab:k=!0,basicSetup:S=!0,root:A,initialState:C}=t,[I,M]=(0,s.useState)(),[T,O]=(0,s.useState)(),[P,D]=(0,s.useState)(),E=l.tk.theme({"&":{height:d,minHeight:p,maxHeight:m,width:g,minWidth:v,maxWidth:y},"& .cm-scroller":{height:"100% !important"}}),N=[l.tk.updateListener.of(t=>{t.docChanged&&"function"==typeof i&&!t.transactions.some(t=>t.annotation(K))&&i(t.state.doc.toString(),t),r&&r(Q(t))}),E,...H({theme:f,editable:b,readOnly:w,placeholder:x,indentWithTab:k,basicSetup:S})];return h&&"function"==typeof h&&N.push(l.tk.updateListener.of(h)),N=N.concat(c),(0,s.useEffect)(()=>{if(I&&!P){var t={doc:e,selection:n,extensions:N},i=C?o.yy.fromJSON(C.json,t,C.fields):o.yy.create(t);if(D(i),!T){var r=new l.tk({state:i,parent:I,root:A});O(r),a&&a(r,i)}}return()=>{T&&(D(void 0),O(void 0))}},[I,P]),(0,s.useEffect)(()=>M(t.container),[t.container]),(0,s.useEffect)(()=>()=>{T&&(T.destroy(),O(void 0))},[T]),(0,s.useEffect)(()=>{u&&T&&T.focus()},[u,T]),(0,s.useEffect)(()=>{T&&T.dispatch({effects:o.Py.reconfigure.of(N)})},[f,c,d,p,m,g,v,y,x,b,w,k,S,i,h]),(0,s.useEffect)(()=>{if(void 0!==e){var t=T?T.state.doc.toString():"";T&&e!==t&&T.dispatch({changes:{from:0,to:t.length,insert:e||""},annotations:[K.of(!0)]})}},[e,T]),{state:P,setState:D,view:T,setView:O,container:I,setContainer:M}}({container:D.current,root:T,value:a,autoFocus:m,theme:g,height:v,minHeight:y,maxHeight:x,width:b,minWidth:w,maxWidth:k,basicSetup:S,placeholder:A,indentWithTab:C,editable:I,readOnly:M,selection:h,onChange:u,onStatistics:f,onCreateEditor:d,onUpdate:p,extensions:c,initialState:O});if((0,s.useImperativeHandle)(e,()=>({editor:D.current,state:E,view:N}),[D,B,E,N]),"string"!=typeof a)throw Error("value must be typeof string but got "+typeof a);var R="string"==typeof g?"cm-theme-"+g:"cm-theme";return(0,Y.jsx)("div",(0,i.Z)({ref:D,className:""+R+(n?" "+n:"")},P))});tt.displayName="CodeMirror";var te=tt},17561:function(t,e,n){n.d(e,{B1:function(){return tC},GA:function(){return tx},Gn:function(){return tl},Mb:function(){return a},TK:function(){return o},eC:function(){return h},vQ:function(){return td},ys:function(){return tA}});var i=n(8693),r=n(64451),s=n(83982);class o{constructor(t,e,n,i){this.state=t,this.pos=e,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=(0,s.qz)(this.state).resolveInner(this.pos,-1);for(;e&&0>t.indexOf(e.name);)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),n=Math.max(e.from,this.pos-250),i=e.text.slice(n-e.from,this.pos-e.from),r=i.search(f(t,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,n){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function l(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function a(t){let e=t.map(t=>"string"==typeof t?{label:t}:t),[n,i]=e.every(t=>/^\w+$/.test(t.label))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let t=1;t<i.length;t++)n[i[t]]=!0}let i=l(e)+l(n)+"*$";return[RegExp("^"+i),new RegExp(i)]}(e);return t=>{let r=t.matchBefore(i);return r||t.explicit?{from:r?r.from:t.pos,options:e,validFor:n}:null}}function h(t,e){return n=>{for(let e=(0,s.qz)(n.state).resolveInner(n.pos,-1);e;e=e.parent){if(t.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return e(n)}}class c{constructor(t,e,n,i){this.completion=t,this.source=e,this.match=n,this.score=i}}function u(t){return t.selection.main.from}function f(t,e){var n;let{source:i}=t,r=e&&"^"!=i[0],s="$"!=i[i.length-1];return r||s?RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,null!==(n=t.flags)&&void 0!==n?n:t.ignoreCase?"i":""):t}let d=i.q6.define(),p=new WeakMap;function m(t){if(!Array.isArray(t))return t;let e=p.get(t);return e||p.set(t,e=a(t)),e}let g=i.Py.define(),v=i.Py.define();class y{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let n=(0,i.gm)(t,e),r=(0,i.nZ)(n);this.chars.push(n);let s=t.slice(e,e+r),o=s.toUpperCase();this.folded.push((0,i.gm)(o==s?s.toLowerCase():o,0)),e+=r}
1this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(0==this.pattern.length)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:n,any:r,precise:s,byWord:o}=this;if(1==e.length){let r=(0,i.gm)(t,0),s=(0,i.nZ)(r),o=s==t.length?0:-100;if(r==e[0]);else{if(r!=n[0])return null;o+=-200}return this.ret(o,[0,s])}let l=t.indexOf(this.pattern);if(0==l)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=e.length,h=0;if(l<0){for(let s=0,o=Math.min(t.length,200);s<o&&h<a;){let o=(0,i.gm)(t,s);(o==e[h]||o==n[h])&&(r[h++]=s),s+=(0,i.nZ)(o)}if(h<a)return null}let c=0,u=0,f=!1,d=0,p=-1,m=-1,g=/[a-z]/.test(t),v=!0;for(let r=0,h=Math.min(t.length,200),y=0;r<h&&u<a;){let h=(0,i.gm)(t,r);l<0&&(c<a&&h==e[c]&&(s[c++]=r),d<a&&(h==e[d]||h==n[d]?(0==d&&(p=r),m=r+1,d++):d=0));let x,b=h<255?h>=48&&h<=57||h>=97&&h<=122?2:h>=65&&h<=90?1:0:(x=(0,i.bg)(h))!=x.toLowerCase()?1:x!=x.toUpperCase()?2:0;(!r||1==b&&g||0==y&&0!=b)&&(e[u]==h||n[u]==h&&(f=!0)?o[u++]=r:o.length&&(v=!1)),y=b,r+=(0,i.nZ)(h)}return u==a&&0==o[0]&&v?this.result(-100+(f?-200:0),o,t):d==a&&0==p?this.ret(-200-t.length+(m==t.length?0:-100),[0,m]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):d==a?this.ret(-900-t.length,[p,m]):u==a?this.result(-100+(f?-200:0)+-700+(v?0:-1100),o,t):2==e.length?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,e,n){let r=[],s=0;for(let t of e){let e=t+(this.astral?(0,i.nZ)((0,i.gm)(n,t)):1);s&&r[s-1]==t?r[s-1]=e:(r[s++]=t,r[s++]=e)}return this.ret(t-n.length,r)}}class x{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),n=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,e.length],this.score=n+(t.length==this.pattern.length?0:-100),this)}}let b=i.r$.define({combine:t=>(0,i.BO)(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:k,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>n=>w(t(n),e(n)),optionClass:(t,e)=>n=>w(t(n),e(n)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function w(t,e){return t?e?t+" "+e:t:e}function k(t,e,n,i,s,o){let l=t.textDirection==r.Nm.RTL,a=l,h=!1,c="top",u,f,d=e.left-s.left,p=s.right-e.right,m=i.right-i.left,g=i.bottom-i.top;if(a&&d<Math.min(m,p)?a=!1:!a&&p<Math.min(m,d)&&(a=!0),m<=(a?d:p))u=Math.max(s.top,Math.min(n.top,s.bottom-g))-e.top,f=Math.min(400,a?d:p);else{h=!0,f=Math.min(400,(l?e.right:s.right-e.left)-30);let t=s.bottom-e.bottom;t>=g||t>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let v=(e.bottom-e.top)/o.offsetHeight,y=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(h?l?"left-narrow":"right-narrow":a?"left":"right")}}function S(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/n);return{from:t*n,to:(t+1)*n}
vendor: 3,328 bytes, line 1
1}let i=Math.floor((t-e)/n);return{from:t-(i+1)*n,to:t-i*n}}class A{constructor(t,e,n){let i;this.view=t,this.stateField=e,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let r=t.state.field(e),{options:s,selected:o}=r.open,l=t.state.facet(b);this.optionContent=(i=l.addToOptions.slice(),l.icons&&i.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map(t=>"cm-completionIcon-"+t)),e.setAttribute("aria-hidden","true"),e},position:20}),i.push({render(t,e,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let s=t.displayLabel||t.label,o=0;for(let t=0;t<i.length;){let e=i[t++],n=i[t++];e>o&&r.appendChild(document.createTextNode(s.slice(o,e)));let l=r.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(s.slice(e,n))),l.className="cm-completionMatchedText",o=n}return o<s.length&&r.appendChild(document.createTextNode(s.slice(o))),r},position:50},{render(t){if(!t.detail)return null;let e=document.createElement("span");return e.className="cm-completionDetail",e.textContent=t.detail,e},position:80}),i.sort((t,e)=>t.position-e.position).map(t=>t.render)),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=S(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=t.state.field(e).open;for(let e=n.target,r;e&&e!=this.dom;e=e.parentNode)if("LI"==e.nodeName&&(r=/-(\d+)$/.exec(e.id))&&+r[1]<i.length){this.applyCompletion(t,i[+r[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",e=>{let n=t.state.field(this.stateField,!1);n&&n.tooltip&&t.state.facet(b).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:v.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let n=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),n!=i){let{options:r,selected:s,disabled:o}=n.open;i.open&&i.open.options==r||(this.range=S(r.length,s,t.state.facet(b).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),o!=(null===(e=i.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=S(e.options.length,e.selected,this.view.state.facet(b).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();
1let{completion:n}=e.options[e.selected],{info:i}=n;if(!i)return;let s="string"==typeof i?document.createTextNode(i):i(n);if(!s)return;"then"in s?s.then(e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,n)}).catch(t=>(0,r.OO)(this.view.state,t,"completion info")):this.addInfoPane(s,n)}}addInfoPane(t,e){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=t.nodeType)n.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:i}=t;n.appendChild(e),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){var e,n;let i,r,s,o=null;for(let e=this.list.firstChild,n=this.range.from;e;e=e.nextSibling,n++)"LI"==e.nodeName&&e.id?n==t?e.hasAttribute("aria-selected")||(e.setAttribute("aria-selected","true"),o=e):e.hasAttribute("aria-selected")&&e.removeAttribute("aria-selected"):n--;return o&&(e=this.list,n=o,i=e.getBoundingClientRect(),r=n.getBoundingClientRect(),s=i.height/e.offsetHeight,r.top<i.top?e.scrollTop-=(i.top-r.top)/s:r.bottom>i.bottom&&(e.scrollTop+=(r.bottom-i.bottom)/s)),o}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),r=this.space;if(!r){let t=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:t.innerWidth,bottom:t.innerHeight}}return i.top>Math.min(r.bottom,e.bottom)-10||i.bottom<Math.max(r.top,e.top)+10?null:this.view.state.facet(b).positionInfo(this.view,e,i,n,r,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,n){let i=document.createElement("ul");i.id=e,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let r=null;for(let s=n.from;s<n.to;s++){let{completion:o,match:l}=t[s],{section:a}=o;if(a){let t="string"==typeof a?a:a.name;t!=r&&(s>n.from||0==n.from)&&(r=t,"string"!=typeof a&&a.header?i.appendChild(a.header(a)):i.appendChild(document.createElement("completion-section")).textContent=t)}let h=i.appendChild(document.createElement("li"));h.id=e+"-"+s,h.setAttribute("role","option");let c=this.optionClass(o);for(let t of(c&&(h.className=c),this.optionContent)){let e=t(o,this.view.state,this.view,l);e&&h.appendChild(e)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function C(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class I{constructor(t,e,n,i,r,s){this.options=t,this.attrs=e,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=s}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new I(this.options,P(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,n,i,r,s){if(i&&!s&&t.some(t=>1==t.state))return i.setDisabled();let o=function(t,e){let n=[],i=null,r=t=>{n.push(t);let{section:e}=t.completion;if(e){i||(i=[]);let t="string"==typeof e?e:e.name;i.some(e=>e.name==t)||i.push("string"==typeof e?{name:t}:e)}},s=e.facet(b);for(let i of t)if(i.hasResult()){let t=i.result.getMatch;if(!1===i.result.filter)for(let e of i.result.options)r(new c(e,i.source,t?t(e):[],1e9-n.length));else{let n=e.sliceDoc(i.from,i.to),o,l=s.filterStrict?new x(n):new y(n);for(let e of i.result.options)if(o=l.match(e.label)){let n=e.displayLabel?t?t(e,o.matched):[]:o.matched;r(new c(e,i.source,n,o.score+(e.boost||0)))}}}if(i){let t=Object.create(null),e=0;for(let n of i.sort((t,e)=>{var n,i;return(null!==(n=t.rank)&&void 0!==n?n:1e9)-(null!==(i=e.rank)&&void 0!==i?i:1e9)||(t.name<e.name?-1:1)}))e-=1e5,t[n.name]=e;for(let e of n){let{section:n}=e.completion;n&&(e.score+=t["string"==typeof n?n:n.name])}}let o=[],l=null,a=s.compareCompletions;for(let t of n.sort((t,e)=>e.score-t.score||a(t.completion,e.completion))){let e=t.completion;l&&l.label==e.label&&l.detail==e.detail&&(null==l.type||null==e.type||l.type==e.type)&&l.apply==e.apply&&l.boost==e.boost?C(t.completion)>C(l)&&(o[o.length-1]=t):o.push(t),l=t.completion}return o}(t,e);if(!o.length)return i&&t.some(t=>1==t.state)?i.setDisabled():null;let l=e.facet(b).selectOnOpen?0:-1;if(i&&i.selected!=l&&-1!=i.selected){let t=i.options[i.selected].completion;for(let e=0;e<o.length;e++)if(o[e].completion==t){l=e;break}}return new I(o,P(n,l),{pos:t.reduce((t,e)=>e.hasResult()?Math.min(t,e.from):t,1e8),create:F,above:r.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(t){return new I(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new I(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class M{constructor(t,e,n){this.active=t,this.id=e,this.open=n}static start(){return new M(D,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,n=e.facet(b),i=(n.override||e.languageDataAt("autocomplete",u(e)).map(m)).map(e=>(this.active.find(t=>t.source==e)||new N(e,this.active.some(t=>0!=t.state)?1:0)).update(t,n));i.length==this.active.length&&i.every((t,e)=>t==this.active[e])&&(i=this.active);let r=this.open,s=t.effects.some(t=>t.is(R));for(let o of(r&&t.docChanged&&(r=r.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!function(t,e){if(t==e)return!0;for(let n=0,i=0;;){for(;n<t.length&&!t[n].hasResult;)n++;for(;i<e.length&&!e[i].hasResult;)i++;let r=n==t.length,s=i==e.length;if(r||s)return r==s;if(t[n++].result!=e[i++].result)return!1}}(i,this.active)||s?r=I.build(i,e,this.id,r,n,s):r&&r.disabled&&!i.some(t=>1==t.state)&&(r=null),!r&&i.every(t=>1!=t.state)&&i.some(t=>t.hasResult())&&(i=i.map(t=>t.hasResult()?new N(t.source,0):t)),t.effects))o.is(L)&&(r=r&&r.setSelected(o.value,this.id));return i==this.active&&r==this.open?this:new M(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?T:O}}let T={"aria-autocomplete":"list"},O={};function P(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}let D=[];function E(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(d);if(n&&e.activateOnCompletion(n))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class N{constructor(t,e,n=-1){this.source=t,this.state=e,this.explicitPos=n}hasResult(){return!1}update(t,e){let n=E(t,e),i=this;for(let e of((8&n||16&n&&this.touches(t))&&(i=new N(i.source,0)),4&n&&0==i.state&&(i=new N(this.source,1)),i=i.updateFor(t,n),t.effects))if(e.is(g))i=new N(i.source,1,e.value?u(t.state):-1);else if(e.is(v))i=new N(i.source,0);else if(e.is(R))for(let t of e.value)t.source==i.source&&(i=t);return i}updateFor(t,e){return this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new N(this.source,this.state,t.mapPos(this.explicitPos))}touches(t){return t.changes.touchesRange(u(t.state))}}class B extends N{constructor(t,e,n,i,r){super(t,2,e),this.result=n,this.from=i,this.to=r}hasResult(){return!0}updateFor(t,e){var n;if(!(3&e))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let r=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),l=u(t.state);if((this.explicitPos<0?l<=r:l<this.from)||l>s||!i||2&e&&u(t.startState)==this.from)return new N(this.source,4&e?1:0);let a=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos);return!function(t,e,n,i){if(!t)return!1;let r=e.sliceDoc(n,i);return"function"==typeof t?t(r,n,i,e):f(t,!0).test(r)}(i.validFor,t.state,r,s)?i.update&&(i=i.update(i,r,s,new o(t.state,l,a>=0)))?new B(this.source,a,i,i.from,null!==(n=i.to)&&void 0!==n?n:u(t.state)):new N(this.source,1,a):new B(this.source,a,i,r,s)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new B(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new N(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}let R=i.Py.define({map:(t,e)=>t.map(t=>t.map(e))}),L=i.Py.define(),J=i.QQ.define({create:()=>M.start(),update:(t,e)=>t.update(e),provide:t=>[r.hJ.from(t,t=>t.tooltip),r.tk.contentAttributes.from(t,t=>t.attrs)]});function j(t,e){let n=e.completion.apply||e.completion.label,r=t.state.field(J).active.find(t=>t.source==e.source);return r instanceof B&&("string"==typeof n?t.dispatch(Object.assign(Object.assign({},function(t,e,n,r){let{main:s}=t.selection,o=n-s.from,l=r-s.from;return Object.assign(Object.assign({},t.changeByRange(a=>{if(a!=s&&n!=r&&t.sliceDoc(a.from+o,a.from+l)!=t.sliceDoc(n,r))return{range:a};let h=t.toText(e);return{changes:{from:a.from+o,to:r==s.from?a.to:a.from+l,insert:h},range:i.jT.cursor(a.from+o+h.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}(t.state,n,r.from,r.to)),{annotations:d.of(e.completion)})):n(t,e.completion,r.from,r.to),!0)}let F=t=>new A(t,J,j);function q(t,e="option"){return n=>{let i=n.state.field(J,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(b).interactionDelay)return!1;let s=1,o;"page"==e&&(o=(0,r.gB)(n,i.open.tooltip))&&(s=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:l}=i.open.options,a=i.open.selected>-1?i.open.selected+s*(t?1:-1):t?0:l-1;return a<0?a="page"==e?0:l-1:a>=l&&(a="page"==e?l-1:0),n.dispatch({effects:L.of(a)}),!0}}let $=t=>!!t.state.field(J,!1)&&(t.dispatch({effects:g.of(!0)}),!0);class _{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}let W=r.lg.fromClass(class{constructor(t){for(let e of(this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,t.state.field(J).active))1==e.state&&this.startQuery(e)}update(t){let e=t.state.field(J),n=t.state.facet(b);if(!t.selectionSet&&!t.docChanged&&t.startState.field(J)==e)return;let i=t.transactions.some(t=>{let e=E(t,n);return 8&e||(t.selection||t.docChanged)&&!(3&e)});for(let e=0;e<this.running.length;e++){let n=this.running[e];if(i||n.context.abortOnDocChange&&t.docChanged||n.updates.length+t.transactions.length>50&&Date.now()-n.time>1e3){for(let t of n.context.abortListeners)try{t()}catch(t){(0,r.OO)(this.view.state,t)}n.context.abortListeners=null,this.running.splice(e--,1)}else n.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(t=>t.effects.some(t=>t.is(g)))&&(this.pendingStart=!0);let s=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(t=>1==t.state&&!this.running.some(e=>e.active.source==t.source))?setTimeout(()=>
1this.startUpdate(),s):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(J);for(let t of e.active)1!=t.state||this.running.some(e=>e.active.source==t.source)||this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(b).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=u(e),i=new o(e,n,t.explicitPos==n,this.view),s=new _(t,i);this.running.push(s),Promise.resolve(t.source(i)).then(t=>{s.context.aborted||(s.done=t||null,this.scheduleAccept())},t=>{this.view.dispatch({effects:v.of(null)}),(0,r.OO)(this.view.state,t)})}scheduleAccept(){this.running.every(t=>void 0!==t.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(b).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(b),i=this.view.state.field(J);for(let r=0;r<this.running.length;r++){let s=this.running[r];if(void 0===s.done)continue;if(this.running.splice(r--,1),s.done){let i=new B(s.active.source,s.active.explicitPos,s.done,s.done.from,null!==(t=s.done.to)&&void 0!==t?t:u(s.updates.length?s.updates[0].startState:this.view.state));for(let t of s.updates)i=i.update(t,n);if(i.hasResult()){e.push(i);continue}}let o=i.active.find(t=>t.source==s.active.source);if(o&&1==o.state){if(null==s.done){let t=new N(s.active.source,0);for(let e of s.updates)t=t.update(e,n);1!=t.state&&e.push(t)}else this.startQuery(o)}}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:R.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(J,!1);if(e&&e.tooltip&&this.view.state.facet(b).closeOnBlur){let n=e.open&&(0,r.gB)(this.view,e.open.tooltip);n&&n.dom.contains(t.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:v.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:g.of(!1)}),20),this.composing=0}}}),z="object"==typeof navigator&&/Win/.test(navigator.platform),U=i.Wl.highest(r.tk.domEventHandlers({keydown(t,e){let n=e.state.field(J,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(z&&t.altKey)||t.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(t=>t.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&j(e,i),!1}})),V=r.tk.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:'"\xb7\xb7\xb7"',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:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'âª'"}},".cm-completionIcon-property":{"&:after":{content:"'â¡'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11ï¸'"}},".cm-completionIcon-namespace":{"&:after":{content:"'â¢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Z{constructor(t,e,n,i){this.field=t,this.line=e,this.from=n,this.to=i}}class H{constructor(t,e,n){this.field=t,this.from=e,this.to=n}map(t){let e=t.mapPos(this.from,-1,i.gc.TrackDel),n=t.mapPos(this.to,1,i.gc.TrackDel);
1return null==e||null==n?null:new H(this.field,e,n)}}class Q{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let n=[],i=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let r of this.lines){if(n.length){let n=o,l=/^\t*/.exec(r)[0].length;for(let e=0;e<l;e++)n+=t.facet(s.c);i.push(e+n.length-l),r=n+r.slice(l)}n.push(r),e+=r.length+1}return{text:n,ranges:this.fieldPositions.map(t=>new H(t.field,i[t.line]+t.from,i[t.line]+t.to))}}static parse(t){let e=[],n=[],i=[],r;for(let s of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(s);){let t=r[1]?+r[1]:null,o=r[2]||r[3]||"",l=-1,a=o.replace(/\\[{}]/g,t=>t[1]);for(let n=0;n<e.length;n++)(null!=t?e[n].seq==t:a&&e[n].name==a)&&(l=n);if(l<0){let n=0;for(;n<e.length&&(null==t||null!=e[n].seq&&e[n].seq<t);)n++;for(let r of(e.splice(n,0,{seq:t,name:a}),l=n,i))r.field>=l&&r.field++}i.push(new Z(l,n.length,r.index,r.index+a.length)),s=s.slice(0,r.index)+o+s.slice(r.index+r[0].length)}s=s.replace(/\\([{}])/g,(t,e,r)=>{for(let t of i)t.line==n.length&&t.from>r&&(t.from--,t.to--);return e}),n.push(s)}return new Q(n,i)}}let K=r.p.widget({widget:new class extends r.l9{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),G=r.p.mark({class:"cm-snippetField"});class Y{constructor(t,e){this.ranges=t,this.active=e,this.deco=r.p.set(t.map(t=>(t.from==t.to?K:G).range(t.from,t.to)))}map(t){let e=[];for(let n of this.ranges){let i=n.map(t);if(!i)return null;e.push(i)}return new Y(e,this.active)}selectionInsideField(t){return t.ranges.every(t=>this.ranges.some(e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))}}let X=i.Py.define({map:(t,e)=>t&&t.map(e)}),tt=i.Py.define(),te=i.QQ.define({create:()=>null,update(t,e){for(let n of e.effects){if(n.is(X))return n.value;if(n.is(tt)&&t)return new Y(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>r.tk.decorations.from(t,t=>t?t.deco:r.p.none)});function tn(t,e){return i.jT.create(t.filter(t=>t.field==e).map(t=>i.jT.range(t.from,t.to)))}function ti(t){return({state:e,dispatch:n})=>{let i=e.field(te,!1);if(!i||t<0&&0==i.active)return!1;let r=i.active+t,s=t>0&&!i.ranges.some(e=>e.field==r+t);return n(e.update({selection:tn(i.ranges,r),effects:X.of(s?null:new Y(i.ranges,r)),scrollIntoView:!0})),!0}}let tr=[{key:"Tab",run:ti(1),shift:ti(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(te,!1)&&(e(t.update({effects:X.of(null)})),!0)}],ts=i.r$.define({combine:t=>t.length?t[0]:tr}),to=i.Wl.highest(r.$f.compute([ts],t=>t.facet(ts)));function tl(t,e){let n;return Object.assign(Object.assign({},e),{apply:(n=Q.parse(t),(t,e,r,s)=>{let{text:o,ranges:l}=n.instantiate(t.state,r),a={changes:{from:r,to:s,insert:i.xv.of(o)},scrollIntoView:!0,annotations:e?[d.of(e),i.YW.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=tn(l,0)),l.some(t=>t.field>0)){let e=new Y(l,0),n=a.effects=[X.of(e)];void 0===t.state.field(te,!1)&&n.push(i.Py.appendConfig.of([te,to,ta,V]))}t.dispatch(t.state.update(a))})})}let ta=r.tk.domEventHandlers({mousedown(t,e){let n=e.state.field(te,!1),i;if(!n||null==(i=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let r=n.ranges.find(t=>t.from<=i&&t.to>=i);return!!r&&r.field!=n.active&&(e.dispatch({selection:tn(n.ranges,r.field),effects:X.of(n.ranges.some(t=>t.field>r.field)?new Y(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),th={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},tc=i.Py.define({map(t,e){let n=e.mapPos(t,-1,i.gc.TrackAfter);return null==n?void 0:n}}),tu=new class extends i.uU{};tu.startSide=1,tu.endSide=-1;let tf=i.QQ.define({create:()=>i.Xs.empty,update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=n.from&&t<=n.to})}for(let n of e.effects)n.is(tc)&&(t=t.update({add:[tu.range(n.value,n.value+1)]}));return t}});function td(){return[ty,tf]}let tp="()[]{}<>";function tm(t){for(let e=0;e<tp.length;e+=2)if(tp.charCodeAt(e)==t)return tp.charAt(e+1);return(0,i.bg)(t<128?t:t+1)}function tg(t,e){return t.languageDataAt("closeBrackets",e)[0]||th}let tv="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),t
1y=r.tk.inputHandler.of((t,e,n,r)=>{if((tv?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let o=t.state.selection.main;if(r.length>2||2==r.length&&1==(0,i.nZ)((0,i.gm)(r,0))||e!=o.from||n!=o.to)return!1;let l=function(t,e){let n=tg(t,t.selection.main.head),r=n.brackets||th.brackets;for(let o of r){let l=tm((0,i.gm)(o,0));if(e==o)return l==o?function(t,e,n,r){let o=r.stringPrefixes||th.stringPrefixes,l=null,a=t.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:e,from:r.to}],effects:tc.of(r.to+e.length),range:i.jT.range(r.anchor+e.length,r.head+e.length)};let a=r.head,h=tw(t.doc,a),c;if(h==e){if(tk(t,a))return{changes:{insert:e+e,from:a},effects:tc.of(a+e.length),range:i.jT.cursor(a+e.length)};if(tb(t,a)){let r=n&&t.sliceDoc(a,a+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+r.length,insert:r},range:i.jT.cursor(a+r.length)}}}else if(n&&t.sliceDoc(a-2*e.length,a)==e+e&&(c=tS(t,a-2*e.length,o))>-1&&tk(t,c))return{changes:{insert:e+e+e+e,from:a},effects:tc.of(a+e.length),range:i.jT.cursor(a+e.length)};else if(t.charCategorizer(a)(h)!=i.D0.Word&&tS(t,a,o)>-1&&!function(t,e,n,i){let r=(0,s.qz)(t).resolveInner(e,-1),o=i.reduce((t,e)=>Math.max(t,e.length),0);for(let s=0;s<5;s++){let s=t.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),l=s.indexOf(n);if(!l||l>-1&&i.indexOf(s.slice(0,l))>-1){let e=r.firstChild;for(;e&&e.from==r.from&&e.to-e.from>n.length+l;){if(t.sliceDoc(e.to-n.length,e.to)==n)return!1;e=e.firstChild}return!0}let a=r.to==e&&r.parent;if(!a)break;r=a}return!1}(t,a,e,o))return{changes:{insert:e+e,from:a},effects:tc.of(a+e.length),range:i.jT.cursor(a+e.length)};return{range:l=r}});return l?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(t,o,r.indexOf(o+o+o)>-1,n):function(t,e,n,r){let s=null,o=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:tc.of(o.to+e.length),range:i.jT.range(o.anchor+e.length,o.head+e.length)};let l=tw(t.doc,o.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:o.head},effects:tc.of(o.head+e.length),range:i.jT.cursor(o.head+e.length)}:{range:s=o}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(t,o,l,n.before||th.before);if(e==l&&tb(t,t.selection.main.from))return function(t,e,n){let r=null,s=t.changeByRange(e=>e.empty&&tw(t.doc,e.head)==n?{changes:{from:e.head,to:e.head+n.length,insert:n},range:i.jT.cursor(e.head+n.length)}:r={range:e});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(t,0,l)}return null}(t.state,r);return!!l&&(t.dispatch(l),!0)}),tx=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=tg(t,t.selection.main.head).brackets||th.brackets,r=null,s=t.changeByRange(e=>{if(e.empty){var s,o;let r;let l=(s=t.doc,o=e.head,r=s.sliceString(o-2,o),(0,i.nZ)((0,i.gm)(r,0))==r.length?r:r.slice(1));for(let r of n)if(r==l&&tw(t.doc,e.head)==tm((0,i.gm)(r,0)))return{changes:{from:e.head-r.length,to:e.head+r.length},range:i.jT.cursor(e.head-r.length)}}return{range:r=e}});return r||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function tb(t,e){let n=!1;return t.field(tf).between(0,t.doc.length,t=>{t==e&&(n=!0)}),n}function tw(t,e){let n=t.sliceString(e,e+2);return n.slice(0,(0,i.nZ)((0,i.gm)(n,0)))}function tk(t,e){let n=(0,s.qz)(t).resolveInner(e+1);return n.parent&&n.from==e}function tS(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=i.D0.Word)return e;for(let s of n){let n=e-s.length;if(t.sliceDoc(n,e)==s&&r(t.sliceDoc(n-1,n))!=i.D0.Word)return n}return -1}function tA(t={}){return[U,J,b.of(t),W,tI,V]}let tC=[{key:"Ctrl-Space",run:$},{mac:"Alt-`",run:$},{key:"Escape",run:t=>{let e=t.state.field(J,!1);return!!(e&&e.active.some(t=>0!=t.state))&&(t.dispatch({effects:v.of(null)}),!0)}},{key:"ArrowDown",run:q(!0)},{key:"ArrowUp",run:q(!1)},{key:"PageDown",run:q(!0,"page")},{key:"PageUp",run:q(!1,"page")},{key:"Enter",run:t=>{let e=t.state.field(J,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(b).interactionDelay)&&j(t,e.open.options[e.open.selected])}}],tI=i.Wl.highest(r.$f.computeN([b],t=>t.facet(b).defaultKeymap?[tC]:[]))},67594:function(t,e,n){n.d(e,{f$:function(){return E},m8:function(){return y},oc:function(){return tP},wQ:function(){return tO}});var i=n(8693),r=n(64451),s=n(83982),o=n(73544);function l(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return!!r&&(i(n.update(r)),!0)}}let a=l(function(t,e,n=e.selection.ranges){let i=[],r=-1;for(let{from:t,to:s}of n){let n=i.length,o=1e9,l=u(e,t).line;if(l){for(let n=t;n<=s;){let a=e.doc.lineAt(n);if(a.from>r&&(t==s||s>a.from)){r=a.from;let t=/^\s*/.exec(a.text)[0].length,e=t==a.length,n=a.text.slice(t,t+l.length)==l?t:-1;t<a.text.length&&t<o&&(o=t),i.push({line:a,comment:n,token:l,indent:t,empty:e,single:!1})}n=a.to+1}if(o<1e9)for(let t=n;t<i.length;t++)i[t].indent<i[t].line.text.length&&(i[t].indent=o);i.length==n+1&&(i[n].single=!0)}}if(2!=t&&i.some(t=>t.comment<0&&(!t.empty||t.single))){let t=[];for(let{line:e,token:n,indent:r,empty:s,single:o}of i)(o||!s)&&t.push({from:e.from+r,insert:n+" "});let n=e.changes(t);return{changes:n,selection:e.selection.map(n,1)}}if(1!=t&&i.some(t=>t.comment>=0)){let t=[];for(let{line:e,comment:n,token:r}of i)if(n>=0){let i=e.from+n,s=i+r.length;" "==e.text[s-e.from]&&s++,t.push({from:i,to:s})}return{changes:t}}return null},0),h=l(f,0),c=l((t,e)=>f(t,e,function(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}(e)),0);function u(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}function f(t,e,n=e.selection.ranges){let i=n.map(t=>u(e,t.from).block);if(!i.every(t=>t))return null;let r=n.map((t,n)=>(function(t,{open:e,close:n},i,r){let s,o,l=t.sliceDoc(i-50,i),a=t.sliceDoc(r,r+50),h=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,u=l.length-h;if(l.slice(u-e.length,u)==e&&a.slice(c,c+n.length)==n)return{open:{pos:i-h,margin:h&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?s=o=t.sliceDoc(i,r):(s=t.sliceDoc(i,i+50),o=t.sliceDoc(r-50,r));let f=/^\s*/.exec(s)[0].length,d=/\s*$/.exec(o)[0].length,p=o.length-d-n.length;return s.slice(f,f+e.length)==e&&o.slice(p,p+n.length)==n?{open:{pos:i+f+e.length,margin:/\s/.test(s.charAt(f+e.length))?1:0}
1,close:{pos:r-d-n.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null})(e,i[n],t.from,t.to));if(2!=t&&!r.every(t=>t))return{changes:e.changes(n.map((t,e)=>r[e]?[]:[{from:t.from,insert:i[e].open+" "},{from:t.to,insert:" "+i[e].close}]))};if(1!=t&&r.some(t=>t)){let t=[];for(let e=0,n;e<r.length;e++)if(n=r[e]){let r=i[e],{open:s,close:o}=n;t.push({from:s.pos-r.open.length,to:s.pos+s.margin},{from:o.pos-o.margin,to:o.pos+r.close.length})}return{changes:t}}return null}let d=i.q6.define(),p=i.q6.define(),m=i.r$.define(),g=i.r$.define({combine:t=>(0,i.BO)(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(n,i)=>t(n,i)||e(n,i)})}),v=i.QQ.define({create:()=>D.empty,update(t,e){let n=e.state.facet(g),r=e.annotation(d);if(r){let i=A.fromTransaction(e,r.selection),s=r.side,o=0==s?t.undone:t.done;return o=i?C(o,o.length,n.minDepth,i):T(o,e.startState.selection),new D(0==s?r.rest:o,0==s?o:r.rest)}let s=e.annotation(p);if(("full"==s||"before"==s)&&(t=t.isolate()),!1===e.annotation(i.YW.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let o=A.fromTransaction(e),l=e.annotation(i.YW.time),a=e.annotation(i.YW.userEvent);return o?t=t.addChanges(o,l,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,l,a,n.newGroupDelay)),("full"==s||"after"==s)&&(t=t.isolate()),t},toJSON:t=>({done:t.done.map(t=>t.toJSON()),undone:t.undone.map(t=>t.toJSON())}),fromJSON:t=>new D(t.done.map(A.fromJSON),t.undone.map(A.fromJSON))});function y(t={}){return[v,g.of(t),r.tk.domEventHandlers({beforeinput(t,e){let n="historyUndo"==t.inputType?b:"historyRedo"==t.inputType?w:null;return!!n&&(t.preventDefault(),n(e))}})]}function x(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(v,!1);if(!r)return!1;let s=r.pop(t,n,e);return!!s&&(i(s),!0)}}let b=x(0,!1),w=x(1,!1),k=x(0,!0),S=x(1,!0);class A{constructor(t,e,n,i,r){this.changes=t,this.effects=e,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(t){return new A(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,n;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(t=>t.toJSON())}}static fromJSON(t){return new A(t.changes&&i.as.fromJSON(t.changes),[],t.mapped&&i.n0.fromJSON(t.mapped),t.startSelection&&i.jT.fromJSON(t.startSelection),t.selectionsAfter.map(i.jT.fromJSON))}static fromTransaction(t,e){let n=M;for(let e of t.startState.facet(m)){let i=e(t);i.length&&(n=n.concat(i))}return!n.length&&t.changes.empty?null:new A(t.changes.invert(t.startState.doc),n,void 0,e||t.startState.selection,M)}static selection(t){return new A(void 0,M,void 0,void 0,t)}}function C(t,e,n,i){let r=t.slice(e+1>n+20?e-n-1:0,e);return r.push(i),r}function I(t,e){return t.length?e.length?t.concat(e):t:e}let M=[];function T(t,e){if(!t.length)return[A.selection([e])];{let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),C(t,t.length-1,1e9,n.setSelAfter(i)))}}function O(t,e){if(!t.length)return t;let n=t.length,r=M;for(;n;){let s=function(t,e,n){let r=I(t.selectionsAfter.length?t.selectionsAfter.map(t=>t.map(e)):M,n);if(!t.changes)return A.selection(r);let s=t.changes.map(e),o=e.mapDesc(t.changes,!0),l=t.mapped?t.mapped.composeDesc(o):o;return new A(s,i.Py.mapEffects(t.effects,e),l,t.startSelection.map(o),r)}(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let e=t.slice(0,n);return e[n-1]=s,e}e=s.mapped,n--,r=s.selectionsAfter}return r.length?[A.selection(r)]:M}let P=/^(input\.type|delete)($|\.)/;class D{constructor(t,e,n=0,i){this.done=t,this.undone=e,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new D(this.done,this.undone):this}addChanges(t,e,n,r,s){var o,l;let a,h,c=this.done,u=c[c.length-1];return new D(c=u&&u.changes&&!u.changes.empty&&t.changes&&(!n||P.test(n))&&(!u.selectionsAfter.length&&e-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,(o=u.changes,l=t.changes,a=[],h=!1,o.iterChangedRanges((t,e)=>a.push(t,e)),l.iterChangedRanges((t,e,n,i)=>{for(let t=0;t<a.length;){let e=a[t++],r=a[t++];i>=e&&n<=r&&(h=!0)}}),h))||"input.type.compose"==n)?C(c,c.length-1,r.minDepth,new A(t.changes.compose(u.changes),I(i.Py.mapEffects(t.effects,u.changes),u.effects),u.mapped,u.startSelection,M)):C(c,c.length,r.minDepth,t),M,e,n)}addSelection(t,e,n,i){var r;let s=this.done.length?this.done[this.done.length-1].selectionsAfter:M;return s.length>0&&e-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(r=s[s.length-1]).ranges.length==t.ranges.length&&0===r.ranges.filter((e,n
1)=>e.empty!=t.ranges[n].empty).length?this:new D(T(this.done,t),this.undone,e,n)}addMapping(t){return new D(O(this.done,t),O(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,n){let i=0==t?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],s=r.selectionsAfter[0]||e.selection;if(n&&r.selectionsAfter.length){let n,o;return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:d.of({side:t,rest:(n=i[i.length-1],(o=i.slice())[i.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),o),selection:s}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0})}if(!r.changes)return null;{let n=1==i.length?M:i.slice(0,i.length-1);return r.mapped&&(n=O(n,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:d.of({side:t,rest:n,selection:s}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}}}D.empty=new D(M,M);let E=[{key:"Mod-z",run:b,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:w,preventDefault:!0},{linux:"Ctrl-Shift-z",run:w,preventDefault:!0},{key:"Mod-u",run:k,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:S,preventDefault:!0}];function N(t,e){return i.jT.create(t.ranges.map(e),t.mainIndex)}function B(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function R({state:t,dispatch:e},n){let i=N(t.selection,n);return!i.eq(t.selection,!0)&&(e(B(t,i)),!0)}function L(t,e){return i.jT.cursor(e?t.to:t.from)}function J(t,e){return R(t,n=>n.empty?t.moveByChar(n,e):L(n,e))}function j(t){return t.textDirectionAt(t.state.selection.main.head)==r.Nm.LTR}let F=t=>J(t,!j(t)),q=t=>J(t,j(t));function $(t,e){return R(t,n=>n.empty?t.moveByGroup(n,e):L(n,e))}function _(t,e,n){let r,l,a=(0,s.qz)(t).resolveInner(e.head),h=n?o.md.closedBy:o.md.openedBy;for(let i=e.head;;){let e=n?a.childAfter(i):a.childBefore(i);if(!e)break;!function(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}(t,e,h)?i=n?e.to:e.from:a=e}return l=a.type.prop(h)&&(r=n?(0,s.Um)(t,a.from,1):(0,s.Um)(t,a.to,-1))&&r.matched?n?r.end.to:r.end.from:n?a.to:a.from,i.jT.cursor(l,n?-1:1)}function W(t,e){return R(t,n=>{if(!n.empty)return L(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}"undefined"!=typeof Intl&&Intl.Segmenter;let z=t=>W(t,!1),U=t=>W(t,!0);function V(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,s;if(e){for(let e of t.state.facet(r.tk.scrollMargins)){let r=e(t);(null==r?void 0:r.top)&&(n=Math.max(null==r?void 0:r.top,n)),(null==r?void 0:r.bottom)&&(i=Math.max(null==r?void 0:r.bottom,i))}s=t.scrollDOM.clientHeight-n-i}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function Z(t,e){let n,i=V(t),{state:s}=t,o=N(s.selection,n=>n.empty?t.moveVertically(n,e,i.height):L(n,e));if(o.eq(s.selection))return!1;if(i.selfScroll){let e=t.coordsAtPos(s.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+i.marginTop,h=l.bottom-i.marginBottom;e&&e.top>a&&e.bottom<h&&(n=r.tk.scrollIntoView(o.main.head,{y:"start",yMargin:e.top-a}))}return t.dispatch(B(s,o),{effects:n}),!0}let H=t=>Z(t,!1),Q=t=>Z(t,!0);function K(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let n=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&e.head!=r.from+n&&(s=i.jT.cursor(r.from+n))}return s}function G(t,e){let n=N(t.state.selection,t=>{let n=e(t);return i.jT.range(t.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(t.state.selection)&&(t.dispatch(B(t.state,n)),!0)}function Y(t,e){return G(t,n=>t.moveByChar(n,e))}let X=t=>Y(t,!j(t)),tt=t=>Y(t,j(t));function te(t,e){return G(t,n=>t.moveByGroup(n,e))}function tn(t,e){return G(t,n=>t.moveVertically(n,e))}let ti=t=>tn(t,!1),tr=t=>tn(t,!0);function ts(t,e){return G(t,n=>t.moveVertically(n,e,V(t).height))}let to=t=>ts(t,!1),tl=t=>ts(t,!0),ta=({state:t,dispatch:e})=>(e(B(t,{anchor:0})),!0),th=({state:t,dispatch:e})=>(e(B(t,{anchor:t.doc.length})),!0),tc=({state:t,dispatch:e})=>(e(B(t,{anchor:t.selection.main.anchor,head:0})),!0),tu=({state:t,dispatch:e})=>(e(B(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function tf(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:s}=t,o=s.changeByRange(r=>{let{from:s,to:o}=r;if(s==o){let i=e(r);i<s?(n="delete.backward",i=td(t,i,!1)):i>s&&(n="delete.forward",i=td(t,i,!0)),s=Math.min(s,i),o=Math.max(o,i)}else s=td(t,s,!1),o=td(t,o,!0);return s==o?{range:r}:{changes:{from:s,to:o},range:i.jT.cursor(s,s<r.head?-1:1)}});return!o.changes.empty&&(t.dispatch(s.update(o,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?r.tk.announce.of(s.phrase("Selection deleted")):void 0})),!0)}function td(t,e,n){if(t instanceof r.tk)for(let i of t.state.facet(r.tk.atomicRanges).map(e=>
1e(t)))i.between(e,e,(t,i)=>{t<e&&i>e&&(e=n?i:t)});return e}let tp=(t,e,n)=>tf(t,r=>{let o=r.from,{state:l}=t,a=l.doc.lineAt(o),h,c;if(n&&!e&&o>a.from&&o<a.from+200&&!/[^ \t]/.test(h=a.text.slice(0,o-a.from))){if(" "==h[h.length-1])return o-1;let t=(0,i.IS)(h,l.tabSize)%(0,s.y1)(l)||(0,s.y1)(l);for(let e=0;e<t&&" "==h[h.length-1-e];e++)o--;c=o}else(c=(0,i.cp)(a.text,o-a.from,e,e)+a.from)==o&&a.number!=(e?l.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(c-a.from,o-a.from))&&(c=(0,i.cp)(a.text,c-a.from,!1,!1)+a.from);return c}),tm=t=>tp(t,!1,!0),tg=t=>tp(t,!0,!1),tv=(t,e)=>tf(t,n=>{let r=n.head,{state:s}=t,o=s.doc.lineAt(r),l=s.charCategorizer(r);for(let t=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let a=(0,i.cp)(o.text,r-o.from,e)+o.from,h=o.text.slice(Math.min(r,a)-o.from,Math.max(r,a)-o.from),c=l(h);if(null!=t&&c!=t)break;(" "!=h||r!=n.head)&&(t=c),r=a}return r}),ty=t=>tv(t,!1);function tx(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(i.empty||i.to!=s.from||(s=t.doc.lineAt(i.to-1)),n>=r.number){let t=e[e.length-1];t.to=s.to,t.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function tb(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let e of tx(t)){if(n?e.to==t.doc.length:0==e.from)continue;let o=t.doc.lineAt(n?e.to+1:e.from-1),l=o.length+1;if(n)for(let n of(r.push({from:e.to,to:o.to},{from:e.from,insert:o.text+t.lineBreak}),e.ranges))s.push(i.jT.range(Math.min(t.doc.length,n.anchor+l),Math.min(t.doc.length,n.head+l)));else for(let n of(r.push({from:o.from,to:e.from},{from:e.to,insert:t.lineBreak+o.text}),e.ranges))s.push(i.jT.range(n.anchor-l,n.head-l))}return!!r.length&&(e(t.update({changes:r,scrollIntoView:!0,selection:i.jT.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0)}function tw(t,e,n){if(t.readOnly)return!1;let i=[];for(let e of tx(t))n?i.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):i.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});return e(t.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let tk=tA(!1),tS=tA(!0);function tA(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{let{from:r,to:l}=n,a=e.doc.lineAt(r),h=!t&&r==l&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=(0,s.qz)(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),l;return i&&r&&i.to<=e&&r.from>=e&&(l=i.type.prop(o.md.closedBy))&&l.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}(e,r);t&&(r=l=(l<=a.to?a:e.doc.lineAt(l)).to);let c=new s.Gn(e,{simulateBreak:r,simulateDoubleBreak:!!h}),u=(0,s.K0)(c,r);for(null==u&&(u=(0,i.IS)(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));l<a.to&&/\s/.test(a.text[l-a.from]);)l++;h?{from:r,to:l}=h:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let f=["",(0,s.SS)(e,u)];return h&&f.push((0,s.SS)(e,c.lineIndent(a.from,-1))),{changes:{from:r,to:l,insert:i.xv.of(f)},range:i.jT.cursor(r+1+f[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function tC(t,e){let n=-1;return t.changeByRange(r=>{let s=[];for(let i=r.from;i<=r.to;){let o=t.doc.lineAt(i);o.number>n&&(r.empty||r.to>o.from)&&(e(o,s,r),n=o.number),i=o.to+1}let o=t.changes(s);return{changes:s,range:i.jT.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}let tI=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(tC(t,(e,n)=>{n.push({from:e.from,insert:t.facet(s.c)})}),{userEvent:"input.indent"})),!0),tM=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(tC(t,(e,n)=>{let r=/^\s*/.exec(e.text)[0];if(!r)return;let o=(0,i.IS)(r,t.tabSize),l=0,a=(0,s.SS)(t,Math.max(0,o-(0,s.y1)(t)));for(;l<r.length&&l<a.length&&r.charCodeAt(l)==a.charCodeAt(l);)l++;n.push({from:e.from+l,to:e.from+r.length,insert:a.slice(l)})}),{userEvent:"delete.dedent"})),!0),tT=[{key:"Ctrl-b",run:F,shift:X,preventDefault:!0},{key:"Ctrl-f",run:q,shift:tt},{key:"Ctrl-p",run:z,shift:ti},{key:"Ctrl-n",run:U,shift:tr},{key:"Ctrl-a",run:t=>R(t,e=>i.jT.cursor(t.lineBlockAt(e.head).from,1)),shift:t=>G(t,e=>i.jT.cursor(t.lineBlockAt(e.head).from))},{key:"Ctrl-e",run:t=>R(t,e=>i.jT.cursor(t.lineBlockAt(e.head).to,-1)),shift:t=>G(t,e=>i.jT.cursor(t.lineBlockAt(e.head).to))},{key:"Ctrl-d",run:tg},{key:"Ctrl-h",run:tm},{key:"Ctrl-k",run:t=>tf(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)})},{key:"Ctrl-Alt-h",run:ty},{key:"Ctrl-o",run:({state:t,dispatch:e})=>
1{if(t.readOnly)return!1;let n=t.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:i.xv.of(["",""])},range:i.jT.cursor(t.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let n=e.from,r=t.doc.lineAt(n),s=n==r.from?n-1:(0,i.cp)(r.text,n-r.from,!1)+r.from,o=n==r.to?n+1:(0,i.cp)(r.text,n-r.from,!0)+r.from;return{changes:{from:s,to:o,insert:t.doc.slice(n,o).append(t.doc.slice(s,n))},range:i.jT.cursor(o)}});return!n.changes.empty&&(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Q}],tO=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:t=>R(t,e=>_(t.state,e,!j(t))),shift:t=>G(t,e=>_(t.state,e,!j(t)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>R(t,e=>_(t.state,e,j(t))),shift:t=>G(t,e=>_(t.state,e,j(t)))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>tb(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>tw(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>tb(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>tw(t,e,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=i.jT.create([n.main]):n.main.empty||(r=i.jT.create([i.jT.cursor(n.main.head)])),!!r&&(e(B(t,r)),!0)}},{key:"Mod-Enter",run:tS},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let n=tx(t).map(({from:e,to:n})=>i.jT.range(e,Math.min(n+1,t.doc.length)));return e(t.update({selection:i.jT.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let n=N(t.selection,e=>{let n=(0,s.qz)(t),r=n.resolveStack(e.from,1);if(e.empty){let t=n.resolveStack(e.from,-1);t.node.from>=r.node.from&&t.node.to<=r.node.to&&(r=t)}for(let t=r;t;t=t.next){let{node:n}=t;if((n.from<e.from&&n.to>=e.to||n.to>e.to&&n.from<=e.from)&&t.next)return i.jT.range(n.to,n.from)}return e});return!n.eq(t.selection)&&(e(B(t,n)),!0)},preventDefault:!0},{key:"Mod-[",run:tM},{key:"Mod-]",run:tI},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new s.Gn(t,{overrideIndentation:t=>{let e=n[t];return null==e?-1:e}}),r=tC(t,(e,r,o)=>{let l=(0,s.K0)(i,e.from);if(null==l)return;/\S/.test(e.text)||(l=0);let a=/^\s*/.exec(e.text)[0],h=(0,s.SS)(t,l);(a!=h||o.from<e.from+a.length)&&(n[e.from]=l,r.push({from:e.from,to:e.from+a.length,insert:h}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(tx(e).map(({from:t,to:n})=>(t>0?t--:n<e.doc.length&&n++,{from:t,to:n}))),i=N(e.selection,e=>{let n;if(t.lineWrapping){let i=t.lineBlockAt(e.head),r=t.coordsAtPos(e.head,e.assoc||1);r&&(n=i.bottom+t.documentTop-r.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,n)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>{let n,r;return n=!1,r=N(t.selection,e=>{let r=(0,s.Um)(t,e.head,-1)||(0,s.Um)(t,e.head,1)||e.head>0&&(0,s.Um)(t,e.head-1,1)||e.head<t.doc.length&&(0,s.Um)(t,e.head+1,-1);if(!r||!r.end)return e;n=!0;let o=r.start.from==e.head?r.end.to:r.end.from;return i.jT.cursor(o)}),!!n&&(e(B(t,r)),!0)}},{key:"Mod-/",run:t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=u(t.state,n.from);return i.line?a(t):!!i.block&&c(t)}},{key:"Alt-A",run:h},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:F,shift:X,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>$(t,!j(t)),shift:t=>te(t,!j(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>R(t,e=>K(t,e,!j(t))),shift:t=>G(t,e=>K(t,e,!j(t))),preventDefault:!0},{key:"ArrowRight",run:q,shift:tt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>$(t,j(t)),shift:t=>te(t,j(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>R(t,e=>K(t,e,j(t))),shift:t=>G(t,e=>K(t,e,j(t))),preventDefault:!0},{key:"ArrowUp",run:z,shift:ti,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ta,shift:tc},{mac:"Ctrl-ArrowUp",run:H,shift:to},{key:"ArrowDown",run:U,shift:tr,preventDefault:!0},{mac:"Cmd-ArrowDown",run:th,shift:tu},{mac:"Ctrl-ArrowDown",run:Q,shift:tl},{key:"PageUp",run:H,shift:to},{key:"PageDown",run:Q,shift:tl},{key:"Home",run:t=>R(t,e=>K(t,e,!1)),shift:t=>G(t,e=>K(t,e,!1)),preventDefault:!0},{key:"Mod-Home",run:ta,shift:tc},{key:"End",run:t=>R(t,e=>K(t,e,!0)),shift:t=>G(t,e=>K(t,e,!0)),preventDefault:!0},{key:"Mod-End",run:th,shift:tu},{key:"Enter",run:tk,shift:tk},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:tm,shift:tm},{key:"Delete",run:tg},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ty},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>tv(t,!0)},{mac:"Mod-Backspace",run:t=>tf(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)})},{mac:"Mod-Delete",run:t=>tf(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)})}].concat(tT.map(t=>({mac:t.key,run:t.run,shift:t.shift})))),tP={key:"Tab",run:tI,shift:tM}},83982:function(t,e,n){n.d(e,{Be:function(){return y},Dv:function(){return z},Gn:function(){return E},K0:function(){return D},KC:function(){return u},Qf:function(){return tu},R_:function(){return ty},SQ:function(){return f},SS:function(){return P},Um:function(){return tP},a0:function(){return tM},c:function(){return T},c6:function(){return I},e7:function(){return tt},il:function(){return tR},kU:function(){return c},mi:function(){return th},n$:function(){return tI},nF:function(){return tm},nY:function(){return $},pp:function(){return h},qp:function(){return p},qz:function(){return m},ri:function(){return C},rs:function(){return _},tC:function(){return q},uj:function(){return N},vw:function(){return J},x0:function(){return W},y1:function(){return O},ze:function(){return F}});var i,r=n(73544),s=n(8693),o=n(64451),l=n(38397),a=n(80547);let h=new r.md;function c(t){return s.r$.define({combine:t?e=>e.concat(t):void 0})}let u=new r.md;class f{constructor(t,e,n=[],i=""){this.data=t,this.name=i,s.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(s.yy.prototype,"tree",{get(){return m(this)}}),this.parser=e,this.extension=[A.of(this),s.yy.languageData.of((t,e,n)=>{let i=d(t,e,n),r=i.type.prop(h);if(!r)return[];let s=t.facet(r),o=i.type.prop(u);if(o){let r=i.resolve(e-i.from,n);for(let e of o)if(e.test(r,t)){let n=t.facet(e.facet);return"replace"==e.type?n:n.concat(s)}}return s})].concat(n)}isActiveAt(t,e,n=-1){return d(t,e,n).type.prop(h)==this.data}findRegions(t){let e=t.facet(A);
vendor: 3,310 bytes, line 1
1if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[],i=(t,e)=>{if(t.prop(h)==this.data){n.push({from:e,to:e+t.length});return}let s=t.prop(r.md.mounted);if(s){if(s.tree.prop(h)==this.data){if(s.overlay)for(let t of s.overlay)n.push({from:t.from+e,to:t.to+e});else n.push({from:e,to:e+t.length});return}if(s.overlay){let t=n.length;if(i(s.tree,s.overlay[0].from+e),n.length>t)return}}for(let n=0;n<t.children.length;n++){let s=t.children[n];s instanceof r.mp&&i(s,t.positions[n]+e)}};return i(m(t),0),n}get allowsNesting(){return!0}}function d(t,e,n){let i=t.facet(A),s=m(t).topNode;if(!i||i.allowsNesting)for(let t=s;t;t=t.enter(e,n,r.vj.ExcludeBuffers))t.type.isTop&&(s=t);return s}f.setState=s.Py.define();class p extends f{constructor(t,e,n){super(t,e,[],n),this.parser=e}static define(t){let e=c(t.languageData);return new p(e,t.parser.configure({props:[h.add(t=>t.isTop?e:void 0)]}),t.name)}configure(t,e){return new p(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function m(t){let e=t.field(f.state,!1);return e?e.tree:r.mp.empty}class g{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let n=this.cursorPos-this.string.length;return t<n||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}}let v=null;class y{constructor(t,e,n=[],i,r,s,o,l){this.parser=t,this.state=e,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=s,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,e,n){return new y(t,e,[],r.mp.empty,0,n,[],null)}startParse(){return this.parser.startParse(new g(this.state.doc),this.fragments)}work(t,e){return(null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=r.mp.empty&&this.isDone(null!=e?e:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(r.i9.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=v;v=this;try{return t()}finally{v=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=x(t,e.from,e.to);return t}changes(t,e){let{fragments:n,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let e=[];
vendor: 3,233 bytes, line 1
1if(t.iterChangedRanges((t,n,i,r)=>e.push({fromA:t,toA:n,fromB:i,toB:r})),n=r.i9.applyChanges(n,e),i=r.mp.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length)for(let e of(l=[],this.skipped)){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);n<i&&l.push({from:n,to:i})}}return new y(this.parser,e,n,i,s,o,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:n,to:i}=this.skipped[e];n<t.to&&i>t.from&&(this.fragments=x(this.fragments,n,i),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends r._b{createParse(e,n,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let e=v;if(e){for(let t of i)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new r.mp(r.Jq.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return v}}function x(t,e,n){return r.i9.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class b{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),n=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,n)||e.takeTree(),new b(e)}static init(t){let e=Math.min(3e3,t.doc.length),n=y.create(t.facet(A).parser,t,{from:0,to:e});return n.work(20,e)||n.takeTree(),new b(n)}}f.state=s.QQ.define({create:b.init,update(t,e){for(let t of e.effects)if(t.is(f.setState))return t.value;return e.startState.facet(A)!=e.state.facet(A)?b.init(e.state):t.apply(e)}});let w=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(w=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});let k="undefined"!=typeof navigator&&(null===(i=navigator.scheduling)||void 0===i?void 0:i.isInputPending)?()=>navigator.scheduling.isInputPending():null,S=o.lg.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(f.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(f.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=w(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,r=n.field(f.state);
1if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,t&&!k?Math.max(25,t.timeRemaining()-5):1e9),o=r.context.treeLen<i&&n.doc.length>i+1e3,l=r.context.work(()=>k&&k()||Date.now()>s,i+(o?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:f.setState.of(new b(r.context))})),this.chunkBudget>0&&!(l&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(t=>(0,o.OO)(this.view.state,t)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),A=s.r$.define({combine:t=>t.length?t[0]:null,enables:t=>[f.state,S,o.tk.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class C{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class I{constructor(t,e,n,i,r,s){this.name=t,this.alias=e,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:e,support:n}=t;if(!e){if(!n)throw RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(n)}return new I(t.name,(t.alias||[]).concat(t.name).map(t=>t.toLowerCase()),t.extensions||[],t.filename,e,n)}static matchFilename(t,e){for(let n of t)if(n.filename&&n.filename.test(e))return n;let n=/\.([^.]+)$/.exec(e);if(n){for(let e of t)if(e.extensions.indexOf(n[1])>-1)return e}return null}static matchLanguageName(t,e,n=!0){for(let n of(e=e.toLowerCase(),t))if(n.alias.some(t=>t==e))return n;if(n)for(let n of t)for(let t of n.alias){let i=e.indexOf(t);if(i>-1&&(t.length>2||!/\w/.test(e[i-1])&&!/\w/.test(e[i+t.length])))return n}return null}}let M=s.r$.define(),T=s.r$.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function O(t){let e=t.facet(T);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function P(t,e){let n="",i=t.tabSize,r=t.facet(T)[0];if(" "==r){for(;e>=i;)n+=" ",e-=i;r=" "}for(let t=0;t<e;t++)n+=r;return n}function D(t,e){for(let n of(t instanceof s.yy&&(t=new E(t)),t.state.facet(M))){let i=n(t,e);if(void 0!==i)return i}let n=m(t.state);return n.length>=e?function(t,e,n){let i=e.resolveStack(n),r=i.node.enterUnfinishedNodesBefore(n);if(r!=i.node){let t=[];for(let e=r;e!=i.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)i={node:t[e],next:i}}return B(i,t,n)}(t,n,e):null}class E{constructor(t,e={}){this.state=t,this.options=e,this.unit=O(t)}lineAt(t,e=1){let n=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return null!=i&&i>=n.from&&i<=n.to?r&&i==t?{text:"",from:t}:(e<0?i<t:i<=t)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(t,e);return n.slice(t-i,Math.min(n.length,t+100-i))}column(t,e=1){let{text:n,from:i}=this.lineAt(t,e),r=this.countColumn(n,t-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(r+=s-this.countColumn(n,n.search(/\S|$/))),r}countColumn(t,e=t.length){return(0,s.IS)(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:n,from:i}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let t=r(i);if(t>-1)return t}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let N=new r.md;function B(t,e,n){for(let i=t;i;i=i.next){let t=function(t){let e=t.type.prop(N);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(r.md.closedBy))){let e=t.lastChild,n=e&&i.indexOf(e.name)>-1;return t=>j(t,!0,1,void 0,n&&!(t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak)?e.from:void 0)}return null==t.parent?R:null}(i.node);
1if(t)return t(L.create(e,n,i))}return 0}function R(){return 0}class L extends E{constructor(t,e,n){super(t.state,t.options),this.base=t,this.pos=e,this.context=n}get node(){return this.context.node}static create(t,e,n){return new L(t,e,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let n=t.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}(n,t))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){return B(this.context.next,this.base,this.pos)}}function J({closing:t,align:e=!0,units:n=1}){return i=>j(i,e,n,t)}function j(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==t.pos+o,a=e?function(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=null==r||r<=s.from?s.to:Math.min(s.to,r);for(let t=n.to;;){let r=e.childAfter(t);if(!r||r==i)return null;if(!r.type.isSkipped){if(r.from>=o)return null;let t=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+t}}t=r.to}}(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}let F=t=>t.baseIndent;function q({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}function $(){return s.yy.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:i}=t.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return t;let s=n.sliceString(r.from,i);if(!e.some(t=>t.test(s)))return t;let{state:o}=t,l=-1,a=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==l)continue;l=e.from;let n=D(o,e.from);if(null==n)continue;let i=/^\s*/.exec(e.text)[0],r=P(o,n);i!=r&&a.push({from:e.from,to:e.from+i.length,insert:r})}return a.length?[t,{changes:a,sequential:!0}]:t})}let _=s.r$.define(),W=new r.md;function z(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function U(t,e,n){for(let i of t.facet(_)){let r=i(t,e,n);if(r)return r}return function(t,e,n){let i=m(t);if(i.length<n)return null;let r=i.resolveStack(n,1),s=null;for(let o=r;o;o=o.next){let r=o.node;if(r.to<=n||r.from>n)continue;if(s&&r.from<e)break;let l=r.type.prop(W);if(l&&(r.to<i.length-50||i.length==t.doc.length||!function(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}(r))){let i=l(r,t);i&&i.from<=n&&i.from>=e&&i.to>n&&(s=i)}}return s}(t,e,n)}function V(t,e){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return n>=i?void 0:{from:n,to:i}}let Z=s.Py.define({map:V}),H=s.Py.define({map:V});function Q(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(t=>t.from<=n&&t.to>=n)||e.push(t.lineBlockAt(n));return e}let K=s.QQ.define({create:()=>o.p.none,update(t,e){for(let n of(t=t.map(e.changes),e.effects))if(n.is(Z)&&!function(t,e,n){let i=!1;return t.between(e,e,(t,r)=>{t==e&&r==n&&(i=!0)}),i}(t,n.value.from,n.value.to)){let{preparePlaceholder:i}=e.state.facet(tn),r=i?o.p.replace({widget:new to(i(e.state,n.value))}):ts;t=t.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(H)&&(t=t.update({filter:(t,e)=>n.value.from!=t||n.value.to!=e,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:i}=e.selection.main;t.between(i,i,(t,e)=>{t<i&&e>i&&(n=!0)}),n&&(t=t.update({filterFrom:i,filterTo:i,filter:(t,e)=>e<=i||t>=i}))}return t},provide:t=>o.tk.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(t,e)=>{n.push(t,e)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let i=t[n++],r=t[n++];if("number"!=typeof i||"number"!=typeof r)throw RangeError("Invalid JSON for fold state");e.push(ts.range(i,r))}return o.p.set(e,!0)}});function G(t,e,n){var i;let r=null;return null===(i=t.field(K,!1))||void 0===i||i.between(e,n,(t,e)=>{(!r||r.from>t)&&(r={from:t,to:e})}),r}function Y(t,e){return t.field(K,!1)?e:e.concat(s.Py.appendConfig.of(ti()))}function X(t,e,n=!0){let i=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return o.tk.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${r}.`)}let tt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of Q(t)){let n=U(t.state,e.from,e.to);if(n)return t.dispatch({effects:Y(t.state,[Z.of(n),X(t,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(K,!1))return!1;let e=[];for(let n of Q(t)){let i=G(t.state,n.from,n.to);i&&e.push(H.of(i),X(t,i,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,n=[];for(let i=0;i<e.doc.length;){let r=t.lineBlockAt(i),s=U(e,r.from,r.to);s&&n.push(Z.of(s)),i=(s?t.lineBlockAt(s.to):r).to+1}return n.length&&t.dispatch({effects:Y(t.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:t=>{let e=t.state.field(K,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(t,e)=>{n.push(H.of({from:t,to:e}))}
1),t.dispatch({effects:n}),!0}}],te={placeholderDOM:null,preparePlaceholder:null,placeholderText:"â¦"},tn=s.r$.define({combine:t=>(0,s.BO)(t,te)});function ti(t){let e=[K,tc];return t&&e.push(tn.of(t)),e}function tr(t,e){let{state:n}=t,i=n.facet(tn),r=e=>{let n=t.lineBlockAt(t.posAtDOM(e.target)),i=G(t.state,n.from,n.to);i&&t.dispatch({effects:H.of(i)}),e.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}let ts=o.p.replace({widget:new class extends o.l9{toDOM(t){return tr(t,null)}}});class to extends o.l9{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return tr(t,this.value)}}let tl={openText:"â",closedText:"âº",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ta extends o.SJ{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function th(t={}){let e=Object.assign(Object.assign({},tl),t),n=new ta(e,!0),i=new ta(e,!1),r=o.lg.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(A)!=t.state.facet(A)||t.startState.field(K,!1)!=t.state.field(K,!1)||m(t.startState)!=m(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new s.f_;for(let r of t.viewportLineBlocks){let s=G(t.state,r.from,r.to)?i:U(t.state,r.from,r.to)?n:null;s&&e.add(r.from,r.from,s)}return e.finish()}}),{domEventHandlers:l}=e;return[r,(0,o.v5)({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(r))||void 0===e?void 0:e.markers)||s.Xs.empty},initialSpacer:()=>new ta(e,!1),domEventHandlers:Object.assign(Object.assign({},l),{click:(t,e,n)=>{if(l.click&&l.click(t,e,n))return!0;let i=G(t.state,e.from,e.to);if(i)return t.dispatch({effects:H.of(i)}),!0;let r=U(t.state,e.from,e.to);return!!r&&(t.dispatch({effects:Z.of(r)}),!0)}})}),ti()]}let tc=o.tk.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class tu{constructor(t,e){let n;function i(t){let e=a.V.newName();return(n||(n=Object.create(null)))["."+e]=t,e}this.specs=t;let r="string"==typeof e.all?e.all:e.all?i(e.all):void 0,s=e.scope;this.scope=s instanceof f?t=>t.prop(h)==s.data:s?t=>t==s:void 0,this.style=(0,l.QR)(t.map(t=>({tag:t.tag,class:t.class||i(Object.assign({},t,{tag:null}))})),{all:r}).style,this.module=n?new a.V(n):null,this.themeType=e.themeType}static define(t,e){return new tu(t,e||{})}}let tf=s.r$.define(),td=s.r$.define({combine:t=>t.length?[t[0]]:null});function tp(t){let e=t.facet(tf);return e.length?e:t.facet(td)}function tm(t,e){let n=[tv],i;return t instanceof tu&&(t.module&&n.push(o.tk.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?n.push(td.of(t)):i?n.push(tf.computeN([o.tk.darkTheme],e=>e.facet(o.tk.darkTheme)==("dark"==i)?[t]:[])):n.push(tf.of(t)),n}class tg{constructor(t){this.markCache=Object.create(null),this.tree=m(t.state),this.decorations=this.buildDeco(t,tp(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=m(t.state),n=tp(t.state),i=n!=tp(t.startState),{viewport:r}=t.view,s=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!i&&e.type==this.tree.type&&s>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(e!=this.tree||t.viewportChanged||i)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return o.p.none;let n=new s.f_;for(let{from:i,to:r}of t.visibleRanges)(0,l.bW)(this.tree,e,(t,e,i)=>{n.add(t,e,this.markCache[i]||(this.markCache[i]=o.p.mark({class:i})))},i,r);return n.finish()}}let tv=s.Wl.high(o.lg.fromClass(tg,{decorations:t=>t.decorations})),ty=tu.define([{tag:l.pJ.meta,color:"#404740"},{tag:l.pJ.link,textDecoration:"underline"},{tag:l.pJ.heading,textDecoration:"underline",fontWeight:"bold"},{tag:l.pJ.emphasis,fontStyle:"italic"},{tag:l.pJ.strong,fontWeight:"bold"},{tag:l.pJ.strikethrough,textDecoration:"line-through"}
1,{tag:l.pJ.keyword,color:"#708"},{tag:[l.pJ.atom,l.pJ.bool,l.pJ.url,l.pJ.contentSeparator,l.pJ.labelName],color:"#219"},{tag:[l.pJ.literal,l.pJ.inserted],color:"#164"},{tag:[l.pJ.string,l.pJ.deleted],color:"#a11"},{tag:[l.pJ.regexp,l.pJ.escape,l.pJ.special(l.pJ.string)],color:"#e40"},{tag:l.pJ.definition(l.pJ.variableName),color:"#00f"},{tag:l.pJ.local(l.pJ.variableName),color:"#30a"},{tag:[l.pJ.typeName,l.pJ.namespace],color:"#085"},{tag:l.pJ.className,color:"#167"},{tag:[l.pJ.special(l.pJ.variableName),l.pJ.macroName],color:"#256"},{tag:l.pJ.definition(l.pJ.propertyName),color:"#00c"},{tag:l.pJ.comment,color:"#940"},{tag:l.pJ.invalid,color:"#f00"}]),tx=o.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),tb="()[]{}",tw=s.r$.define({combine:t=>(0,s.BO)(t,{afterCursor:!0,brackets:tb,maxScanDistance:1e4,renderMatch:tA})}),tk=o.p.mark({class:"cm-matchingBracket"}),tS=o.p.mark({class:"cm-nonmatchingBracket"});function tA(t){let e=[],n=t.matched?tk:tS;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}let tC=[s.QQ.define({create:()=>o.p.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],i=e.state.facet(tw);for(let t of e.state.selection.ranges){if(!t.empty)continue;let r=tP(e.state,t.head,-1,i)||t.head>0&&tP(e.state,t.head-1,1,i)||i.afterCursor&&(tP(e.state,t.head,1,i)||t.head<e.state.doc.length&&tP(e.state,t.head+1,-1,i));r&&(n=n.concat(i.renderMatch(r,e.state)))}return o.p.set(n,!0)},provide:t=>o.tk.decorations.from(t)}),tx];function tI(t={}){return[tw.of(t),tC]}let tM=new r.md;function tT(t,e,n){let i=t.prop(e<0?r.md.openedBy:r.md.closedBy);if(i)return i;if(1==t.name.length){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function tO(t){let e=t.type.prop(tM);return e?e(t.node):t}function tP(t,e,n,i={}){let r=i.maxScanDistance||1e4,s=i.brackets||tb,o=m(t),l=o.resolveInner(e,n);for(let t=l;t;t=t.parent){let i=tT(t.type,n,s);if(i&&t.from<t.to){let r=tO(t);if(r&&(n>0?e>=r.from&&e<r.to:e>r.from&&e<=r.to))return function(t,e,n,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},h=0,c=null==l?void 0:l.cursor();if(c&&(n<0?c.childBefore(i.from):c.childAfter(i.to)))do if(n<0?c.to<=i.from:c.from>=i.to){if(0==h&&s.indexOf(c.type.name)>-1&&c.from<c.to){let t=tO(c);return{start:a,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(tT(c.type,n,o))h++;else if(tT(c.type,-n,o)){if(0==h){let t=tO(c);return{start:a,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}h--}}while(n<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}(0,0,n,t,r,i,s)}}return function(t,e,n,i,r,s,o){let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},c=t.doc.iterRange(e,n>0?t.doc.length:0),u=0;for(let t=0;!c.next().done&&t<=s;){let s=c.value;n<0&&(t+=s.length);let l=e+t*n;for(let t=n>0?0:s.length-1,e=n>0?s.length:-1;t!=e;t+=n){let e=o.indexOf(s[t]);if(!(e<0)&&i.resolveInner(l+t,1).type==r){if(e%2==0==n>0)u++;else{if(1==u)return{start:h,end:{from:l+t,to:l+t+1},matched:e>>1==a>>1};u--}}}n>0&&(t+=s.length)}return c.done?{start:h,matched:!1}:null}(t,e,n,o,l.type,r,s)}function tD(t,e,n,i=0,r=0){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);let s=r;for(let r=i;r<e;r++)9==t.charCodeAt(r)?s+=n-s%n:s++;return s}class tE{constructor(t,e,n,i){this.string=t,this.tabSize=e,this.indentUnit=n,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t instanceof RegExp?t.test(e):t(e)))return++this.pos,e}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=tD(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return null!==(t=this.overrideIndent)&&void 0!==t?t:tD(this.string,null,this.tabSize)}match(t,e,n){if("string"==typeof t){let i=t=>n?t.toLowerCase():t;return i(this.string.substr(this.pos,t.length))==i(t)?(!1!==e&&(this.pos+=t.length),!0):null}{let n=this.string.slice(this.pos).match(t);return n&&n.index>
10?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function tN(t){if("object"!=typeof t)return t;let e={};for(let n in t){let i=t[n];e[n]=i instanceof Array?i.slice():i}return e}let tB=new WeakMap;class tR extends f{constructor(t){let e,n=c(t.languageData),i={name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||tN,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||tF},s;super(n,new class extends r._b{createParse(t,e,n){return new tJ(s,t,e,n)}},[M.of((t,e)=>this.getIndent(t,e))],t.name),this.topNode=(e=r.Jq.define({id:tq.length,name:"Document",props:[h.add(()=>n)],top:!0}),tq.push(e),e),s=this,this.streamParser=i,this.stateAfter=new r.md({perNode:!0}),this.tokenTable=t.tokenTable?new tU(i.tokenTable):tV}static define(t){return new tR(t)}getIndent(t,e){let n,i=m(t.state),r=i.resolve(e);for(;r&&r.type!=this.topNode;)r=r.parent;if(!r)return null;let{overrideIndentation:s}=t.options;s&&null!=(n=tB.get(t.state))&&n<e-1e4&&(n=void 0);let o=tL(this,i,0,r.from,null!=n?n:e),l,a;if(o?(a=o.state,l=o.pos+1):(a=this.streamParser.startState(t.unit),l=0),e-l>1e4)return null;for(;l<e;){let n=t.state.doc.lineAt(l),i=Math.min(e,n.to);if(n.length){let e=s?s(n.from):-1,r=new tE(n.text,t.state.tabSize,t.unit,e<0?void 0:e);for(;r.pos<i-n.from;)tj(this.streamParser.token,r,a)}else this.streamParser.blankLine(a,t.unit);if(i==e)break;l=n.to+1}let h=t.lineAt(e);return s&&null==n&&tB.set(t.state,h.from),this.streamParser.indent(a,/^\s*(.*)/.exec(h.text)[1],t)}get allowsNesting(){return!1}}function tL(t,e,n,i,s){let o=n>=i&&n+e.length<=s&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=n+e.positions[o],h=l instanceof r.mp&&a<s&&tL(t,l,a,i,s);if(h)return h}return null}class tJ{constructor(t,e,n,i){this.lang=t,this.input=e,this.fragments=n,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let s=y.get(),o=i[0].from,{state:l,tree:a}=function(t,e,n,i){for(let i of e){let e=i.from+(i.openStart?25:0),s=i.to-(i.openEnd?25:0),o=e<=n&&s>n&&tL(t,i.tree,0-i.offset,n,s),l;if(o&&(l=function t(e,n,i,s,o){if(o&&i<=0&&s>=n.length)return n;o||n.type!=e.topNode||(o=!0);for(let l=n.children.length-1;l>=0;l--){let a=n.positions[l],h=n.children[l],c;if(a<s&&h instanceof r.mp){if(!(c=t(e,h,i-a,s-a,o)))break;return o?new r.mp(n.type,n.children.slice(0,l).concat(c),n.positions.slice(0,l+1),a+c.length):c}}return null}(t,i.tree,n+i.offset,o.pos+i.offset,!1)))return{state:o.state,tree:l}}return{state:t.streamParser.startState(i?O(i):4),tree:r.mp.empty}}(t,n,o,null==s?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let t=0;t<a.children.length;t++)this.chunks.push(a.children[t]),this.chunkPos.push(a.positions[t]);s&&this.parsedPos<s.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(O(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=y.get(),e=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(e,this.chunkStart+2048);for(t&&(n=Math.min(n,t.viewport.to));this.parsedPos<n;)this.parseLine(t);return(this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e)?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{let t=e.indexOf("\n");t>-1&&(e=e.slice(0,t))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),n=t+e.length;for(let t=this.rangeIndex;;){let i=this.ranges[t].to;if(i>=n||(e=e.slice(0,i-(n-e.length)),++t==this.ranges.length))break;let r=this.ranges[t].from,s=this.lineAfter(r);e+=s,n=r+s.length}return{line:e,end:n}}skipGapsTo(t,e,n){for(;;){let i=this.ranges[this.rangeIndex].to,r=t+e;if(n>0?i>r:i>=r)break;let s=this.ranges[++this.rangeIndex].from;e+=s-i}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,n,i,r){if(this.ranges.length>1){r=this.skipGapsTo(e,r,1),e+=r;let t=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-t}return this.chunk.push(t,e,n,i),r}parseLine(t){let{line:e,end:n}=this.nextLine(),i=0,{streamParser:r}=this.lang,s=new tE(e,t?t.state.tabSize:4,t?O(t.state):2);if(s.eol())r.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let t=tj(r.token,s,this.state);if(t&&(i=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+s.start,this.parsedPos+s.pos,4,i)),s.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=r.mp.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:t$,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new r.mp(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new r.mp(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function tj(t,e,n){e.start=e.pos;for(let i=0;i<10;i++){let i=t(e,n);if(e.pos>e.start)return i}throw Error("Stream parser failed to advance stream.")}let tF=Object.create(null),tq=[r.Jq.none],t$=new r.Lj(tq),t_=[],tW=Object.create(null),tz=Object.create(null);for(let[t,e]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","invali
1d"],["header","heading"],["property","propertyName"]])tz[t]=tH(tF,e);class tU{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),tz)}resolve(t){return t?this.table[t]||(this.table[t]=tH(this.extra,t)):0}}let tV=new tU(tF);function tZ(t,e){t_.indexOf(t)>-1||(t_.push(t),console.warn(e))}function tH(t,e){let n=[];for(let i of e.split(" ")){let e=[];for(let n of i.split(".")){let i=t[n]||l.pJ[n];i?"function"==typeof i?e.length?e=e.map(i):tZ(n,`Modifier ${n} used at start of tag`):e.length?tZ(n,`Tag ${n} used as modifier`):e=Array.isArray(i)?i:[i]:tZ(n,`Unknown highlighting tag ${n}`)}for(let t of e)n.push(t)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+n.map(t=>t.id),o=tW[s];if(o)return o.id;let a=tW[s]=r.Jq.define({id:tq.length,name:i,props:[(0,l.Gv)({[i]:n})]});return tq.push(a),a.id}o.Nm.RTL,o.Nm.LTR},86017:function(t,e,n){n.d(e,{Lp:function(){return tn},sW:function(){return w}});var i=n(64451),r=n(8693),s=n(16914);let o="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class l{constructor(t,e,n=0,i=t.length,r,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,i),this.bufferStart=n,this.normalize=r?t=>r(o(t)):o,this.query=this.normalize(e)}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(0,r.gm)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=(0,r.bg)(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,r.nZ)(t);let i=this.normalize(e);if(i.length)for(let t=0,r=n;;t++){let s=i.charCodeAt(t),o=this.match(s,r,this.bufferPos+this.bufferStart);if(t==i.length-1){if(o)return this.value=o,this;break}r==n&&t<e.length&&e.charCodeAt(t)==s&&r++}}}match(t,e,n){let i=null;for(let e=0;e<this.matches.length;e+=2){let r=this.matches[e],s=!1;this.query.charCodeAt(r)==t&&(r==this.query.length-1?i={from:this.matches[e+1],to:n}:(this.matches[e]++,s=!0)),s||(this.matches.splice(e,2),e-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?i={from:e,to:n}:this.matches.push(1,e)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}"undefined"!=typeof Symbol&&(l.prototype[Symbol.iterator]=function(){return this});let a={from:-1,to:-1,match:/.*/.exec("")},h="gm"+(null==/x/.unicode?"":"u");class c{constructor(t,e,n,i=0,r=t.length){if(this.text=t,this.to=r,this.curLine="",this.done=!1,this.value=a,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new d(t,e,n,i,r);this.re=new RegExp(e,h+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=t.iter();let s=t.lineAt(i);this.curLineStart=s.from,this.matchPos=p(t,i),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.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 t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let n=this.curLineStart+e.index,i=n+e[0].length;if(this.matchPos=p(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,e)))return this.value={from:n,to:i,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),t=0}}}}let u=new WeakMap;class f{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,n){let i=u.get(t);if(!i||i.from>=n||i.to<=e){let i=new f(e,t.sliceString(e,n));return u.set(t,i),i}if(i.from==e&&i.to==n)return i;let{text:r,from:s}=i;return s>e&&(r=t.sliceString(e,s)+r,s=e),i.to<n&&(r+=t.sliceString(i.to,n)),u.set(t,new f(s,r)),new f(e,r.slice(e-s,n-s))}}class d{constructor(t,e,n,i,r){this.text=t,this.to=r,this.done=!1,this.value=a,this.matchPos=p(t,i),this.re=new RegExp(e,h+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=f.get(t,i,this.chunkEnd(i+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,n=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,n,e)))return this.value={from:t,to:n,match:e},this.matchPos=p(this.text,n+(t==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=f.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function p(t,e){if(e>=t.length)return e;let n=t.lineAt(e),i;for(;e<n.to&&(i=n.text.charCodeAt(e-n.from))>=56320&&i<57344;)e++;return e}function m(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=(0,s.Z)("input",{class:"cm-textfield",name:"line",value:e});function o(){let e=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!e)return;let{state:s}=t,o=s.doc.lineAt(s.selection.main.head),[,l,a,h,c]=e,u=h?+h.slice(1):0,f=a?+a:o.number;if(a&&c){let t=f/100;l&&(t=t*("-"==l?-1:1)+o.number/s.doc.lines),f=Math.round(s.doc.lines*t)}else a&&l&&(f=f*("-"==l?-1:1)+o.number);let d=s.doc.line(Math.max(1,Math.min(s.doc.lines,f))),p=r.jT.cursor(d.from+Math.max(0,Math.min(u,d.length)));t.dispatch({effects:[g.of(!1),i.tk.scrollIntoView(p.from,{y:"center"})],selection:p}),t.focus()}return{dom:(0,s.Z)("form",{class:"cm-gotoLine",onkeydown:e=>
1{27==e.keyCode?(e.preventDefault(),t.dispatch({effects:g.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),o())},onsubmit:t=>{t.preventDefault(),o()}},(0,s.Z)("label",t.state.phrase("Go to line"),": ",n)," ",(0,s.Z)("button",{class:"cm-button",type:"submit"},t.state.phrase("go")))}}"undefined"!=typeof Symbol&&(c.prototype[Symbol.iterator]=d.prototype[Symbol.iterator]=function(){return this});let g=r.Py.define(),v=r.QQ.define({create:()=>!0,update(t,e){for(let n of e.effects)n.is(g)&&(t=n.value);return t},provide:t=>i.mH.from(t,t=>t?m:null)}),y=i.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),x={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},b=r.r$.define({combine:t=>(0,r.BO)(t,x,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});function w(t){let e=[I,C];return t&&e.push(b.of(t)),e}let k=i.p.mark({class:"cm-selectionMatch"}),S=i.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function A(t,e,n,i){return(0==n||t(e.sliceDoc(n-1,n))!=r.D0.Word)&&(i==e.doc.length||t(e.sliceDoc(i,i+1))!=r.D0.Word)}let C=i.lg.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(b),{state:n}=t,s=n.selection;if(s.ranges.length>1)return i.p.none;let o=s.main,a,h=null;if(o.empty){if(!e.highlightWordAroundCursor)return i.p.none;let t=n.wordAt(o.head);if(!t)return i.p.none;h=n.charCategorizer(o.head),a=n.sliceDoc(t.from,t.to)}else{let t=o.to-o.from;if(t<e.minSelectionLength||t>200)return i.p.none;if(e.wholeWords){var c,u,f;if(a=n.sliceDoc(o.from,o.to),!(A(h=n.charCategorizer(o.head),n,o.from,o.to)&&(c=h,u=o.from,f=o.to,c(n.sliceDoc(u,u+1))==r.D0.Word&&c(n.sliceDoc(f-1,f))==r.D0.Word)))return i.p.none}else if(!(a=n.sliceDoc(o.from,o.to)))return i.p.none}let d=[];for(let r of t.visibleRanges){let t=new l(n.doc,a,r.from,r.to);for(;!t.next().done;){let{from:r,to:s}=t.value;if((!h||A(h,n,r,s))&&(o.empty&&r<=o.from&&s>=o.to?d.push(S.range(r,s)):(r>=o.to||s<=o.from)&&d.push(k.range(r,s)),d.length>e.maxMatches))return i.p.none}}return i.p.set(d)}},{decorations:t=>t.decorations}),I=i.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),M=({state:t,dispatch:e})=>{let{selection:n}=t,i=r.jT.create(n.ranges.map(e=>t.wordAt(e.head)||r.jT.cursor(e.head)),n.mainIndex);return!i.eq(n)&&(e(t.update({selection:i})),!0)},T=r.r$.define({combine:t=>(0,r.BO)(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new ti(t),scrollToMatch:t=>i.tk.scrollIntoView(t)})});class O{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,h),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new L(this):new E(this)}getCursor(t,e=0,n){let i=t.doc?t:r.yy.create({doc:t});return null==n&&(n=i.doc.length),this.regexp?N(this,i,e,n):D(this,i,e,n)}}class P{constructor(t){this.spec=t}}function D(t,e,n,i){var s,o;return new l(e.doc,t.unquoted,n,i,t.caseSensitive?void 0:t=>t.toLowerCase(),t.wholeWord?(s=e.doc,o=e.charCategorizer(e.selection.main.head),(t,e,n,i)=>((i>t||i+n.length<e)&&(i=Math.max(0,t-2),n=s.sliceString(i,Math.min(s.length,e+2))),(o(B(n,t-i))!=r.D0.Word||o(R(n,t-i))!=r.D0.Word)&&(o(R(n,e-i))!=r.D0.Word||o(B(n,e-i))!=r.D0.Word))):void 0)}class E extends P{constructor(t){super(t)}nextMatch(t,e,n){let i=D(this.spec,t,n,t.doc.length).nextOverlapping();if(i.done){let n=Math.min(t.doc.length,e+this.spec.unquoted.length);i=D(this.spec,t,0,n).nextOverlapping()}return i.done||i.value.from==e&&i.value.to==n?null:i.value}prevMatchInRange(t,e,n){for(let i=n;;){let n=Math.max(e,i-1e4-this.spec.unquoted.length),r=D(this.spec,t,n,i),s=null;for(;!r.nextOverlapping().done;)s=r.value;if(s)return s;if(n==e)return null;i-=1e4}}prevMatch(t,e,n){let i=this.prevMatchInRange(t,0,e);
1return i||(i=this.prevMatchInRange(t,Math.max(0,n-this.spec.unquoted.length),t.doc.length)),i&&(i.from!=e||i.to!=n)?i:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let n=D(this.spec,t,0,t.doc.length),i=[];for(;!n.next().done;){if(i.length>=e)return null;i.push(n.value)}return i}highlight(t,e,n,i){let r=D(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function N(t,e,n,i){var s;return new c(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(s=e.charCategorizer(e.selection.main.head),(t,e,n)=>!n[0].length||(s(B(n.input,n.index))!=r.D0.Word||s(R(n.input,n.index))!=r.D0.Word)&&(s(R(n.input,n.index+n[0].length))!=r.D0.Word||s(B(n.input,n.index+n[0].length))!=r.D0.Word)):void 0},n,i)}function B(t,e){return t.slice((0,r.cp)(t,e,!1),e)}function R(t,e){return t.slice(e,(0,r.cp)(t,e))}class L extends P{nextMatch(t,e,n){let i=N(this.spec,t,n,t.doc.length).next();return i.done&&(i=N(this.spec,t,0,e).next()),i.done?null:i.value}prevMatchInRange(t,e,n){for(let i=1;;i++){let r=Math.max(e,n-1e4*i),s=N(this.spec,t,r,n),o=null;for(;!s.next().done;)o=s.value;if(o&&(r==e||o.from>r+10))return o;if(r==e)return null}}prevMatch(t,e,n){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,n,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(e,n)=>"$"==n?"$":"&"==n?t.match[0]:"0"!=n&&+n<t.match.length?t.match[n]:e)}matchAll(t,e){let n=N(this.spec,t,0,t.doc.length),i=[];for(;!n.next().done;){if(i.length>=e)return null;i.push(n.value)}return i}highlight(t,e,n,i){let r=N(this.spec,t,Math.max(0,e-250),Math.min(n+250,t.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}let J=r.Py.define(),j=r.Py.define(),F=r.QQ.define({create:t=>new q(G(t).create(),null),update(t,e){for(let n of e.effects)n.is(J)?t=new q(n.value.create(),t.panel):n.is(j)&&(t=new q(t.query,n.value?K:null));return t},provide:t=>i.mH.from(t,t=>t.panel)});class q{constructor(t,e){this.query=t,this.panel=e}}let $=i.p.mark({class:"cm-searchMatch"}),_=i.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),W=i.lg.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(F))}update(t){let e=t.state.field(F);(e!=t.startState.field(F)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return i.p.none;let{view:n}=this,s=new r.f_;for(let e=0,i=n.visibleRanges,r=i.length;e<r;e++){let{from:o,to:l}=i[e];for(;e<r-1&&l>i[e+1].from-500;)l=i[++e].to;t.highlight(n.state,o,l,(t,e)=>{let i=n.state.selection.ranges.some(n=>n.from==t&&n.to==e);s.add(t,e,i?_:$)})}return s.finish()}},{decorations:t=>t.decorations});function z(t){return e=>{let n=e.state.field(F,!1);return n&&n.query.spec.valid?t(e,n):tt(e)}}let U=z((t,{query:e})=>{let{to:n}=t.state.selection.main,i=e.nextMatch(t.state,n,n);if(!i)return!1;let s=r.jT.single(i.from,i.to),o=t.state.facet(T);return t.dispatch({selection:s,effects:[to(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),X(t),!0}),V=z((t,{query:e})=>{let{state:n}=t,{from:i}=n.selection.main,s=e.prevMatch(n,i,i);if(!s)return!1;let o=r.jT.single(s.from,s.to),l=t.state.facet(T);return t.dispatch({selection:o,effects:[to(t,s),l.scrollToMatch(o.main,t)],userEvent:"select.search"}),X(t),!0}),Z=z((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!!n&&!!n.length&&(t.dispatch({selection:r.jT.create(n.map(t=>r.jT.range(t.from,t.to))),userEvent:"select.search.matches"}),!0)}),H=z((t,{query:e})=>{let{state:n}=t,{from:s,to:o}=n.selection.main;if(n.readOnly)return!1;let l=e.nextMatch(n,s,s);if(!l)return!1;let a=[],h,c,u=[];if(l.from==s&&l.to==o&&(c=n.toText(e.getReplacement(l)),a.push({from:l.from,to:l.to,insert:c}),l=e.nextMatch(n,l.from,l.to),u.push(i.tk.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(s).number)+"."))),l){let e=0==a.length||a[0].from>=l.to?0:l.to-l.from-c.length;h=r.jT.single(l.from-e,l.to-e),u.push(to(t,l)),u.push(n.facet(T).scrollToMatch(h.main,t))}return t.dispatch({changes:a,selection:h,effects:u,userEvent:"input.replace"}),!0}),Q=z((t,{query:e})=>
1{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(t=>{let{from:n,to:i}=t;return{from:n,to:i,insert:e.getReplacement(t)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:i.tk.announce.of(r),userEvent:"input.replace.all"}),!0});function K(t){return t.state.facet(T).createPanel(t)}function G(t,e){var n,i,r,s,o;let l=t.selection.main,a=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=t.facet(T);return new O({search:(null!==(n=null==e?void 0:e.literal)&&void 0!==n?n:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==e?void 0:e.caseSensitive)&&void 0!==i?i:h.caseSensitive,literal:null!==(r=null==e?void 0:e.literal)&&void 0!==r?r:h.literal,regexp:null!==(s=null==e?void 0:e.regexp)&&void 0!==s?s:h.regexp,wholeWord:null!==(o=null==e?void 0:e.wholeWord)&&void 0!==o?o:h.wholeWord})}function Y(t){let e=(0,i.Sd)(t,K);return e&&e.dom.querySelector("[main-field]")}function X(t){let e=Y(t);e&&e==t.root.activeElement&&e.select()}let tt=t=>{let e=t.state.field(F,!1);if(e&&e.panel){let n=Y(t);if(n&&n!=t.root.activeElement){let i=G(t.state,e.query.spec);i.valid&&t.dispatch({effects:J.of(i)}),n.focus(),n.select()}}else t.dispatch({effects:[j.of(!0),e?J.of(G(t.state,e.query.spec)):r.Py.appendConfig.of(ta)]});return!0},te=t=>{let e=t.state.field(F,!1);if(!e||!e.panel)return!1;let n=(0,i.Sd)(t,K);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:j.of(!1)}),!0},tn=[{key:"Mod-f",run:tt,scope:"editor search-panel"},{key:"F3",run:U,shift:V,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:U,shift:V,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:te,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:s}=n.main,o=[],a=0;for(let e=new l(t.doc,t.sliceDoc(i,s));!e.next().done;){if(o.length>1e3)return!1;e.value.from==i&&(a=o.length),o.push(r.jT.range(e.value.from,e.value.to))}return e(t.update({selection:r.jT.create(o,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:t=>{let e=(0,i.Sd)(t,m);if(!e){let n=[g.of(!0)];null==t.state.field(v,!1)&&n.push(r.Py.appendConfig.of([v,y])),t.dispatch({effects:n}),e=(0,i.Sd)(t,m)}return e&&e.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(t=>t.from===t.to))return M({state:t,dispatch:e});let s=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(e=>t.sliceDoc(e.from,e.to)!=s))return!1;let o=function(t,e){let{main:n,ranges:i}=t.selection,r=t.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new l(t.doc,e,i[i.length-1].to);;)if(r.next(),r.done){if(n)return null;r=new l(t.doc,e,0,Math.max(0,i[i.length-1].from-1)),n=!0}else{if(n&&i.some(t=>t.from==r.value.from))continue;if(s){let e=t.wordAt(r.value.from);if(!e||e.from!=r.value.from||e.to!=r.value.to)continue}return r.value}}(t,s);return!!o&&(e(t.update({selection:t.selection.addRange(r.jT.range(o.from,o.to),!1),effects:i.tk.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class ti{constructor(t){this.view=t;let e=this.query=t.state.field(F).query.spec;function n(t,e,n){return(0,s.Z)("button",{class:"cm-button",name:t,onclick:e,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=(0,s.Z)("input",{value:e.search,placeholder:tr(t,"Find"),"aria-label":tr(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=(0,s.Z)("input",{value:e.replace,placeholder:tr(t,"Replace"),"aria-label":tr(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=(0,s.Z)("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=(0,s.Z)("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=(0,s.Z)("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=(0,s.Z)("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,n("next",()=>U(t),[tr(t,"next")]),n("prev",()=>V(t),[tr(t,"previous")]),n("select",()=>Z(t),[tr(t,"all")]),(0,s.Z)("label",null,[this.caseField,tr(t,"match case")]),(0,s.Z)("label",null,[this.reField,tr(t,"regexp")]),(0,s.Z)("label",null,[this.wordField,tr(t,"by w
1ord")]),...t.state.readOnly?[]:[(0,s.Z)("br"),this.replaceField,n("replace",()=>H(t),[tr(t,"replace")]),n("replaceAll",()=>Q(t),[tr(t,"replace all")])],(0,s.Z)("button",{name:"close",onclick:()=>te(t),"aria-label":tr(t,"close"),type:"button"},["\xd7"])])}commit(){let t=new O({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:J.of(t)}))}keydown(t){(0,i.$1)(this.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?V:U)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),H(this.view))}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(J)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(T).top}}function tr(t,e){return t.state.phrase(e)}let ts=/[\s\.,:;?!]/;function to(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),s=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-30),l=Math.min(s,n+30),a=t.state.sliceDoc(o,l);if(o!=r.from){for(let t=0;t<30;t++)if(!ts.test(a[t+1])&&ts.test(a[t])){a=a.slice(t);break}}if(l!=s){for(let t=a.length-1;t>a.length-30;t--)if(!ts.test(a[t-1])&&ts.test(a[t])){a=a.slice(0,t);break}}return i.tk.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}let tl=i.tk.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"}}),ta=[F,r.Wl.low(W),tl]},8693:function(t,e,n){let i;n.d(e,{BO:function(){return tx},D0:function(){return tg},Gz:function(){return tJ},IS:function(){return tL},Py:function(){return tc},QQ:function(){return z},Wl:function(){return Z},Xs:function(){return tA},YW:function(){return tu},as:function(){return M},bg:function(){return b},cp:function(){return m},f_:function(){return tC},gc:function(){return C},gm:function(){return x},jT:function(){return R},n0:function(){return I},nZ:function(){return w},q6:function(){return tl},r$:function(){return j},uU:function(){return tb},xv:function(){return r},yy:function(){return ty}});class r{lineAt(t){if(t<0||t>this.length)throw RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,n){[t,e]=f(this,t,e);let i=[];return this.decompose(0,t,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(e,this.length,i,1),o.from(i,this.length-(e-t)+n.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=f(this,t,e);let n=[];return this.decompose(t,e,n,0),o.from(n,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),n=this.length-this.scanIdentical(t,-1),i=new a(this),r=new a(t);for(let t=e,s=e;;){if(i.next(t),r.next(t),t=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(s+=i.value.length,i.done||s>=n)return!0}}iter(t=1){return new a(this,t)}iterRange(t,e=this.length){return new h(this,t,e)}iterLines(t,e){let n;if(null==t)n=this.iter();else{null==e&&(e=this.lines+1);let i=this.line(t).from;n=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new s(t):o.from(s.split(t,[])):r.empty}}class s extends r{constructor(t,e=function(t){let e=-1;for(let n of t)e+=n.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,n,i){for(let r=0;;r++){let s=this.text[r],o=i+s.length;if((e?n:o)>=t)return new u(i,o,n,s);i=o+1,n++}}decompose(t,e,n,i){let r=t<=0&&e>=this.length?this:new s(l(this.text,[""],t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){let t=n.pop(),e=l(r.text,t.text.slice(),0,r.length);if(e.length<=32)n.push(new s(e,t.length+r.length));else{let t=e.length>>1;n.push(new s(e.slice(0,t)),new s(e.slice(t)))}}else n.push(r)}replace(t,e,n){if(!(n instanceof s))return super.replace(t,e,n);[t,e]=f(this,t,e);let i=l(this.text,l(n.text,l(this.text,[""],0,t)),e),r=this.length+n.length-(e-t);return i.length<=32?new s(i,r):o.from(s.split(i,[]),r)}sliceString(t,e=this.length,n="\n"){[t,e]=f(this,t,e);let i="";for(let r=0,s=0;r<=e&&s<this.text.length;s++){let o=this.text[s],l=r+o.length;r>t&&s&&(i+=n),t<l&&e>r&&(i+=o.slice(Math.max(0,t-r),e-r)),r=l+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let n=[],i=-1;for(let r of t)n.push(r),i+=r.length+1,32==n.length&&(e.push(new s(n,i)),n=[],i=-1);return i>-1&&e.push(new s(n,i)),e}}class o extends r{constructor(t,e){for(let n of(super(),this.children=t,this.length=e,this.lines=0,t))this.lines+=n.lines}lineInner(t,e,n,i){for(let r=0;;r++){let s=this.children[r],o=i+s.length,l=n+s.lines-1;if((e?l:o)>=t)return s.lineInner(t,e,n,i);i=o+1,n=l+1}}decompose(t,e,n,i){for(let r=0,s=0;s<=e&&r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(t<=l&&e>=s){let r=i&((s<=t?1:0)|(l>=e?2:0));s>=t&&l<=e&&!r?n.push(o):o.decompose(t-s,e-s,n,r)}s=l+1}}replace(t,e,n){if([t,e]=f(this,t,e),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let s=this.children[i],l=r+s.length;if(t>=r&&e<=l){let a=s.replace(t-r,e-r,n),h=this.lines-s.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let r=this.children.slice();return r[i]=a,new o(r,this.length-(e-t)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,n)}sliceString(t,e=this.length,n="\n"){[t,e]=f(this,t,e);let i="";for(let r=0,s=0;r<this.children.length&&s<=e;r++){let o=this.children[r],l=s+o.length;s>t&&r&&(i+=n),t<l&&e>s&&(i+=o.sliceString(t-s,e-s,n)),s=l+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof o))return 0;let n=0,[i,r,s,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,r+=e){if(i==s||r==l)return n;let o=this.children[i],a=t.children[r];if(o!=a)return n+o.scanIdentical(a,e);n+=o.length+1}}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let n=0;for(let e of t)n+=e.lines;if(n<32){let n=[];for(let e of t)e.flatten(n);return new s(n,e)}let i=Math.max(32,n>>5),r=i<<1,l=i>>1,a=[],h=0,c=-1,u=[];function f(){0!=h&&(a.push(1==u.length?u[0]:o.from(u,c)),c=-1,h=u.length=0)}for(let e of t)!function t(e){let n;if(e.lines>r&&e instanceof o)for(let n of e.children)t(n);else e.lines>l&&(h>l||!h)?(f(),a.push(e)):e instanceof s&&h&&(n=u[u.length-1])instanceof s&&e.lines+n.lines<=32?(h+=e.lines,c+=e.length+1,u[u.length-1]=new s(n.text.concat(e.text),n.length+1+e.length)):(h+e.lines>i&&f(),h+=e.lines,c+=e.length+1,u.push(e))}(e);return f(),1==a.length?a[0]:new o(a,e)}}function l(t,e,n=0,i=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=i;s++){let l=t[s],a=r+l.length;a>=n&&(a>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}r.empty=new s([""],0);class a{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof s?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,l=i instanceof s?i.text.length:i.children.length;if(o==(e>0?l:0)){if(0==n)return this.done=!0,this.value="",this;e>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(e>
10?0:1)){if(this.offsets[n]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof s){let r=i.text[o+(e<0?-1:0)];if(this.offsets[n]+=e,r.length>Math.max(0,t))return this.value=0==t?r:e>0?r.slice(t):r.slice(0,r.length-t),this;t-=r.length}else{let r=i.children[o+(e<0?-1:0)];t>r.length?(t-=r.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(e>0?1:(r instanceof s?r.text.length:r.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class h{constructor(t,e,n){this.value="",this.done=!1,this.cursor=new a(t,e>n?-1:1),this.pos=e>n?t.length:0,this.from=Math.min(e,n),this.to=Math.max(e,n)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let n=e<0?this.pos-this.from:this.to-this.pos;t>n&&(t=n),n-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=n?i:e<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:n,value:i}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(r.prototype[Symbol.iterator]=function(){return this.iter()},a.prototype[Symbol.iterator]=h.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class u{constructor(t,e,n,i){this.from=t,this.to=e,this.number=n,this.text=i}get length(){return this.to-this.from}}function f(t,e,n){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,n))]}let d="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(t=>t?parseInt(t,36):1);for(let t=1;t<d.length;t++)d[t]+=d[t-1];function p(t){return t>=127462&&t<=127487}function m(t,e,n=!0,i=!0){return(n?g:function(t,e,n){for(;e>0;){let i=g(t,e-2,n);if(i<e)return i;e--}return 0})(t,e,i)}function g(t,e,n){if(e==t.length)return e;e&&v(t.charCodeAt(e))&&y(t.charCodeAt(e-1))&&e--;let i=x(t,e);for(e+=w(i);e<t.length;){let r=x(t,e);if(8205==i||8205==r||n&&function(t){for(let e=1;e<d.length;e+=2)if(d[e]>t)return d[e-1]<=t;return!1}(r))e+=w(r),i=r;else if(p(r)){let n=0,i=e-2;for(;i>=0&&p(x(t,i));)n++,i-=2;if(n%2==0)break;e+=2}else break}return e}function v(t){return t>=56320&&t<57344}function y(t){return t>=55296&&t<56320}function x(t,e){let n=t.charCodeAt(e);if(!y(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return v(i)?(n-55296<<10)+(i-56320)+65536:n}function b(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(((t-=65536)>>10)+55296,(1023&t)+56320)}function w(t){return t<65536?1:2}let k=/\r\n?|\n/;var S,A,C=((S=C||(C={}
vendor: 4,193 bytes, line 1
1))[S.Simple=0]="Simple",S[S.TrackDel=1]="TrackDel",S[S.TrackBefore=2]="TrackBefore",S[S.TrackAfter=3]="TrackAfter",S);class I{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e+1];t+=n<0?this.sections[e]:n}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,n=0,i=0;e<this.sections.length;){let r=this.sections[e++],s=this.sections[e++];s<0?(t(n,i,r),i+=r):i+=s,n+=r}}iterChangedRanges(t,e=!1){P(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];i<0?t.push(n,i):t.push(i,n)}return new I(t)}composeDesc(t){return this.empty?t:t.empty?this:E(this,t)}mapDesc(t,e=!1){return t.empty?this:D(this,t,e)}mapPos(t,e=-1,n=C.Simple){let i=0,r=0;for(let s=0;s<this.sections.length;){let o=this.sections[s++],l=this.sections[s++],a=i+o;if(l<0){if(a>t)return r+(t-i);r+=o}else{if(n!=C.Simple&&a>=t&&(n==C.TrackDel&&i<t&&a>t||n==C.TrackBefore&&i<t||n==C.TrackAfter&&a>t))return null;if(a>t||a==t&&e<0&&!o)return t==i||e<0?r:r+l;r+=l}i=a}if(t>i)throw RangeError(`Position ${t} is out of range for changeset of length ${i}`);return r}touchesRange(t,e=t){for(let n=0,i=0;n<this.sections.length&&i<=e;){let r=this.sections[n++],s=this.sections[n++],o=i+r;if(s>=0&&i<=e&&o>=t)return!(i<t)||!(o>e)||"cover";i=o}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];t+=(t?" ":"")+n+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(t=>"number"!=typeof t))throw RangeError("Invalid JSON representation of ChangeDesc");return new I(t)}static create(t){return new I(t)}}class M extends I{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw RangeError("Applying change set to a document with the wrong length");return P(this,(e,n,i,r,s)=>t=t.replace(i,i+(n-e),s),!1),t}mapDesc(t,e=!1){return D(this,t,e,!0)}invert(t){let e=this.sections.slice(),n=[];for(let i=0,s=0;i<e.length;i+=2){let o=e[i],l=e[i+1];if(l>=0){e[i]=l,e[i+1]=o;let a=i>>1;for(;n.length<a;)n.push(r.empty);n.push(o?t.slice(s,s+o):r.empty)}s+=o}return new M(e,n)}compose(t){return this.empty?t:t.empty?this:E(this,t,!0)}map(t,e=!1){return t.empty?this:D(this,t,e,!0)}iterChanges(t,e=!1){P(this,t,e)}get desc(){return I.create(this.sections)}filter(t){let e=[],n=[],i=[],r=new N(this);e:for(let s=0,o=0;;){let l=s==t.length?1e9:t[s++];for(;o<l||o==l&&0==r.len;){if(r.done)break e;let t=Math.min(r.len,l-o);T(i,t,-1);let s=-1==r.ins?-1:0==r.off?r.ins:0;T(e,t,s),s>0&&O(n,e,r.text),r.forward(t),o+=t}let a=t[s++];for(;o<a;){if(r.done)break e;let t=Math.min(r.len,a-o);T(e,t,-1),T(i,t,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(t),o+=t}}return{changes:new M(e,n),filtered:I.create(i)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e],i=this.sections[e+1];i<0?t.push(n):0==i?t.push([n]):t.push([n].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,n){let i=[],s=[],o=0,l=null;function a(t=!1){if(!t&&!i.length)return;o<e&&T(i,e-o,-1);let n=new M(i,s);l=l?l.compose(n.map(l)):n,i=[],s=[],o=0}return!function t(h){if(Array.isArray(h))for(let e of h)t(e);else if(h instanceof M){if(h.length!=e)throw RangeError(`Mismatched change set length (got ${h.length}, expected ${e})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:t,to:l=t,insert:c}=h;if(t>l||t<0||l>e)throw RangeError(`Invalid change range ${t} to ${l} (in doc of length ${e})`);let u=c?"string"==typeof c?r.of(c.split(n||k)):c:r.empty,f=u.length;if(t==l&&0==f)return;t<o&&a(),t>o&&T(i,t-o,-1),T(i,l-t,f),O(s,i,u),o=l}}(t),a(!l),l}static empty(t){return new M(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError("Invalid JSON representation of ChangeSet");let e=[],n=[];for(let i=0;i<t.length;i++){let s=t[i];if("number"==typeof s)e.push(s,-1);else if(!Array.isArray(s)||"number"!=typeof s[0]||s.some((t,e)=>e&&"string"!=typeof t))throw RangeError("Invalid JSON representation of ChangeSet");
vendor: 15,333 bytes, line 1
1else if(1==s.length)e.push(s[0],0);else{for(;n.length<i;)n.push(r.empty);n[i]=r.of(s.slice(1)),e.push(s[0],n[i].length)}}return new M(e,n)}static createSet(t,e){return new M(t,e)}}function T(t,e,n,i=!1){if(0==e&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:0==e&&0==t[r]?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function O(t,e,n){if(0==n.length)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(r.empty);t.push(n)}}function P(t,e,n){let i=t.inserted;for(let s=0,o=0,l=0;l<t.sections.length;){let a=t.sections[l++],h=t.sections[l++];if(h<0)s+=a,o+=a;else{let c=s,u=o,f=r.empty;for(;c+=a,u+=h,h&&i&&(f=f.append(i[l-2>>1])),!n&&l!=t.sections.length&&!(t.sections[l+1]<0);)a=t.sections[l++],h=t.sections[l++];e(s,c,o,u,f),s=c,o=u}}}function D(t,e,n,i=!1){let r=[],s=i?[]:null,o=new N(t),l=new N(e);for(let t=-1;;)if(-1==o.ins&&-1==l.ins){let t=Math.min(o.len,l.len);T(r,t,-1),o.forward(t),l.forward(t)}else if(l.ins>=0&&(o.ins<0||t==o.i||0==o.off&&(l.len<o.len||l.len==o.len&&!n))){let e=l.len;for(T(r,l.ins,-1);e;){let n=Math.min(o.len,e);o.ins>=0&&t<o.i&&o.len<=n&&(T(r,0,o.ins),s&&O(s,r,o.text),t=o.i),o.forward(n),e-=n}l.next()}else if(o.ins>=0){let e=0,n=o.len;for(;n;)if(-1==l.ins){let t=Math.min(n,l.len);e+=t,n-=t,l.forward(t)}else if(0==l.ins&&l.len<n)n-=l.len,l.next();else break;T(r,e,t<o.i?o.ins:0),s&&t<o.i&&O(s,r,o.text),t=o.i,o.forward(o.len-n)}else if(o.done&&l.done)return s?M.createSet(r,s):I.create(r);else throw Error("Mismatched change set lengths")}function E(t,e,n=!1){let i=[],r=n?[]:null,s=new N(t),o=new N(e);for(let t=!1;;){if(s.done&&o.done)return r?M.createSet(i,r):I.create(i);if(0==s.ins)T(i,s.len,0,t),s.next();else if(0!=o.len||o.done){if(s.done||o.done)throw Error("Mismatched change set lengths");{let e=Math.min(s.len2,o.len),n=i.length;if(-1==s.ins){let n=-1==o.ins?-1:o.off?0:o.ins;T(i,e,n,t),r&&n&&O(r,i,o.text)}else -1==o.ins?(T(i,s.off?0:s.len,e,t),r&&O(r,i,s.textBit(e))):(T(i,s.off?0:s.len,o.off?0:o.ins,t),r&&!o.off&&O(r,i,o.text));t=(s.ins>e||o.ins>=0&&o.len>e)&&(t||i.length>n),s.forward2(e),o.forward(e)}}else T(i,0,o.ins,t),r&&O(r,i,o.text),o.next()}}class N{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?r.empty:t[e]}textBit(t){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length&&!t?r.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class B{constructor(t,e,n){this.from=t,this.to=e,this.flags=n}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 t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let n,i;return this.empty?n=i=t.mapPos(this.from,e):(n=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new B(n,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return R.range(t,e);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return R.range(this.anchor,n)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid JSON representation for SelectionRange");return R.range(t.anchor,t.head)}static create(t,e,n){return new B(t,e,n)}}class R{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:R.create(this.ranges.map(n=>n.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(t.ranges[n],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new R([this.main],0)}addRange(t,e=!0){return R.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let n=this.ranges.slice();return n[e]=t,R.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new R(t.ranges.map(t=>B.fromJSON(t)),t.main)}static single(t,e=t){return new R([R.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw RangeError("A selection needs at least one range");for(let n=0,i=0;i<t.length;i++){let r=t[i];if(r.empty?r.from<=n:r.from<n)return R.normalized(t.slice(),e);n=r.to}return new R(t,e)}static cursor(t,e=0,n,i){return B.create(t,t,(0==e?0:e<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:16777215)<<6)}static range(t,e,n,i){let r=(null!=n?n:16777215)<<6|(null==i?7:Math.min(6,i));return e<t?B.create(e,t,48|r):B.create(t,e,(e>t?8:0)|r)}static normalized(t,e=0){let n=t[e];t.sort((t,e)=>t.from-e.from),e=t.indexOf(n);for(let n=1;n<t.length;n++){let i=t[n],r=t[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let s=r.from,o=Math.max(i.to,r.to);n<=e&&e--,t.splice(--n,2,i.anchor>i.head?R.range(o,s):R.range(s,o))}}return new R(t,e)}}function L(t,e){for(let n of t.ranges)if(n.to>e)throw RangeError("Selection points outside of document")}let J=0;class j{constructor(t,e,n,i,r){this.combine=t,this.compareInput=e,this.compare=n,this.isStatic=i,this.id=J++,this.default=t([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(t={}){return new j(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:F),!!t.static,t.enables)}of(t){return new q([],this,0,t)}compute(t,e){if(this.isStatic)throw Error("Can't compute a static facet");return new q(t,this,1,e)}computeN(t,e){if(this.isStatic)throw Error("Can't compute a static facet");return new q(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],n=>e(n.field(t)))}}function F(t,e){return t==e||t.length==e.length&&t.every((t,n)=>t===e[n])}class q{constructor(t,e,n,i){this.dependencies=t,this.facet=e,this.type=n,this.value=i,this.id=J++}dynamicSlot(t){var e;let n=this.value,i=this.facet.compareInput,r=this.id,s=t[r]>>1,o=2==this.type,l=!1,a=!1,h=[];for(let n of this.dependencies)"doc"==n?l=!0:"selection"==n?a=!0:((null!==(e=t[n.id])&&void 0!==e?e:1)&1)==0&&h.push(t[n.id]);return{create:t=>(t.values[s]=n(t),1),update(t,e){if(l&&e.docChanged||a&&(e.docChanged||e.selection)||_(t,h)){let e=n(t);if(o?!$(e,t.values[s],i):!i(e,t.values[s]))return t.values[s]=e,1}return 0},reconfigure:(t,e)=>{let l,a=e.config.address[r];if(null!=a){let r=X(e,a);if(this.dependencies.every(n=>n instanceof j?e.facet(n)===t.facet(n):!(n instanceof z)||e.field(n,!1)==t.field(n,!1))||(o?$(l=n(t),r,i):i(l=n(t),r)))return t.values[s]=r,0}else l=n(t);return t.values[s]=l,1}}}}function $(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function _(t,e){let n=!1;for(let i of e)1&Y(t,i)&&(n=!0);return n}let W=j.define({static:!0});class z{constructor(t,e,n,i,r){this.id=t,this.createF=e,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(t){let e=new z(J++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(W).find(t=>t.field==this);return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,n)=>{let i=t.values[e],r=this.updateF(i,n);return this.compareF(i,r)?0:(t.values[e]=r,1)},reconfigure:(t,n)=>null!=n.config.address[this.id]?(t.values[e]=n.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,W.of({field:this,create:t})]}get extension(){return this}}let U={lowest:4,low:3,default:2,high:1,highest:0};function V(t){return e=>new H(e,t)}let Z={highest:V(U.highest),high:V(U.high),default:V(U.default),low:V(U.low),lowest:V(U.lowest)};class H{constructor(t,e){this.inner=t,this.prec=e}}class Q{of(t){return new K(this,t)}reconfigure(t){return Q.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class K{constructor(t,e){this.compartment=t,this.inner=e}}class G{constructor(t,e,n,i,r,s){for(this.base=t,this.compartments=e,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,n){let i,r,s=[],o=Object.create(null),l=new Map;for(let n of(i=[[],[],[],[],[]],r=new Map,!function t(n,s){let o=r.get(n);if(null!=o){if(o<=s)return;let t=i[o].indexOf(n);t>-1&&i[o].splice(t,1),n instanceof K&&l.delete(n.compartment)}if(r.set(n,s),Array.isArray(n))for(let e of n)t(e,s);else if(n instanceof K){if(l.has(n.compartment))throw RangeError("Duplicate use of compartment in extensions");let i=e.get(n.compartment)||n.inner;l.set(n.compartment,i),t(i,s)}else if(n instanceof H)t(n.inner,n.prec);else if(n instanceof z)i[s].push(n),n.provides&&t(n.provides,s);else if(n instanceof q)i[s].push(n),n.facet.extensions&&t(n.facet.extensions,U.default);else{let e=n.extension;if(!e)throw Error(`Unrecognized extension value in extension set (${n}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(e,s)}}(t,U.default),i.reduce((t,e)=>t.concat(e))))n instanceof z?s.push(n):(o[n.facet.id]||(o[n.facet.id]=[])).push(n);let a=Object.create(null),h=[],c=[];for(let t of s)a[t.id]=c.length<<1,c.push(e=>t.slot(e));let u=null==n?void 0:n.config.facets;for(let t in o){let e=o[t],i=e[0].facet,r=u&&u[t]||[];if(e.every(t=>0==t.type)){if(a[i.id]=h.length<<1|1,F(r,e))h.push(n.facet(i));else{let t=i.combine(e.map(t=>t.value));h.push(n&&i.compare(t,n.facet(i))?n.facet(i):t)}}else{for(let t of e)0==t.type?(a[t.id]=h.length<<1|1,h.push(t.value)):(a[t.id]=c.length<<1,c.push(e=>t.dynamicSlot(e)));a[i.id]=c.length<<1,c.push(t=>(function(t,e,n){let i=n.map(e=>t[e.id]),r=n.map(t=>t.type),s=i.filter(t=>!(1&t)),o=t[e.id]>>1;function l(t){let n=[];for(let e=0;e<i.length;e++){let s=X(t,i[e]);if(2==r[e])for(let t of s)n.push(t);else n.push(s)}return e.combine(n)}return{create(t){for(let e of i)Y(t,e);return t.values[o]=l(t),1},update(t,n){if(!_(t,s))return 0;let i=l(t);return e.compare(i,t.values[o])?0:(t.values[o]=i,1)},reconfigure(t,r){let s=_(t,i),a=r.config.facets[e.id],h=r.facet(e);if(a&&!s&&F(n,a))return t.values[o]=h,0;let c=l(t);return e.compare(c,h)?(t.values[o]=h,0):(t.values[o]=c,1)}}})(t,i,e))}}return new G(t,l,c.map(t=>t(a)),a,h,o)}}function Y(t,e){if(1&e)return 2;let n=e>>1,i=t.status[n];if(4==i)throw Error("Cyclic dependency between fields and/or facets");if(2&i)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function X(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}let tt=j.define(),te=j.define({combine:t=>t.some(t=>t),static:!0}),tn=j.define({combine:t=>t.length?t[0]:void 0,static:!0}),ti=j.define(),tr=j.define(),ts=j.define(),to=j.define({combine:t=>!!t.length&&t[0]});class tl{constructor(t,e){this.type=t,this.value=e}static define(){return new ta}}class ta{of(t){return new tl(this,t)}}class th{constructor(t){this.map=t}of(t){return new tc(this,t)}}class tc{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new tc(this.type,e)}is(t){return this.type==t}static define(t={}){return new th(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let n=[];for(let i of t){let t=i.map(e);t&&n.push(t)}return n}}tc.reconfigure=tc.define(),tc.appendConfig=tc.define();class tu{constructor(t,e,n,i,r,s){this.startState=t,this.changes=e,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,n&&L(n,e.newLength),r.some(t=>t.type==tu.time)||(this.annotations=r.concat(tu.time.of(Date.now())))}static create(t,e,n,i,r,s){return new tu(t,e,n,i,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(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(tu.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function tf(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=M.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):null===(i=t.selection)||void 0===i?void 0:i.map(r),effects:tc.mapEffects(t.effects,r).concat(tc.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function td(t,e,n){let i=e.selection,r=tm(e.annotations);return e.userEvent&&(r=r.concat(tu.userEvent.of(e.userEvent))),{changes:e.changes instanceof M?e.changes:M.of(e.changes||[],n,t.facet(tn)),selection:i&&(i instanceof R?i:R.single(i.anchor,i.head)),effects:tm(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}tu.time=tl.define(),tu.userEvent=tl.define(),tu.addToHistory=tl.define(),tu.remote=tl.define();let tp=[];function tm(t){return null==t?tp:Array.isArray(t)?t:[t]}var tg=((A=tg||(tg={}))[A.Word=0]="Word",A[A.Space=1]="Space",A[A.Other=2]="Other",A);let tv=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{i=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}class ty{constructor(t,e,n,i,r,s){this.config=t,this.doc=e,this.selection=n,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=r,s&&(s._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)Y(this,t<<1);this.computeSlot=null}field(t,e=!0){let n=this.config.address[t.id];if(null==n){if(e)throw RangeError("Field is not present in this state");return}return Y(this,n),X(this,n)}update(...t){return function t(e,n,i){let r=td(e,n.length?n[0]:{},e.doc.length);n.length&&!1===n[0].filter&&(i=!1);for(let t=1;t<n.length;t++){!1===n[t].filter&&(i=!1);let s=!!n[t].sequential;r=tf(r,td(e,n[t],s?r.changes.newLength:e.doc.length),s)}let s=tu.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(t){let e=t.startState,n=e.facet(ts),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=tf(i,td(e,s,t.changes.newLength),!0))}return i==t?t:tu.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(i?function(e){let n=e.startState,i=!0;for(let t of n.facet(ti)){let n=t(e);
vendor: 5,171 bytes, line 1
1if(!1===n){i=!1;break}Array.isArray(n)&&(i=!0===i?n:function(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],o=t[i++];else{if(!(r<e.length))return n;s=e[r++],o=e[r++]}!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}(i,n))}if(!0!==i){let t,r;if(!1===i)r=e.changes.invertedDesc,t=M.empty(n.doc.length);else{let n=e.changes.filter(i);t=n.changes,r=n.filtered.mapDesc(n.changes).invertedDesc}e=tu.create(n,t,e.selection&&e.selection.map(r),tc.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let r=n.facet(tr);for(let i=r.length-1;i>=0;i--){let s=r[i](e);e=s instanceof tu?s:Array.isArray(s)&&1==s.length&&s[0]instanceof tu?s[0]:t(n,tm(s),!1)}return e}(s):s)}(this,t,!0)}applyTransaction(t){let e,n=this.config,{base:i,compartments:r}=n;for(let e of t.effects)e.is(Q.reconfigure)?(n&&(r=new Map,n.compartments.forEach((t,e)=>r.set(e,t)),n=null),r.set(e.value.compartment,e.value.extension)):e.is(tc.reconfigure)?(n=null,i=e.value):e.is(tc.appendConfig)&&(n=null,i=tm(i).concat(e.value));e=n?t.startState.values.slice():new ty(n=G.resolve(i,r,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(t,e)=>e.reconfigure(t,this),null).values;let s=t.startState.facet(te)?t.newSelection:t.newSelection.asSingle();new ty(n,t.newDoc,s,e,(e,n)=>n.update(e,t),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:R.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,n=t(e.ranges[0]),i=this.changes(n.changes),r=[n.range],s=tm(n.effects);for(let n=1;n<e.ranges.length;n++){let o=t(e.ranges[n]),l=this.changes(o.changes),a=l.map(i);for(let t=0;t<n;t++)r[t]=r[t].map(a);let h=i.mapDesc(l,!0);r.push(o.range.map(h)),i=i.compose(a),s=tc.mapEffects(s,a).concat(tc.mapEffects(tm(o.effects),h))}return{changes:i,selection:R.create(r,e.mainIndex),effects:s}}changes(t=[]){return t instanceof M?t:M.of(t,this.doc.length,this.facet(ty.lineSeparator))}toText(t){return r.of(t.split(this.facet(ty.lineSeparator)||k))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(Y(this,e),X(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let n in t){let i=t[n];i instanceof z&&null!=this.config.address[i.id]&&(e[n]=i.spec.toJSON(this.field(t[n]),this))}return e}static fromJSON(t,e={},n){if(!t||"string"!=typeof t.doc)throw RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(t,e)){let r=n[e],s=t[e];i.push(r.init(t=>r.spec.fromJSON(s,t)))}}return ty.create({doc:t.doc,selection:R.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=G.resolve(t.extensions||[],new Map),n=t.doc instanceof r?t.doc:r.of((t.doc||"").split(e.staticFacet(ty.lineSeparator)||k)),i=t.selection?t.selection instanceof R?t.selection:R.single(t.selection.anchor,t.selection.head):R.single(0);return L(i,n.length),e.staticFacet(te)||(i=i.asSingle()),new ty(e,n,i,e.dynamicSlots.map(()=>null),(t,e)=>e.create(t),null)}get tabSize(){return this.facet(ty.tabSize)}get lineBreak(){return this.facet(ty.lineSeparator)||"\n"}get readOnly(){return this.facet(to)}phrase(t,...e){for(let e of this.facet(ty.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(t,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>e.length?t:e[i-1]})),t}languageDataAt(t,e,n=-1){let i=[];for(let r of this.facet(tt))for(let s of r(this,e,n))Object.prototype.hasOwnProperty.call(s,t)&&i.push(s[t]);return i}charCategorizer(t){var e;return e=this.languageDataAt("wordChars",t).join(""),t=>{if(!/\S/.test(t))return tg.Space;if(function(t){if(i)return i.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||tv.test(n)))return!0}return!1}(t))return tg.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return tg.Word;return tg.Other}}wordAt(t){let{text:e,from:n,length:i}=this.doc.lineAt(t),r=this.charCategorizer(t),s=t-n,o=t-n;for(;s>0;){let t=m(e,s,!1);if(r(e.slice(t,s))!=tg.Word)break;s=t}for(;o<i;){let t=m(e,o);if(r(e.slice(o,t))!=tg.Word)break;o=t}return s==o?null:R.range(s+n,o+n)}}function tx(t,e,n={}){let i={};for(let e of t)for(let t of Object.keys(e)){let r=e[t],s=i[t];if(void 0===s)i[t]=r;else if(s===r||void 0===r);else if(Object.hasOwnProperty.call(n,t))i[t]=n[t](s,r);else throw Error("Config merge conflict for field "+t)}for(let t in e)void 0===i[t]&&(i[t]=e[t]);return i}ty.allowMultipleSelections=te,ty.tabSize=j.define({combine:t=>t.length?t[0]:4}),ty.lineSeparator=tn,ty.readOnly=to,ty.phrases=j.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(n=>t[n]==e[n])}}),ty.languageData=tt,ty.changeFilter=ti,ty.transactionFilter=tr,ty.transactionExtender=ts,Q.reconfigure=tc.define();class tb{eq(t){return this==t}range(t,e=t){return tw.create(t,e,this)}}tb.prototype.startSide=tb.prototype.endSide=0,tb.prototype.point=!1,tb.prototype.mapM
vendor: 10,081 bytes, line 1
1ode=C.TrackDel;class tw{constructor(t,e,n){this.from=t,this.to=e,this.value=n}static create(t,e,n){return new tw(t,e,n)}}function tk(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class tS{constructor(t,e,n,i){this.from=t,this.to=e,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,n,i=0){let r=n?this.to:this.from;for(let s=i,o=r.length;;){if(s==o)return s;let i=s+o>>1,l=r[i]-t||(n?this.value[i].endSide:this.value[i].startSide)-e;if(i==s)return l>=0?s:o;l>=0?o=i:s=i+1}}between(t,e,n,i){for(let r=this.findIndex(e,-1e9,!0),s=this.findIndex(n,1e9,!1,r);r<s;r++)if(!1===i(this.from[r]+t,this.to[r]+t,this.value[r]))return!1}map(t,e){let n=[],i=[],r=[],s=-1,o=-1;for(let l=0;l<this.value.length;l++){let a=this.value[l],h=this.from[l]+t,c=this.to[l]+t,u,f;if(h==c){let t=e.mapPos(h,a.startSide,a.mapMode);if(null==t||(u=f=t,a.startSide!=a.endSide&&(f=e.mapPos(h,a.endSide))<u))continue}else if((u=e.mapPos(h,a.startSide))>(f=e.mapPos(c,a.endSide))||u==f&&a.startSide>0&&a.endSide<=0)continue;0>(f-u||a.endSide-a.startSide)||(s<0&&(s=u),a.point&&(o=Math.max(o,f-u)),n.push(a),i.push(u-s),r.push(f-s))}return{mapped:n.length?new tS(i,r,n,o):null,pos:s}}}class tA{constructor(t,e,n,i){this.chunkPos=t,this.chunk=e,this.nextLayer=n,this.maxPoint=i}static create(t,e,n,i){return new tA(t,e,n,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=t,s=t.filter;if(0==e.length&&!s)return this;if(n&&(e=e.slice().sort(tk)),this.isEmpty)return e.length?tA.of(e):this;let o=new tM(this,null,-1).goto(0),l=0,a=[],h=new tC;for(;o.value||l<e.length;)if(l<e.length&&(o.from-e[l].from||o.startSide-e[l].value.startSide)>=0){let t=e[l++];h.addInner(t.from,t.to,t.value)||a.push(t)}else 1==o.rangeIndex&&o.chunkIndex<this.chunk.length&&(l==e.length||this.chunkEnd(o.chunkIndex)<e[l].from)&&(!s||i>this.chunkEnd(o.chunkIndex)||r<this.chunkPos[o.chunkIndex])&&h.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!s||i>o.to||r<o.from||s(o.from,o.to,o.value))&&!h.addInner(o.from,o.to,o.value)&&a.push(tw.create(o.from,o.to,o.value)),o.next());return h.finishInner(this.nextLayer.isEmpty&&!a.length?tA.empty:this.nextLayer.update({add:a,filter:s,filterFrom:i,filterTo:r}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r],l=t.touchesRange(s,s+o.length);if(!1===l)i=Math.max(i,o.maxPoint),e.push(o),n.push(t.mapPos(s));else if(!0===l){let{mapped:r,pos:l}=o.map(s,t);r&&(i=Math.max(i,r.maxPoint),e.push(r),n.push(l))}}let r=this.nextLayer.map(t);return 0==e.length?r:new tA(n,e,r||tA.empty,i)}between(t,e,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],s=this.chunk[i];if(e>=r&&t<=r+s.length&&!1===s.between(r,t-r,e-r,n))return}this.nextLayer.between(t,e,n)}}iter(t=0){return tT.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return tT.from(t).goto(e)}static compare(t,e,n,i,r=-1){let s=t.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r),o=e.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r),l=tI(s,o,n),a=new tP(s,l,r),h=new tP(o,l,r);n.iterGaps((t,e,n)=>tD(a,t,h,e,n,i)),n.empty&&0==n.length&&tD(a,0,h,0,0,i)}static eq(t,e,n=0,i){null==i&&(i=999999999);let r=t.filter(t=>!t.isEmpty&&0>e.indexOf(t)),s=e.filter(e=>!e.isEmpty&&0>t.indexOf(e));if(r.length!=s.length)return!1;if(!r.length)return!0;let o=tI(r,s),l=new tP(r,o,0).goto(n),a=new tP(s,o,0).goto(n);for(;;){if(l.to!=a.to||!tE(l.active,a.active)||l.point&&(!a.point||!l.point.eq(a.point)))return!1;if(l.to>i)return!0;l.next(),a.next()}}static spans(t,e,n,i,r=-1){let s=new tP(t,null,r).goto(e),o=e,l=s.openStart;for(;;){let t=Math.min(s.to,n);if(s.point){let n=s.activeForPoint(s.to),r=s.pointFrom<e?n.length+1:s.point.startSide<0?n.length:Math.min(n.length,l);i.point(o,t,s.point,n,r,s.pointRank),l=Math.min(s.openEnd(t),n.length)}else t>o&&(i.span(o,t,s.active,l),l=s.openEnd(t));if(s.to>n)return l+(s.point&&s.to>n?1:0);o=s.to,s.next()}}static of(t,e=!1){let n=new tC;for(let i of t instanceof tw?[t]:e?function(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(tk(e,i)>0)return t.slice().sort(tk);e=i}return t}(t):t)n.add(i.from,i.to,i.value);return n.finish()}static join(t){if(!t.length)return tA.empty;let e=t[t.length-1];for(let n=t.length-2;n>=0;n--)for(let i=t[n];i!=tA.empty;i=i.nextLayer)e=new tA(i.chunkPos,i.chunk,e,Math.max(i.maxPoint,e.maxPoint));return e}}tA.empty=new tA([],[],null,-1),tA.empty.nextLayer=tA.empty;class tC{finishChunk(t){this.chunks.push(new tS(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,t&&(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(t,e,n){this.addInner(t,e,n)||(this.nextLayer||(this.nextLayer=new tC)).add(t,e,n)}addInner(t,e,n){let i=t-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&0>(t-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if(0>(t-this.lastTo||e.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}finish(){return this.finishInner(tA.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=tA.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function tI(t,e,n){let i=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&i.set(e.chunk[t],e.chunkPos[t]);let r=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let s=i.get(t.chunk[e]);null==s||(n?n.mapPos(s):s)!=t.chunkPos[e]||(null==n?void 0:n.touchesRange(s,s+t.chunk[e].length))||r.add(t.chunk[e])}return r}class tM{constructor(t,e,n,i=0){this.layer=t,this.skip=e,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,n){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,e){0>(this.to-t||this.endSide-e)&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],n=t+e.from[this.rangeIndex];if(this.from=n,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class tT{constructor(t){this.heap=t}static from(t,e=null,n=-1){let i=[];for(let r=0;r<t.length;r++)for(let s=t[r];!s.isEmpty;s=s.nextLayer)s.maxPoint>=n&&i.push(new tM(s,e,n,r));return 1==i.length?i[0]:new tT(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let n of this.heap)n.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)tO(this.heap,t);return this.next(),this}forward(t,e){for(let n of this.heap)n.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)tO(this.heap,t);0>(this.to-t||this.value.endSide-e)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),tO(this.heap,0)}}}function tO(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),0>n.compare(r))break;t[i]=n,t[e]=r,e=i}}class tP{constructor(t,e,n){this.minPoint=n,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=tT.from(t,e,n)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e);)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){tN(this.active,t),tN(this.activeTo,t),tN(this.activeRank,t),this.minActive=tR(this.active,this.activeTo)}
1addActive(t){let e=0,{value:n,to:i,rank:r}=this.cursor;for(;e<this.activeRank.length&&(r-this.activeRank[e]||i-this.activeTo[e])>0;)e++;tB(this.active,e,n),tB(this.activeTo,e,i),tB(this.activeRank,e,r),t&&tB(t,e,this.cursor.from),this.minActive=tR(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&0>(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&tN(n,i)}else if(this.cursor.value){if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else this.addActive(n),this.cursor.next()}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let e=n.length-1;e>=0&&n[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>=this.point.endSide)&&e.push(this.active[n]);return e.reverse()}openEnd(t){let e=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>t;n--)e++;return e}}function tD(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,a=i-e;for(;;){let e=t.to+a-n.to||t.endSide-n.endSide,i=e<0?t.to+a:n.to,r=Math.min(i,o);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&tE(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,r,t.point,n.point):r>l&&!tE(t.active,n.active)&&s.compareRange(l,r,t.active,n.active),i>o)break;l=i,e<=0&&t.next(),e>=0&&n.next()}}function tE(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function tN(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function tB(t,e,n){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=n}function tR(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)0>(e[r]-i||t[r].endSide-t[n].endSide)&&(n=r,i=e[r]);return n}function tL(t,e,n=t.length){let i=0;for(let r=0;r<n;)9==t.charCodeAt(r)?(i+=e-i%e,r++):(i++,r=m(t,r));return i}function tJ(t,e,n,i){for(let i=0,r=0;;){if(r>=e)return i;if(i==t.length)break;r+=9==t.charCodeAt(i)?n-r%n:1,i=m(t,i)}return!0===i?-1:t.length}},73544:function(t,e,n){var i,r;n.d(e,{FE:function(){return J},Jq:function(){return u},L3:function(){return s},Lj:function(){return f},_b:function(){return R},hr:function(){return N},i9:function(){return B},md:function(){return a},mp:function(){return m},vj:function(){return i}});let s=1024,o=0;class l{constructor(t,e){this.from=t,this.to=e}}class a{constructor(t={}){this.id=o++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=u.match(t)),e=>{let n=t(e);return void 0===n?null:[this,n]}}}a.closedBy=new a({deserialize:t=>t.split(" ")}),a.openedBy=new a({deserialize:t=>t.split(" ")}),a.group=new a({deserialize:t=>t.split(" ")}),a.isolate=new a({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw RangeError("Invalid value for isolate: "+t);return t||"auto"}}),a.contextHash=new a({perNode:!0}),a.lookAhead=new a({perNode:!0}),a.mounted=new a({perNode:!0});class h{constructor(t,e,n){this.tree=t,this.overlay=e,this.parser=n}static get(t){return t&&t.props&&t.props[a.mounted.id]}}let c=Object.create(null);class u{constructor(t,e,n,i=0){this.name=t,this.props=e,this.id=n,this.flags=i}static define(t){let e=t.props&&t.props.length?Object.create(null):c,n=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),i=new u(t.name||"",e,t.id,n);if(t.props){for(let n of t.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");e[n[0].id]=n[1]}}return i}prop(t){return this.props[t.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(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(a.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let n in t)for(let i of n.split(" "))e[i]=t[n];return t=>{for(let n=t.prop(a.group),i=-1;i<(n?n.length:0);i++){let r=e[i<0?t.name:n[i]];if(r)return r}}}}u.none=new u("",Object.create(null),0,8);class f{constructor(t){this.types=t;
1for(let e=0;e<t.length;e++)if(t[e].id!=e)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let n of this.types){let i=null;for(let e of t){let t=e(n);t&&(i||(i=Object.assign({},n.props)),i[t[0].id]=t[1])}e.push(i?new u(n.name,i,n.id,n.flags):n)}return new f(e)}}let d=new WeakMap,p=new WeakMap;(r=i||(i={}))[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays";class m{constructor(t,e,n,i,r){if(this.type=t,this.children=e,this.positions=n,this.length=i,this.props=null,r&&r.length)for(let[t,e]of(this.props=Object.create(null),r))this.props["number"==typeof t?t:t.id]=e}toString(){let t=h.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let t of this.children){let n=t.toString();n&&(e&&(e+=","),e+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new T(this.topNode,t)}cursorAt(t,e=0,n=0){let i=new T(d.get(this)||this.topNode);return i.moveTo(t,e),d.set(this,i._tree),i}get topNode(){return new w(this,0,0,null)}resolve(t,e=0){let n=x(d.get(this)||this.topNode,t,e,!1);return d.set(this,n),n}resolveInner(t,e=0){let n=x(p.get(this)||this.topNode,t,e,!0);return p.set(this,n),n}resolveStack(t,e=0){return function(t,e,n){let i=t.resolveInner(e,n),r=null;for(let t=i instanceof w?i:i.context.parent;t;t=t.parent)if(t.index<0){let s=t.parent;(r||(r=[i])).push(s.resolve(e,n)),t=s}else{let s=h.get(t.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let o=new w(s.tree,s.overlay[0].from+t.from,-1,t);(r||(r=[i])).push(x(o,e,n,!1))}}return r?I(r):i}(this,t,e)}iterate(t){let{enter:e,leave:n,from:r=0,to:s=this.length}=t,o=t.mode||0,l=(o&i.IncludeAnonymous)>0;for(let t=this.cursor(o|i.IncludeAnonymous);;){let i=!1;if(t.from<=s&&t.to>=r&&(!l&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;i=!0}for(;i&&n&&(l||!t.type.isAnonymous)&&n(t),!t.nextSibling();){if(!t.parent())return;i=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:E(u.none,this.children,this.positions,0,this.children.length,0,this.length,(t,e,n)=>new m(this.type,t,e,n,this.propValues),t.makeTree||((t,e,n)=>new m(u.none,t,e,n)))}static build(t){return function(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=s,reused:o=[],minRepeatType:l=i.types.length}=t,h=Array.isArray(n)?new g(n,n.length):n,c=i.types,u=0,f=0;function d(t,e,n,r,s,o,l,a,h){let c=[],u=[];for(;t.length>r;)c.push(t.pop()),u.push(e.pop()+n-s);t.push(p(i.types[l],c,u,o-s,a-o,h)),e.push(s-n)}function p(t,e,n,i,r,s,o){if(s){let t=[a.contextHash,s];o=o?[t].concat(o):[t]}if(r>25){let t=[a.lookAhead,r];o=o?[t].concat(o):[t]}return new m(t,e,n,i,o)}let y=[],x=[];for(;h.pos>0;)!function t(e,n,s,g,y,x){let{id:b,start:w,end:k,size:S}=h,A=f,C=u;for(;S<0;){if(h.next(),-1==S){let t=o[b];s.push(t),g.push(w-e);return}if(-3==S){u=b;return}if(-4==S){f=b;return}throw RangeError(`Unrecognized record size: ${S}`)}let I=c[b],M,T,O=w-e;if(k-w<=r&&(T=function(t,e){let n=h.fork(),i=0,s=0,o=0,a=n.end-r,c={size:0,start:0,skip:0};n:for(let r=n.pos-t;n.pos>r;){let t=n.size;if(n.id==e&&t>=0){c.size=i,c.start=s,c.skip=o,o+=4,i+=4,n.next();continue}let h=n.pos-t;if(t<0||h<r||n.start<a)break;let u=n.id>=l?4:0,f=n.start;for(n.next();n.pos>h;){if(n.size<0){if(-3==n.size)u+=4;else break n}else n.id>=l&&(u+=4);n.next()}s=f,i+=t,o+=u}return(e<0||i==t)&&(c.size=i,c.start=s,c.skip=o),c.size>4?c:void 0}(h.pos-n,y))){let t=new Uint16Array(T.size-T.skip),n=h.pos-T.size,r=t.length;for(;h.pos>n;)r=function t(e,n,i){let{id:r,start:s,end:o,size:a}=h;if(h.next(),a>=0&&r<l){let l=i;if(a>4){let r=h.pos-(a-4);for(;h.pos>r;)i=t(e,n,i)}n[--i]=l,n[--i]=o-e,n[--i]=s-e,n[--i]=r}else -3==a?u=r:-4==a&&(f=r);return i}(T.start,t,r);M=new v(t,k-T.start,i),O=T.start-e}else{let e=h.pos-S;h.next();let n=[],s=[],o=b>=l?b:-1,c=0,u=k;for(;h.pos>e;)o>=0&&h.id==o&&h.size>=0?(h.end<=u-r&&(d(n,s,w,c,h.end,u,o,A,C),c=n.length,u=h.end),h.next()):x>2500?function(t,e,n,s){let o=[],l=0,a=-1;for(;h.pos>e;){let{id:t,start:e,end:n,size:i}=h;if(i>4)h.next();else if(a>-1&&e<a)break;else a<0&&(a=n-r),o.push(t,e,n),l++,h.next()}if(l){let e=new Uint16Array(4*l),r=o[o.length-2];for(let t=o.length-3,n=0;t>=0;t-=3)e[n++]=o[t],e[n++]=o[t+1]-r,e[n++]=o[t+2]-r,e[n++]=n;n.push(new v(e,o[2]-r,i)),s.push(r-t)}}(w,e,n,s):t(w,e,n,s,o,x+1);if(o>=0&&c>0&&c<n.length&&d(n,s,w,c,w,u,o,A,C),n.reverse(),s.reverse(),o>-1&&c>0){let t=function(t,e){return(n,i,r)=>{let s=0,o=n.length-1,l,h;if(o>=0&&(l=n[o])instanceof m){if(!o&&l.type==t&&l.length==r)return l;(h=l.prop(a.lookAhead))&&(s=i[o]+l.length+h)}return p(t,n,i,r,s,e)}}(I,C);M=E(I,n,s,0,n.length,0,k-w,t,t)}else M=p(I,n,s,k-w,A-k,C)}
vendor: 6,968 bytes, line 1
1s.push(M),g.push(O)}(t.start||0,t.bufferStart||0,y,x,-1,0);let b=null!==(e=t.length)&&void 0!==e?e:y.length?x[0]+y[0].length:0;return new m(c[t.topID],y.reverse(),x.reverse(),b)}(t)}}m.empty=new m(u.none,[],[],0);class g{constructor(t,e){this.buffer=t,this.index=e}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 g(this.buffer,this.index)}}class v{constructor(t,e,n){this.buffer=t,this.length=e,this.set=n}get type(){return u.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],n=this.buffer[t+3],i=this.set.types[e],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(t+=4))return r;let s=[];for(;t<n;)s.push(this.childString(t)),t=this.buffer[t+3];return r+"("+s.join(",")+")"}findChild(t,e,n,i,r){let{buffer:s}=this,o=-1;for(let l=t;l!=e&&(!y(r,i,s[l+1],s[l+2])||(o=l,!(n>0)));l=s[l+3]);return o}slice(t,e,n){let i=this.buffer,r=new Uint16Array(e-t),s=0;for(let o=t,l=0;o<e;){r[l++]=i[o++],r[l++]=i[o++]-n;let e=r[l++]=i[o++]-n;r[l++]=i[o++]-t,s=Math.max(s,e)}return new v(r,s,this.set)}}function y(t,e,n,i){switch(t){case -2:return n<e;case -1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function x(t,e,n,r){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let e=!r&&t instanceof w&&t.index<0?null:t.parent;if(!e)return t;t=e}let o=r?0:i.IgnoreOverlays;if(r)for(let i=t,r=i.parent;r;r=(i=r).parent)i instanceof w&&i.index<0&&(null===(s=r.enter(e,n,o))||void 0===s?void 0:s.from)!=i.from&&(t=r);for(;;){let i=t.enter(e,n,o);if(!i)return t;t=i}}class b{cursor(t=0){return new T(this,t)}getChild(t,e=null,n=null){let i=k(this,t,e,n);return i.length?i[0]:null}getChildren(t,e=null,n=null){return k(this,t,e,n)}resolve(t,e=0){return x(this,t,e,!1)}resolveInner(t,e=0){return x(this,t,e,!0)}matchContext(t){return S(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),n=this;for(;e;){let t=e.lastChild;if(!t||t.to!=e.to)break;t.type.isError&&t.from==t.to?(n=e,e=t.prevSibling):e=t}return n}get node(){return this}get next(){return this.parent}}class w extends b{constructor(t,e,n,i){super(),this._tree=t,this.from=e,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,n,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=e>0?l.length:-1;t!=c;t+=e){let c=l[t],u=a[t]+o.from;if(y(r,n,u,u+c.length)){if(c instanceof v){if(s&i.ExcludeBuffers)continue;let l=c.findChild(0,c.buffer.length,e,n-u,r);if(l>-1)return new C(new A(o,c,t,u),null,l)}else if(s&i.IncludeAnonymous||!c.type.isAnonymous||O(c)){let l;if(!(s&i.IgnoreMounts)&&(l=h.get(c))&&!l.overlay)return new w(l.tree,u,t,o);let a=new w(c,u,t,o);return s&i.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(e<0?c.children.length-1:0,e,n,r)}}}if(s&i.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,!(o=o._parent)))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(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,n=0){let r;if(!(n&i.IgnoreOverlays)&&(r=h.get(this._tree))&&r.overlay){let n=t-this.from;for(let{from:t,to:i}of r.overlay)if((e>0?t<=n:t<n)&&(e<0?i>=n:i>n))return new w(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,n)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}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 k(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(null!=n){for(let t=!1;!t;)if(t=r.type.is(n),!r.nextSibling())return s}for(;;){if(null!=i&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return null==i?s:[]}}function S(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class A{constructor(t,e,n,i){this.parent=t,this.buffer=e,this.index=n,this.start=i}}class C extends b{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(t,e,n){super(),this.context=t,this._parent=e,this.index=n,this.type=t.buffer.set.types[t.buffer.buffer[n]]}child(t,e,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.context.start,n);return r<0?null:new C(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,n=0){if(n&i.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return s<0?null:new C(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new C(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new C(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let s=n.buffer[this.index+1];t.push(n.slice(i,r,s)),e.push(0)}return new m(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function I(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;i<t.length;i++){let r=t[i];(r.from>n.from||r.to<n.to)&&(n=r,e=i)}let i=n instanceof w&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new M(r,n)}class M{constructor(t,e){this.heads=t,this.node=e}get next(){return I(this.heads)}}class T{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof w)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;
vendor: 4,312 bytes, line 1
1for(let e=t._parent;e;e=e._parent)this.stack.unshift(e.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}yieldBuf(t,e){this.index=t;let{start:n,buffer:i}=this.buffer;return this.type=e||i.set.types[i.buffer[t]],this.from=n+i.buffer[t+1],this.to=n+i.buffer[t+2],!0}yield(t){return!!t&&(t instanceof w?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,n){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,n=this.mode){return this.buffer?!(n&i.ExcludeBuffers)&&this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&i.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&i.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));let{buffer:e}=this.buffer,n=this.stack.length-1;if(t<0){let t=n<0?0:this.stack[n]+4;if(this.index!=t)return this.yieldBuf(e.findChild(t,this.index,-1,0,4))}else{let t=e.buffer[this.index+3];if(t<(n<0?e.buffer.length:e.buffer[this.stack[n]+3]))return this.yieldBuf(t)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,n,{buffer:r}=this;if(r){if(t>0){if(this.index<r.buffer.buffer.length)return!1}else for(let t=0;t<this.index;t++)if(r.buffer.buffer[t+3]<this.index)return!1;({index:e,parent:n}=r)}else({index:e,_parent:n}=this._tree);for(;n;{index:e,_parent:n}=n)if(e>-1)for(let r=e+t,s=t<0?-1:n._tree.children.length;r!=s;r+=t){let t=n._tree.children[r];if(this.mode&i.IncludeAnonymous||t instanceof v||!t.type.isAnonymous||O(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,n=0;if(t&&t.context==this.buffer)n:for(let i=this.index,r=this.stack.length;r>=0;){for(let s=t;s;s=s._parent)if(s.index==i){if(i==this.index)return s;e=s,n=r+1;break n}i=this.stack[--r]}for(let t=n;t<this.stack.length;t++)e=new C(this.buffer,e,this.stack[t]);return this.bufferNode=new C(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&e&&e(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(t){if(!this.buffer)return S(this.node.parent,t);let{buffer:e}=this.buffer,{types:n}=e.set;for(let i=t.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return S(this._tree,t,i);let s=n[e.buffer[this.stack[r]]];if(!s.isAnonymous){if(t[i]&&t[i]!=s.name)return!1;i--}}return!0}}function O(t){return t.children.some(t=>t instanceof v||!t.type.isAnonymous||O(t))}let P=new WeakMap;function D(t,e){if(!t.isAnonymous||e instanceof v||e.type!=t)return 1;let n=P.get(e);if(null==n){for(let i of(n=1,e.children)){if(i.type!=t||!(i instanceof m)){n=1;break}n+=D(t,i)}P.set(e,n)}return n}function E(t,e,n,i,r,s,o,l,a){let h=0;for(let n=i;n<r;n++)h+=D(t,e[n]);let c=Math.ceil(1.5*h/8),u=[],f=[];return!function e(n,i,r,o,l){for(let h=r;h<o;
vendor: 1,480 bytes, line 1
1){let r=h,d=i[h],p=D(t,n[h]);for(h++;h<o;h++){let e=D(t,n[h]);if(p+e>=c)break;p+=e}if(h==r+1){if(p>c){let t=n[r];e(t.children,t.positions,0,t.children.length,i[r]+l);continue}u.push(n[r])}else{let e=i[h-1]+n[h-1].length-d;u.push(E(t,n,i,r,h,d,e,null,a))}f.push(d+l-s)}}(e,n,i,r,0),(l||a)(u,f,o)}class N{constructor(){this.map=new WeakMap}setBuffer(t,e,n){let i=this.map.get(t);i||this.map.set(t,i=new Map),i.set(e,n)}getBuffer(t,e){let n=this.map.get(t);return n&&n.get(e)}set(t,e){t instanceof C?this.setBuffer(t.context.buffer,t.index,e):t instanceof w&&this.map.set(t.tree,e)}get(t){return t instanceof C?this.getBuffer(t.context.buffer,t.index):t instanceof w?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class B{constructor(t,e,n,i,r=!1,s=!1){this.from=t,this.to=e,this.tree=n,this.offset=i,this.open=(r?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],n=!1){let i=[new B(0,t.length,t,0,!1,n)];for(let n of e)n.to>t.length&&i.push(n);return i}static applyChanges(t,e,n=128){if(!e.length)return t;let i=[],r=1,s=t.length?t[0]:null;for(let o=0,l=0,a=0;;o++){let h=o<e.length?e[o]:null,c=h?h.fromA:1e9;if(c-l>=n)for(;s&&s.from<c;){let e=s;if(l>=e.from||c<=e.to||a){let t=Math.max(e.from,l)-a,n=Math.min(e.to,c)-a;e=t>=n?null:new B(t,n,e.tree,e.offset+a,o>
10,!!h)}if(e&&i.push(e),s.to>c)break;s=r<t.length?t[r++]:null}if(!h)break;l=h.toA,a=h.toA-h.toB}return i}}class R{startParse(t,e,n){return"string"==typeof t&&(t=new L(t)),n=n?n.length?n.map(t=>new l(t.from,t.to)):[new l(0,0)]:[new l(0,t.length)],this.createParse(t,e||[],n)}parse(t,e,n){let i=this.startParse(t,e,n);for(;;){let t=i.advance();if(t)return t}}}class L{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function J(t){return(e,n,i,r)=>new _(e,t,n,i,r)}class j{constructor(t,e,n,i,r){this.parser=t,this.parse=e,this.overlay=n,this.target=i,this.from=r}}function F(t){if(!t.length||t.some(t=>t.from>=t.to))throw RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class q{constructor(t,e,n,i,r,s,o){this.parser=t,this.predicate=e,this.mounts=n,this.index=i,this.start=r,this.target=s,this.prev=o,this.depth=0,this.ranges=[]}}let $=new a({perNode:!0});class _{constructor(t,e,n,i,r){this.nest=e,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return null!=this.stoppedAt&&(t=new m(t.type,t.children,t.positions,t.length,t.propValues.concat([[$,this.stoppedAt]]))),t}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let n=Object.assign(Object.create(null),t.target.props);n[a.mounted.id]=new h(e,t.overlay,t.parser),t.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].from<t&&(t=Math.min(t,this.inner[e].parse.parsedPos));return t}stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].parse.stopAt(t)}startInner(){let t=new U(this.fragments),e=null,n=null,r=new T(new w(this.baseTree,this.ranges[0].from,0,null),i.IncludeAnonymous|i.IgnoreMounts);n:for(let i,s;;){let o=!0,a;if(null!=this.stoppedAt&&r.from>=this.stoppedAt)o=!1;else if(t.hasNode(r)){if(e){let t=e.mounts.find(t=>t.frag.from<=r.from&&t.frag.to>=r.to&&t.mount.overlay);if(t)for(let n of t.mount.overlay){let i=n.from+t.pos,s=n.to+t.pos;i>=r.from&&s<=r.to&&!e.ranges.some(t=>t.from<s&&t.to>i)&&e.ranges.push({from:i,to:s})}}o=!1}else if(n&&(s=function(t,e,n){for(let i of t){if(i.from>=n)break;if(i.to>e)return i.from<=e&&i.to>=n?2:1}return 0}(n.ranges,r.from,r.to)))o=2!=s;else if(!r.type.isAnonymous&&(i=this.nest(r,this.input))&&(r.from<r.to||!i.overlay)){r.tree||function(t){let{node:e}=t,n=[],i=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let r=t.tree,s=r.children.indexOf(i),o=r.children[s],l=o.buffer,a=[s];for(let i of(r.children[s]=function t(i,r,s,h,c,u){let f=n[u],d=[],p=[];W(o,i,f,d,p,h);let g=l[f+1],v=l[f+2];a.push(d.length);let y=u?t(f+4,l[f+3],o.set.types[l[f]],g,v-g,u-1):e.toTree();return d.push(y),p.push(g-h),W(o,l[f+3],r,d,p,h),new m(s,d,p,c)}(0,l.length,u.none,0,o.length,n.length-1),a)){let e=t.tree.children[i],n=t.tree.positions[i];t.yield(new w(e,n+t.from,i,t._tree))}}(r);let s=t.findMounts(r.from,i.parser);if("function"==typeof i.overlay)e=new q(i.parser,i.overlay,s,this.inner.length,r.from,r.tree,e);else{let t=V(this.ranges,i.overlay||(r.from<r.to?[new l(r.from,r.to)]:[]));t.length&&F(t),(t.length||!i.overlay)&&this.inner.push(new j(i.parser,t.length?i.parser.startParse(this.input,Z(s,t),t):i.parser.startParse(""),i.overlay?i.overlay.map(t=>new l(t.from-r.from,t.to-r.from)):null,r.tree,t.length?t[0].from:r.from)),i.overlay?t.length&&(n={ranges:t,depth:0,prev:n}):o=!1}}else if(e&&(a=e.predicate(r))&&(!0===a&&(a=new l(r.from,r.to)),a.from<a.to)){let t=e.ranges.length-1;t>=0&&e.ranges[t].to==a.from?e.ranges[t]={from:e.ranges[t].from,to:a.to}:e.ranges.push(a)}if(o&&r.firstChild())e&&e.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break n;if(e&&!--e.depth){let t=V(this.ranges,e.ranges);t.length&&(F(t),this.inner.splice(e.index,0,new j(e.parser,e.parser.startParse(this.input,Z(e.mounts,t),t),e.ranges.map(t=>new l(t.from-e.start,t.to-e.start)),e.target,t[0].from))),e=e.prev}!n||--n.depth||(n=n.prev)}}}}function W(t,e,n,i,r,s){if(e<n){let o=t.buffer[e+1];i.push(t.slice(e,n,o)),r.push(o-s)}}class z{constructor(t,e){this.offset=e,this.done=!1,this.cursor=t.cursor(i.IncludeAnonymous|i.IgnoreMounts)}moveTo(t){let{cursor:e}=this,n=t-this.offset;for(;!this.done&&e.from<n;)e.to>=t&&e.enter(n,1,i.IgnoreOverlays|i.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;
1if(e.children.length&&0==e.positions[0]&&e.children[0]instanceof m)e=e.children[0];else break}return!1}}class U{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let n=this.curFrag=t[0];this.curTo=null!==(e=n.tree.prop($))&&void 0!==e?e:n.to,this.inner=new z(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=e.tree.prop($))&&void 0!==t?t:e.to,this.inner=new z(e.tree,-e.offset)}}findMounts(t,e){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let t=this.inner.cursor.node;t;t=t.parent){let r=null===(n=t.tree)||void 0===n?void 0:n.prop(a.mounted);if(r&&r.parser==e)for(let e=this.fragI;e<this.fragments.length;e++){let n=this.fragments[e];if(n.from>=t.to)break;n.tree==this.curFrag.tree&&i.push({frag:n,pos:t.from-n.offset,mount:r})}}}return i}}function V(t,e){let n=null,i=e;for(let r=1,s=0;r<t.length;r++){let o=t[r-1].to,a=t[r].from;for(;s<i.length;s++){let t=i[s];if(t.from>=a)break;!(t.to<=o)&&(n||(i=n=e.slice()),t.from<o?(n[s]=new l(t.from,o),t.to>a&&n.splice(s+1,0,new l(a,t.to))):t.to>a?n[s--]=new l(a,t.to):n.splice(s--,1))}}return i}function Z(t,e){let n=[];for(let{pos:i,mount:r,frag:s}of t){let t=i+(r.overlay?r.overlay[0].from:0),o=t+r.tree.length,a=Math.max(s.from,t),h=Math.min(s.to,o);if(r.overlay){let o=function(t,e,n,i){let r=0,s=0,o=!1,a=!1,h=-1e9,c=[];for(;;){let u=r==t.length?1e9:o?t[r].to:t[r].from,f=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let t=Math.max(h,n),e=Math.min(u,f,i);t<e&&c.push(new l(t,e))}if(1e9==(h=Math.min(u,f)))break;u==h&&(o?(o=!1,r++):o=!0),f==h&&(a?(a=!1,s++):a=!0)}return c}(e,r.overlay.map(t=>new l(t.from+i,t.to+i)),a,h);for(let e=0,i=a;;e++){let l=e==o.length,a=l?h:o[e].from;if(a>i&&n.push(new B(i,a,r.tree,-t,s.from>=i||s.openStart,s.to<=a||s.openEnd)),l)break;i=o[e].to}}else n.push(new B(a,h,r.tree,-t,s.from>=t||s.openStart,s.to<=o||s.openEnd))}return n}},38397:function(t,e,n){n.d(e,{Gv:function(){return a},QR:function(){return u},Vp:function(){return s},bW:function(){return f},pJ:function(){return O}});var i=n(73544);let r=0;class s{constructor(t,e,n,i){this.name=t,this.set=e,this.base=n,this.modified=i,this.id=r++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){if(t instanceof s&&(e=t),null==e?void 0:e.base)throw Error("Can not derive from a modified tag");let n=new s("string"==typeof t?t:"?",[],null,[]);if(n.set.push(n),e)for(let t of e.set)n.set.push(t);return n}static defineModifier(t){let e=new l(t);return t=>t.modified.indexOf(e)>-1?t:l.get(t.base||t,t.modified.concat(e).sort((t,e)=>t.id-e.id))}}let o=0;class l{constructor(t){this.name=t,this.instances=[],this.id=o++}static get(t,e){if(!e.length)return t;let n=e[0].instances.find(n=>{var i;return n.base==t&&(i=n.modified,e.length==i.length&&e.every((t,e)=>t==i[e]))});if(n)return n;let i=[],r=new s(t.name,i,t,e);for(let t of e)t.instances.push(r);let o=function(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((t,e)=>e.length-t.length)}(e);for(let e of t.set)if(!e.modified.length)for(let t of o)i.push(l.get(e,t));return r}}function a(t){let e=Object.create(null);for(let n in t){let i=t[n];for(let t of(Array.isArray(i)||(i=[i]),n.split(" ")))if(t){let n=[],r=2,s=t;for(let e=0;;){if("..."==s&&e>0&&e+3==t.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!i)throw RangeError("Invalid path: "+t);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),(e+=i[0].length)==t.length)break;let o=t[e++];if(e==t.length&&"!"==o){r=0;break}if("/"!=o)throw RangeError("Invalid path: "+t);s=t.slice(e)}let o=n.length-1,l=n[o];if(!l)throw RangeError("Invalid path: "+t);let a=new c(i,r,o>0?n.slice(0,o):null);e[l]=a.sort(e[l])}}return h.add(e)}let h=new i.md;class c{constructor(t,e,n,i){this.tags=t,this.mode=e,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}function u(t,e){let n=Object.create(null);for(let e of t)if(Array.isArray(e.tag))for(let t of e.tag)n[t.id]=e.class;else n[e.tag.id]=e.class;let{scope:i,all:r=null}=e||{};return{style:t=>{let e=r;
vendor: 4,285 bytes, line 1
1for(let i of t)for(let t of i.set){let i=n[t.id];if(i){e=e?e+" "+i:i;break}}return e},scope:i}}function f(t,e,n,i=0,r=t.length){let s=new d(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}c.empty=new c([],2,null);class d{constructor(t,e,n){this.at=t,this.highlighters=e,this.span=n,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,n,r,s){let{type:o,from:l,to:a}=t;if(l>=n||a<=e)return;o.isTop&&(s=this.highlighters.filter(t=>!t.scope||t.scope(o)));let u=r,f=function(t){let e=t.type.prop(h);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||c.empty,d=function(t,e){let n=null;for(let i of t){let t=i.style(e);t&&(n=n?n+" "+t:t)}return n}(s,f.tags);if(d&&(u&&(u+=" "),u+=d,1==f.mode&&(r+=(r?" ":"")+d)),this.startSpan(Math.max(e,l),u),f.opaque)return;let p=t.tree&&t.tree.prop(i.md.mounted);if(p&&p.overlay){let i=t.node.enter(p.overlay[0].from+l,1),o=this.highlighters.filter(t=>!t.scope||t.scope(p.tree.type)),h=t.firstChild();for(let c=0,f=l;;c++){let d=c<p.overlay.length?p.overlay[c]:null,m=d?d.from+l:a,g=Math.max(e,f),v=Math.min(n,m);if(g<v&&h)for(;t.from<v&&(this.highlightRange(t,g,v,r,s),this.startSpan(Math.min(v,t.to),u),!(t.to>=m)&&t.nextSibling()););if(!d||m>n)break;(f=d.to+l)>e&&(this.highlightRange(i.cursor(),Math.max(e,d.from+l),Math.min(n,f),"",o),this.startSpan(Math.min(n,f),u))}h&&t.parent()}else if(t.firstChild()){p&&(r="");do{if(t.to<=e)continue;if(t.from>=n)break;this.highlightRange(t,e,n,r,s),this.startSpan(Math.min(n,t.to),u)}while(t.nextSibling());t.parent()}}}let p=s.define,m=p(),g=p(),v=p(g),y=p(g),x=p(),b=p(x),w=p(x),k=p(),S=p(k),A=p(),C=p(),I=p(),M=p(I),T=p(),O={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:v,tagName:p(v),propertyName:y,attributeName:p(y),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:x,string:b,docString:p(b),character:p(b),attributeValue:p(b),number:w,integer:p(w),float:p(w),bool:p(x),regexp:p(x),escape:p(x),color:p(x),url:p(x),keyword:A,self:p(A),null:p(A),atom:p(A),unit:p(A),modifier:p(A),operatorKeyword:p(A),controlKeyword:p(A),definitionKeyword:p(A),moduleKeyword:p(A),operator:C,derefOperator:p(C),arithmeticOperator:p(C),logicOperator:p(C),bitwiseOperator:p(C),compareOperator:p(C),updateOperator:p(C),definitionOperator:p(C),typeOperator:p(C),controlOperator:p(C),punctuation:I,separator:p(I),bracket:M,angleBracket:p(M),squareBracket:p(M),paren:p(M),brace:p(M),content:k,heading:S,heading1:p(S),heading2:p(S),heading3:p(S),heading4:p(S),heading5:p(S),heading6:p(S),contentSeparator:p(k),list:p(k),quote:p(k),emphasis:p(k),strong:p(k),link:p(k),monospace:p(k),strikethrough:p(k),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:T,documentMeta:p(T),annotation:p(T),processingInstruction:p(T),definition:s.defineModifier("definition"),constant:s.defineModifier("constant"),function:s.defineModifier("function"),standard:s.defineModifier("standard"),local:s.defineModifier("local"),special:s.defineModifier("special")};for(let t in O){let e=O[t];e instanceof s&&(e.name=t)}u([{tag:O.link,class:"tok-link"},{tag:O.heading,class:"tok-heading"},{tag:O.emphasis,class:"tok-emphasis"},{tag:O.strong,class:"tok-strong"},{tag:O.keyword,class:"tok-keyword"},{tag:O.atom,class:"tok-atom"},{tag:O.bool,class:"tok-bool"},{tag:O.url,class:"tok-url"},{tag:O.labelName,class:"tok-labelName"},{tag:O.inserted,class:"tok-inserted"},{tag:O.deleted,class:"tok-deleted"},{tag:O.literal,class:"tok-literal"},{tag:O.string,class:"tok-string"},{tag:O.number,class:"tok-number"},{tag:[O.regexp,O.escape,O.special(O.string)],class:"tok-string2"},{tag:O.variableName,class:"tok-variableName"},{tag:O.local(O.variableName),class:"tok-variableName tok-local"},{tag:O.definition(O.variableName),class:"tok-variableName tok-definition"},{tag:O.special(O.variableName),class:"tok-variableName2"},{tag:O.definition(O.propertyName),class:"tok-propertyName tok-definition"},{tag:O.typeName,class:"tok-typeName"},{tag:O.namespace,class:"tok-namespace"},{tag:O.className,class:"tok-className"},{tag:O.macroName,class:"tok-macroName"},{tag:O.propertyName,class:"tok-propertyName"}
1,{tag:O.operator,class:"tok-operator"},{tag:O.comment,class:"tok-comment"},{tag:O.meta,class:"tok-meta"},{tag:O.invalid,class:"tok-invalid"},{tag:O.punctuation,class:"tok-punctuation"}])},16914:function(t,e,n){function i(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?t.setAttribute(i,r):null!=r&&(t[i]=r)}e++}for(;e<arguments.length;e++)!function t(e,n){if("string"==typeof n)e.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)e.appendChild(n);else if(Array.isArray(n))for(var i=0;i<n.length;i++)t(e,n[i]);else throw RangeError("Unsupported child node: "+n)}(t,arguments[e]);return t}n.d(e,{Z:function(){return i}})},80547:function(t,e,n){n.d(e,{V:function(){return o}});let i="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(t,e){this.rules=[];let{finish:n}=e||{};function i(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}for(let e in t)!function t(e,r,s,o){let l=[],a=/^@(\w+)\b/.exec(e[0]),h=a&&"keyframes"==a[1];if(a&&null==r)return s.push(e[0]+";");for(let n in r){let o=r[n];if(/&/.test(n))t(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((t,e)=>t.concat(e)),o,s);else if(o&&"object"==typeof o){if(!a)throw RangeError("The value of a property ("+n+") should be a primitive value.");t(i(n),o,l,h)}else null!=o&&l.push(n.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+o+";")}(l.length||h)&&s.push((!n||a||o?e:e.map(n)).join(", ")+" {"+l.join(" ")+"}")}(i(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=s[i]||1;return s[i]=t+1,"ͼ"+t.toString(36)}static mount(t,e,n){let i=t[r],s=n&&n.nonce;i?s&&i.setNonce(s):i=new a(t,s),i.mount(Array.isArray(e)?e:[e],t)}}let l=new Map;class a{constructor(t,e){let n=t.ownerDocument||t,i=n.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let e=l.get(n);if(e)return t[r]=e;this.sheet=new i.CSSStyleSheet,l.set(n,this)}else this.styleTag=n.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[r]=this}mount(t,e){let n=this.sheet,i=0,r=0;for(let e=0;e<t.length;e++){let s=t[e],o=this.modules.indexOf(s);if(o<r&&o>-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,s),n)for(let t=0;t<s.rules.length;t++)n.insertRule(s.rules[t],i++)}else{for(;r<o;)i+=this.modules[r++].rules.length;i+=s.rules.length,r++}}if(n)0>e.adoptedStyleSheets.indexOf(this.sheet)&&(e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets]);else{let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t;let n=e.head||e;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}},99126:function(t,e,n){n.d(e,{YG:function(){return h},uY:function(){return r},ue:function(){return i}});for(var i={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=0;l<10;l++)i[48+l]=i[96+l]=String(l);for(var l=1;l<=24;l++)i[l+111]="F"+l;for(var l=65;l<=90;l++)i[l]=String.fromCharCode(l+32),r[l]=String.fromCharCode(l);for(var a in i)r.hasOwnProperty(a)||(r[a]=i[a]);function h(t){var e=!(s&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||o&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?r:i)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.