Files
owncast/static/web/_next/static/chunks/1943-701e08920ac663be.js
2022-12-30 17:14:11 +00:00

1 line
246 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1943],{58909:function(t,e,n){n.d(e,{F:function(){return a}});var i=n(87462),r=n(35524),s=n(47421),o=n(59119),l=t=>{var{theme:e,settings:n,styles:i}=t,r={"&":{backgroundColor:n.background,color:n.foreground},".cm-gutters":{}};n.fontFamily&&(r["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(r[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(r[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(r[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(r[".cm-content"]={caretColor:n.caret},r[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var l={};n.gutterActiveForeground&&(l.color=n.gutterActiveForeground),n.lineHighlight&&(r[".cm-activeLine"]={backgroundColor:n.lineHighlight},l.backgroundColor=n.lineHighlight),r[".cm-activeLineGutter"]=l,n.selection&&(r["&.cm-focused .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={backgroundColor:n.selection}),n.selectionMatch&&(r["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var a=s.tk.theme(r,{dark:"dark"===e}),h=o.Qf.define(i);return[a,(0,o.nF)(h)]},a=(t=>{var{theme:e="light",settings:n={},styles:s=[]}={};return l({theme:e,settings:(0,i.Z)({background:"#FFFFFF",foreground:"#000000",caret:"#FBAC52",selection:"#FFD420",selectionMatch:"#FFD420",gutterBackground:"#f5f5f5",gutterForeground:"#4D4D4C",gutterBorder:"transparent",lineHighlight:"#00000012"},n),styles:[{tag:[r.pJ.meta,r.pJ.comment],color:"#804000"},{tag:[r.pJ.keyword,r.pJ.strong],color:"#0000FF"},{tag:[r.pJ.number],color:"#FF0080"},{tag:[r.pJ.string],color:"#FF0080"},{tag:[r.pJ.variableName],color:"#006600"},{tag:[r.pJ.escape],color:"#33CC33"},{tag:[r.pJ.tagName],color:"#1C02FF"},{tag:[r.pJ.heading],color:"#0C07FF"},{tag:[r.pJ.quote],color:"#000000"},{tag:[r.pJ.list],color:"#B90690"},{tag:[r.pJ.documentMeta],color:"#888888"},{tag:[r.pJ.function(r.pJ.variableName)],color:"#0000A2"},{tag:[r.pJ.definition(r.pJ.typeName),r.pJ.typeName],color:"#6D79DE"},...s]})})()},87685:function(t,e,n){n.d(e,{ZP:function(){return nF}});var i=n(87462),r=n(63366),s=n(67294),o=n(78120),l=n(47421),a=n(59119),h=n(41113);let c=t=>{let e=m(t.state);return e.line?f(t):!!e.block&&p(t)};function u(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 f=u(function(t,e,n=e.selection.ranges){let i=[],r=-1;for(let{from:s,to:o}of n){let l=i.length,a=1e9;for(let h=s;h<=o;){let c=e.doc.lineAt(h);if(c.from>r&&(s==o||o>c.from)){r=c.from;let u=m(e,h).line;if(!u)continue;let f=/^\s*/.exec(c.text)[0].length,d=f==c.length,p=c.text.slice(f,f+u.length)==u?f:-1;f<c.text.length&&f<a&&(a=f),i.push({line:c,comment:p,token:u,indent:f,empty:d,single:!1})}h=c.to+1}if(a<1e9)for(let g=l;g<i.length;g++)i[g].indent<i[g].line.text.length&&(i[g].indent=a);i.length==l+1&&(i[l].single=!0)}if(2!=t&&i.some(t=>t.comment<0&&(!t.empty||t.single))){let k=[];for(let{line:y,token:v,indent:b,empty:O,single:x}of i)(x||!O)&&k.push({from:y.from+b,insert:v+" "});let w=e.changes(k);return{changes:w,selection:e.selection.map(w,1)}}if(1!=t&&i.some(t=>t.comment>=0)){let S=[];for(let{line:P,comment:C,token:A}of i)if(C>=0){let Q=P.from+C,T=Q+A.length;" "==P.text[T-P.from]&&T++,S.push({from:Q,to:T})}return{changes:S}}return null},0),d=u(g,0),p=u((t,e)=>g(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),s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from,to:r.to})}return e}(e)),0);function m(t,e=t.selection.main.head){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}function g(t,e,n=e.selection.ranges){let i=n.map(t=>m(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},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 s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let a=i[o],{open:h,close:c}=l;s.push({from:h.pos-a.open.length,to:h.pos+h.margin},{from:c.pos-c.margin,to:c.pos+a.close.length})}return{changes:s}}return null}let k=o.q6.define(),y=o.q6.define(),v=o.r$.define(),b=o.r$.define({combine:t=>(0,o.BO)(t,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}),O=o.QQ.define({create:()=>$.empty,update(t,e){let n=e.state.facet(b),i=e.annotation(k);if(i){var r;let s;let l=e.docChanged?o.jT.single((r=e.changes,s=0,r.iterChangedRanges((t,e)=>s=e),s)):void 0,a=A.fromTransaction(e,l),h=i.side,c=0==h?t.undone:t.done;return c=a?Q(c,c.length,n.minDepth,a):D(c,e.startState.selection),new $(0==h?i.rest:c,0==h?c:i.rest)}let u=e.annotation(y);if(("full"==u||"before"==u)&&(t=t.isolate()),!1===e.annotation(o.YW.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let f=A.fromTransaction(e),d=e.annotation(o.YW.time),p=e.annotation(o.YW.userEvent);return f?t=t.addChanges(f,d,p,n.newGroupDelay,n.minDepth):e.selection&&(t=t.addSelection(e.startState.selection,d,p,n.newGroupDelay)),("full"==u||"after"==u)&&(t=t.isolate()),t},toJSON:t=>({done:t.done.map(t=>t.toJSON()),undone:t.undone.map(t=>t.toJSON())}),fromJSON:t=>new $(t.done.map(A.fromJSON),t.undone.map(A.fromJSON))});function x(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(O,!1);if(!r)return!1;let s=r.pop(t,n,e);return!!s&&(i(s),!0)}}let w=x(0,!1),S=x(1,!1),P=x(0,!0),C=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&&o.as.fromJSON(t.changes),[],t.mapped&&o.n0.fromJSON(t.mapped),t.startSelection&&o.jT.fromJSON(t.startSelection),t.selectionsAfter.map(o.jT.fromJSON))}static fromTransaction(t,e){let n=I;for(let i of t.startState.facet(v)){let r=i(t);r.length&&(n=n.concat(r))}return!n.length&&t.changes.empty?null:new A(t.changes.invert(t.startState.doc),n,void 0,e||t.startState.selection,I)}static selection(t){return new A(void 0,I,void 0,void 0,t)}}function Q(t,e,n,i){let r=t.slice(e+1>n+20?e-n-1:0,e);return r.push(i),r}function T(t,e){return t.length?e.length?t.concat(e):t:e}let I=[];function D(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),Q(t,t.length-1,1e9,n.setSelAfter(i)))}}function R(t,e){if(!t.length)return t;let n=t.length,i=I;for(;n;){let r=function(t,e,n){let i=T(t.selectionsAfter.length?t.selectionsAfter.map(t=>t.map(e)):I,n);if(!t.changes)return A.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),l=t.mapped?t.mapped.composeDesc(s):s;return new A(r,o.Py.mapEffects(t.effects,e),l,t.startSelection.map(s),i)}(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}e=r.mapped,n--,i=r.selectionsAfter}return i.length?[A.selection(i)]:I}let M=/^(input\.type|delete)($|\.)/;class ${constructor(t,e,n=0,i){this.done=t,this.undone=e,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new $(this.done,this.undone):this}addChanges(t,e,n,i,r){var s,o;let l,a,h=this.done,c=h[h.length-1];return h=c&&c.changes&&!c.changes.empty&&t.changes&&(!n||M.test(n))&&(!c.selectionsAfter.length&&e-this.prevTime<i&&(s=c.changes,o=t.changes,l=[],a=!1,s.iterChangedRanges((t,e)=>l.push(t,e)),o.iterChangedRanges((t,e,n,i)=>{for(let r=0;r<l.length;){let s=l[r++],o=l[r++];i>=s&&n<=o&&(a=!0)}}),a)||"input.type.compose"==n)?Q(h,h.length-1,r,new A(t.changes.compose(c.changes),T(t.effects,c.effects),c.mapped,c.startSelection,I)):Q(h,h.length,r,t),new $(h,I,e,n)}addSelection(t,e,n,i){var r;let s=this.done.length?this.done[this.done.length-1].selectionsAfter:I;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)=>e.empty!=t.ranges[n].empty).length?this:new $(D(this.done,t),this.undone,e,n)}addMapping(t){return new $(R(this.done,t),R(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];if(n&&r.selectionsAfter.length){var s;let o,l;return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:k.of({side:t,rest:(o=(s=i)[s.length-1],(l=s.slice())[s.length-1]=o.setSelAfter(o.selectionsAfter.slice(0,o.selectionsAfter.length-1)),l)}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0})}if(!r.changes)return null;{let a=1==i.length?I:i.slice(0,i.length-1);return r.mapped&&(a=R(a,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:k.of({side:t,rest:a}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}}}$.empty=new $(I,I);let N=[{key:"Mod-z",run:w,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:S,preventDefault:!0},{linux:"Ctrl-Shift-z",run:S,preventDefault:!0},{key:"Mod-u",run:P,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:C,preventDefault:!0}];function E(t,e){return o.jT.create(t.ranges.map(e),t.mainIndex)}function z(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function B({state:t,dispatch:e},n){let i=E(t.selection,n);return!i.eq(t.selection)&&(e(z(t,i)),!0)}function W(t,e){return o.jT.cursor(e?t.to:t.from)}function J(t,e){return B(t,n=>n.empty?t.moveByChar(n,e):W(n,e))}function L(t){return t.textDirectionAt(t.state.selection.main.head)==l.Nm.LTR}let j=t=>J(t,!L(t)),F=t=>J(t,L(t));function _(t,e){return B(t,n=>n.empty?t.moveByGroup(n,e):W(n,e))}let U=t=>_(t,!L(t)),X=t=>_(t,L(t));function q(t,e,n){let i,r,s=(0,a.qz)(t).resolveInner(e.head),l=n?h.md.closedBy:h.md.openedBy;for(let c=e.head;;){let u=n?s.childAfter(c):s.childBefore(c);if(!u)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,u,l)?c=n?u.to:u.from:s=u}return r=s.type.prop(l)&&(i=n?(0,a.Um)(t,s.from,1):(0,a.Um)(t,s.to,-1))&&i.matched?n?i.end.to:i.end.from:n?s.to:s.from,o.jT.cursor(r,n?-1:1)}let V=t=>B(t,e=>q(t.state,e,!L(t))),G=t=>B(t,e=>q(t.state,e,L(t)));function Z(t,e){return B(t,n=>{if(!n.empty)return W(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}let Y=t=>Z(t,!1),K=t=>Z(t,!0);function H(t){return Math.max(t.defaultLineHeight,Math.min(t.dom.clientHeight,innerHeight)-5)}function tt(t,e){let n,{state:i}=t,r=E(i.selection,n=>n.empty?t.moveVertically(n,e,H(t)):W(n,e));if(r.eq(i.selection))return!1;let s=t.coordsAtPos(i.selection.main.head),o=t.scrollDOM.getBoundingClientRect();return s&&s.top>o.top&&s.bottom<o.bottom&&s.top-o.top<=t.scrollDOM.scrollHeight-t.scrollDOM.scrollTop-t.scrollDOM.clientHeight&&(n=l.tk.scrollIntoView(r.main.head,{y:"start",yMargin:s.top-o.top})),t.dispatch(z(i,r),{effects:n}),!0}let te=t=>tt(t,!1),tn=t=>tt(t,!0);function ti(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=o.jT.cursor(i.from+s))}return r}let tr=t=>B(t,e=>ti(t,e,!0)),ts=t=>B(t,e=>ti(t,e,!1)),to=t=>B(t,e=>ti(t,e,!L(t))),tl=t=>B(t,e=>ti(t,e,L(t))),ta=t=>B(t,e=>o.jT.cursor(t.lineBlockAt(e.head).from,1)),th=t=>B(t,e=>o.jT.cursor(t.lineBlockAt(e.head).to,-1)),tc=({state:t,dispatch:e})=>{let n,i;return n=!1,i=E(t.selection,e=>{let i=(0,a.Um)(t,e.head,-1)||(0,a.Um)(t,e.head,1)||e.head>0&&(0,a.Um)(t,e.head-1,1)||e.head<t.doc.length&&(0,a.Um)(t,e.head+1,-1);if(!i||!i.end)return e;n=!0;let r=i.start.from==e.head?i.end.to:i.end.from;return o.jT.cursor(r)}),!!n&&(e(z(t,i)),!0)};function tu(t,e){let n=E(t.state.selection,t=>{let n=e(t);return o.jT.range(t.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(t.state.selection)&&(t.dispatch(z(t.state,n)),!0)}function tf(t,e){return tu(t,n=>t.moveByChar(n,e))}let td=t=>tf(t,!L(t)),tp=t=>tf(t,L(t));function tm(t,e){return tu(t,n=>t.moveByGroup(n,e))}let tg=t=>tm(t,!L(t)),tk=t=>tm(t,L(t)),ty=t=>tu(t,e=>q(t.state,e,!L(t))),tv=t=>tu(t,e=>q(t.state,e,L(t)));function tb(t,e){return tu(t,n=>t.moveVertically(n,e))}let tO=t=>tb(t,!1),tx=t=>tb(t,!0);function tw(t,e){return tu(t,n=>t.moveVertically(n,e,H(t)))}let tS=t=>tw(t,!1),tP=t=>tw(t,!0),tC=t=>tu(t,e=>ti(t,e,!0)),tA=t=>tu(t,e=>ti(t,e,!1)),tQ=t=>tu(t,e=>ti(t,e,!L(t))),tT=t=>tu(t,e=>ti(t,e,L(t))),tI=t=>tu(t,e=>o.jT.cursor(t.lineBlockAt(e.head).from)),tD=t=>tu(t,e=>o.jT.cursor(t.lineBlockAt(e.head).to)),tR=({state:t,dispatch:e})=>(e(z(t,{anchor:0})),!0),tM=({state:t,dispatch:e})=>(e(z(t,{anchor:t.doc.length})),!0),t$=({state:t,dispatch:e})=>(e(z(t,{anchor:t.selection.main.anchor,head:0})),!0),tN=({state:t,dispatch:e})=>(e(z(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),tE=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),tz=({state:t,dispatch:e})=>{let n=tK(t).map(({from:e,to:n})=>o.jT.range(e,Math.min(n+1,t.doc.length)));return e(t.update({selection:o.jT.create(n),userEvent:"select"})),!0},tB=({state:t,dispatch:e})=>{let n=E(t.selection,e=>{var n;let i=(0,a.qz)(t).resolveInner(e.head,1);for(;!(i.from<e.from&&i.to>=e.to||i.to>e.to&&i.from<=e.from||!(null===(n=i.parent)||void 0===n?void 0:n.parent));)i=i.parent;return o.jT.range(i.to,i.from)});return e(z(t,n)),!0},tW=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=o.jT.create([n.main]):n.main.empty||(i=o.jT.create([o.jT.cursor(n.main.head)])),!!i&&(e(z(t,i)),!0)};function tJ(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(i=>{let{from:r,to:s}=i;if(r==s){let l=e(r);l<r?(n="delete.backward",l=tL(t,l,!1)):l>r&&(n="delete.forward",l=tL(t,l,!0)),r=Math.min(r,l),s=Math.max(s,l)}else r=tL(t,r,!1),s=tL(t,s,!0);return r==s?{range:i}:{changes:{from:r,to:s},range:o.jT.cursor(r)}});return!r.changes.empty&&(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?l.tk.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function tL(t,e,n){if(t instanceof l.tk)for(let i of t.state.facet(l.tk.atomicRanges).map(e=>e(t)))i.between(e,e,(t,i)=>{t<e&&i>e&&(e=n?i:t)});return e}let tj=(t,e)=>tJ(t,n=>{let{state:i}=t,r=i.doc.lineAt(n),s,l;if(!e&&n>r.from&&n<r.from+200&&!/[^ \t]/.test(s=r.text.slice(0,n-r.from))){if(" "==s[s.length-1])return n-1;let h=(0,o.IS)(s,i.tabSize)%(0,a.y1)(i)||(0,a.y1)(i);for(let c=0;c<h&&" "==s[s.length-1-c];c++)n--;l=n}else(l=(0,o.cp)(r.text,n-r.from,e,e)+r.from)==n&&r.number!=(e?i.doc.lines:1)&&(l+=e?1:-1);return l}),tF=t=>tj(t,!1),t_=t=>tj(t,!0),tU=(t,e)=>tJ(t,n=>{let i=n,{state:r}=t,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let a=null;;){if(i==(e?s.to:s.from)){i==n&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let h=(0,o.cp)(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,h)-s.from,Math.max(i,h)-s.from),u=l(c);if(null!=a&&u!=a)break;(" "!=c||i!=n)&&(a=u),i=h}return i}),tX=t=>tU(t,!1),tq=t=>tU(t,!0),tV=t=>tJ(t,e=>{let n=t.lineBlockAt(e).to;return e<n?n:Math.min(t.state.doc.length,e+1)}),tG=t=>tJ(t,e=>{let n=t.lineBlockAt(e).from;return e>n?n:Math.max(0,e-1)}),tZ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:o.xv.of(["",""])},range:o.jT.cursor(t.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},tY=({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,i=t.doc.lineAt(n),r=n==i.from?n-1:(0,o.cp)(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:(0,o.cp)(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:s,insert:t.doc.slice(n,s).append(t.doc.slice(r,n))},range:o.jT.cursor(s)}});return!n.changes.empty&&(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function tK(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 o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function tH(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of tK(t)){if(n?s.to==t.doc.length:0==s.from)continue;let l=t.doc.lineAt(n?s.to+1:s.from-1),a=l.length+1;if(n)for(let h of(i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+t.lineBreak}),s.ranges))r.push(o.jT.range(Math.min(t.doc.length,h.anchor+a),Math.min(t.doc.length,h.head+a)));else for(let c of(i.push({from:l.from,to:s.from},{from:s.to,insert:t.lineBreak+l.text}),s.ranges))r.push(o.jT.range(c.anchor-a,c.head-a))}return!!i.length&&(e(t.update({changes:i,scrollIntoView:!0,selection:o.jT.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0)}let t0=({state:t,dispatch:e})=>tH(t,e,!1),t1=({state:t,dispatch:e})=>tH(t,e,!0);function t2(t,e,n){if(t.readOnly)return!1;let i=[];for(let r of tK(t))n?i.push({from:r.from,insert:t.doc.slice(r.from,r.to)+t.lineBreak}):i.push({from:r.to,insert:t.lineBreak+t.doc.slice(r.from,r.to)});return e(t.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let t5=({state:t,dispatch:e})=>t2(t,e,!1),t3=({state:t,dispatch:e})=>t2(t,e,!0),t4=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(tK(e).map(({from:t,to:n})=>(t>0?t--:n<e.doc.length&&n++,{from:t,to:n}))),i=E(e.selection,e=>t.moveVertically(e,!0)).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0},t9=t8(!1),t6=t8(!0);function t8(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(n=>{let{from:i,to:r}=n,s=e.doc.lineAt(i),l=!t&&i==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=(0,a.qz)(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(h.md.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from?{from:i.to,to:r.from}:null}(e,i);t&&(i=r=(r<=s.to?s:e.doc.lineAt(r)).to);let c=new a.Gn(e,{simulateBreak:i,simulateDoubleBreak:!!l}),u=(0,a.K0)(c,i);for(null==u&&(u=/^\s*/.exec(e.doc.lineAt(i).text)[0].length);r<s.to&&/\s/.test(s.text[r-s.from]);)r++;l?{from:i,to:r}=l:i>s.from&&i<s.from+100&&!/\S/.test(s.text.slice(0,i))&&(i=s.from);let f=["",(0,a.SS)(e,u)];return l&&f.push((0,a.SS)(e,c.lineIndent(s.from,-1))),{changes:{from:i,to:r,insert:o.xv.of(f)},range:o.jT.cursor(i+1+f[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function t7(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let s=i.from;s<=i.to;){let l=t.doc.lineAt(s);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),s=l.to+1}let a=t.changes(r);return{changes:r,range:o.jT.range(a.mapPos(i.anchor,1),a.mapPos(i.head,1))}})}let et=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new a.Gn(t,{overrideIndentation:t=>{let e=n[t];return null==e?-1:e}}),r=t7(t,(e,r,s)=>{let o=(0,a.K0)(i,e.from);if(null==o)return;/\S/.test(e.text)||(o=0);let l=/^\s*/.exec(e.text)[0],h=(0,a.SS)(t,o);(l!=h||s.from<e.from+l.length)&&(n[e.from]=o,r.push({from:e.from,to:e.from+l.length,insert:h}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},ee=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(t7(t,(e,n)=>{n.push({from:e.from,insert:t.facet(a.c)})}),{userEvent:"input.indent"})),!0),en=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(t7(t,(e,n)=>{let i=/^\s*/.exec(e.text)[0];if(!i)return;let r=(0,o.IS)(i,t.tabSize),s=0,l=(0,a.SS)(t,Math.max(0,r-(0,a.y1)(t)));for(;s<i.length&&s<l.length&&i.charCodeAt(s)==l.charCodeAt(s);)s++;n.push({from:e.from+s,to:e.from+i.length,insert:l.slice(s)})}),{userEvent:"delete.dedent"})),!0),ei=[{key:"ArrowLeft",run:j,shift:td,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:U,shift:tg,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:to,shift:tQ,preventDefault:!0},{key:"ArrowRight",run:F,shift:tp,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:X,shift:tk,preventDefault:!0},{mac:"Cmd-ArrowRight",run:tl,shift:tT,preventDefault:!0},{key:"ArrowUp",run:Y,shift:tO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:tR,shift:t$},{mac:"Ctrl-ArrowUp",run:te,shift:tS},{key:"ArrowDown",run:K,shift:tx,preventDefault:!0},{mac:"Cmd-ArrowDown",run:tM,shift:tN},{mac:"Ctrl-ArrowDown",run:tn,shift:tP},{key:"PageUp",run:te,shift:tS},{key:"PageDown",run:tn,shift:tP},{key:"Home",run:ts,shift:tA,preventDefault:!0},{key:"Mod-Home",run:tR,shift:t$},{key:"End",run:tr,shift:tC,preventDefault:!0},{key:"Mod-End",run:tM,shift:tN},{key:"Enter",run:t9},{key:"Mod-a",run:tE},{key:"Backspace",run:tF,shift:tF},{key:"Delete",run:t_},{key:"Mod-Backspace",mac:"Alt-Backspace",run:tX},{key:"Mod-Delete",mac:"Alt-Delete",run:tq},{mac:"Mod-Backspace",run:tG},{mac:"Mod-Delete",run:tV}].concat([{key:"Ctrl-b",run:j,shift:td,preventDefault:!0},{key:"Ctrl-f",run:F,shift:tp},{key:"Ctrl-p",run:Y,shift:tO},{key:"Ctrl-n",run:K,shift:tx},{key:"Ctrl-a",run:ta,shift:tI},{key:"Ctrl-e",run:th,shift:tD},{key:"Ctrl-d",run:t_},{key:"Ctrl-h",run:tF},{key:"Ctrl-k",run:tV},{key:"Ctrl-Alt-h",run:tX},{key:"Ctrl-o",run:tZ},{key:"Ctrl-t",run:tY},{key:"Ctrl-v",run:tn}].map(t=>({mac:t.key,run:t.run,shift:t.shift}))),er=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:V,shift:ty},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:G,shift:tv},{key:"Alt-ArrowUp",run:t0},{key:"Shift-Alt-ArrowUp",run:t5},{key:"Alt-ArrowDown",run:t1},{key:"Shift-Alt-ArrowDown",run:t3},{key:"Escape",run:tW},{key:"Mod-Enter",run:t6},{key:"Alt-l",mac:"Ctrl-l",run:tz},{key:"Mod-i",run:tB,preventDefault:!0},{key:"Mod-[",run:en},{key:"Mod-]",run:ee},{key:"Mod-Alt-\\",run:et},{key:"Shift-Mod-k",run:t4},{key:"Shift-Mod-\\",run:tc},{key:"Mod-/",run:c},{key:"Alt-A",run:d}].concat(ei),es={key:"Tab",run:ee,shift:en};function eo(){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}let el="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class ea{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(el(t)):el,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,o.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,o.bg)(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,o.nZ)(t);let i=this.normalize(e);for(let r=0,s=n;;r++){let l=i.charCodeAt(r),a=this.match(l,s);if(a)return this.value=a,this;if(r==i.length-1)break;s==n&&r<e.length&&e.charCodeAt(r)==l&&s++}}}match(t,e){let n=null;for(let i=0;i<this.matches.length;i+=2){let r=this.matches[i],s=!1;this.query.charCodeAt(r)==t&&(r==this.query.length-1?n={from:this.matches[i+1],to:e+1}:(this.matches[i]++,s=!0)),s||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?n={from:e,to:e+1}:this.matches.push(1,e)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferPos)&&(n=null),n}}"undefined"!=typeof Symbol&&(ea.prototype[Symbol.iterator]=function(){return this});let eh={from:-1,to:-1,match:/.*/.exec("")},ec="gm"+(null==/x/.unicode?"":"u");class eu{constructor(t,e,n,i=0,r=t.length){if(this.text=t,this.to=r,this.curLine="",this.done=!1,this.value=eh,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new ep(t,e,n,i,r);this.re=RegExp(e,ec+((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=em(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=em(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 ef=new WeakMap;class ed{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,n){let i=ef.get(t);if(!i||i.from>=n||i.to<=e){let r=new ed(e,t.sliceString(e,n));return ef.set(t,r),r}if(i.from==e&&i.to==n)return i;let{text:s,from:o}=i;return o>e&&(s=t.sliceString(e,o)+s,o=e),i.to<n&&(s+=t.sliceString(i.to,n)),ef.set(t,new ed(o,s)),new ed(e,s.slice(e-o,n-o))}}class ep{constructor(t,e,n,i,r){this.text=t,this.to=r,this.done=!1,this.value=eh,this.matchPos=em(t,i),this.re=RegExp(e,ec+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=ed.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 n=this.flat.from+e.index,i=n+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,e)))return this.value={from:n,to:i,match:e},this.matchPos=em(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ed.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function em(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 eg(t){let e=eo("input",{class:"cm-textfield",name:"line"}),n=eo("form",{class:"cm-gotoLine",onkeydown:e=>{27==e.keyCode?(e.preventDefault(),t.dispatch({effects:ek.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),i())},onsubmit:t=>{t.preventDefault(),i()}},eo("label",t.state.phrase("Go to line"),": ",e)," ",eo("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!n)return;let{state:i}=t,r=i.doc.lineAt(i.selection.main.head),[,s,l,a,h]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&h){let f=u/100;s&&(f=f*("-"==s?-1:1)+r.number/i.doc.lines),u=Math.round(i.doc.lines*f)}else l&&s&&(u=u*("-"==s?-1:1)+r.number);let d=i.doc.line(Math.max(1,Math.min(i.doc.lines,u)));t.dispatch({effects:ek.of(!1),selection:o.jT.cursor(d.from+Math.max(0,Math.min(c,d.length))),scrollIntoView:!0}),t.focus()}return{dom:n}}"undefined"!=typeof Symbol&&(eu.prototype[Symbol.iterator]=ep.prototype[Symbol.iterator]=function(){return this});let ek=o.Py.define(),ey=o.QQ.define({create:()=>!0,update(t,e){for(let n of e.effects)n.is(ek)&&(t=n.value);return t},provide:t=>l.mH.from(t,t=>t?eg:null)}),ev=t=>{let e=(0,l.Sd)(t,eg);if(!e){let n=[ek.of(!0)];null==t.state.field(ey,!1)&&n.push(o.Py.appendConfig.of([ey,eb])),t.dispatch({effects:n}),e=(0,l.Sd)(t,eg)}return e&&e.dom.querySelector("input").focus(),!0},eb=l.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),eO={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ex=o.r$.define({combine:t=>(0,o.BO)(t,eO,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}),ew=l.p.mark({class:"cm-selectionMatch"}),eS=l.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function eP(t,e,n,i){return(0==n||t(e.sliceDoc(n-1,n))!=o.D0.Word)&&(i==e.doc.length||t(e.sliceDoc(i,i+1))!=o.D0.Word)}let eC=l.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(ex),{state:n}=t,i=n.selection;if(i.ranges.length>1)return l.p.none;let r=i.main,s,a=null;if(r.empty){if(!e.highlightWordAroundCursor)return l.p.none;let h=n.wordAt(r.head);if(!h)return l.p.none;a=n.charCategorizer(r.head),s=n.sliceDoc(h.from,h.to)}else{let c=r.to-r.from;if(c<e.minSelectionLength||c>200)return l.p.none;if(e.wholeWords){var u,f,d;if(s=n.sliceDoc(r.from,r.to),!(eP(a=n.charCategorizer(r.head),n,r.from,r.to)&&(u=a,f=r.from,d=r.to,u(n.sliceDoc(f,f+1))==o.D0.Word&&u(n.sliceDoc(d-1,d))==o.D0.Word)))return l.p.none}else if(!(s=n.sliceDoc(r.from,r.to).trim()))return l.p.none}let p=[];for(let m of t.visibleRanges){let g=new ea(n.doc,s,m.from,m.to);for(;!g.next().done;){let{from:k,to:y}=g.value;if((!a||eP(a,n,k,y))&&(r.empty&&k<=r.from&&y>=r.to?p.push(eS.range(k,y)):(k>=r.to||y<=r.from)&&p.push(ew.range(k,y)),p.length>e.maxMatches))return l.p.none}}return l.p.set(p)}},{decorations:t=>t.decorations}),eA=l.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),eQ=({state:t,dispatch:e})=>{let{selection:n}=t,i=o.jT.create(n.ranges.map(e=>t.wordAt(e.head)||o.jT.cursor(e.head)),n.mainIndex);return!i.eq(n)&&(e(t.update({selection:i})),!0)},eT=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(t=>t.from===t.to))return eQ({state:t,dispatch:e});let i=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(e=>t.sliceDoc(e.from,e.to)!=i))return!1;let r=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 o=!1,l=new ea(t.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ea(t.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(t=>t.from==l.value.from))continue;if(s){let a=t.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}(t,i);return!!r&&(e(t.update({selection:t.selection.addRange(o.jT.range(r.from,r.to),!1),effects:l.tk.scrollIntoView(r.to)})),!0)},eI=o.r$.define({combine:t=>(0,o.BO)(t,{top:!1,caseSensitive:!1,literal:!1,wholeWord:!1,createPanel:t=>new e3(t)})});class eD{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 RegExp(t,ec),!0}catch(e){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 eB(this):new e$(this)}getCursor(t,e=0,n){let i=t.doc?t:o.yy.create({doc:t});return null==n&&(n=i.doc.length),this.regexp?eN(this,i,e,n):eM(this,i,e,n)}}class eR{constructor(t){this.spec=t}}function eM(t,e,n,i){var r,s;return new ea(e.doc,t.unquoted,n,i,t.caseSensitive?void 0:t=>t.toLowerCase(),t.wholeWord?(r=e.doc,s=e.charCategorizer(e.selection.main.head),(t,e,n,i)=>((i>t||i+n.length<e)&&(i=Math.max(0,t-2),n=r.sliceString(i,Math.min(r.length,e+2))),(s(eE(n,t-i))!=o.D0.Word||s(ez(n,t-i))!=o.D0.Word)&&(s(ez(n,e-i))!=o.D0.Word||s(eE(n,e-i))!=o.D0.Word))):void 0)}class e$ extends eR{constructor(t){super(t)}nextMatch(t,e,n){let i=eM(this.spec,t,n,t.doc.length).nextOverlapping();return i.done&&(i=eM(this.spec,t,0,e).nextOverlapping()),i.done?null:i.value}prevMatchInRange(t,e,n){for(let i=n;;){let r=Math.max(e,i-1e4-this.spec.unquoted.length),s=eM(this.spec,t,r,i),o=null;for(;!s.nextOverlapping().done;)o=s.value;if(o)return o;if(r==e)return null;i-=1e4}}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)}matchAll(t,e){let n=eM(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=eM(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 eN(t,e,n,i){var r;return new eu(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(r=e.charCategorizer(e.selection.main.head),(t,e,n)=>!n[0].length||(r(eE(n.input,n.index))!=o.D0.Word||r(ez(n.input,n.index))!=o.D0.Word)&&(r(ez(n.input,n.index+n[0].length))!=o.D0.Word||r(eE(n.input,n.index+n[0].length))!=o.D0.Word)):void 0},n,i)}function eE(t,e){return t.slice((0,o.cp)(t,e,!1),e)}function ez(t,e){return t.slice(e,(0,o.cp)(t,e))}class eB extends eR{nextMatch(t,e,n){let i=eN(this.spec,t,n,t.doc.length).next();return i.done&&(i=eN(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=eN(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=eN(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=eN(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 eW=o.Py.define(),eJ=o.Py.define(),eL=o.QQ.define({create:t=>new ej(e0(t).create(),null),update(t,e){for(let n of e.effects)n.is(eW)?t=new ej(n.value.create(),t.panel):n.is(eJ)&&(t=new ej(t.query,n.value?eH:null));return t},provide:t=>l.mH.from(t,t=>t.panel)});class ej{constructor(t,e){this.query=t,this.panel=e}}let eF=l.p.mark({class:"cm-searchMatch"}),e_=l.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),eU=l.lg.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(eL))}update(t){let e=t.state.field(eL);(e!=t.startState.field(eL)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return l.p.none;let{view:n}=this,i=new o.f_;for(let r=0,s=n.visibleRanges,a=s.length;r<a;r++){let{from:h,to:c}=s[r];for(;r<a-1&&c>s[r+1].from-500;)c=s[++r].to;t.highlight(n.state,h,c,(t,e)=>{let r=n.state.selection.ranges.some(n=>n.from==t&&n.to==e);i.add(t,e,r?e_:eF)})}return i.finish()}},{decorations:t=>t.decorations});function eX(t){return e=>{let n=e.state.field(eL,!1);return n&&n.query.spec.valid?t(e,n):e1(e)}}let eq=eX((t,{query:e})=>{let{to:n}=t.state.selection.main,i=e.nextMatch(t.state,n,n);return!!i&&(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:e6(t,i),userEvent:"select.search"}),!0)}),eV=eX((t,{query:e})=>{let{state:n}=t,{from:i}=n.selection.main,r=e.prevMatch(n,i,i);return!!r&&(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:e6(t,r),userEvent:"select.search"}),!0)}),eG=eX((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!!n&&!!n.length&&(t.dispatch({selection:o.jT.create(n.map(t=>o.jT.range(t.from,t.to))),userEvent:"select.search.matches"}),!0)}),eZ=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],l=0;for(let a=new ea(t.doc,t.sliceDoc(i,r));!a.next().done;){if(s.length>1e3)return!1;a.value.from==i&&(l=s.length),s.push(o.jT.range(a.value.from,a.value.to))}return e(t.update({selection:o.jT.create(s,l),userEvent:"select.search.matches"})),!0},eY=eX((t,{query:e})=>{let{state:n}=t,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,i,i);if(!s)return!1;let o=[],a,h,c=[];if(s.from==i&&s.to==r&&(h=n.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:h}),s=e.nextMatch(n,s.from,s.to),c.push(l.tk.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),s){let u=0==o.length||o[0].from>=s.to?0:s.to-s.from-h.length;a={anchor:s.from-u,head:s.to-u},c.push(e6(t,s))}return t.dispatch({changes:o,selection:a,scrollIntoView:!!a,effects:c,userEvent:"input.replace"}),!0}),eK=eX((t,{query:e})=>{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 i=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:l.tk.announce.of(i),userEvent:"input.replace.all"}),!0});function eH(t){return t.state.facet(eI).createPanel(t)}function e0(t,e){var n,i,r,s;let o=t.selection.main,l=o.empty||o.to>o.from+100?"":t.sliceDoc(o.from,o.to);if(e&&!l)return e;let a=t.facet(eI);return new eD({search:(null!==(n=null==e?void 0:e.literal)&&void 0!==n?n:a.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==e?void 0:e.caseSensitive)&&void 0!==i?i:a.caseSensitive,literal:null!==(r=null==e?void 0:e.literal)&&void 0!==r?r:a.literal,wholeWord:null!==(s=null==e?void 0:e.wholeWord)&&void 0!==s?s:a.wholeWord})}let e1=t=>{let e=t.state.field(eL,!1);if(e&&e.panel){let n=(0,l.Sd)(t,eH);if(!n)return!1;let i=n.dom.querySelector("[main-field]");if(i&&i!=t.root.activeElement){let r=e0(t.state,e.query.spec);r.valid&&t.dispatch({effects:eW.of(r)}),i.focus(),i.select()}}else t.dispatch({effects:[eJ.of(!0),e?eW.of(e0(t.state,e.query.spec)):o.Py.appendConfig.of(e7)]});return!0},e2=t=>{let e=t.state.field(eL,!1);if(!e||!e.panel)return!1;let n=(0,l.Sd)(t,eH);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:eJ.of(!1)}),!0},e5=[{key:"Mod-f",run:e1,scope:"editor search-panel"},{key:"F3",run:eq,shift:eV,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:eq,shift:eV,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:e2,scope:"editor search-panel"},{key:"Mod-Shift-l",run:eZ},{key:"Alt-g",run:ev},{key:"Mod-d",run:eT,preventDefault:!0}];class e3{constructor(t){this.view=t;let e=this.query=t.state.field(eL).query.spec;function n(t,e,n){return eo("button",{class:"cm-button",name:t,onclick:e,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=eo("input",{value:e.search,placeholder:e4(t,"Find"),"aria-label":e4(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=eo("input",{value:e.replace,placeholder:e4(t,"Replace"),"aria-label":e4(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=eo("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=eo("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=eo("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=eo("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,n("next",()=>eq(t),[e4(t,"next")]),n("prev",()=>eV(t),[e4(t,"previous")]),n("select",()=>eG(t),[e4(t,"all")]),eo("label",null,[this.caseField,e4(t,"match case")]),eo("label",null,[this.reField,e4(t,"regexp")]),eo("label",null,[this.wordField,e4(t,"by word")]),...t.state.readOnly?[]:[eo("br"),this.replaceField,n("replace",()=>eY(t),[e4(t,"replace")]),n("replaceAll",()=>eK(t),[e4(t,"replace all")])],eo("button",{name:"close",onclick:()=>e2(t),"aria-label":e4(t,"close"),type:"button"},["\xd7"])])}commit(){let t=new eD({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:eW.of(t)}))}keydown(t){(0,l.$1)(this.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?eV:eq)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),eY(this.view))}update(t){for(let e of t.transactions)for(let n of e.effects)n.is(eW)&&!n.value.eq(this.query)&&this.setQuery(n.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(eI).top}}function e4(t,e){return t.state.phrase(e)}let e9=/[\s\.,:;?!]/;function e6(t,{from:e,to:n}){let i=t.state.doc.lineAt(e),r=t.state.doc.lineAt(n).to,s=Math.max(i.from,e-30),o=Math.min(r,n+30),a=t.state.sliceDoc(s,o);if(s!=i.from){for(let h=0;h<30;h++)if(!e9.test(a[h+1])&&e9.test(a[h])){a=a.slice(h);break}}if(o!=r){for(let c=a.length-1;c>a.length-30;c--)if(!e9.test(a[c-1])&&e9.test(a[c])){a=a.slice(0,c);break}}return l.tk.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${i.number}.`)}let e8=l.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"}}),e7=[eL,o.Wl.lowest(eU),e8];var nt=n(34790);class ne{constructor(t,e,n){this.from=t,this.to=e,this.diagnostic=n}}class nn{constructor(t,e,n){this.diagnostics=t,this.panel=e,this.selected=n}static init(t,e,n){let i=t,r=n.facet(nk).markerFilter;r&&(i=r(i));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 nb(t),diagnostic:t}).range(t.from):l.p.mark({attributes:{class:"cm-lintRange cm-lintRange-"+t.severity},diagnostic:t}).range(t.from,t.to)),!0);return new nn(s,e,ni(s))}}function ni(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 ne(t,n,r.diagnostic),!1}),i}function nr(t,e){return!!(t.effects.some(t=>t.is(no))||t.changes.touchesRange(e.pos))}function ns(t,e){return t.field(nh,!1)?e:e.concat(o.Py.appendConfig.of([nh,l.tk.decorations.compute([nh],t=>{let{selected:e,panel:n}=t.field(nh);return e&&n&&e.from!=e.to?l.p.set([nc.range(e.from,e.to)]):l.p.none}),(0,l.bF)(nu,{hideOn:nr}),nS]))}let no=o.Py.define(),nl=o.Py.define(),na=o.Py.define(),nh=o.QQ.define({create:()=>new nn(l.p.none,null,null),update(t,e){if(e.docChanged){let n=t.diagnostics.map(e.changes),i=null;if(t.selected){let r=e.changes.mapPos(t.selected.from,1);i=ni(n,t.selected.diagnostic,r)||ni(n,null,r)}t=new nn(n,t.panel,i)}for(let s of e.effects)s.is(no)?t=nn.init(s.value,t.panel,e.state):s.is(nl)?t=new nn(t.diagnostics,s.value?nx.open:null,t.selected):s.is(na)&&(t=new nn(t.diagnostics,t.panel,s.value));return t},provide:t=>[l.mH.from(t,t=>t.panel),l.tk.decorations.from(t,t=>t.diagnostics)]}),nc=l.p.mark({class:"cm-lintRange cm-lintRange-active"});function nu(t,e,n){let{diagnostics:i}=t.state.field(nh),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(nk).tooltipFilter;return(l&&(r=l(r)),r.length)?{pos:s,end:o,above:t.state.doc.lineAt(s).to<o,create:()=>({dom:function(t,e){return eo("ul",{class:"cm-tooltip-lint"},e.map(e=>nv(t,e,!1)))}(t,r)})}:null}let nf=t=>{let e=t.state.field(nh,!1);e&&e.panel||t.dispatch({effects:ns(t.state,[nl.of(!0)])});let n=(0,l.Sd)(t,nx.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},nd=t=>{let e=t.state.field(nh,!1);return!!e&&!!e.panel&&(t.dispatch({effects:nl.of(!1)}),!0)},np=t=>{let e=t.state.field(nh,!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)},nm=[{key:"Mod-Shift-m",run:nf,preventDefault:!0},{key:"F8",run:np}],ng=l.lg.fromClass(class{constructor(t){this.view=t,this.timeout=-1,this.set=!0;let{delay:e}=t.state.facet(nk);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let t=Date.now();if(t<this.lintTime-10)setTimeout(this.run,this.lintTime-t);else{this.set=!1;let{state:e}=this.view,{sources:n}=e.facet(nk);Promise.all(n.map(t=>Promise.resolve(t(this.view)))).then(t=>{let n=t.reduce((t,e)=>t.concat(e));this.view.state.doc==e.doc&&this.view.dispatch({effects:ns(this.view.state,[no.of(n)])})},t=>{(0,l.OO)(this.view.state,t)})}}update(t){let e=t.state.facet(nk);(t.docChanged||e!=t.startState.facet(nk))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),nk=o.r$.define({combine:t=>Object.assign({sources:t.map(t=>t.source)},(0,o.BO)(t.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null})),enables:ng});function ny(t){let e=[];if(t)t:for(let{name:n}of t){for(let i=0;i<n.length;i++){let r=n[i];if(/[a-zA-Z]/.test(r)&&!e.some(t=>t.toLowerCase()==r.toLowerCase())){e.push(r);continue t}}e.push("")}return e}function nv(t,e,n){var i;let r=n?ny(e.actions):[];return eo("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},eo("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),null===(i=e.actions)||void 0===i?void 0:i.map((n,i)=>{let s=i=>{i.preventDefault();let r=ni(t.state.field(nh).diagnostics,e);r&&n.apply(t,r.from,r.to)},{name:o}=n,l=r[i]?o.indexOf(r[i]):-1,a=l<0?o:[o.slice(0,l),eo("u",o.slice(l,l+1)),o.slice(l+1)];return eo("button",{type:"button",class:"cm-diagnosticAction",onclick:s,onmousedown:s,"aria-label":` Action: ${o}${l<0?"":` (access key "${r[i]})"`}.`},a)}),e.source&&eo("div",{class:"cm-diagnosticSource"},e.source))}class nb extends l.l9{constructor(t){super(),this.diagnostic=t}eq(t){return t.diagnostic==this.diagnostic}toDOM(){return eo("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class nO{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=nv(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class nx{constructor(t){this.view=t,this.items=[];let e=e=>{if(27==e.keyCode)nd(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=ny(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==e.keyCode){let s=ni(this.view.state.field(nh).diagnostics,n);s&&n.actions[r].apply(t,s.from,s.to)}}e.preventDefault()},n=t=>{for(let e=0;e<this.items.length;e++)this.items[e].dom.contains(t.target)&&this.moveSelection(e)};this.list=eo("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e,onclick:n}),this.dom=eo("div",{class:"cm-panel-lint"},this.list,eo("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>nd(this.view)},"\xd7")),this.update()}get selectedIndex(){let t=this.view.state.field(nh).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(nh),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 h=n;h<this.items.length;h++)if(this.items[h].diagnostic==o.diagnostic){l=h;break}l<0?(a=new nO(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 nO(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})=>{t.top<e.top?this.list.scrollTop-=e.top-t.top:t.bottom>e.bottom&&(this.list.scrollTop+=t.bottom-e.bottom)}})):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=ni(this.view.state.field(nh).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:na.of(e)})}static open(t){return new nx(t)}}function nw(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 nS=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-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:nw("#d11")},".cm-lintRange-warning":{backgroundImage:nw("orange")},".cm-lintRange-info":{backgroundImage:nw("#999")},".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-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 nP=o.Py.define();var nC=function(t){void 0===t&&(t={});var e,n=[];!1!==t.closeBracketsKeymap&&(n=n.concat(nt.GA)),!1!==t.defaultKeymap&&(n=n.concat(er)),!1!==t.searchKeymap&&(n=n.concat(e5)),!1!==t.historyKeymap&&(n=n.concat(N)),!1!==t.foldKeymap&&(n=n.concat(a.e7)),!1!==t.completionKeymap&&(n=n.concat(nt.B1)),!1!==t.lintKeymap&&(n=n.concat(nm));var i=[];if(!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(function(t={}){return[O,b.of(t),l.tk.domEventHandlers({beforeinput(t,e){let n="historyUndo"==t.inputType?w:"historyRedo"==t.inputType?S:null;return!!n&&(t.preventDefault(),n(e))}})]}()),!1!==t.foldGutter&&i.push((0,a.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,a.nY)()),!1!==t.syntaxHighlighting&&i.push((0,a.nF)(a.R_,{fallback:!0})),!1!==t.bracketMatching&&i.push((0,a.n$)()),!1!==t.closeBrackets&&i.push((0,nt.vQ)()),!1!==t.autocompletion&&i.push((0,nt.ys)()),!1!==t.rectangularSelection&&i.push((0,l.Zs)()),!1!==t.crosshairCursor&&i.push((0,l.S2)()),!1!==t.highlightActiveLine&&i.push((0,l.ZO)()),!1!==t.highlightSelectionMatches){let r;i.push((r=[eA,eC],e&&r.push(ex.of(e)),r))}return t.tabSize&&"number"==typeof t.tabSize&&i.push(a.c.of(" ".repeat(t.tabSize))),i.concat([l.$f.of(n.flat())]).filter(Boolean)},nA=n(35524);let nQ="#e06c75",nT="#abb2bf",nI="#7d8799",nD="#d19a66",nR="#2c313a",nM="#282c34",n$="#353a42",nN="#528bff",nE=l.tk.theme({"&":{color:nT,backgroundColor:nM},".cm-content":{caretColor:nN},".cm-cursor, .cm-dropCursor":{borderLeftColor:nN},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:nT},".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",outline:"1px solid #515a6b"},".cm-gutters":{backgroundColor:nM,color:nI,border:"none"},".cm-activeLineGutter":{backgroundColor:nR},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:n$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:n$,borderBottomColor:n$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:nR,color:nT}}},{dark:!0}),nz=a.Qf.define([{tag:nA.pJ.keyword,color:"#c678dd"},{tag:[nA.pJ.name,nA.pJ.deleted,nA.pJ.character,nA.pJ.propertyName,nA.pJ.macroName],color:nQ},{tag:[nA.pJ.function(nA.pJ.variableName),nA.pJ.labelName],color:"#61afef"},{tag:[nA.pJ.color,nA.pJ.constant(nA.pJ.name),nA.pJ.standard(nA.pJ.name)],color:nD},{tag:[nA.pJ.definition(nA.pJ.name),nA.pJ.separator],color:nT},{tag:[nA.pJ.typeName,nA.pJ.className,nA.pJ.number,nA.pJ.changed,nA.pJ.annotation,nA.pJ.modifier,nA.pJ.self,nA.pJ.namespace],color:"#e5c07b"},{tag:[nA.pJ.operator,nA.pJ.operatorKeyword,nA.pJ.url,nA.pJ.escape,nA.pJ.regexp,nA.pJ.link,nA.pJ.special(nA.pJ.string)],color:"#56b6c2"},{tag:[nA.pJ.meta,nA.pJ.comment],color:nI},{tag:nA.pJ.strong,fontWeight:"bold"},{tag:nA.pJ.emphasis,fontStyle:"italic"},{tag:nA.pJ.strikethrough,textDecoration:"line-through"},{tag:nA.pJ.link,color:nI,textDecoration:"underline"},{tag:nA.pJ.heading,fontWeight:"bold",color:nQ},{tag:[nA.pJ.atom,nA.pJ.bool,nA.pJ.special(nA.pJ.variableName)],color:nD},{tag:[nA.pJ.processingInstruction,nA.pJ.string,nA.pJ.inserted],color:"#98c379"},{tag:nA.pJ.invalid,color:"#ffffff"}]),nB=[nE,(0,a.nF)(nz)];var nW=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)}),nJ=n(85893),nL=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],nj=(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:k,minHeight:y,maxHeight:v,width:b,minWidth:O,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:P,editable:C,readOnly:A,root:Q,initialState:T}=t,I=(0,r.Z)(t,nL),D=(0,s.useRef)(null),{state:R,view:M,container:$,setContainer:N}=function(t){var{value:e,selection:n,onChange:i,onStatistics:r,onCreateEditor:a,onUpdate:h,extensions:c=[],autoFocus:u,theme:f="light",height:d="",minHeight:p="",maxHeight:m="",placeholder:g="",width:k="",minWidth:y="",maxWidth:v="",editable:b=!0,readOnly:O=!1,indentWithTab:x=!0,basicSetup:w=!0,root:S,initialState:P}=t,[C,A]=(0,s.useState)(),[Q,T]=(0,s.useState)(),[I,D]=(0,s.useState)(),R=l.tk.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),M=l.tk.theme({"&":{height:d,minHeight:p,maxHeight:m,width:k,minWidth:y,maxWidth:v}}),$=[l.tk.updateListener.of(t=>{t.docChanged&&"function"==typeof i&&i(t.state.doc.toString(),t),r&&r(nW(t))}),M];switch(x&&$.unshift(l.$f.of([es])),w&&("boolean"==typeof w?$.unshift(nC()):$.unshift(nC(w))),g&&$.unshift((0,l.W$)(g)),f){case"light":$.push(R);break;case"dark":$.push(nB);break;case"none":break;default:$.push(f)}return!1===b&&$.push(l.tk.editable.of(!1)),O&&$.push(o.yy.readOnly.of(!0)),h&&"function"==typeof h&&$.push(l.tk.updateListener.of(h)),$=$.concat(c),(0,s.useEffect)(()=>{if(C&&!I){var t={doc:e,selection:n,extensions:$},i=P?o.yy.fromJSON(P.json,t,P.fields):o.yy.create(t);if(D(i),!Q){var r=new l.tk({state:i,parent:C,root:S});T(r),a&&a(r,i)}}return()=>{Q&&(D(void 0),T(void 0))}},[C,I]),(0,s.useEffect)(()=>A(t.container),[t.container]),(0,s.useEffect)(()=>()=>{Q&&(Q.destroy(),T(void 0))},[Q]),(0,s.useEffect)(()=>{u&&Q&&Q.focus()},[u,Q]),(0,s.useEffect)(()=>{Q&&Q.dispatch({effects:o.Py.reconfigure.of($)})},[f,c,d,p,m,k,y,v,g,b,O,x,w,i,h]),(0,s.useEffect)(()=>{var t=Q?Q.state.doc.toString():"";Q&&e!==t&&Q.dispatch({changes:{from:0,to:t.length,insert:e||""}})},[e,Q]),{state:I,setState:D,view:Q,setView:T,container:C,setContainer:A}}({container:D.current,root:Q,value:a,autoFocus:m,theme:g,height:k,minHeight:y,maxHeight:v,width:b,minWidth:O,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:P,editable:C,readOnly:A,selection:h,onChange:u,onStatistics:f,onCreateEditor:d,onUpdate:p,extensions:c,initialState:T});if((0,s.useImperativeHandle)(e,()=>({editor:D.current,state:R,view:M}),[D,$,R,M]),"string"!=typeof a)throw Error("value must be typeof string but got "+typeof a);return(0,nJ.jsx)("div",(0,i.Z)({ref:D,className:("string"==typeof g?"cm-theme-"+g:"cm-theme")+(n?" "+n:"")},I))});nj.displayName="CodeMirror";var nF=nj},34790:function(t,e,n){n.d(e,{B1:function(){return tC},GA:function(){return tb},Gn:function(){return to},Mb:function(){return a},eC:function(){return h},vQ:function(){return td},ys:function(){return tP}});var i=n(78120),r=n(47421),s=n(59119);class o{constructor(t,e,n){this.state=t,this.pos=e,this.explicit=n,this.abortListeners=[]}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){"abort"==t&&this.abortListeners&&this.abortListeners.push(e)}}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 r=1;r<i.length;r++)n[i[r]]=!0}let s=l(e)+l(n)+"*$";return[RegExp("^"+s),RegExp(s)]}(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 i=(0,s.qz)(n.state).resolveInner(n.pos,-1);i;i=i.parent)if(t.indexOf(i.name)>-1)return null;return e(n)}}class c{constructor(t,e,n){this.completion=t,this.source=e,this.match=n}}function u(t){return t.selection.main.head}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();function p(t,e){let n=e.completion.apply||e.completion.label,r=e.source;if("string"==typeof n){var s,o,l;t.dispatch(Object.assign(Object.assign({},(s=t.state,o=r.from,l=r.to,Object.assign(Object.assign({},s.changeByRange(t=>{if(t==s.selection.main)return{changes:{from:o,to:l,insert:n},range:i.jT.cursor(o+n.length)};let e=l-o;return!t.empty||e&&s.sliceDoc(t.from-e,t.from)!=s.sliceDoc(o,l)?{range:t}:{changes:{from:t.from-e,to:t.from,insert:n},range:i.jT.cursor(t.from-e+n.length)}})),{userEvent:"input.complete"}))),{annotations:d.of(e.completion)}))}else n(t,e.completion,r.from,r.to)}let m=new WeakMap;function g(t){if(!Array.isArray(t))return t;let e=m.get(t);return e||m.set(t,e=a(t)),e}class k{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];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}this.astral=t.length!=this.chars.length}match(t){if(0==this.pattern.length)return[0];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 l=(0,i.gm)(t,0);return l==e[0]?[0,0,(0,i.nZ)(l)]:l==n[0]?[-200,0,(0,i.nZ)(l)]:null}let a=t.indexOf(this.pattern);if(0==a)return[0,0,this.pattern.length];let h=e.length,c=0;if(a<0){for(let u=0,f=Math.min(t.length,200);u<f&&c<h;){let d=(0,i.gm)(t,u);(d==e[c]||d==n[c])&&(r[c++]=u),u+=(0,i.nZ)(d)}if(c<h)return null}let p=0,m=0,g=!1,k=0,y=-1,v=-1,b=/[a-z]/.test(t),O=!0;for(let x=0,w=Math.min(t.length,200),S=0;x<w&&m<h;){let P=(0,i.gm)(t,x);a<0&&(p<h&&P==e[p]&&(s[p++]=x),k<h&&(P==e[k]||P==n[k]?(0==k&&(y=x),v=x+1,k++):k=0));let C,A=P<255?P>=48&&P<=57||P>=97&&P<=122?2:P>=65&&P<=90?1:0:(C=(0,i.bg)(P))!=C.toLowerCase()?1:C!=C.toUpperCase()?2:0;(!x||1==A&&b||0==S&&0!=A)&&(e[m]==P||n[m]==P&&(g=!0)?o[m++]=x:o.length&&(O=!1)),S=A,x+=(0,i.nZ)(P)}return m==h&&0==o[0]&&O?this.result(-100+(g?-200:0),o,t):k==h&&0==y?[-200-t.length,0,v]:a>-1?[-700-t.length,a,a+this.pattern.length]:k==h?[-900-t.length,y,v]:m==h?this.result(-100+(g?-200:0)+-700+(O?0:-1100),o,t):2==e.length?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,e,n){let r=[t-n.length],s=1;for(let o of e){let l=o+(this.astral?(0,i.nZ)((0,i.gm)(n,o)):1);s>1&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return r}}let y=i.r$.define({combine:t=>(0,i.BO)(t,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>n=>v(t(n),e(n)),optionClass:(t,e)=>n=>v(t(n),e(n)),addToOptions:(t,e)=>t.concat(e)})});function v(t,e){return t?e?t+" "+e:t:e}function b(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class O{constructor(t,e){let n;this.view=t,this.stateField=e,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:t=>this.positionInfo(t),key:this},this.space=null,this.currentClass="";let i=t.state.field(e),{options:r,selected:s}=i.open,o=t.state.facet(y);this.optionContent=(n=o.addToOptions.slice(),o.icons&&n.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}),n.push({render(t,e,n){let i=document.createElement("span");i.className="cm-completionLabel";let{label:r}=t,s=0;for(let o=1;o<n.length;){let l=n[o++],a=n[o++];l>s&&i.appendChild(document.createTextNode(r.slice(s,l)));let h=i.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(r.slice(l,a))),h.className="cm-completionMatchedText",s=a}return s<r.length&&i.appendChild(document.createTextNode(r.slice(s))),i},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}),n.sort((t,e)=>t.position-e.position).map(t=>t.render)),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=b(r.length,s,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",e=>{for(let n=e.target,i;n&&n!=this.dom;n=n.parentNode)if("LI"==n.nodeName&&(i=/-(\d+)$/.exec(n.id))&&+i[1]<r.length){p(t,r[+i[1]]),e.preventDefault();return}}),this.list=this.dom.appendChild(this.createListBox(r,i.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(t){var e,n,i;let r=t.state.field(this.stateField),s=t.startState.field(this.stateField);this.updateTooltipClass(t.state),r!=s&&(this.updateSel(),(null===(e=r.open)||void 0===e?void 0:e.disabled)!=(null===(n=s.open)||void 0===n?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(null===(i=r.open)||void 0===i?void 0:i.disabled)))}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let i of e.split(" "))i&&this.dom.classList.add(i);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfo)}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=b(e.options.length,e.selected,this.view.state.facet(y).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e.options,t.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(e.selected)){this.info&&(this.info.remove(),this.info=null);let{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)}).catch(t=>(0,r.OO)(this.view.state,t,"completion info")):this.addInfoPane(s)}}addInfoPane(t){let e=this.info=document.createElement("div");e.className="cm-tooltip cm-completionInfo",e.appendChild(t),this.dom.appendChild(e),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(t){var e,n;let i,r,s=null;for(let o=this.list.firstChild,l=this.range.from;o;o=o.nextSibling,l++)l==t?o.hasAttribute("aria-selected")||(o.setAttribute("aria-selected","true"),s=o):o.hasAttribute("aria-selected")&&o.removeAttribute("aria-selected");return s&&(e=this.list,n=s,i=e.getBoundingClientRect(),(r=n.getBoundingClientRect()).top<i.top?e.scrollTop-=i.top-r.top:r.bottom>i.bottom&&(e.scrollTop+=r.bottom-i.bottom)),s}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(),s=this.space;if(!s){let o=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}if(i.top>Math.min(s.bottom,e.bottom)-10||i.bottom<Math.max(s.top,e.top)+10)return null;let l=this.view.textDirection==r.Nm.RTL,a=l,h=!1,c,u="",f="",d=e.left-s.left,p=s.right-e.right;if(a&&d<Math.min(n.width,p)?a=!1:!a&&p<Math.min(n.width,d)&&(a=!0),n.width<=(a?d:p))u=Math.max(s.top,Math.min(i.top,s.bottom-n.height))-e.top+"px",c=Math.min(400,a?d:p)+"px";else{h=!0,c=Math.min(400,(l?e.right:s.right-e.left)-30)+"px";let m=s.bottom-e.bottom;m>=n.height||m>e.top?u=i.bottom-e.top+"px":f=e.bottom-i.top+"px"}return{top:u,bottom:f,maxWidth:c,class:h?l?"left-narrow":"right-narrow":a?"left":"right"}}positionInfo(t){this.info&&(t?(this.info.style.top=t.top,this.info.style.bottom=t.bottom,this.info.style.maxWidth=t.maxWidth,this.info.className="cm-tooltip cm-completionInfo cm-completionInfo-"+t.class):this.info.style.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"));for(let r=n.from;r<n.to;r++){let{completion:s,match:o}=t[r],l=i.appendChild(document.createElement("li"));l.id=e+"-"+r,l.setAttribute("role","option");let a=this.optionClass(s);for(let h of(a&&(l.className=a),this.optionContent)){let c=h(s,this.view.state,o);c&&l.appendChild(c)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}}function x(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class w{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 w(this.options,C(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,n,i,r){let s=function(t,e){let n=[],i=0;for(let r of t)if(r.hasResult()){if(!1===r.result.filter){let s=r.result.getMatch;for(let o of r.result.options){let l=[1e9-i++];if(s)for(let a of s(o))l.push(a);n.push(new c(o,r,l))}}else{let h=new k(e.sliceDoc(r.from,r.to)),u;for(let f of r.result.options)(u=h.match(f.label))&&(null!=f.boost&&(u[0]+=f.boost),n.push(new c(f,r,u)))}}let d=[],p=null,m=e.facet(y).compareCompletions;for(let g of n.sort((t,e)=>e.match[0]-t.match[0]||m(t.completion,e.completion)))p&&p.label==g.completion.label&&p.detail==g.completion.detail&&(null==p.type||null==g.completion.type||p.type==g.completion.type)&&p.apply==g.completion.apply?x(g.completion)>x(p)&&(d[d.length-1]=g):d.push(g),p=g.completion;return d}(t,e);if(!s.length)return i&&t.some(t=>1==t.state)?new w(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let o=e.facet(y).selectOnOpen?0:-1;if(i&&i.selected!=o&&-1!=i.selected){let l=i.options[i.selected].completion;for(let a=0;a<s.length;a++)if(s[a].completion==l){o=a;break}}return new w(s,C(n,o),{pos:t.reduce((t,e)=>e.hasResult()?Math.min(t,e.from):t,1e8),create:t=>new O(t,N),above:r.aboveCursor},i?i.timestamp:Date.now(),o,!1)}map(t){return new w(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class S{constructor(t,e,n){this.active=t,this.id=e,this.open=n}static start(){return new S(A,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,n=e.facet(y),i=(n.override||e.languageDataAt("autocomplete",u(e)).map(g)).map(e=>(this.active.find(t=>t.source==e)||new T(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;for(let s 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)?r=w.build(i,e,this.id,r,n):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 T(t.source,0):t)),t.effects))s.is($)&&(r=r&&r.setSelected(s.value,this.id));return i==this.active&&r==this.open?this:new S(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:P}}let P={"aria-autocomplete":"list"};function C(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}let A=[];function Q(t){return t.isUserEvent("input.type")?"input":t.isUserEvent("delete.backward")?"delete":null}class T{constructor(t,e,n=-1){this.source=t,this.state=e,this.explicitPos=n}hasResult(){return!1}update(t,e){let n=Q(t),i=this;for(let r of(n?i=i.handleUserEvent(t,n,e):t.docChanged?i=i.handleChange(t):t.selection&&0!=i.state&&(i=new T(i.source,0)),t.effects))if(r.is(D))i=new T(i.source,1,r.value?u(t.state):-1);else if(r.is(R))i=new T(i.source,0);else if(r.is(M))for(let s of r.value)s.source==i.source&&(i=s);return i}handleUserEvent(t,e,n){return"delete"!=e&&n.activateOnTyping?new T(this.source,1):this.map(t.changes)}handleChange(t){return t.changes.touchesRange(u(t.startState))?new T(this.source,0):this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new T(this.source,this.state,t.mapPos(this.explicitPos))}}class I extends T{constructor(t,e,n,i,r){super(t,2,e),this.result=n,this.from=i,this.to=r}hasResult(){return!0}handleUserEvent(t,e,n){var i;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||"delete"==e&&u(t.startState)==this.from)return new T(this.source,"input"==e&&n.activateOnTyping?1:0);let a=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos),h;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)}(this.result.validFor,t.state,r,s)?this.result.update&&(h=this.result.update(this.result,r,s,new o(t.state,l,a>=0)))?new I(this.source,a,h,h.from,null!==(i=h.to)&&void 0!==i?i:u(t.state)):new T(this.source,1,a):new I(this.source,a,this.result,r,s)}handleChange(t){return t.changes.touchesRange(this.from,this.to)?new T(this.source,0):this.map(t.changes)}map(t){return t.empty?this:new I(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1))}}let D=i.Py.define(),R=i.Py.define(),M=i.Py.define({map:(t,e)=>t.map(t=>t.map(e))}),$=i.Py.define(),N=i.QQ.define({create:()=>S.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 E(t,e="option"){return n=>{let i=n.state.field(N,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(y).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:$.of(a)}),!0}}let z=t=>{let e=t.state.field(N,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||Date.now()-e.open.timestamp<t.state.facet(y).interactionDelay)&&(e.open.disabled||p(t,e.open.options[e.open.selected]),!0)},B=t=>!!t.state.field(N,!1)&&(t.dispatch({effects:D.of(!0)}),!0),W=t=>{let e=t.state.field(N,!1);return!!(e&&e.active.some(t=>0!=t.state))&&(t.dispatch({effects:R.of(null)}),!0)};class J{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}let L=r.lg.fromClass(class{constructor(t){for(let e of(this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0,t.state.field(N).active))1==e.state&&this.startQuery(e)}update(t){let e=t.state.field(N);if(!t.selectionSet&&!t.docChanged&&t.startState.field(N)==e)return;let n=t.transactions.some(t=>(t.selection||t.docChanged)&&!Q(t));for(let i=0;i<this.running.length;i++){let s=this.running[i];if(n||s.updates.length+t.transactions.length>50&&Date.now()-s.time>1e3){for(let o of s.context.abortListeners)try{o()}catch(l){(0,r.OO)(this.view.state,l)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...t.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(t=>1==t.state&&!this.running.some(e=>e.active.source==t.source))?setTimeout(()=>this.startUpdate(),50):-1,0!=this.composing)for(let a of t.transactions)"input"==Q(a)?this.composing=2:2==this.composing&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:t}=this.view;for(let e of t.field(N).active)1!=e.state||this.running.some(t=>t.active.source==e.source)||this.startQuery(e)}startQuery(t){let{state:e}=this.view,n=u(e),i=new o(e,n,t.explicitPos==n),s=new J(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:R.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(),50))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(y);for(let i=0;i<this.running.length;i++){let r=this.running[i];if(void 0===r.done)continue;if(this.running.splice(i--,1),r.done){let s=new I(r.active.source,r.active.explicitPos,r.done,r.done.from,null!==(t=r.done.to)&&void 0!==t?t:u(r.updates.length?r.updates[0].startState:this.view.state));for(let o of r.updates)s=s.update(o,n);if(s.hasResult()){e.push(s);continue}}let l=this.view.state.field(N).active.find(t=>t.source==r.active.source);if(l&&1==l.state){if(null==r.done){let a=new T(r.active.source,0);for(let h of r.updates)a=a.update(h,n);1!=a.state&&e.push(a)}else this.startQuery(l)}}e.length&&this.view.dispatch({effects:M.of(e)})}},{eventHandlers:{blur(){let t=this.view.state.field(N,!1);t&&t.tooltip&&this.view.state.facet(y).closeOnBlur&&this.view.dispatch({effects:R.of(null)})},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:D.of(!1)}),20),this.composing=0}}}),j=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":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&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"},".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 F{constructor(t,e,n,i){this.field=t,this.line=e,this.from=n,this.to=i}}class _{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);return null==e||null==n?null:new _(this.field,e,n)}}class U{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 l of this.lines){if(n.length){let a=o,h=/^\t*/.exec(l)[0].length;for(let c=0;c<h;c++)a+=t.facet(s.c);i.push(e+a.length-h),l=a+l.slice(h)}n.push(l),e+=l.length+1}let u=this.fieldPositions.map(t=>new _(t.field,i[t.line]+t.from,i[t.line]+t.to));return{text:n,ranges:u}}static parse(t){let e=[],n=[],i=[],r;for(let s of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(s);){let o=r[1]?+r[1]:null,l=r[2]||r[3]||"",a=-1;for(let h=0;h<e.length;h++)(null!=o?e[h].seq==o:l&&e[h].name==l)&&(a=h);if(a<0){let c=0;for(;c<e.length&&(null==o||null!=e[c].seq&&e[c].seq<o);)c++;for(let u of(e.splice(c,0,{seq:o,name:l}),a=c,i))u.field>=a&&u.field++}i.push(new F(a,n.length,r.index,r.index+l.length)),s=s.slice(0,r.index)+l+s.slice(r.index+r[0].length)}for(let f;f=/\\([{}])/.exec(s);)for(let d of(s=s.slice(0,f.index)+f[1]+s.slice(f.index+f[0].length),i))d.line==n.length&&d.from>f.index&&(d.from--,d.to--);n.push(s)}return new U(n,i)}}let X=r.p.widget({widget:new class extends r.l9{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),q=r.p.mark({class:"cm-snippetField"});class V{constructor(t,e){this.ranges=t,this.active=e,this.deco=r.p.set(t.map(t=>(t.from==t.to?X:q).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 V(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 G=i.Py.define({map:(t,e)=>t&&t.map(e)}),Z=i.Py.define(),Y=i.QQ.define({create:()=>null,update(t,e){for(let n of e.effects){if(n.is(G))return n.value;if(n.is(Z)&&t)return new V(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 K(t,e){return i.jT.create(t.filter(t=>t.field==e).map(t=>i.jT.range(t.from,t.to)))}function H(t){return({state:e,dispatch:n})=>{let i=e.field(Y,!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:K(i.ranges,r),effects:G.of(s?null:new V(i.ranges,r))})),!0}}let tt=({state:t,dispatch:e})=>!!t.field(Y,!1)&&(e(t.update({effects:G.of(null)})),!0),te=H(1),tn=H(-1),ti=[{key:"Tab",run:te,shift:tn},{key:"Escape",run:tt}],tr=i.r$.define({combine:t=>t.length?t[0]:ti}),ts=i.Wl.highest(r.$f.compute([tr],t=>t.facet(tr)));function to(t,e){let n;return Object.assign(Object.assign({},e),{apply:(n=U.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};if(l.length&&(a.selection=K(l,0)),l.length>1){let h=new V(l,0),c=a.effects=[G.of(h)];void 0===t.state.field(Y,!1)&&c.push(i.Py.appendConfig.of([Y,ts,tl,j]))}t.dispatch(t.state.update(a))})})}let tl=r.tk.domEventHandlers({mousedown(t,e){let n=e.state.field(Y,!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:K(n.ranges,r.field),effects:G.of(n.ranges.some(t=>t.field>r.field)?new V(n.ranges,r.field):null)}),!0)}}),ta={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},th=i.Py.define({map(t,e){let n=e.mapPos(t,-1,i.gc.TrackAfter);return null==n?void 0:n}}),tc=i.Py.define({map:(t,e)=>e.mapPos(t)}),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(e.selection){let n=e.state.doc.lineAt(e.selection.main.head).from,r=e.startState.doc.lineAt(e.startState.selection.main.head).from;n!=e.changes.mapPos(r,-1)&&(t=i.Xs.empty)}for(let s of(t=t.map(e.changes),e.effects))s.is(th)?t=t.update({add:[tu.range(s.value,s.value+1)]}):s.is(tc)&&(t=t.update({filter:t=>t!=s.value}));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]||ta}let tk="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),ty=r.tk.inputHandler.of((t,e,n,r)=>{if((tk?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||ta.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||ta.stringPrefixes,l=null,a=t.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:e,from:r.to}],effects:th.of(r.to+e.length),range:i.jT.range(r.anchor+e.length,r.head+e.length)};let a=r.head,h=tx(t.doc,a),c;if(h==e){if(tw(t,a))return{changes:{insert:e+e,from:a},effects:th.of(a+e.length),range:i.jT.cursor(a+e.length)};if(tO(t,a)){let u=n&&t.sliceDoc(a,a+3*e.length)==e+e+e;return{range:i.jT.cursor(a+e.length*(u?3:1)),effects:tc.of(a)}}}else if(n&&t.sliceDoc(a-2*e.length,a)==e+e&&(c=tS(t,a-2*e.length,o))>-1&&tw(t,c))return{changes:{insert:e+e+e+e,from:a},effects:th.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 l=0;l<5;l++){let a=t.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),h=a.indexOf(n);if(!h||h>-1&&i.indexOf(a.slice(0,h))>-1){let c=r.firstChild;for(;c&&c.from==r.from&&c.to-c.from>n.length+h;){if(t.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let u=r.to==e&&r.parent;if(!u)break;r=u}return!1}(t,a,e,o))return{changes:{insert:e+e,from:a},effects:th.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:th.of(o.to+e.length),range:i.jT.range(o.anchor+e.length,o.head+e.length)};let l=tx(t.doc,o.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:o.head},effects:th.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||ta.before);if(e==l&&tO(t,t.selection.main.from))return function(t,e,n){let r=null,s=t.selection.ranges.map(e=>e.empty&&tx(t.doc,e.head)==n?i.jT.cursor(e.head+n.length):r=e);return r?null:t.update({selection:i.jT.create(s,t.selection.mainIndex),scrollIntoView:!0,effects:t.selection.ranges.map(({from:t})=>tc.of(t))})}(t,0,l)}return null}(t.state,r);return!!l&&(t.dispatch(l),!0)}),tv=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=tg(t,t.selection.main.head).brackets||ta.brackets,r=null,s=t.changeByRange(e=>{if(e.empty){var s,o;let l;let a=(s=t.doc,o=e.head,l=s.sliceString(o-2,o),(0,i.nZ)((0,i.gm)(l,0))==l.length?l:l.slice(1));for(let h of n)if(h==a&&tx(t.doc,e.head)==tm((0,i.gm)(h,0)))return{changes:{from:e.head-h.length,to:e.head+h.length},range:i.jT.cursor(e.head-h.length)}}return{range:r=e}});return r||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},tb=[{key:"Backspace",run:tv}];function tO(t,e){let n=!1;return t.field(tf).between(0,t.doc.length,t=>{t==e&&(n=!0)}),n}function tx(t,e){let n=t.sliceString(e,e+2);return n.slice(0,(0,i.nZ)((0,i.gm)(n,0)))}function tw(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 o=e-s.length;if(t.sliceDoc(o,e)==s&&r(t.sliceDoc(o-1,o))!=i.D0.Word)return o}return -1}function tP(t={}){return[N,y.of(t),L,tA,j]}let tC=[{key:"Ctrl-Space",run:B},{key:"Escape",run:W},{key:"ArrowDown",run:E(!0)},{key:"ArrowUp",run:E(!1)},{key:"PageDown",run:E(!0,"page")},{key:"PageUp",run:E(!1,"page")},{key:"Enter",run:z}],tA=i.Wl.highest(r.$f.computeN([y],t=>t.facet(y).defaultKeymap?[tC]:[]))},61426:function(t,e,n){n.r(e),n.d(e,{css:function(){return S},cssCompletionSource:function(){return x},cssLanguage:function(){return w}});var i=n(53105),r=n(35524);let s=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function o(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}let l=new i.Jq((t,e)=>{for(let n=!1,i=0,r=0;;r++){var s;let{next:l}=t;if(o(l)||45==l||95==l||n&&(s=l)>=48&&s<=57)!n&&(45!=l||r>0)&&(n=!0),i===r&&45==l&&i++,t.advance();else{n&&t.acceptToken(40==l?95:2==i&&e.canShift(2)?2:96);break}}}),a=new i.Jq(t=>{if(s.includes(t.peek(-1))){let{next:e}=t;(o(e)||95==e||35==e||46==e||91==e||58==e||45==e)&&t.acceptToken(94)}}),h=new i.Jq(t=>{if(!s.includes(t.peek(-1))){let{next:e}=t;if(37==e&&(t.advance(),t.acceptToken(1)),o(e)){do t.advance();while(o(t.next));t.acceptToken(1)}}}),c=(0,r.Gv)({"AtKeyword import charset namespace keyframes media supports":r.pJ.definitionKeyword,"from to selector":r.pJ.keyword,NamespaceName:r.pJ.namespace,KeyframeName:r.pJ.labelName,TagName:r.pJ.tagName,ClassName:r.pJ.className,PseudoClassName:r.pJ.constant(r.pJ.className),IdName:r.pJ.labelName,"FeatureName PropertyName":r.pJ.propertyName,AttributeName:r.pJ.attributeName,NumberLiteral:r.pJ.number,KeywordQuery:r.pJ.keyword,UnaryQueryOp:r.pJ.operatorKeyword,"CallTag ValueName":r.pJ.atom,VariableName:r.pJ.variableName,Callee:r.pJ.operatorKeyword,Unit:r.pJ.unit,"UniversalSelector NestingSelector":r.pJ.definitionOperator,MatchOp:r.pJ.compareOperator,"ChildOp SiblingOp, LogicOp":r.pJ.logicOperator,BinOp:r.pJ.arithmeticOperator,Important:r.pJ.modifier,Comment:r.pJ.blockComment,ParenthesizedContent:r.pJ.special(r.pJ.name),ColorLiteral:r.pJ.color,StringLiteral:r.pJ.string,":":r.pJ.punctuation,"PseudoOp #":r.pJ.derefOperator,"; ,":r.pJ.separator,"( )":r.pJ.paren,"[ ]":r.pJ.squareBracket,"{ }":r.pJ.brace}),u={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},f={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},d={__proto__:null,not:128,only:128,from:158,to:160},p=i.WQ.deserialize({version:14,states:"7WQYQ[OOO#_Q[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO#fQ[O'#CfO$YQXO'#CaO$aQ[O'#ChO$lQ[O'#DPO$qQ[O'#DTOOQP'#Ed'#EdO$vQdO'#DeO%bQ[O'#DrO$vQdO'#DtO%sQ[O'#DvO&OQ[O'#DyO&TQ[O'#EPO&cQ[O'#EROOQS'#Ec'#EcOOQS'#ET'#ETQYQ[OOO&jQXO'#CdO'_QWO'#DaO'dQWO'#EjO'oQ[O'#EjQOQWOOOOQP'#Cg'#CgOOQP,59Q,59QO#fQ[O,59QO'yQ[O'#EWO(eQWO,58{O(mQ[O,59SO$lQ[O,59kO$qQ[O,59oO'yQ[O,59sO'yQ[O,59uO'yQ[O,59vO(xQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)PQWO,59SO)UQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)ZQ`O,59oOOQS'#Cp'#CpO$vQdO'#CqO)cQvO'#CsO*pQtO,5:POOQO'#Cx'#CxO)UQWO'#CwO+UQWO'#CyOOQS'#Eg'#EgOOQO'#Dh'#DhO+ZQ[O'#DoO+iQWO'#EkO&TQ[O'#DmO+wQWO'#DpOOQO'#El'#ElO(hQWO,5:^O+|QpO,5:`OOQS'#Dx'#DxO,UQWO,5:bO,ZQ[O,5:bOOQO'#D{'#D{O,cQWO,5:eO,hQWO,5:kO,pQWO,5:mOOQS-E8R-E8RO$vQdO,59{O,xQ[O'#EYO-VQWO,5;UO-VQWO,5;UOOQP1G.l1G.lO-|QXO,5:rOOQO-E8U-E8UOOQS1G.g1G.gOOQP1G.n1G.nO)PQWO1G.nO)UQWO1G.nOOQP1G/V1G/VO.ZQ`O1G/ZO.tQXO1G/_O/[QXO1G/aO/rQXO1G/bO0YQWO,59zO0_Q[O'#DOO0fQdO'#CoOOQP1G/Z1G/ZO$vQdO1G/ZO0mQpO,59]OOQS,59_,59_O$vQdO,59aO0uQWO1G/kOOQS,59c,59cO0zQ!bO,59eO1SQWO'#DhO1_QWO,5:TO1dQWO,5:ZO&TQ[O,5:VO&TQ[O'#EZO1lQWO,5;VO1wQWO,5:XO'yQ[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2YQWO1G/|O2_QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO2mQtO1G/gOOQO,5:t,5:tO3TQ[O,5:tOOQO-E8W-E8WO3bQWO1G0pOOQP7+$Y7+$YOOQP7+$u7+$uO$vQdO7+$uOOQS1G/f1G/fO3mQXO'#EiO3tQWO,59jO3yQtO'#EUO4nQdO'#EfO4xQWO,59ZO4}QpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5VQWO1G/PO$vQdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5[QWO,5:uOOQO-E8X-E8XO5jQXO1G/vOOQS7+%h7+%hO5qQYO'#CsO(hQWO'#E[O5yQdO,5:hOOQS,5:h,5:hO6XQtO'#EXO$vQdO'#EXO7VQdO7+%ROOQO7+%R7+%ROOQO1G0`1G0`O7jQpO<<HaO7rQWO,5;TOOQP1G/U1G/UOOQS-E8S-E8SO$vQdO'#EVO7zQWO,5;QOOQT1G.u1G.uOOQP<<Ha<<HaOOQS7+$k7+$kO8SQdO7+%ZOOQO7+%b7+%bOOQS,5:v,5:vOOQS-E8Y-E8YOOQS1G0S1G0SO8ZQtO,5:sOOQS-E8V-E8VOOQO<<Hm<<HmOOQPAN={AN={O9XQdO,5:qOOQO-E8T-E8TOOQO<<Hu<<Hu",stateData:"9i~O#UOSROS~OUXOXXO]UO^UOtVOxWO!Y`O!ZYO!gZO!i[O!k]O!n^O!t_O#SQO#XSO~OQeOUXOXXO]UO^UOtVOxWO!Y`O!ZYO!gZO!i[O!k]O!n^O!t_O#SdO#XSO~O#P#^P~P!ZO#SiO~O]nO^nOplOtoOxpO|qO!PsO#QrO#XkO~O!RtO~P#kO`zO#RwO#SvO~O#S{O~O#S}O~OQ!WOb!QOf!WOh!WOn!VO#R!TO#S!PO#[!RO~Ob!YO!b![O!e!]O#S!XO!R#_P~Oh!bOn!VO#S!aO~O#S!dO~Ob!YO!b![O!e!]O#S!XO~O!W#_P~P%bO]WX]!UX^WXpWXtWXxWX|WX!PWX!RWX#QWX#XWX~O]!iO~O!W!jO#P#^X!Q#^X~O#P#^X!Q#^X~P!ZOUXOXXO]UO^UOtVOxWO#SQO#XSO~OplO!RtO~O`!sO#RwO#SvO~O!Q#^P~P!ZOb!zO~Ob!{O~Ov!|Oz!}O~OP#PObgXjgX!WgX!bgX!egX#SgXagXQgXfgXhgXngXpgX!VgX#PgX#RgX#[gXvgX!QgX~Ob!YOj#QO!b![O!e!]O#S!XO!W#_P~Ob#TO~Ob!YO!b![O!e!]O#S#UO~Op#YO!`#XO!R#_X!W#_X~Ob#]O~Oj#QO!W#_O~O!W#`O~Oh#aOn!VO~O!R#bO~O!RtO!`#XO~O!RtO!W#eO~O!W!|X#P!|X!Q!|X~P!ZO!W!jO#P#^a!Q#^a~O]nO^nOtoOxpO|qO!PsO#QrO#XkO~Op!za!R!zaa!za~P-bOv#lOz#mO~O]nO^nOtoOxpO#XkO~Op{i|{i!P{i!R{i#Q{ia{i~P.cOp}i|}i!P}i!R}i#Q}ia}i~P.cOp!Oi|!Oi!P!Oi!R!Oi#Q!Oia!Oi~P.cO!Q#nO~Oa#]P~P'yOa#YP~P$vOa#uOj#QO~O!W#wO~Oh#xOo#xO~O]!^Xa![X!`![X~O]#yO~Oa#zO!`#XO~Op#YO!R#_a!W#_a~O!`#XOp!aa!R!aa!W!aaa!aa~O!W$PO~O!Q$TO!q$RO!r$RO#[$QO~Oj#QOp$VO!V$XO!W!Ti#P!Ti!Q!Ti~P$vO!W!|a#P!|a!Q!|a~P!ZO!W!jO#P#^i!Q#^i~Oa#]X~P#kOa$]O~Oj#QOQ!xXa!xXb!xXf!xXh!xXn!xXp!xX#R!xX#S!xX#[!xX~Op$_Oa#YX~P$vOa$aO~Oj#QOv$bO~Oa$cO~O!`#XOp!}a!R!}a!W!}a~Oa$eO~P-bOP#PO!RgX~O!Q$hO!q$RO!r$RO#[$QO~Oj#QOQ!{Xb!{Xf!{Xh!{Xn!{Xp!{X!V!{X!W!{X#P!{X#R!{X#S!{X#[!{X!Q!{X~Op$VO!V$kO!W!Tq#P!Tq!Q!Tq~P$vOj#QOv$lO~OplOa#]a~Op$_Oa#Ya~Oa$oO~P$vOj#QOQ!{ab!{af!{ah!{an!{ap!{a!V!{a!W!{a#P!{a#R!{a#S!{a#[!{a!Q!{a~Oa!yap!ya~P$vOo#[j!Pj~",goto:",`#aPPPPP#bP#k#zP#k$Z#kPP$aPPP$g$p$pP%SP$pP$p%j%|PPP&f&l#kP&rP#kP&xP#kP#k#kPPP'O'b'oPP#bPP'v'v(Q'vP'vP'v'vP#bP#bP#bP(T#bP(W(ZPP#bP#bP(^(m({)R)])c)m)sPPPPPP)y*SP*o*rP+h+k+q+z_aOPcgt!j#hkXOPcglqrst!j!z#]#hkROPcglqrst!j!z#]#hQjSR!mkQxUR!qnQ!qzQ#S!UR#k!sq!WY[!Q!i!{!}#Q#f#m#r#y$V$W$_$d$mp!WY[!Q!i!{!}#Q#f#m#r#y$V$W$_$d$mT$R#b$Sq!UY[!Q!i!{!}#Q#f#m#r#y$V$W$_$d$mp!WY[!Q!i!{!}#Q#f#m#r#y$V$W$_$d$mQ!b]R#a!cQyUR!rnQ!qyR#k!rQ|VR!toQ!OWR!upQuTQ!pmQ#^!_Q#d!fQ#e!gR$f$RSfPtQ!lgQ#g!jR$Y#hZePgt!j#ha!^Z_`!S!Y![#X#YR#V!YR!c]R!e^R#c!eQcOSgPtU!hcg#hR#h!jQ#r!{U$^#r$d$mQ$d#yR$m$_Q$`#rR$n$`QmTS!om$[R$[#oQ$W#fR$j$WQ!kfS#i!k#jR#j!lQ#Z!ZR#}#ZQ$S#bR$g$S_bOPcgt!j#h^TOPcgt!j#hQ!nlQ!vqQ!wrQ!xsQ#o!zR$O#]R#s!{Q!SYQ!`[Q#O!QQ#f!i[#q!{#r#y$_$d$mQ#t!}Q#v#QS$U#f$WQ$Z#mR$i$VR#p!zQhPR!ytQ!_ZQ!g`R#R!SU!ZZ`!SQ!f_Q#W!YQ#[![Q#{#XR#|#Y",nodeNames:"⚠ Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent , PseudoClassName ArgList IdSelector # IdName ] AttributeSelector [ AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList from to SupportsStatement supports AtRule Styles",maxTerm:108,nodeProps:[["openedBy",17,"(",48,"{"],["closedBy",18,")",49,"}"]],propSources:[c],skippedNodes:[0,3],repeatNodeCount:8,tokenData:"Lq~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Cu![!]Dp!]!^El!^!_$}!_!`E}!`!aF`!a!b$}!b!cG[!c!}$}!}#OHt#O#P$}#P#QIV#Q#R6d#R#T$}#T#UIh#U#c$}#c#dJy#d#o$}#o#pK`#p#q6d#q#rKq#r#sLS#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`Lk<%lO$}W%QSOy%^z;'S%^;'S;=`%o<%lO%^W%cSoWOy%^z;'S%^;'S;=`%o<%lO%^W%rP;=`<%l%^~%zh#U~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#U~oWOX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^^)[UOy%^z#]%^#]#^)n#^;'S%^;'S;=`%o<%lO%^^)sUoWOy%^z#a%^#a#b*V#b;'S%^;'S;=`%o<%lO%^^*[UoWOy%^z#d%^#d#e*n#e;'S%^;'S;=`%o<%lO%^^*sUoWOy%^z#c%^#c#d+V#d;'S%^;'S;=`%o<%lO%^^+[UoWOy%^z#f%^#f#g+n#g;'S%^;'S;=`%o<%lO%^^+sUoWOy%^z#h%^#h#i,V#i;'S%^;'S;=`%o<%lO%^^,[UoWOy%^z#T%^#T#U,n#U;'S%^;'S;=`%o<%lO%^^,sUoWOy%^z#b%^#b#c-V#c;'S%^;'S;=`%o<%lO%^^-[UoWOy%^z#h%^#h#i-n#i;'S%^;'S;=`%o<%lO%^^-uS!VUoWOy%^z;'S%^;'S;=`%o<%lO%^~.UWOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o<%lO.R~.sOh~~.vRO;'S.R;'S;=`/P;=`O.R~/SXOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o;=`<%l.R<%lO.R~/rP;=`<%l.R_/zYtPOy%^z!Q%^!Q![0j![!c%^!c!i0j!i#T%^#T#Z0j#Z;'S%^;'S;=`%o<%lO%^^0oYoWOy%^z!Q%^!Q![1_![!c%^!c!i1_!i#T%^#T#Z1_#Z;'S%^;'S;=`%o<%lO%^^1dYoWOy%^z!Q%^!Q![2S![!c%^!c!i2S!i#T%^#T#Z2S#Z;'S%^;'S;=`%o<%lO%^^2ZYfUoWOy%^z!Q%^!Q![2y![!c%^!c!i2y!i#T%^#T#Z2y#Z;'S%^;'S;=`%o<%lO%^^3QYfUoWOy%^z!Q%^!Q![3p![!c%^!c!i3p!i#T%^#T#Z3p#Z;'S%^;'S;=`%o<%lO%^^3uYoWOy%^z!Q%^!Q![4e![!c%^!c!i4e!i#T%^#T#Z4e#Z;'S%^;'S;=`%o<%lO%^^4lYfUoWOy%^z!Q%^!Q![5[![!c%^!c!i5[!i#T%^#T#Z5[#Z;'S%^;'S;=`%o<%lO%^^5aYoWOy%^z!Q%^!Q![6P![!c%^!c!i6P!i#T%^#T#Z6P#Z;'S%^;'S;=`%o<%lO%^^6WSfUoWOy%^z;'S%^;'S;=`%o<%lO%^Y6gUOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^Y7QSzQoWOy%^z;'S%^;'S;=`%o<%lO%^X7cSXPOy%^z;'S%^;'S;=`%o<%lO%^~7rWOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W<%lO7o~8_RO;'S7o;'S;=`8h;=`O7o~8kXOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W;=`<%l7o<%lO7o~9ZP;=`<%l7o_9cSbVOy%^z;'S%^;'S;=`%o<%lO%^~9tOa~_9{UUPjSOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^_:fWjS!PPOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^^;TUoWOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^^;nYoW#[UOy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^^<cYoWOy%^z{%^{|=R|}%^}!O=R!O!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^^=WUoWOy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^^=qUoW#[UOy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^^>[[oW#[UOy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^_?VSpVOy%^z;'S%^;'S;=`%o<%lO%^^?hWjSOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^_@VU#XPOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjSOy%^z{@}{;'S%^;'S;=`%o<%lO%^~ASUoWOy@}yzAfz{Bm{;'S@};'S;=`Co<%lO@}~AiTOzAfz{Ax{;'SAf;'S;=`Bg<%lOAf~A{VOzAfz{Ax{!PAf!P!QBb!Q;'SAf;'S;=`Bg<%lOAf~BgOR~~BjP;=`<%lAf~BrWoWOy@}yzAfz{Bm{!P@}!P!QC[!Q;'S@};'S;=`Co<%lO@}~CcSoWR~Oy%^z;'S%^;'S;=`%o<%lO%^~CrP;=`<%l@}^Cz[#[UOy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^XDuU]POy%^z![%^![!]EX!];'S%^;'S;=`%o<%lO%^XE`S^PoWOy%^z;'S%^;'S;=`%o<%lO%^_EqS!WVOy%^z;'S%^;'S;=`%o<%lO%^YFSSzQOy%^z;'S%^;'S;=`%o<%lO%^XFeU|POy%^z!`%^!`!aFw!a;'S%^;'S;=`%o<%lO%^XGOS|PoWOy%^z;'S%^;'S;=`%o<%lO%^XG_WOy%^z!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHO[!YPoWOy%^z}%^}!OGw!O!Q%^!Q![Gw![!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHySxPOy%^z;'S%^;'S;=`%o<%lO%^^I[SvUOy%^z;'S%^;'S;=`%o<%lO%^XIkUOy%^z#b%^#b#cI}#c;'S%^;'S;=`%o<%lO%^XJSUoWOy%^z#W%^#W#XJf#X;'S%^;'S;=`%o<%lO%^XJmS!`PoWOy%^z;'S%^;'S;=`%o<%lO%^XJ|UOy%^z#f%^#f#gJf#g;'S%^;'S;=`%o<%lO%^XKeS!RPOy%^z;'S%^;'S;=`%o<%lO%^_KvS!QVOy%^z;'S%^;'S;=`%o<%lO%^ZLXU!PPOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^WLnP;=`<%l$}",tokenizers:[a,h,l,0,1,2,3],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:95,get:t=>u[t]||-1},{term:56,get:t=>f[t]||-1},{term:96,get:t=>d[t]||-1}],tokenPrec:1123});var m=n(59119);let g=null;function k(){if(!g&&"object"==typeof document&&document.body){let t=[];for(let e in document.body.style)/[A-Z]|^-|^(item|length)$/.test(e)||t.push(e);g=t.sort().map(t=>({type:"property",label:t}))}return g||[]}let y=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),v=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),b=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),O=/^[\w-]*/,x=t=>{let{state:e,pos:n}=t,i=(0,m.qz)(e).resolveInner(n,-1);if("PropertyName"==i.name)return{from:i.from,options:k(),validFor:O};if("ValueName"==i.name)return{from:i.from,options:v,validFor:O};if("PseudoClassName"==i.name)return{from:i.from,options:y,validFor:O};if("TagName"==i.name){for(let{parent:r}=i;r;r=r.parent)if("Block"==r.name)return{from:i.from,options:k(),validFor:O};return{from:i.from,options:b,validFor:O}}if(!t.explicit)return null;let s=i.resolve(n),o=s.childBefore(n);return o&&":"==o.name&&"PseudoClassSelector"==s.name?{from:n,options:y,validFor:O}:o&&":"==o.name&&"Declaration"==s.name||"ArgList"==s.name?{from:n,options:v,validFor:O}:"Block"==s.name?{from:n,options:k(),validFor:O}:null},w=m.qp.define({name:"css",parser:p.configure({props:[m.uj.add({Declaration:(0,m.tC)()}),m.x0.add({Block:m.Dv})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function S(){return new m.ri(w,w.data.of({autocomplete:x}))}},59119:function(t,e,n){n.d(e,{Be:function(){return k},Dv:function(){return F},Gn:function(){return D},K0:function(){return I},Qf:function(){return tf},R_:function(){return ty},SQ:function(){return u},SS:function(){return T},Um:function(){return tT},c:function(){return A},c6:function(){return P},e7:function(){return ti},il:function(){return tM},kU:function(){return c},mi:function(){return tc},n$:function(){return tA},nF:function(){return tg},nY:function(){return J},pp:function(){return h},qp:function(){return d},qz:function(){return p},ri:function(){return S},tC:function(){return W},uj:function(){return R},vw:function(){return E},x0:function(){return j},y1:function(){return Q},ze:function(){return B}});var i,r=n(41113),s=n(78120),o=n(47421),l=n(35524),a=n(28699);let h=new r.md;function c(t){return s.r$.define({combine:t?e=>e.concat(t):void 0})}class u{constructor(t,e,n=[],i=""){this.data=t,this.name=i,s.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(s.yy.prototype,"tree",{get(){return p(this)}}),this.parser=e,this.extension=[w.of(this),s.yy.languageData.of((t,e,n)=>t.facet(f(t,e,n)))].concat(n)}isActiveAt(t,e,n=-1){return f(t,e,n)==this.data}findRegions(t){let e=t.facet(w);if((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 o of s.overlay)n.push({from:o.from+e,to:o.to+e});else n.push({from:e,to:e+t.length});return}if(s.overlay){let l=n.length;if(i(s.tree,s.overlay[0].from+e),n.length>l)return}}for(let a=0;a<t.children.length;a++){let c=t.children[a];c instanceof r.mp&&i(c,t.positions[a]+e)}};return i(p(t),0),n}get allowsNesting(){return!0}}function f(t,e,n){let i=t.facet(w);if(!i)return null;let s=i.data;if(i.allowsNesting)for(let o=p(t).topNode;o;o=o.enter(e,n,r.vj.ExcludeBuffers))s=o.type.prop(h)||s;return s}u.setState=s.Py.define();class d extends u{constructor(t,e,n){super(t,e,[],n),this.parser=e}static define(t){let e=c(t.languageData);return new d(e,t.parser.configure({props:[h.add(t=>t.isTop?e:void 0)]}),t.name)}configure(t,e){return new d(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function p(t){let e=t.field(u.state,!1);return e?e.tree:r.mp.empty}class m{constructor(t,e=t.length){this.doc=t,this.length=e,this.cursorPos=0,this.string="",this.cursor=t.iter()}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 g=null;class k{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 k(t,e,[],r.mp.empty,0,n,[],null)}startParse(){return this.parser.startParse(new m(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 i=Date.now()+t;t=()=>Date.now()>i}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 s=this.parse.advance();if(s){if(this.fragments=this.withoutTempSkipped(r.i9.addTree(s,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=s,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=g;g=this;try{return t()}finally{g=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=y(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 a=[];if(t.iterChangedRanges((t,e,n,i)=>a.push({fromA:t,toA:e,fromB:n,toB:i})),n=r.i9.applyChanges(n,a),i=r.mp.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length)for(let h of(l=[],this.skipped)){let c=t.mapPos(h.from,1),u=t.mapPos(h.to,-1);c<u&&l.push({from:c,to:u})}}return new k(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 n=0;n<this.skipped.length;n++){let{from:i,to:r}=this.skipped[n];i<t.to&&r>t.from&&(this.fragments=y(this.fragments,i,r),this.skipped.splice(n--,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=g;if(e){for(let n of i)e.tempSkipped.push(n);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 g}}function y(t,e,n){return r.i9.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class v{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 v(e)}static init(t){let e=Math.min(3e3,t.doc.length),n=k.create(t.facet(w).parser,t,{from:0,to:e});return n.work(20,e)||n.takeTree(),new v(n)}}u.state=s.QQ.define({create:v.init,update(t,e){for(let n of e.effects)if(n.is(u.setState))return n.value;return e.startState.facet(w)!=e.state.facet(w)?v.init(e.state):t.apply(e)}});let b=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(b=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});let O="undefined"!=typeof navigator&&(null===(i=navigator.scheduling)||void 0===i?void 0:i.isInputPending)?()=>navigator.scheduling.isInputPending():null,x=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(u.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(u.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=b(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(u.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,t&&!O?Math.max(25,t.timeRemaining()-5):1e9),o=r.context.treeLen<i&&n.doc.length>i+1e3,l=r.context.work(()=>O&&O()||Date.now()>s,i+(o?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:u.setState.of(new v(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()}}}),w=s.r$.define({combine:t=>t.length?t[0]:null,enables:t=>[u.state,x,o.tk.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class S{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class P{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 P(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 i=/\.([^.]+)$/.exec(e);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,e,n=!0){for(let i of(e=e.toLowerCase(),t))if(i.alias.some(t=>t==e))return i;if(n)for(let r of t)for(let s of r.alias){let o=e.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(e[o-1])&&!/\w/.test(e[o+s.length])))return r}return null}}let C=s.r$.define(),A=s.r$.define({combine:t=>{if(!t.length)return" ";if(!/^(?: +|\t+)$/.test(t[0]))throw Error("Invalid indent unit: "+JSON.stringify(t[0]));return t[0]}});function Q(t){let e=t.facet(A);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function T(t,e){let n="",i=t.tabSize;if(9==t.facet(A).charCodeAt(0))for(;e>=i;)n+=" ",e-=i;for(let r=0;r<e;r++)n+=" ";return n}function I(t,e){var n;for(let i of(t instanceof s.yy&&(t=new D(t)),t.state.facet(C))){let r=i(t,e);if(void 0!==r)return r}let o=p(t.state);return o?(n=t,M(o.resolveInner(e).enterUnfinishedNodesBefore(e),e,n)):null}class D{constructor(t,e={}){this.state=t,this.options=e,this.unit=Q(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 s=r(i);if(s>-1)return s}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let R=new r.md;function M(t,e,n){for(;t;t=t.parent){let i=function(t){let e=t.type.prop(R);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(r.md.closedBy))){let s=t.lastChild,o=s&&i.indexOf(s.name)>-1;return t=>z(t,!0,1,void 0,o&&!(t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak)?s.from:void 0)}return null==t.parent?$:null}(t);if(i)return i(N.create(n,e,t))}return null}function $(){return 0}class N extends D{constructor(t,e,n){super(t.state,t.options),this.base=t,this.pos=e,this.node=n}static create(t,e,n){return new N(t,e,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let t=this.state.doc.lineAt(this.node.from);for(;;){let e=this.node.resolve(t.from);for(;e.parent&&e.parent.from==e.from;)e=e.parent;if(function(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}(e,this.node))break;t=this.state.doc.lineAt(e.from)}return this.lineIndent(t.from)}continue(){let t=this.node.parent;return t?M(t,this.pos,this.base):0}}function E({closing:t,align:e=!0,units:n=1}){return i=>z(i,e,n,t)}function z(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 l=n.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from<o?n:null;l=a.to}}(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}let B=t=>t.baseIndent;function W({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}function J(){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:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let u=I(o,c.from);if(null==u)continue;let f=/^\s*/.exec(c.text)[0],d=T(o,u);f!=d&&a.push({from:c.from,to:c.from+f.length,insert:d})}return a.length?[t,{changes:a,sequential:!0}]:t})}let L=s.r$.define(),j=new r.md;function F(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 _(t,e,n){for(let i of t.facet(L)){let r=i(t,e,n);if(r)return r}return function(t,e,n){let i=p(t);if(i.length<n)return null;let r=i.resolveInner(n,1),s=null;for(let o=r;o;o=o.parent){if(o.to<=n||o.from>n)continue;if(s&&o.from<e)break;let l=o.type.prop(j);if(l&&(o.to<i.length-50||i.length==t.doc.length||!function(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}(o))){let a=l(o,t);a&&a.from<=n&&a.from>=e&&a.to>n&&(s=a)}}return s}(t,e,n)}function U(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 X=s.Py.define({map:U}),q=s.Py.define({map:U});function V(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 G=s.QQ.define({create:()=>o.p.none,update(t,e){for(let n of(t=t.map(e.changes),e.effects))n.is(X)&&!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)?t=t.update({add:[tl.range(n.value.from,n.value.to)]}):n.is(q)&&(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 i=!1,{head:r}=e.selection.main;t.between(r,r,(t,e)=>{t<r&&e>r&&(i=!0)}),i&&(t=t.update({filterFrom:r,filterTo:r,filter:(t,e)=>e<=r||t>=r}))}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(tl.range(i,r))}return o.p.set(e,!0)}});function Z(t,e,n){var i;let r=null;return null===(i=t.field(G,!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(G,!1)?e:e.concat(s.Py.appendConfig.of(to()))}let K=t=>{for(let e of V(t)){let n=_(t.state,e.from,e.to);if(n)return t.dispatch({effects:Y(t.state,[X.of(n),tt(t,n)])}),!0}return!1},H=t=>{if(!t.state.field(G,!1))return!1;let e=[];for(let n of V(t)){let i=Z(t.state,n.from,n.to);i&&e.push(q.of(i),tt(t,i,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function tt(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 te=t=>{let{state:e}=t,n=[];for(let i=0;i<e.doc.length;){let r=t.lineBlockAt(i),s=_(e,r.from,r.to);s&&n.push(X.of(s)),i=(s?t.lineBlockAt(s.to):r).to+1}return n.length&&t.dispatch({effects:Y(t.state,n)}),!!n.length},tn=t=>{let e=t.state.field(G,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(t,e)=>{n.push(q.of({from:t,to:e}))}),t.dispatch({effects:n}),!0},ti=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:K},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:H},{key:"Ctrl-Alt-[",run:te},{key:"Ctrl-Alt-]",run:tn}],tr={placeholderDOM:null,placeholderText:"…"},ts=s.r$.define({combine:t=>(0,s.BO)(t,tr)});function to(t){let e=[G,tu];return t&&e.push(ts.of(t)),e}let tl=o.p.replace({widget:new class extends o.l9{toDOM(t){let{state:e}=t,n=e.facet(ts),i=e=>{let n=t.lineBlockAt(t.posAtDOM(e.target)),i=Z(t.state,n.from,n.to);i&&t.dispatch({effects:q.of(i)}),e.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,i);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",e.phrase("folded code")),r.title=e.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=i,r}}}),ta={openText:"⌄",closedText:"",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class th 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 tc(t={}){let e=Object.assign(Object.assign({},ta),t),n=new th(e,!0),i=new th(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(w)!=t.state.facet(w)||t.startState.field(G,!1)!=t.state.field(G,!1)||p(t.startState)!=p(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 o=Z(t.state,r.from,r.to)?i:_(t.state,r.from,r.to)?n:null;o&&e.add(r.from,r.from,o)}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 th(e,!1),domEventHandlers:Object.assign(Object.assign({},l),{click:(t,e,n)=>{if(l.click&&l.click(t,e,n))return!0;let i=Z(t.state,e.from,e.to);if(i)return t.dispatch({effects:q.of(i)}),!0;let r=_(t.state,e.from,e.to);return!!r&&(t.dispatch({effects:X.of(r)}),!0)}})}),to()]}let tu=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 tf{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 u?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 tf(t,e||{})}}let td=s.r$.define(),tp=s.r$.define({combine:t=>t.length?[t[0]]:null});function tm(t){let e=t.facet(td);return e.length?e:t.facet(tp)}function tg(t,e){let n=[tk],i;return t instanceof tf&&(t.module&&n.push(o.tk.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?n.push(tp.of(t)):i?n.push(td.computeN([o.tk.darkTheme],e=>e.facet(o.tk.darkTheme)==("dark"==i)?[t]:[])):n.push(td.of(t)),n}let tk=s.Wl.high(o.lg.fromClass(class{constructor(t){this.markCache=Object.create(null),this.tree=p(t.state),this.decorations=this.buildDeco(t,tm(t.state))}update(t){let e=p(t.state),n=tm(t.state),i=n!=tm(t.startState);e.length<t.view.viewport.to&&!i&&e.type==this.tree.type?this.decorations=this.decorations.map(t.changes):(e!=this.tree||t.viewportChanged||i)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n))}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()}},{decorations:t=>t.decorations})),ty=tf.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"},{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"}]),tv=o.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),tb="()[]{}",tO=s.r$.define({combine:t=>(0,s.BO)(t,{afterCursor:!0,brackets:tb,maxScanDistance:1e4,renderMatch:tS})}),tx=o.p.mark({class:"cm-matchingBracket"}),tw=o.p.mark({class:"cm-nonmatchingBracket"});function tS(t){let e=[],n=t.matched?tx:tw;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 tP=s.QQ.define({create:()=>o.p.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],i=e.state.facet(tO);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=tT(e.state,r.head,-1,i)||r.head>0&&tT(e.state,r.head-1,1,i)||i.afterCursor&&(tT(e.state,r.head,1,i)||r.head<e.state.doc.length&&tT(e.state,r.head+1,-1,i));s&&(n=n.concat(i.renderMatch(s,e.state)))}return o.p.set(n,!0)},provide:t=>o.tk.decorations.from(t)}),tC=[tP,tv];function tA(t={}){return[tO.of(t),tC]}function tQ(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 s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function tT(t,e,n,i={}){let r=i.maxScanDistance||1e4,s=i.brackets||tb,o=p(t),l=o.resolveInner(e,n);for(let a=l;a;a=a.parent){let h=tQ(a.type,n,s);if(h&&a.from<a.to)return function(t,e,n,i,r,s){let o=i.parent,l={from:i.from,to:i.to},a=0,h=null==o?void 0:o.cursor();if(h&&(n<0?h.childBefore(i.from):h.childAfter(i.to)))do if(n<0?h.to<=i.from:h.from>=i.to){if(0==a&&r.indexOf(h.type.name)>-1&&h.from<h.to)return{start:l,end:{from:h.from,to:h.to},matched:!0};if(tQ(h.type,n,s))a++;else if(tQ(h.type,-n,s)){if(0==a)return{start:l,end:h.from==h.to?void 0:{from:h.from,to:h.to},matched:!1};a--}}while(n<0?h.prevSibling():h.nextSibling());return{start:l,matched:!1}}(0,0,n,a,h,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 f=0;!c.next().done&&f<=s;){let d=c.value;n<0&&(f+=d.length);let p=e+f*n;for(let m=n>0?0:d.length-1,g=n>0?d.length:-1;m!=g;m+=n){let k=o.indexOf(d[m]);if(!(k<0)&&i.resolveInner(p+m,1).type==r){if(k%2==0==n>0)u++;else{if(1==u)return{start:h,end:{from:p+m,to:p+m+1},matched:k>>1==a>>1};u--}}}n>0&&(f+=d.length)}return c.done?{start:h,matched:!1}:null}(t,e,n,o,l.type,r,s)}function tI(t,e,n,i=0,r=0){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);let s=r;for(let o=i;o<e;o++)9==t.charCodeAt(o)?s+=n-s%n:s++;return s}class tD{constructor(t,e,n){this.string=t,this.tabSize=e,this.indentUnit=n,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=tI(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return tI(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 r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function tR(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}class tM extends u{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||tR,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||tz},s;super(n,new class extends r._b{createParse(t,e,n){return new tN(s,t,e,n)}},[C.of((t,e)=>this.getIndent(t,e))],t.name),this.topNode=(e=r.Jq.define({id:tB.length,name:"Document",props:[h.add(()=>n)]}),tB.push(e),e),s=this,this.streamParser=i,this.stateAfter=new r.md({perNode:!0}),this.tokenTable=t.tokenTable?new t_(i.tokenTable):tU}static define(t){return new tM(t)}getIndent(t,e){let n=p(t.state),i=n.resolve(e);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let r=t$(this,n,0,i.from,e),s,o;if(r?(o=r.state,s=r.pos+1):(o=this.streamParser.startState(t.unit),s=0),e-s>1e4)return null;for(;s<e;){let l=t.state.doc.lineAt(s),a=Math.min(e,l.to);if(l.length){let h=new tD(l.text,t.state.tabSize,t.unit);for(;h.pos<a-l.from;)tE(this.streamParser.token,h,o)}else this.streamParser.blankLine(o,t.unit);if(a==e)break;s=l.to+1}let{text:c}=t.lineAt(e);return this.streamParser.indent(o,/^\s*(.*)/.exec(c)[1],t)}get allowsNesting(){return!1}}function t$(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 l=e.children.length-1;l>=0;l--){let a=e.children[l],h=n+e.positions[l],c=a instanceof r.mp&&h<s&&t$(t,a,h,i,s);if(c)return c}return null}class tN{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=k.get(),o=i[0].from,{state:l,tree:a}=function(t,e,n,i){for(let s of e){let o=s.from+(s.openStart?25:0),l=s.to-(s.openEnd?25:0),a=o<=n&&l>n&&t$(t,s.tree,0-s.offset,n,l),h;if(a&&(h=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,s.tree,n+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:h}}return{state:t.streamParser.startState(i?Q(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 h=0;h<a.children.length;h++)this.chunks.push(a.children[h]),this.chunkPos.push(a.positions[h]);s&&this.parsedPos<s.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(Q(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=k.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 n=e.indexOf("\n");n>-1&&(e=e.slice(0,n))}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 i=this.rangeIndex;;){let r=this.ranges[i].to;if(r>=n||(e=e.slice(0,r-(n-e.length)),++i==this.ranges.length))break;let s=this.ranges[i].from,o=this.lineAfter(s);e+=o,n=s+o.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;e+=this.ranges[++this.rangeIndex].from-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 s=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-s}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 tD(e,t?t.state.tabSize:4,t?Q(t.state):2);if(s.eol())r.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let o=tE(r.token,s,this.state);if(o&&(i=this.emitToken(this.lang.tokenTable.resolve(o),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:tW,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 tE(t,e,n){e.start=e.pos;for(let i=0;i<10;i++){let r=t(e,n);if(e.pos>e.start)return r}throw Error("Stream parser failed to advance stream.")}let tz=Object.create(null),tB=[r.Jq.none],tW=new r.Lj(tB),tJ=[],tL=Object.create(null);for(let[tj,tF]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])tL[tj]=tq(tz,tF);class t_{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),tL)}resolve(t){return t?this.table[t]||(this.table[t]=tq(this.extra,t)):0}}let tU=new t_(tz);function tX(t,e){tJ.indexOf(t)>-1||(tJ.push(t),console.warn(e))}function tq(t,e){let n=null;for(let i of e.split(".")){let s=t[i]||l.pJ[i];s?"function"==typeof s?n?n=s(n):tX(i,`Modifier ${i} used at start of tag`):n?tX(i,`Tag ${i} used as modifier`):n=s:tX(i,`Unknown highlighting tag ${i}`)}if(!n)return 0;let o=e.replace(/ /g,"_"),a=r.Jq.define({id:tB.length,name:o,props:[(0,l.Gv)({[o]:n})]});return tB.push(a),a.id}},78120:function(t,e,n){let i;n.d(e,{BO:function(){return tO},D0:function(){return tk},Gz:function(){return tW},IS:function(){return tB},Py:function(){return tu},QQ:function(){return U},Wl:function(){return V},Xs:function(){return tC},YW:function(){return tf},as:function(){return Q},bg:function(){return O},cp:function(){return m},f_:function(){return tA},gc:function(){return C},gm:function(){return b},jT:function(){return E},n0:function(){return A},nZ:function(){return x},q6:function(){return ta},r$:function(){return W},uU:function(){return tx},xv:function(){return r},yy:function(){return tb}});class r{constructor(){}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){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){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 s=e,o=e;;){if(i.next(s),r.next(s),s=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=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}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 o=n.pop(),a=l(r.text,o.text.slice(),0,r.length);if(a.length<=32)n.push(new s(a,o.length+r.length));else{let h=a.length>>1;n.push(new s(a.slice(0,h)),new s(a.slice(h)))}}else n.push(r)}replace(t,e,n){if(!(n instanceof s))return super.replace(t,e,n);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"){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 a=i&((s<=t?1:0)|(l>=e?2:0));s>=t&&l<=e&&!a?n.push(o):o.decompose(t-s,e-s,n,a)}s=l+1}}replace(t,e,n){if(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 c=this.children.slice();return c[i]=a,new o(c,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"){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 a=this.children[i],h=t.children[r];if(a!=h)return n+a.scanIdentical(h,e);n+=a.length+1}}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let n=0;for(let i of t)n+=i.lines;if(n<32){let r=[];for(let l of t)l.flatten(r);return new s(r,e)}let a=Math.max(32,n>>5),h=a<<1,c=a>>1,u=[],f=0,d=-1,p=[];function m(){0!=f&&(u.push(1==p.length?p[0]:o.from(p,d)),d=-1,f=p.length=0)}for(let g of t)!function t(e){let n;if(e.lines>h&&e instanceof o)for(let i of e.children)t(i);else e.lines>c&&(f>c||!f)?(m(),u.push(e)):e instanceof s&&f&&(n=p[p.length-1])instanceof s&&e.lines+n.lines<=32?(f+=e.lines,d+=e.length+1,p[p.length-1]=new s(n.text.concat(e.text),n.length+1+e.length)):(f+e.lines>a&&m(),f+=e.lines,d+=e.length+1,p.push(e))}(g);return m(),1==u.length?u[0]:new o(u,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>0?0:1)){if(this.offsets[n]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof s){let a=i.text[o+(e<0?-1:0)];if(this.offsets[n]+=e,a.length>Math.max(0,t))return this.value=0==t?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let h=i.children[o+(e<0?-1:0)];t>h.length?(t-=h.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(h),this.offsets.push(e>0?1:(h instanceof s?h.text.length:h.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.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}}let f="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 d=1;d<f.length;d++)f[d]+=f[d-1];function p(t){return t>=127462&&t<=127487}function m(t,e,n=!0,i=!0){return(n?g:k)(t,e,i)}function g(t,e,n){if(e==t.length)return e;e&&y(t.charCodeAt(e))&&v(t.charCodeAt(e-1))&&e--;let i=b(t,e);for(e+=x(i);e<t.length;){let r=b(t,e);if(8205==i||8205==r||n&&function(t){for(let e=1;e<f.length;e+=2)if(f[e]>t)return f[e-1]<=t;return!1}(r))e+=x(r),i=r;else if(p(r)){let s=0,o=e-2;for(;o>=0&&p(b(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function k(t,e,n){for(;e>0;){let i=g(t,e-2,n);if(i<e)return i;e--}return 0}function y(t){return t>=56320&&t<57344}function v(t){return t>=55296&&t<56320}function b(t,e){let n=t.charCodeAt(e);if(!v(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return y(i)?(n-55296<<10)+(i-56320)+65536:n}function O(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(((t-=65536)>>10)+55296,(1023&t)+56320)}function x(t){return t<65536?1:2}let w=/\r\n?|\n/;var S,P,C=((S=C||(C={}))[S.Simple=0]="Simple",S[S.TrackDel=1]="TrackDel",S[S.TrackBefore=2]="TrackBefore",S[S.TrackAfter=3]="TrackAfter",S);class A{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){D(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 A(t)}composeDesc(t){return this.empty?t:t.empty?this:M(this,t)}mapDesc(t,e=!1){return t.empty?this:R(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 A(t)}static create(t){return new A(t)}}class Q extends A{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 D(this,(e,n,i,r,s)=>t=t.replace(i,i+(n-e),s),!1),t}mapDesc(t,e=!1){return R(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 Q(e,n)}compose(t){return this.empty?t:t.empty?this:M(this,t,!0)}map(t,e=!1){return t.empty?this:R(this,t,e,!0)}iterChanges(t,e=!1){D(this,t,e)}get desc(){return A.create(this.sections)}filter(t){let e=[],n=[],i=[],r=new $(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 a=Math.min(r.len,l-o);T(i,a,-1);let h=-1==r.ins?-1:0==r.off?r.ins:0;T(e,a,h),h>0&&I(n,e,r.text),r.forward(a),o+=a}let c=t[s++];for(;o<c;){if(r.done)break e;let u=Math.min(r.len,c-o);T(e,u,-1),T(i,u,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(u),o+=u}}return{changes:new Q(e,n),filtered:A.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 Q(i,s);l=l?l.compose(n.map(l)):n,i=[],s=[],o=0}return!function t(h){if(Array.isArray(h))for(let c of h)t(c);else if(h instanceof Q){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:u,to:f=u,insert:d}=h;if(u>f||u<0||f>e)throw RangeError(`Invalid change range ${u} to ${f} (in doc of length ${e})`);let p=d?"string"==typeof d?r.of(d.split(n||w)):d:r.empty,m=p.length;if(u==f&&0==m)return;u<o&&a(),u>o&&T(i,u-o,-1),T(i,f-u,m),I(s,i,p),o=f}}(t),a(!l),l}static empty(t){return new Q(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");else 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 Q(e,n)}static createSet(t,e){return new Q(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 I(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 D(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 R(t,e,n,i=!1){let r=[],s=i?[]:null,o=new $(t),l=new $(e);for(let a=-1;;)if(-1==o.ins&&-1==l.ins){let h=Math.min(o.len,l.len);T(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||0==o.off&&(l.len<o.len||l.len==o.len&&!n))){let c=l.len;for(T(r,l.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=u&&(T(r,0,o.ins),s&&I(s,r,o.text),a=o.i),o.forward(u),c-=u}l.next()}else if(o.ins>=0){let f=0,d=o.len;for(;d;)if(-1==l.ins){let p=Math.min(d,l.len);f+=p,d-=p,l.forward(p)}else if(0==l.ins&&l.len<d)d-=l.len,l.next();else break;T(r,f,a<o.i?o.ins:0),s&&a<o.i&&I(s,r,o.text),a=o.i,o.forward(o.len-d)}else if(o.done&&l.done)return s?Q.createSet(r,s):A.create(r);else throw Error("Mismatched change set lengths")}function M(t,e,n=!1){let i=[],r=n?[]:null,s=new $(t),o=new $(e);for(let l=!1;;){if(s.done&&o.done)return r?Q.createSet(i,r):A.create(i);if(0==s.ins)T(i,s.len,0,l),s.next();else if(0!=o.len||o.done){if(s.done||o.done)throw Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),h=i.length;if(-1==s.ins){let c=-1==o.ins?-1:o.off?0:o.ins;T(i,a,c,l),r&&c&&I(r,i,o.text)}else -1==o.ins?(T(i,s.off?0:s.len,a,l),r&&I(r,i,s.textBit(a))):(T(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&I(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),s.forward2(a),o.forward(a)}}else T(i,0,o.ins,l),r&&I(r,i,o.text),o.next()}}class ${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 N{constructor(t,e,n){this.from=t,this.to=e,this.flags=n}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let t=3&this.flags;return 3==t?null:t}get goalColumn(){let t=this.flags>>5;return 33554431==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 N(n,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return E.range(t,e);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return E.range(this.anchor,n)}eq(t){return this.anchor==t.anchor&&this.head==t.head}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 E.range(t.anchor,t.head)}static create(t,e,n){return new N(t,e,n)}}class E{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:E.create(this.ranges.map(n=>n.map(t,e)),this.mainIndex)}eq(t){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let e=0;e<this.ranges.length;e++)if(!this.ranges[e].eq(t.ranges[e]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new E([this.main],0)}addRange(t,e=!0){return E.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let n=this.ranges.slice();return n[e]=t,E.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 E(t.ranges.map(t=>N.fromJSON(t)),t.main)}static single(t,e=t){return new E([E.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 E.normalized(t.slice(),e);n=r.to}return new E(t,e)}static cursor(t,e=0,n,i){return N.create(t,t,(0==e?0:e<0?4:8)|(null==n?3:Math.min(2,n))|(null!=i?i:33554431)<<5)}static range(t,e,n,i){let r=(null!=n?n:33554431)<<5|(null==i?3:Math.min(2,i));return e<t?N.create(e,t,24|r):N.create(t,e,(e>t?4: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 i=1;i<t.length;i++){let r=t[i],s=t[i-1];if(r.empty?r.from<=s.to:r.from<s.to){let o=s.from,l=Math.max(r.to,s.to);i<=e&&e--,t.splice(--i,2,r.anchor>r.head?E.range(l,o):E.range(o,l))}}return new E(t,e)}}function z(t,e){for(let n of t.ranges)if(n.to>e)throw RangeError("Selection points outside of document")}let B=0;class W{constructor(t,e,n,i,r){this.combine=t,this.compareInput=e,this.compare=n,this.isStatic=i,this.id=B++,this.default=t([]),this.extensions="function"==typeof r?r(this):r}static define(t={}){return new W(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:J),!!t.static,t.enables)}of(t){return new L([],this,0,t)}compute(t,e){if(this.isStatic)throw Error("Can't compute a static facet");return new L(t,this,1,e)}computeN(t,e){if(this.isStatic)throw Error("Can't compute a static facet");return new L(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],n=>e(n.field(t)))}}function J(t,e){return t==e||t.length==e.length&&t.every((t,n)=>t===e[n])}class L{constructor(t,e,n,i){this.dependencies=t,this.facet=e,this.type=n,this.value=i,this.id=B++}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 c of this.dependencies)"doc"==c?l=!0:"selection"==c?a=!0:((null!==(e=t[c.id])&&void 0!==e?e:1)&1)==0&&h.push(t[c.id]);return{create:t=>(t.values[s]=n(t),1),update(t,e){if(l&&e.docChanged||a&&(e.docChanged||e.selection)||F(t,h)){let r=n(t);if(o?!j(r,t.values[s],i):!i(r,t.values[s]))return t.values[s]=r,1}return 0},reconfigure:(t,e)=>{let l,a=e.config.address[r];if(null!=a){let h=tt(e,a);if(this.dependencies.every(n=>n instanceof W?e.facet(n)===t.facet(n):!(n instanceof U)||e.field(n,!1)==t.field(n,!1))||(o?j(l=n(t),h,i):i(l=n(t),h)))return t.values[s]=h,0}else l=n(t);return t.values[s]=l,1}}}}function j(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 F(t,e){let n=!1;for(let i of e)1&H(t,i)&&(n=!0);return n}let _=W.define({static:!0});class U{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 U(B++,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(_).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,_.of({field:this,create:t})]}get extension(){return this}}let X={lowest:4,low:3,default:2,high:1,highest:0};function q(t){return e=>new G(e,t)}let V={highest:q(X.highest),high:q(X.high),default:q(X.default),low:q(X.low),lowest:q(X.lowest)};class G{constructor(t,e){this.inner=t,this.prec=e}}class Z{of(t){return new Y(this,t)}reconfigure(t){return Z.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class Y{constructor(t,e){this.compartment=t,this.inner=e}}class K{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 a of(i=[[],[],[],[],[]],r=new Map,!function t(n,s){let o=r.get(n);if(null!=o){if(o<=s)return;let a=i[o].indexOf(n);a>-1&&i[o].splice(a,1),n instanceof Y&&l.delete(n.compartment)}if(r.set(n,s),Array.isArray(n))for(let h of n)t(h,s);else if(n instanceof Y){if(l.has(n.compartment))throw RangeError("Duplicate use of compartment in extensions");let c=e.get(n.compartment)||n.inner;l.set(n.compartment,c),t(c,s)}else if(n instanceof G)t(n.inner,n.prec);else if(n instanceof U)i[s].push(n),n.provides&&t(n.provides,s);else if(n instanceof L)i[s].push(n),n.facet.extensions&&t(n.facet.extensions,X.default);else{let u=n.extension;if(!u)throw Error(`Unrecognized extension value in extension set (${n}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(u,s)}}(t,X.default),i.reduce((t,e)=>t.concat(e))))a instanceof U?s.push(a):(o[a.facet.id]||(o[a.facet.id]=[])).push(a);let h=Object.create(null),c=[],u=[];for(let f of s)h[f.id]=u.length<<1,u.push(t=>f.slot(t));let d=null==n?void 0:n.config.facets;for(let p in o){let m=o[p],g=m[0].facet,k=d&&d[p]||[];if(m.every(t=>0==t.type)){if(h[g.id]=c.length<<1|1,J(k,m))c.push(n.facet(g));else{let y=g.combine(m.map(t=>t.value));c.push(n&&g.compare(y,n.facet(g))?n.facet(g):y)}}else{for(let v of m)0==v.type?(h[v.id]=c.length<<1|1,c.push(v.value)):(h[v.id]=u.length<<1,u.push(t=>v.dynamicSlot(t)));h[g.id]=u.length<<1,u.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 s=0;s<i.length;s++){let o=tt(t,i[s]);if(2==r[s])for(let l of o)n.push(l);else n.push(o)}return e.combine(n)}return{create(t){for(let e of i)H(t,e);return t.values[o]=l(t),1},update(t,n){if(!F(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=F(t,i),a=r.config.facets[e.id],h=r.facet(e);if(a&&!s&&J(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,g,m))}}let b=u.map(t=>t(h));return new K(t,l,b,h,c,o)}}function H(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 tt(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}let te=W.define(),tn=W.define({combine:t=>t.some(t=>t),static:!0}),ti=W.define({combine:t=>t.length?t[0]:void 0,static:!0}),tr=W.define(),ts=W.define(),to=W.define(),tl=W.define({combine:t=>!!t.length&&t[0]});class ta{constructor(t,e){this.type=t,this.value=e}static define(){return new th}}class th{of(t){return new ta(this,t)}}class tc{constructor(t){this.map=t}of(t){return new tu(this,t)}}class tu{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 tu(this.type,e)}is(t){return this.type==t}static define(t={}){return new tc(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let n=[];for(let i of t){let r=i.map(e);r&&n.push(r)}return n}}tu.reconfigure=tu.define(),tu.appendConfig=tu.define();class tf{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&&z(n,e.newLength),r.some(t=>t.type==tf.time)||(this.annotations=r.concat(tf.time.of(Date.now())))}static create(t,e,n,i,r,s){return new tf(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(tf.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function td(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=Q.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:tu.mapEffects(t.effects,r).concat(tu.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function tp(t,e,n){let i=e.selection,r=tg(e.annotations);return e.userEvent&&(r=r.concat(tf.userEvent.of(e.userEvent))),{changes:e.changes instanceof Q?e.changes:Q.of(e.changes||[],n,t.facet(ti)),selection:i&&(i instanceof E?i:E.single(i.anchor,i.head)),effects:tg(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}tf.time=ta.define(),tf.userEvent=ta.define(),tf.addToHistory=ta.define(),tf.remote=ta.define();let tm=[];function tg(t){return null==t?tm:Array.isArray(t)?t:[t]}var tk=((P=tk||(tk={}))[P.Word=0]="Word",P[P.Space=1]="Space",P[P.Other=2]="Other",P);let ty=/[\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(tv){}class tb{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 o=0;o<this.config.dynamicSlots.length;o++)H(this,o<<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 H(this,n),tt(this,n)}update(...t){return function t(e,n,i){let r=tp(e,n.length?n[0]:{},e.doc.length);n.length&&!1===n[0].filter&&(i=!1);for(let s=1;s<n.length;s++){!1===n[s].filter&&(i=!1);let o=!!n[s].sequential;r=td(r,tp(e,n[s],o?r.changes.newLength:e.doc.length),o)}let l=tf.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(t){let e=t.startState,n=e.facet(to),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=td(i,tp(e,s,t.changes.newLength),!0))}return i==t?t:tf.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(i?function(e){let n=e.startState,i=!0;for(let r of n.facet(tr)){let s=r(e);if(!1===s){i=!1;break}Array.isArray(s)&&(i=!0===i?s: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,s))}if(!0!==i){let o,l;if(!1===i)l=e.changes.invertedDesc,o=Q.empty(n.doc.length);else{let a=e.changes.filter(i);o=a.changes,l=a.filtered.mapDesc(a.changes).invertedDesc}e=tf.create(n,o,e.selection&&e.selection.map(l),tu.mapEffects(e.effects,l),e.annotations,e.scrollIntoView)}let h=n.facet(ts);for(let c=h.length-1;c>=0;c--){let u=h[c](e);e=u instanceof tf?u:Array.isArray(u)&&1==u.length&&u[0]instanceof tf?u[0]:t(n,tg(u),!1)}return e}(l):l)}(this,t,!0)}applyTransaction(t){let e,n=this.config,{base:i,compartments:r}=n;for(let s of t.effects)s.is(Z.reconfigure)?(n&&(r=new Map,n.compartments.forEach((t,e)=>r.set(e,t)),n=null),r.set(s.value.compartment,s.value.extension)):s.is(tu.reconfigure)?(n=null,i=s.value):s.is(tu.appendConfig)&&(n=null,i=tg(i).concat(s.value));n?e=t.startState.values.slice():(n=K.resolve(i,r,this),e=new tb(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(t,e)=>e.reconfigure(t,this),null).values),new tb(n,t.newDoc,t.newSelection,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:E.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=tg(n.effects);for(let o=1;o<e.ranges.length;o++){let l=t(e.ranges[o]),a=this.changes(l.changes),h=a.map(i);for(let c=0;c<o;c++)r[c]=r[c].map(h);let u=i.mapDesc(a,!0);r.push(l.range.map(u)),i=i.compose(h),s=tu.mapEffects(s,h).concat(tu.mapEffects(tg(l.effects),u))}return{changes:i,selection:E.create(r,e.mainIndex),effects:s}}changes(t=[]){return t instanceof Q?t:Q.of(t,this.doc.length,this.facet(tb.lineSeparator))}toText(t){return r.of(t.split(this.facet(tb.lineSeparator)||w))}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:(H(this,e),tt(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 U&&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 r in n)if(Object.prototype.hasOwnProperty.call(t,r)){let s=n[r],o=t[r];i.push(s.init(t=>s.spec.fromJSON(o,t)))}}return tb.create({doc:t.doc,selection:E.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=K.resolve(t.extensions||[],new Map),n=t.doc instanceof r?t.doc:r.of((t.doc||"").split(e.staticFacet(tb.lineSeparator)||w)),i=t.selection?t.selection instanceof E?t.selection:E.single(t.selection.anchor,t.selection.head):E.single(0);return z(i,n.length),e.staticFacet(tn)||(i=i.asSingle()),new tb(e,n,i,e.dynamicSlots.map(()=>null),(t,e)=>e.create(t),null)}get tabSize(){return this.facet(tb.tabSize)}get lineBreak(){return this.facet(tb.lineSeparator)||"\n"}get readOnly(){return this.facet(tl)}phrase(t,...e){for(let n of this.facet(tb.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[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(te))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 tk.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()||ty.test(n)))return!0}return!1}(t))return tk.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return tk.Word;return tk.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 l=m(e,s,!1);if(r(e.slice(l,s))!=tk.Word)break;s=l}for(;o<i;){let a=m(e,o);if(r(e.slice(o,a))!=tk.Word)break;o=a}return s==o?null:E.range(s+n,o+n)}}function tO(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(void 0===l)i[s]=o;else if(l===o||void 0===o);else if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw Error("Config merge conflict for field "+s)}for(let a in e)void 0===i[a]&&(i[a]=e[a]);return i}tb.allowMultipleSelections=tn,tb.tabSize=W.define({combine:t=>t.length?t[0]:4}),tb.lineSeparator=ti,tb.readOnly=tl,tb.phrases=W.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])}}),tb.languageData=te,tb.changeFilter=tr,tb.transactionFilter=ts,tb.transactionExtender=to,Z.reconfigure=tu.define();class tx{eq(t){return this==t}range(t,e=t){return tw.create(t,e,this)}}tx.prototype.startSide=tx.prototype.endSide=0,tx.prototype.point=!1,tx.prototype.mapMode=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 tS(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class tP{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 l=s+o>>1,a=r[l]-t||(n?this.value[l].endSide:this.value[l].startSide)-e;if(l==s)return a>=0?s:o;a>=0?o=l:s=l+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 d=e.mapPos(h,a.startSide,a.mapMode);if(null==d||(u=f=d,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 tP(i,r,n,o):null,pos:s}}}class tC{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 tC(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(tS)),this.isEmpty)return e.length?tC.of(e):this;let o=new tT(this,null,-1).goto(0),l=0,a=[],h=new tA;for(;o.value||l<e.length;)if(l<e.length&&(o.from-e[l].from||o.startSide-e[l].value.startSide)>=0){let c=e[l++];h.addInner(c.from,c.to,c.value)||a.push(c)}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?tC.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:a,pos:h}=o.map(s,t);a&&(i=Math.max(i,a.maxPoint),e.push(a),n.push(h))}}let c=this.nextLayer.map(t);return 0==e.length?c:new tC(n,e,c||tC.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 tI.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return tI.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=tQ(s,o,n),a=new tR(s,l,r),h=new tR(o,l,r);n.iterGaps((t,e,n)=>tM(a,t,h,e,n,i)),n.empty&&0==n.length&&tM(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=tQ(r,s),l=new tR(r,o,0).goto(n),a=new tR(s,o,0).goto(n);for(;;){if(l.to!=a.to||!t$(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 tR(t,null,r).goto(e),o=e,l=s.openStart;for(;;){let a=Math.min(s.to,n);if(s.point){let h=s.activeForPoint(s.to),c=s.pointFrom<e?h.length+1:Math.min(h.length,l);i.point(o,a,s.point,h,c,s.pointRank),l=Math.min(s.openEnd(a),h.length)}else a>o&&(i.span(o,a,s.active,l),l=s.openEnd(a));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 tA;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(tS(e,i)>0)return t.slice().sort(tS);e=i}return t}(t):t)n.add(i.from,i.to,i.value);return n.finish()}}tC.empty=new tC([],[],null,-1),tC.empty.nextLayer=tC.empty;class tA{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}finishChunk(t){this.chunks.push(new tP(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=[])}add(t,e,n){this.addInner(t,e,n)||(this.nextLayer||(this.nextLayer=new tA)).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(tC.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=tC.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function tQ(t,e,n){let i=new Map;for(let r of t)for(let s=0;s<r.chunk.length;s++)r.chunk[s].maxPoint<=0&&i.set(r.chunk[s],r.chunkPos[s]);let o=new Set;for(let l of e)for(let a=0;a<l.chunk.length;a++){let h=i.get(l.chunk[a]);null==h||(n?n.mapPos(h):h)!=l.chunkPos[a]||(null==n?void 0:n.touchesRange(h,h+l.chunk[a].length))||o.add(l.chunk[a])}return o}class tT{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 i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<t||i.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}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 tI{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 tT(s,e,n,r));return 1==i.length?i[0]:new tI(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 i=this.heap.length>>1;i>=0;i--)tD(this.heap,i);return this.next(),this}forward(t,e){for(let n of this.heap)n.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)tD(this.heap,i);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(),tD(this.heap,0)}}}function tD(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 tR{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=tI.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=tz(this.active,this.activeTo)}addActive(t){let e=0,{value:n,to:i,rank:r}=this.cursor;for(;e<this.activeRank.length&&this.activeRank[e]<=r;)e++;tE(this.active,e,n),tE(this.activeTo,e,i),tE(this.activeRank,e,r),t&&tE(t,e,this.cursor.from),this.minActive=tz(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 r=this.cursor.value;if(r.point){if(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.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 s=n.length-1;s>=0&&n[s]<t;s--)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 tM(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,a=i-e;for(;;){let h=t.to+a-n.to||t.endSide-n.endSide,c=h<0?t.to+a:n.to,u=Math.min(c,o);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&t$(t.activeForPoint(t.to+a),n.activeForPoint(n.to))||s.comparePoint(l,u,t.point,n.point):u>l&&!t$(t.active,n.active)&&s.compareRange(l,u,t.active,n.active),c>o)break;l=c,h<=0&&t.next(),h>=0&&n.next()}}function t$(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 tE(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function tz(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 tB(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 tW(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=9==t.charCodeAt(r)?n-s%n:1,r=m(t,r)}return!0===i?-1:t.length}},41113:function(t,e,n){var i,r;n.d(e,{FE:function(){return N},Jq:function(){return u},L3:function(){return s},Lj:function(){return f},_b:function(){return M},hr:function(){return D},i9:function(){return R},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.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}}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 r of t.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[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;for(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 r of t){let s=r(n);s&&(i||(i=Object.assign({},n.props)),i[s[0].id]=s[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[s,o]of(this.props=Object.create(null),r))this.props["number"==typeof s?s:s.id]=o}toString(){let t=this.prop(a.mounted);if(t&&!t.overlay)return t.tree.toString();let e="";for(let n of this.children){let i=n.toString();i&&(e&&(e+=","),e+=i)}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 C(this.topNode,t)}cursorAt(t,e=0,n=0){let i=d.get(this)||this.topNode,r=new C(i);return r.moveTo(t,e),d.set(this,r._tree),r}get topNode(){return new O(this,0,0,null)}resolve(t,e=0){let n=b(d.get(this)||this.topNode,t,e,!1);return d.set(this,n),n}resolveInner(t,e=0){let n=b(p.get(this)||this.topNode,t,e,!0);return p.set(this,n),n}iterate(t){let{enter:e,leave:n,from:r=0,to:s=this.length}=t;for(let o=this.cursor((t.mode||0)|i.IncludeAnonymous);;){let l=!1;if(o.from<=s&&o.to>=r&&(o.type.isAnonymous||!1!==e(o))){if(o.firstChild())continue;l=!0}for(;l&&n&&!o.type.isAnonymous&&n(o),!o.nextSibling();){if(!o.parent())return;l=!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:I(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){let h=[],c=[];for(;t.length>r;)h.push(t.pop()),c.push(e.pop()+n-s);t.push(p(i.types[l],h,c,o-s,a-o)),e.push(s-n)}function p(t,e,n,i,r=0,s){if(u){let o=[a.contextHash,u];s=s?[o].concat(s):[o]}if(r>25){let l=[a.lookAhead,r];s=s?[l].concat(s):[l]}return new m(t,e,n,i,s)}let y=[],v=[];for(;h.pos>0;)!function t(e,n,s,g,y){let{id:v,start:b,end:O,size:x}=h,w=f;for(;x<0;){if(h.next(),-1==x){let S=o[v];s.push(S),g.push(b-e);return}if(-3==x){u=v;return}if(-4==x){f=v;return}throw RangeError(`Unrecognized record size: ${x}`)}let P=c[v],C,A,Q=b-e;if(O-b<=r&&(A=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 u=n.pos-t;n.pos>u;){let f=n.size;if(n.id==e&&f>=0){c.size=i,c.start=s,c.skip=o,o+=4,i+=4,n.next();continue}let d=n.pos-f;if(f<0||d<u||n.start<a)break;let p=n.id>=l?4:0,m=n.start;for(n.next();n.pos>d;){if(n.size<0){if(-3==n.size)p+=4;else break n}else n.id>=l&&(p+=4);n.next()}s=m,i+=f,o+=p}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(A.size-A.skip),D=h.pos-A.size,R=T.length;for(;h.pos>D;)R=function t(e,n,i){let{id:r,start:s,end:o,size:a}=h;if(h.next(),a>=0&&r<l){let c=i;if(a>4){let d=h.pos-(a-4);for(;h.pos>d;)i=t(e,n,i)}n[--i]=c,n[--i]=o-e,n[--i]=s-e,n[--i]=r}else -3==a?u=r:-4==a&&(f=r);return i}(A.start,T,R);C=new k(T,O-A.start,i),Q=A.start-e}else{let M=h.pos-x;h.next();let $=[],N=[],E=v>=l?v:-1,z=0,B=O;for(;h.pos>M;)E>=0&&h.id==E&&h.size>=0?(h.end<=B-r&&(d($,N,b,z,h.end,B,E,w),z=$.length,B=h.end),h.next()):t(b,M,$,N,E);if(E>=0&&z>0&&z<$.length&&d($,N,b,z,b,B,E,w),$.reverse(),N.reverse(),E>-1&&z>0){let W=function(t){return(e,n,i)=>{let r=0,s=e.length-1,o,l;if(s>=0&&(o=e[s])instanceof m){if(!s&&o.type==t&&o.length==i)return o;(l=o.prop(a.lookAhead))&&(r=n[s]+o.length+l)}return p(t,e,n,i,r)}}(P);C=I(P,$,N,0,$.length,0,O-b,W,W)}else C=p(P,$,N,O-b,w-O)}s.push(C),g.push(Q)}(t.start||0,t.bufferStart||0,y,v,-1);let b=null!==(e=t.length)&&void 0!==e?e:y.length?v[0]+y[0].length:0;return new m(c[t.topID],y.reverse(),v.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 k{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 a=r[l++]=i[o++]-n;r[l++]=i[o++]-t,s=Math.max(s,a)}return new k(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 v(t,e){let n=t.childBefore(e);for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(t=n,n=i.prevSibling):n=i}return t}function b(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 o=!r&&t instanceof O&&t.index<0?null:t.parent;if(!o)return t;t=o}let l=r?0:i.IgnoreOverlays;if(r)for(let a=t,h=a.parent;h;h=(a=h).parent)a instanceof O&&a.index<0&&(null===(s=h.enter(e,n,l))||void 0===s?void 0:s.from)!=a.from&&(t=h);for(;;){let c=t.enter(e,n,l);if(!c)return t;t=c}}class O{constructor(t,e,n,i){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:h}=o._tree,c=e>0?l.length:-1;t!=c;t+=e){let u=l[t],f=h[t]+o.from;if(y(r,n,f,f+u.length)){if(u instanceof k){if(s&i.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,e,n-f,r);if(d>-1)return new P(new S(o,u,t,f),null,d)}else if(s&i.IncludeAnonymous||!u.type.isAnonymous||A(u)){let p;if(!(s&i.IgnoreMounts)&&u.props&&(p=u.prop(a.mounted))&&!p.overlay)return new O(p.tree,f,t,o);let m=new O(u,f,t,o);return s&i.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(e<0?u.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=this._tree.prop(a.mounted))&&r.overlay){let s=t-this.from;for(let{from:o,to:l}of r.overlay)if((e>0?o<=s:o<s)&&(e<0?l>=s:l>s))return new O(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}cursor(t=0){return new C(this,t)}get tree(){return this._tree}toTree(){return this._tree}resolve(t,e=0){return b(this,t,e,!1)}resolveInner(t,e=0){return b(this,t,e,!0)}enterUnfinishedNodesBefore(t){return v(this,t)}getChild(t,e=null,n=null){let i=x(this,t,e,n);return i.length?i[0]:null}getChildren(t,e=null,n=null){return x(this,t,e,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(t){return w(this,t)}}function x(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(null!=n){for(;!r.type.is(n);)if(!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 w(t,e,n=e.length-1){for(let i=t.parent;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 S{constructor(t,e,n,i){this.parent=t,this.buffer=e,this.index=n,this.start=i}}class P{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,n){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 P(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 P(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 P(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 P(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}cursor(t=0){return new C(this,t)}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)}resolve(t,e=0){return b(this,t,e,!1)}resolveInner(t,e=0){return b(this,t,e,!0)}enterUnfinishedNodesBefore(t){return v(this,t)}toString(){return this.context.buffer.childString(this.index)}getChild(t,e=null,n=null){let i=x(this,t,e,n);return i.length?i[0]:null}getChildren(t,e=null,n=null){return x(this,t,e,n)}get node(){return this}matchContext(t){return w(this,t)}}class C{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 O)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let n=t._parent;n;n=n._parent)this.stack.unshift(n.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 O?(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 i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(e.findChild(i,this.index,-1,0,4))}else{let r=e.buffer[this.index+3];if(r<(n<0?e.buffer.length:e.buffer[this.stack[n]+3]))return this.yieldBuf(r)}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 s=0;s<this.index;s++)if(r.buffer.buffer[s+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 o=e+t,l=t<0?-1:n._tree.children.length;o!=l;o+=t){let a=n._tree.children[o];if(this.mode&i.IncludeAnonymous||a instanceof k||!a.type.isAnonymous||A(a))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 o=n;o<this.stack.length;o++)e=new P(this.buffer,e,this.stack[o]);return this.bufferNode=new P(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(;i&&e&&e(this),i=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,i=!0}}}matchContext(t){if(!this.buffer)return w(this.node,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 w(this.node,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 A(t){return t.children.some(t=>t instanceof k||!t.type.isAnonymous||A(t))}let Q=new WeakMap;function T(t,e){if(!t.isAnonymous||e instanceof k||e.type!=t)return 1;let n=Q.get(e);if(null==n){for(let i of(n=1,e.children)){if(i.type!=t||!(i instanceof m)){n=1;break}n+=T(t,i)}Q.set(e,n)}return n}function I(t,e,n,i,r,s,o,l,a){let h=0;for(let c=i;c<r;c++)h+=T(t,e[c]);let u=Math.ceil(1.5*h/8),f=[],d=[];return!function e(n,i,r,o,l){for(let h=r;h<o;){let c=h,p=i[h],m=T(t,n[h]);for(h++;h<o;h++){let g=T(t,n[h]);if(m+g>=u)break;m+=g}if(h==c+1){if(m>u){let k=n[c];e(k.children,k.positions,0,k.children.length,i[c]+l);continue}f.push(n[c])}else{let y=i[h-1]+n[h-1].length-p;f.push(I(t,n,i,c,h,p,y,null,a))}d.push(p+l-s)}}(e,n,i,r,0),(l||a)(f,d,o)}class D{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 P?this.setBuffer(t.context.buffer,t.index,e):t instanceof O&&this.map.set(t.tree,e)}get(t){return t instanceof P?this.getBuffer(t.context.buffer,t.index):t instanceof O?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 R{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 R(0,t.length,t,0,!1,n)];for(let r of e)r.to>t.length&&i.push(r);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 u=s;if(l>=u.from||c<=u.to||a){let f=Math.max(u.from,l)-a,d=Math.min(u.to,c)-a;u=f>=d?null:new R(f,d,u.tree,u.offset+a,o>0,!!h)}if(u&&i.push(u),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 M{startParse(t,e,n){return"string"==typeof t&&(t=new $(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 r=i.advance();if(r)return r}}}class ${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 N(t){return(e,n,i,r)=>new W(e,t,n,i,r)}class E{constructor(t,e,n,i,r){this.parser=t,this.parse=e,this.overlay=n,this.target=i,this.ranges=r}}class z{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 B=new a({perNode:!0});class W{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 e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return null!=this.stoppedAt&&(n=new m(n.type,n.children,n.positions,n.length,n.propValues.concat([[B,this.stoppedAt]]))),n}let i=this.inner[this.innerDone],r=i.parse.advance();if(r){this.innerDone++;let s=Object.assign(Object.create(null),i.target.props);s[a.mounted.id]=new h(r,i.overlay,i.parser),i.target.props=s}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].ranges[0].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 j(this.fragments),e=null,n=null,r=new C(new O(this.baseTree,this.ranges[0].from,0,null),i.IncludeAnonymous|i.IgnoreMounts);n:for(let s,o;null==this.stoppedAt||r.from<this.stoppedAt;){let a=!0,h;if(t.hasNode(r)){if(e){let c=e.mounts.find(t=>t.frag.from<=r.from&&t.frag.to>=r.to&&t.mount.overlay);if(c)for(let f of c.mount.overlay){let d=f.from+c.pos,p=f.to+c.pos;d>=r.from&&p<=r.to&&!e.ranges.some(t=>t.from<p&&t.to>d)&&e.ranges.push({from:d,to:p})}}a=!1}else if(n&&(o=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)))a=2!=o;else if(!r.type.isAnonymous&&r.from<r.to&&(s=this.nest(r,this.input))){r.tree||function(t){let{node:e}=t,n=0;do t.parent(),n++;while(!t.tree);let i=0,r=t.tree,s=0;for(;!((s=r.positions[i]+t.from)<=e.from)||!(s+r.children[i].length>=e.to);i++);let o=r.children[i],l=o.buffer;r.children[i]=function t(n,i,r,a,h){let c=n;for(;l[c+2]+s<=e.from;)c=l[c+3];let u=[],f=[];J(o,n,c,u,f,a);let d=l[c+1],p=l[c+2],g=d+s==e.from&&p+s==e.to&&l[c]==e.type.id;return u.push(g?e.toTree():t(c+4,l[c+3],o.set.types[l[c]],d,p-d)),f.push(d-a),J(o,l[c+3],i,u,f,a),new m(r,u,f,h)}(0,l.length,u.none,0,o.length);for(let a=0;a<=n;a++)t.childAfter(e.from)}(r);let g=t.findMounts(r.from,s.parser);if("function"==typeof s.overlay)e=new z(s.parser,s.overlay,g,this.inner.length,r.from,r.tree,e);else{let k=F(this.ranges,s.overlay||[new l(r.from,r.to)]);k.length&&this.inner.push(new E(s.parser,s.parser.startParse(this.input,_(g,k),k),s.overlay?s.overlay.map(t=>new l(t.from-r.from,t.to-r.from)):null,r.tree,k)),s.overlay?k.length&&(n={ranges:k,depth:0,prev:n}):a=!1}}else e&&(h=e.predicate(r))&&(!0===h&&(h=new l(r.from,r.to)),h.from<h.to&&e.ranges.push(h));if(a&&r.firstChild())e&&e.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break n;if(e&&!--e.depth){let y=F(this.ranges,e.ranges);y.length&&this.inner.splice(e.index,0,new E(e.parser,e.parser.startParse(this.input,_(e.mounts,y),y),e.ranges.map(t=>new l(t.from-e.start,t.to-e.start)),e.target,y)),e=e.prev}!n||--n.depth||(n=n.prev)}}}}function J(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 L{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;if(e.children.length&&0==e.positions[0]&&e.children[0]instanceof m)e=e.children[0];else break}return!1}}class j{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(B))&&void 0!==e?e:n.to,this.inner=new L(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(B))&&void 0!==t?t:e.to,this.inner=new L(e.tree,-e.offset)}}findMounts(t,e){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let s=null===(n=r.tree)||void 0===n?void 0:n.prop(a.mounted);if(s&&s.parser==e)for(let o=this.fragI;o<this.fragments.length;o++){let l=this.fragments[o];if(l.from>=r.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:r.from-l.offset,mount:s})}}}return i}}function F(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 h=i[s];if(h.from>=a)break;!(h.to<=o)&&(n||(i=n=e.slice()),h.from<o?(n[s]=new l(h.from,o),h.to>a&&n.splice(s+1,0,new l(a,h.to))):h.to>a?n[s--]=new l(a,h.to):n.splice(s--,1))}}return i}function _(t,e){let n=[];for(let{pos:i,mount:r,frag:s}of t){let o=i+(r.overlay?r.overlay[0].from:0),a=o+r.tree.length,h=Math.max(s.from,o),c=Math.min(s.to,a);if(r.overlay){let u=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 d=Math.max(h,n),p=Math.min(u,f,i);d<p&&c.push(new l(d,p))}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)),h,c);for(let f=0,d=h;;f++){let p=f==u.length,m=p?c:u[f].from;if(m>d&&n.push(new R(d,m,r.tree,-o,s.from>=d||s.openStart,s.to<=m||s.openEnd)),p)break;d=u[f].to}}else n.push(new R(h,c,r.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return n}},35524: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 T}});var i=n(41113);let r=0;class s{constructor(t,e,n){this.set=t,this.base=e,this.modified=n,this.id=r++}static define(t){if(null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let e=new s([],null,[]);if(e.set.push(e),t)for(let n of t.set)e.set.push(n);return e}static defineModifier(){let t=new l;return e=>e.modified.indexOf(t)>-1?e:l.get(e.base||e,e.modified.concat(t).sort((t,e)=>t.id-e.id))}}let o=0;class l{constructor(){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(i,t,e);for(let o of e)o.instances.push(r);let a=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 h of t.set)if(!h.modified.length)for(let c of a)i.push(l.get(h,c));return r}}function a(t){let e=Object.create(null);for(let n in t){let i=t[n];for(let r of(Array.isArray(i)||(i=[i]),n.split(" ")))if(r){let s=[],o=2,l=r;for(let a=0;;){if("..."==l&&a>0&&a+3==r.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw RangeError("Invalid path: "+r);if(s.push("*"==u[0]?"":'"'==u[0][0]?JSON.parse(u[0]):u[0]),(a+=u[0].length)==r.length)break;let f=r[a++];if(a==r.length&&"!"==f){o=0;break}if("/"!=f)throw RangeError("Invalid path: "+r);l=r.slice(a)}let d=s.length-1,p=s[d];if(!p)throw RangeError("Invalid path: "+r);let m=new c(i,o,d>0?s.slice(0,d):null);e[p]=m.sort(e[p])}}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 i of t)if(Array.isArray(i.tag))for(let r of i.tag)n[r.id]=i.class;else n[i.tag.id]=i.class;let{scope:s,all:o=null}=e||{};return{style:t=>{let e=o;for(let i of t)for(let r of i.set){let s=n[r.id];if(s){e=e?e+" "+s:s;break}}return e},scope:s}}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 r=i.style(e);r&&(n=n?n+" "+r:r)}return n}(s,f.tags);if(d&&(u&&(u+=" "),u+=d,1==f.mode&&(r+=(r?" ":"")+d)),this.startSpan(t.from,u),f.opaque)return;let p=t.tree&&t.tree.prop(i.md.mounted);if(p&&p.overlay){let m=t.node.enter(p.overlay[0].from+l,1),g=this.highlighters.filter(t=>!t.scope||t.scope(p.tree.type)),k=t.firstChild();for(let y=0,v=l;;y++){let b=y<p.overlay.length?p.overlay[y]:null,O=b?b.from+l:a,x=Math.max(e,v),w=Math.min(n,O);if(x<w&&k)for(;t.from<w&&(this.highlightRange(t,x,w,r,s),this.startSpan(Math.min(w,t.to),u),!(t.to>=O)&&t.nextSibling()););if(!b||O>n)break;(v=b.to+l)>e&&(this.highlightRange(m.cursor(),Math.max(e,b.from+l),Math.min(n,v),r,g),this.startSpan(v,u))}k&&t.parent()}else if(t.firstChild()){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(),k=p(g),y=p(g),v=p(),b=p(v),O=p(v),x=p(),w=p(x),S=p(),P=p(),C=p(),A=p(C),Q=p(),T={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:k,tagName:p(k),propertyName:y,attributeName:p(y),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:v,string:b,docString:p(b),character:p(b),attributeValue:p(b),number:O,integer:p(O),float:p(O),bool:p(v),regexp:p(v),escape:p(v),color:p(v),url:p(v),keyword:S,self:p(S),null:p(S),atom:p(S),unit:p(S),modifier:p(S),operatorKeyword:p(S),controlKeyword:p(S),definitionKeyword:p(S),moduleKeyword:p(S),operator:P,derefOperator:p(P),arithmeticOperator:p(P),logicOperator:p(P),bitwiseOperator:p(P),compareOperator:p(P),updateOperator:p(P),definitionOperator:p(P),typeOperator:p(P),controlOperator:p(P),punctuation:C,separator:p(C),bracket:A,angleBracket:p(A),squareBracket:p(A),paren:p(A),brace:p(A),content:x,heading:w,heading1:p(w),heading2:p(w),heading3:p(w),heading4:p(w),heading5:p(w),heading6:p(w),contentSeparator:p(x),list:p(x),quote:p(x),emphasis:p(x),strong:p(x),link:p(x),monospace:p(x),strikethrough:p(x),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:Q,documentMeta:p(Q),annotation:p(Q),processingInstruction:p(Q),definition:s.defineModifier(),constant:s.defineModifier(),function:s.defineModifier(),standard:s.defineModifier(),local:s.defineModifier(),special:s.defineModifier()};u([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}])},53105:function(t,e,n){n.d(e,{IK:function(){return I},Jq:function(){return v},WQ:function(){return D}});var i,r,s,o,l,a,h=n(41113),c=n(34155);class u{constructor(t,e,n,i,r,s,o,l,a,h=0,c){this.p=t,this.stack=e,this.state=n,this.reducePos=i,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=l,this.curContext=a,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,n=0){let i=t.parser.context;return new u(t,[],e,n,n,0,[],0,i?new f(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){let e=t>>19,n=65535&t,{parser:i}=this.p,r=i.dynamicPrecedence(n);if(r&&(this.score+=r),0==e){this.pushState(i.getGoto(this.state,n,!0),this.reducePos),n<i.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,4,!0),this.reduceContext(n,this.reducePos);return}let s=this.stack.length-(e-1)*3-(262144&t?6:0),o=this.stack[s-2],l=this.stack[s-1],a=this.bufferBase+this.buffer.length-l;if(n<i.minRepeatTerm||131072&t){let h=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,o,h,a+4,!0)}if(262144&t)this.state=this.stack[s];else{let c=this.stack[s-3];this.state=i.getGoto(c,n,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(n,o)}storeNode(t,e,n,i=4,r=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,o=this.buffer.length;if(0==o&&s.parent&&(o=s.bufferBase-s.parent.bufferBase,s=s.parent),o>0&&0==s.buffer[o-4]&&s.buffer[o-1]>-1){if(e==n)return;if(s.buffer[o-2]>=e){s.buffer[o-2]=n;return}}}if(r&&this.pos!=n){let l=this.buffer.length;if(l>0&&0!=this.buffer[l-4])for(;l>0&&this.buffer[l-2]>n;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,i>4&&(i-=4);this.buffer[l]=t,this.buffer[l+1]=e,this.buffer[l+2]=n,this.buffer[l+3]=i}else this.buffer.push(t,e,n,i)}shift(t,e,n){let i=this.pos;if(131072&t)this.pushState(65535&t,this.pos);else if((262144&t)==0){let{parser:r}=this.p;(n>this.pos||e<=r.maxNode)&&(this.pos=n,r.stateFlag(t,1)||(this.reducePos=n)),this.pushState(t,i),this.shiftContext(e,i),e<=r.maxNode&&this.buffer.push(e,i,n,4)}else this.pos=n,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,n,4)}apply(t,e,n){65536&t?this.reduce(t):this.shift(t,e,n)}useNode(t,e){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=t)&&(this.p.reused.push(t),n++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let n=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new u(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let n=t<=this.p.parser.maxNode;n&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,n?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new d(this);;){let n=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==n)return!1;if((65536&n)==0)return!0;e.reduce(n)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let n=[];for(let i=0,r;i<e.length;i+=2)(r=e[i+1])!=this.state&&this.p.parser.hasAction(r,t)&&n.push(e[i],r);if(this.stack.length<120)for(let s=0;n.length<8&&s<e.length;s+=2){let o=e[s+1];n.some((t,e)=>1&e&&t==o)||n.push(e[s],o)}e=n}let l=[];for(let a=0;a<e.length&&l.length<4;a+=2){let h=e[a+1];if(h==this.state)continue;let c=this.split();c.pushState(h,this.pos),c.storeNode(0,c.pos,c.pos,4,!0),c.shiftContext(e[a],this.pos),c.score-=200,l.push(c)}return l}forceReduce(){let t=this.p.parser.stateSlot(this.state,5);if((65536&t)==0)return!1;let{parser:e}=this.p;if(!e.validAction(this.state,t)){let n=this.stack.length-3*(t>>19);if(n<0||0>e.getGoto(this.stack[n],65535&t,!1))return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||-3!=this.buffer[t])&&this.buffer.push(this.curContext.hash,this.reducePos,this.reducePos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||-4!=this.buffer[t])&&this.buffer.push(this.lookAhead,this.reducePos,this.reducePos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new f(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){t>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class f{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}(i=o||(o={}))[i.Insert=200]="Insert",i[i.Delete=190]="Delete",i[i.Reduce=100]="Reduce",i[i.MaxNext=4]="MaxNext",i[i.MaxInsertStackDepth=300]="MaxInsertStackDepth",i[i.DampenInsertStackDepth=120]="DampenInsertStackDepth";class d{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t>>19;0==e?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(e-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&t,!0);this.state=n}}class p{constructor(t,e,n){this.stack=t,this.pos=e,this.index=n,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new p(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new p(this.stack,this.pos,this.index)}}class m{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let g=new m;class k{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=g,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let n=this.range,i=this.rangeIndex,r=this.pos+t;for(;r<n.from;){if(!i)return null;let s=this.ranges[--i];r-=n.from-s.to,n=s}for(;e<0?r>n.to:r>=n.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];r+=o.from-n.to,n=o}return r}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,n,i;if(e>=0&&e<this.chunk.length)n=this.pos+t,i=this.chunk.charCodeAt(e);else{let r=this.resolveOffset(t,1);if(null==r)return -1;if((n=r)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let s=this.rangeIndex,o=this.range;for(;o.to<=n;)o=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(t,e=0){let n=e?this.resolveOffset(e,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=t,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let n=this.input.chunk(this.pos),i=this.pos+n.length;this.chunk=i>this.range.to?n.slice(0,this.range.to-this.pos):n,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=g,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let n="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(n+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return n}}class y{constructor(t,e){this.data=t,this.id=e}token(t,e){!function(t,e,n,i){let r=0,s=1<<i,{parser:o}=n.p,{dialect:l}=o;n:for(;(s&t[r])!=0;){let a=t[r+1];for(let h=r+3;h<a;h+=2)if((t[h+1]&s)>0){let c=t[h];if(l.allows(c)&&(-1==e.token.value||e.token.value==c||o.overrides(c,e.token.value))){e.acceptToken(c);break}}let u=e.next,f=0,d=t[r+2];if(e.next<0&&d>f&&65535==t[a+3*d-3]&&65535==t[a+3*d-3]){r=t[a+3*d-1];continue n}for(;f<d;){let p=f+d>>1,m=a+p+(p<<1),g=t[m],k=t[m+1]||65536;if(u<g)d=p;else if(u>=k)f=p+1;else{r=t[m+2],e.advance();continue n}}break}}(this.data,t,e,this.id)}}y.prototype.contextual=y.prototype.fallback=y.prototype.extend=!1;class v{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function b(t,e=Uint16Array){if("string"!=typeof t)return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let o=t.charCodeAt(i++),l=!1;if(126==o){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}let O=void 0!==c&&c.env&&/\bparse\b/.test(c.env.LOG),x=null;function w(t,e,n){let i=t.cursor(h.vj.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}(r=l||(l={}))[r.Margin=25]="Margin";class S{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?w(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?w(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let n=this.trees[e],i=this.index[e];if(i==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=n.children[i],s=this.start[e]+n.positions[i];if(s>t)return this.nextStart=s,null;if(r instanceof h.mp){if(s==t){if(s<this.safeFrom)return null;let o=s+r.length;if(o<=this.safeTo){let l=r.prop(h.md.lookAhead);if(!l||o+l<this.fragment.to)return r}}this.index[e]++,s+r.length>=Math.max(this.safeFrom,t)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[e]++,this.nextStart=s+r.length}}}class P{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(t=>new m)}getActions(t){let e=0,n=null,{parser:i}=t.p,{tokenizers:r}=i,s=i.stateSlot(t.state,3),o=t.curContext?t.curContext.hash:0,l=0;for(let a=0;a<r.length;a++){if((1<<a&s)==0)continue;let h=r[a],c=this.tokens[a];if((!n||h.fallback)&&((h.contextual||c.start!=t.pos||c.mask!=s||c.context!=o)&&(this.updateCachedToken(c,h,t),c.mask=s,c.context=o),c.lookAhead>c.end+25&&(l=Math.max(c.lookAhead,l)),0!=c.value)){let u=e;if(c.extended>-1&&(e=this.addActions(t,c.extended,c.end,e)),e=this.addActions(t,c.value,c.end,e),!h.extend&&(n=c,e>u))break}}for(;this.actions.length>e;)this.actions.pop();return l&&t.setLookAhead(l),n||t.pos!=this.stream.end||((n=new m).value=t.p.parser.eofTerm,n.start=n.end=t.pos,e=this.addActions(t,n.value,n.end,e)),this.mainToken=n,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new m,{pos:n,p:i}=t;return e.start=n,e.end=Math.min(n+1,i.stream.end),e.value=n==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,n){let i=this.stream.clipPos(n.pos);if(e.token(this.stream.reset(i,t),n),t.value>-1){let{parser:r}=n.p;for(let s=0;s<r.specialized.length;s++)if(r.specialized[s]==t.value){let o=r.specializers[s](this.stream.read(t.start,t.end),n);if(o>=0&&n.p.parser.dialect.allows(o>>1)){(1&o)==0?t.value=o>>1:t.extended=o>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,n,i){for(let r=0;r<i;r+=3)if(this.actions[r]==t)return i;return this.actions[i++]=t,this.actions[i++]=e,this.actions[i++]=n,i}addActions(t,e,n,i){let{state:r}=t,{parser:s}=t.p,{data:o}=s;for(let l=0;l<2;l++)for(let a=s.stateSlot(r,l?2:1);;a+=3){if(65535==o[a]){if(1==o[a+1])a=R(o,a+2);else{0==i&&2==o[a+1]&&(i=this.putAction(R(o,a+2),e,n,i));break}}o[a]==e&&(i=this.putAction(R(o,a+1),e,n,i))}return i}}(s=a||(a={}))[s.Distance=5]="Distance",s[s.MaxRemainingPerStep=3]="MaxRemainingPerStep",s[s.MinBufferLengthPrune=500]="MinBufferLengthPrune",s[s.ForceReduceLimit=10]="ForceReduceLimit",s[s.CutDepth=15e3]="CutDepth",s[s.CutTo=9e3]="CutTo";class C{constructor(t,e,n,i){this.parser=t,this.input=e,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.stream=new k(e,i),this.tokens=new P(t,this.stream),this.topTerm=t.top[1];let{from:r}=i[0];this.stacks=[u.start(this,t.top[0],r)],this.fragments=n.length&&this.stream.end-r>4*t.bufferLength?new S(n,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,n=this.stacks,i=this.minStackPos,r=this.stacks=[];for(let s=0;s<n.length;s++){let o=n[s];for(;;){if(this.tokens.mainToken=null,o.pos>i)r.push(o);else{if(this.advanceStack(o,r,n))continue;t||(t=[],e=[]),t.push(o);let l=this.tokens.getMainToken(o);e.push(l.value,l.end)}break}}if(!r.length){let a=t&&function(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=i&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}(t);if(a)return this.stackToTree(a);if(this.parser.strict)throw O&&t&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&t){let h=null!=this.stoppedAt&&t[0].pos>this.stoppedAt?t[0]:this.runRecovery(t,e,r);if(h)return this.stackToTree(h.forceAll())}if(this.recovering){let c=1==this.recovering?1:3*this.recovering;if(r.length>c)for(r.sort((t,e)=>e.score-t.score);r.length>c;)r.pop();r.some(t=>t.reducePos>i)&&this.recovering--}else if(r.length>1)i:for(let u=0;u<r.length-1;u++){let f=r[u];for(let d=u+1;d<r.length;d++){let p=r[d];if(f.sameState(p)||f.buffer.length>500&&p.buffer.length>500){if((f.score-p.score||f.buffer.length-p.buffer.length)>0)r.splice(d--,1);else{r.splice(u--,1);continue i}}}}this.minStackPos=r[0].pos;for(let m=1;m<r.length;m++)r[m].pos<this.minStackPos&&(this.minStackPos=r[m].pos);return null}stopAt(t){if(null!=this.stoppedAt&&this.stoppedAt<t)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,n){let i=t.pos,{parser:r}=this,s=O?this.stackID(t)+" -> ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let o=t.curContext&&t.curContext.tracker.strict,l=o?t.curContext.hash:0;for(let a=this.fragments.nodeAt(i);a;){let c=this.parser.nodeSet.types[a.type.id]==a.type?r.getGoto(t.state,a.type.id):-1;if(c>-1&&a.length&&(!o||(a.prop(h.md.contextHash)||0)==l))return t.useNode(a,c),O&&console.log(s+this.stackID(t)+` (via reuse of ${r.getName(a.type.id)})`),!0;if(!(a instanceof h.mp)||0==a.children.length||a.positions[0]>0)break;let u=a.children[0];if(u instanceof h.mp&&0==a.positions[0])a=u;else break}}let f=r.stateSlot(t.state,4);if(f>0)return t.reduce(f),O&&console.log(s+this.stackID(t)+` (via always-reduce ${r.getName(65535&f)})`),!0;if(t.stack.length>=15e3)for(;t.stack.length>9e3&&t.forceReduce(););let d=this.tokens.getActions(t);for(let p=0;p<d.length;){let m=d[p++],g=d[p++],k=d[p++],y=p==d.length||!n,v=y?t:t.split();if(v.apply(m,g,k),O&&console.log(s+this.stackID(v)+` (via ${(65536&m)==0?"shift":`reduce of ${r.getName(65535&m)}`} for ${r.getName(g)} @ ${i}${v==t?"":", split"})`),y)return!0;v.pos>i?e.push(v):n.push(v)}return!1}advanceFully(t,e){let n=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>n)return A(t,e),!0}}runRecovery(t,e,n){let i=null,r=!1;for(let s=0;s<t.length;s++){let o=t[s],l=e[s<<1],a=e[(s<<1)+1],h=O?this.stackID(o)+" -> ":"";if(o.deadEnd&&(r||(r=!0,o.restart(),O&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,n))))continue;let c=o.split(),u=h;for(let f=0;c.forceReduce()&&f<10&&(O&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));f++)O&&(u=this.stackID(c)+" -> ");for(let d of o.recoverByInsert(l))O&&console.log(h+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>o.pos?(a==o.pos&&(a++,l=0),o.recoverByDelete(l,a),O&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),A(o,n)):(!i||i.score<o.score)&&(i=o)}return i}stackToTree(t){return t.close(),h.mp.build({buffer:p.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(x||(x=new WeakMap)).get(t);return e||x.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function A(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class Q{constructor(t,e,n){this.source=t,this.flags=e,this.disabled=n}allows(t){return!this.disabled||0==this.disabled[t]}}let T=t=>t;class I{constructor(t){this.start=t.start,this.shift=t.shift||T,this.reduce=t.reduce||T,this.reuse=t.reuse||T,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}class D extends h._b{constructor(t){if(super(),this.wrappers=[],14!=t.version)throw RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;n<t.repeatNodeCount;n++)e.push("");let i=Object.keys(t.topRules).map(e=>t.topRules[e][1]),r=[];for(let s=0;s<e.length;s++)r.push([]);function o(t,e,n){r[t].push([e,e.deserialize(String(n))])}if(t.nodeProps)for(let l of t.nodeProps){let a=l[0];"string"==typeof a&&(a=h.md[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)o(u,a,l[c++]);else{let f=l[c+-u];for(let d=-u;d>0;d--)o(l[c++],a,f);c++}}}this.nodeSet=new h.Lj(e.map((e,n)=>h.Jq.define({name:n>=this.minRepeatTerm?void 0:e,id:n,props:r[n],top:i.indexOf(n)>-1,error:0==n,skipped:t.skippedNodes&&t.skippedNodes.indexOf(n)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=h.L3;let p=b(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let m=0;m<this.specializerSpecs.length;m++)this.specialized[m]=this.specializerSpecs[m].term;this.specializers=this.specializerSpecs.map($),this.states=b(t.states,Uint32Array),this.data=b(t.stateData),this.goto=b(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(t=>"number"==typeof t?new y(p,t):t),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,n){let i=new C(this,t,e,n);for(let r of this.wrappers)i=r(i,t,e,n);return i}getGoto(t,e,n=!1){let i=this.goto;if(e>=i[0])return -1;for(let r=i[e+1];;){let s=i[r++],o=1&s,l=i[r++];if(o&&n)return l;for(let a=r+(s>>1);r<a;r++)if(i[r]==t)return l;if(o)return -1}}hasAction(t,e){let n=this.data;for(let i=0;i<2;i++)for(let r=this.stateSlot(t,i?2:1),s;;r+=3){if(65535==(s=n[r])){if(1==n[r+1])s=n[r=R(n,r+2)];else if(2==n[r+1])return R(n,r+2);else break}if(s==e||0==s)return R(n,r+1)}return 0}stateSlot(t,e){return this.states[6*t+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){if(e==this.stateSlot(t,4))return!0;for(let n=this.stateSlot(t,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=R(this.data,n+2)}if(e==R(this.data,n+1))return!0}}nextStates(t){let e=[];for(let n=this.stateSlot(t,1);;n+=3){if(65535==this.data[n]){if(1==this.data[n+1])n=R(this.data,n+2);else break}if((1&this.data[n+2])==0){let i=this.data[n+1];e.some((t,e)=>1&e&&t==i)||e.push(this.data[n],i)}}return e}overrides(t,e){let n=M(this.data,this.tokenPrecTable,e);return n<0||M(this.data,this.tokenPrecTable,t)<n}configure(t){let e=Object.assign(Object.create(D.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let n=this.topRules[t.top];if(!n)throw RangeError(`Invalid top rule name ${t.top}`);e.top=n}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=t.specializers.find(t=>t.from==n.external);if(!r)return n;let s=Object.assign(Object.assign({},n),{external:r.to});return e.specializers[i]=$(s),s})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),n=e.map(()=>!1);if(t)for(let i of t.split(" ")){let r=e.indexOf(i);r>=0&&(n[r]=!0)}let s=null;for(let o=0;o<e.length;o++)if(!n[o])for(let l=this.dialects[e[o]],a;65535!=(a=this.data[l++]);)(s||(s=new Uint8Array(this.maxTerm+1)))[a]=1;return new Q(t,n,s)}static deserialize(t){return new D(t)}}function R(t,e){return t[e]|t[e+1]<<16}function M(t,e,n){for(let i=e,r;65535!=(r=t[i]);i++)if(r==n)return i-e;return -1}function $(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}},28699: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 r 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 c in r){let u=r[c];if(/&/.test(c))t(c.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((t,e)=>t.concat(e)),u,s);else if(u&&"object"==typeof u){if(!a)throw RangeError("The value of a property ("+c+") should be a primitive value.");t(i(c),u,l,h)}else null!=u&&l.push(c.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+u+";")}(l.length||h)&&s.push((!n||a||o?e:e.map(n)).join(", ")+" {"+l.join(" ")+"}")}(i(r),t[r],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){(t[r]||new a(t)).mount(Array.isArray(e)?e:[e])}}let l=null;class a{constructor(t){if(!t.head&&t.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(l)return t.adoptedStyleSheets=[l.sheet].concat(t.adoptedStyleSheets),t[r]=l;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),l=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");let e=t.head||t;e.insertBefore(this.styleTag,e.firstChild)}this.modules=[],t[r]=this}mount(t){let e=this.sheet,n=0,i=0;for(let r=0;r<t.length;r++){let s=t[r],o=this.modules.indexOf(s);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),-1==o){if(this.modules.splice(i++,0,s),e)for(let l=0;l<s.rules.length;l++)e.insertRule(s.rules[l],n++)}else{for(;i<o;)n+=this.modules[i++].rules.length;n+=s.rules.length,i++}}if(!e){let a="";for(let h=0;h<this.modules.length;h++)a+=this.modules[h].getRules()+"\n";this.styleTag.textContent=a}}}},33952:function(t,e,n){n.d(e,{YG:function(){return u},uY:function(){return r},ue:function(){return i}});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&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=o||s&&57>+s[1],h=0;h<10;h++)i[48+h]=i[96+h]=String(h);for(var h=1;h<=24;h++)i[h+111]="F"+h;for(var h=65;h<=90;h++)i[h]=String.fromCharCode(h+32),r[h]=String.fromCharCode(h);for(var c in i)r.hasOwnProperty(c)||(r[c]=i[c]);function u(t){var e=!(a&&(t.ctrlKey||t.altKey||t.metaKey)||l&&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}}}]);