Files

33 lines
645 KiB
JavaScript
Raw Permalink Normal View History

// See the "/licenses" URI for full package license details
var $s=[],DO=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<i.length;e++)(e%2?DO:$s).push(t=t+i[e])})();function i$(i){if(i<768)return!1;for(let e=0,t=$s.length;;){let r=e+t>>1;if(i<$s[r])t=r;else if(i>=DO[r])e=r+1;else return!0;if(e==t)return!1}}function GO(i){return i>=127462&&i<=127487}var IO=8205;function NO(i,e,t=!0,r=!0){return(t?FO:r$)(i,e,r)}function FO(i,e,t){if(e==i.length)return e;e&&HO(i.charCodeAt(e))&&KO(i.charCodeAt(e-1))&&e--;let r=ds(i,e);for(e+=BO(r);e<i.length;){let n=ds(i,e);if(r==IO||n==IO||t&&i$(n))e+=BO(n),r=n;else if(GO(n)){let s=0,o=e-2;for(;o>=0&&GO(ds(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function r$(i,e,t){for(;e>0;){let r=FO(i,e-2,t);if(r<e)return r;e--}return 0}function ds(i,e){let t=i.charCodeAt(e);if(!KO(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return HO(r)?(t-55296<<10)+(r-56320)+65536:t}function HO(i){return i>=56320&&i<57344}function KO(i){return i>=55296&&i<56320}function BO(i){return i<65536?1:2}var W=class i{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=Pi(this,e,t);let n=[];return this.decompose(0,e,n,2),r.length&&r.decompose(0,r.length,n,3),this.decompose(t,this.length,n,1),gi.from(n,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Pi(this,e,t);let r=[];return this.decompose(e,t,r,0),gi.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),n=new Ht(this),s=new Ht(e);for(let o=t,a=t;;){if(n.next(o),s.next(o),o=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(a+=n.value.length,n.done||a>=r)return!0}}iter(e=1){return new Ht(this,e)}iterRange(e,t=this.length){return new Gr(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;r=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ir(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?i.empty:e.length<=32?new Re(e):gi.from(Re.split(e,[]))}},Re=class i extends W{constructor(e,t=n$(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.text[s],a=n+o.length;if((t?r:a)>=e)return new m
`){[e,t]=Pi(this,e,t);let n="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],O=s+a.length;s>e&&o&&(n+=r),e<O&&t>s&&(n+=a.slice(Math.max(0,e-s),t-s)),s=O+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],n=-1;for(let s of e)r.push(s),n+=s.length+1,r.length==32&&(t.push(new i(r,n)),r=[],n=-1);return n>-1&&t.push(new i(r,n)),t}},gi=class i extends W{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.children[s],a=n+o.length,O=r+o.lines-1;if((t?O:a)>=e)return o.lineInner(e,t,r,n);n=a+1,r=O+1}}decompose(e,t,r,n){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],O=o+a.length;if(e<=O&&t>=o){let l=n&((o<=e?1:0)|(O>=t?2:0));o>=e&&O<=t&&!l?r.push(a):a.decompose(e-o,t-o,r,l)}o=O+1}}replace(e,t,r){if([e,t]=Pi(this,e,t),r.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let o=this.children[n],a=s+o.length;if(e>=s&&t<=a){let O=o.replace(e-s,t-s,r),l=this.lines-o.lines+O.lines;if(O.lines<l>>4&&O.lines>l>>6){let c=this.children.slice();return c[n]=O,new i(c,this.length-(t-e)+r.length)}return super.replace(s,a,O)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
`){[e,t]=Pi(this,e,t);let n="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],O=o+a.length;o>e&&s&&(n+=r),e<O&&t>o&&(n+=a.sliceString(e-o,t-o,r)),o=O+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let r=0,[n,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==o||s==a)return r;let O=this.children[n],l=e.children[s];if(O!=l)return r+O.scanIdentical(l,t);r+=O.length+1}}static from(e,t=e.reduce((r,n)=>r+n.length+1,-1)){let r=0;for(let d of e)r+=d.lines;if(r<32){let d=[];for(let $ of e)$.flatten(d);return new Re(d,t)}let n=Math.max(32,r>>5),s=n<<1,o=n>>1,a=[],O=0,l=-1,c=[];function h(d){let $;if(d.lines>s&&d instanceof i)for(let p of d.children)h(p);else d.lines>o&&(O>o||!O)?(f(),a.push(d)):d instanceof Re&&O&&($=c[c.length-1])instanceof Re&&d.lines+$.lines<=32?(O+=d.lines,l+=d.length+1,c[c.length-1]=new Re($.text.concat(d.text),$.length+1+d.length)):(O+d.lines>n&&f(),O+=d.lines,l+=d.length+1,c.push(d))}function f(){O!=0&&(a.push(c.length==1?c[0]:i.from(c,l)),l=-1,O=c.length=0)}for(let d of e)h(d);return f(),a.length==1?a[0]:new i(a,t)}};W.empty=new Re([""],0);function n$(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Lr(i,e,t=0,r=1e9){for(let n=0,s=0,o=!0;s<i.length&&n<=r;s++){let a=i[s],O=n+a.length;O>=t&&(O>r&&(a=a.slice(0,r-n)),n<t&&(a=a.slice(t-n)),o?(e[e.length-1]+=a,o=!1):e.push(a)),n=O+1}return e}function JO(i,e,t){return Lr(i,[""],e,t)}var Ht=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Re?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,n=this.nodes[r],s=this.offsets[r],o=s>>1,a=n instanceof Re?n.text.length:n.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(n instanceof Re){let O=n.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,O.length>Math.max(0,e))return this.value=e==0?O:t>0?O.slice(e):O.slice(0,O.length-e),this;e-=O.length}else{let O=n.children[o+(t<0?-1:0)];e>O.length?(e-=O.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(O),this.offsets.push(t>0?1:(O instanceof Re?O.text.length:O.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Gr=class{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Ht(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=r?n:t<0?n.slice(n.length-r):n.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Ir=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(W.prototype[Symbol.iterator]=function(){return this.iter()},Ht.prototype[Symbol.iterator]=Gr.prototype[Symbol.iterator]=Ir.prototype[Symbol.iterator]=function(){return this});var ms=class{constructor(e,t,r,n){this.from=e,this.to=t,this.number=r,this.text=n}get length(){return this.to-this.from}};function Pi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function ae(i,e,t=!0,r=!0){return NO(i,e,t,r)}function s$(i){return i>=56320&&i<57344}function o$(i){return i>=55296&&i<56320}function Zs(i,e){let t=i.charCodeAt(e);if(!o$(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return s$(r)?(t-55296<<10)+(r-56320)+65536:t}function Rs(i){return i<65536?1:2}var gs=/\r\n?|\n/,le=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(le||(le={})),$t=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,n=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,n,s),n+=s):n+=o,r+=s}}iterChangedRanges(e,t=!1){Qs(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],n=this.sections[t++];n<0?e.push(r,n):e.push(n,r)}return new i(e)}composeDesc(e){return this.empty?e:e.empty?this:nl(this,e)}mapDesc(e,t=!1){return e.empty?this:Ss(this,e,t)}mapPos(e,t=-1,r=le.Simple){let n=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],O=this.sections[o++],l=n+a;if(O<0){if(l>e)return s+(e-n);s+=a}else{if(r!=le.Simple&&l>=e&&(r==le.TrackDel&&n<e&&l>e||r==le.TrackBefore&&n<e||r==le.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==n||t<0?s:s+O;s+=O}n=l}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let r=0,n=0;r<this.sections.length&&n<=t;){let s=this.sections[r++],o=this.sections[r++],a=n+s;if(o>=0&&n<=t&&a>=e)return n<e&&a>t?"cover":!0;n=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+r+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>type
`}get readOnly(){return this.facet(hl)}phrase(e,...t){for(let r of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let n=[];for(let s of this.facet(ol))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return $$(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let O=ae(t,o,!1);if(s(t.slice(O,o))!=je.Word)break;o=O}for(;a<n;){let O=ae(t,a);if(s(t.slice(a,O))!=je.Word)break;a=O}return o==a?null:Q.range(o+r,a+r)}};D.allowMultipleSelections=Ts;D.tabSize=v.define({combine:i=>i.length?i[0]:4});D.lineSeparator=al;D.readOnly=hl;D.phrases=v.define({compare(i,e){let t=Object.keys(i),r=Object.keys(e);return t.length==r.length&&t.every(n=>i[n]==e[n])}});D.languageData=ol;D.changeFilter=Ol;D.transactionFilter=ll;D.transactionExtender=cl;pt.reconfigure=B.define();function Zt(i,e,t={}){let r={};for(let n of i)for(let s of Object.keys(n)){let o=n[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let n in e)r[n]===void 0&&(r[n]=e[n]);return r}var Ue=class{eq(e){return this==e}range(e,t=e){return Hi.create(e,t,this)}};Ue.prototype.startSide=Ue.prototype.endSide=0;Ue.prototype.point=!1;Ue.prototype.mapMode=le.TrackDel;function zs(i,e){return i==e||i.constructor==e.constructor&&i.eq(e)}var Hi=class i{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new i(e,t,r)}};function ks(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var Xs=class i{constructor(e,t,r,n){this.from=e,this.to=t,this.value=r,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,n=0){let s=r?this.to:this.from;for(let o=n,a=s.length;;){if(o==a)return o;let O=o+a>>1,l=s[O]-e||(r?this.value[O].endSide:this.value[O].startSide)-t;if(O==o)return l>=0?o:a;l>=0?a=O:o=O+1}}between(e,t,r,n){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(n(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],n=[],s=[],o=-1,a=-1;for(let O=0;O<this.value.length;O++){let l=this.value[O],c=this.from[O]+e,h=this.to[O]+e,f,d;if(c==h){let $=t.mapPos(c,l.startSide,l.mapMode);if($==null||(f=d=$,l.startSide!=l.endSide&&(d=t.mapPos(c,l.endSide),d<f)))continue}else if(f=t.mapPos(c,l.startSide),d=t.mapPos(h,l.endSide),f>d||f==d&&l.startSide>0&&l.endSide<=0)continue;(d-f||l.endSide-l.startSide)<0||(o<0&&(o=f),l.point&&(a=Math.max(a,d-f)),r.push(l),n.push(f-o),s.push(d-o))}return{mapped:r.length?new i(n,s,r,a):null,pos:o}}},G=class i{constructor(e,t,r,n){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=n}static create(e,t,r,n){return new i(e,t,r,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:n=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(ks)),this.isEmpty)return t.length?i.of(t):this;let a=new Fr(this,null,-1).goto(0),O=0,l=[],c=new Jt;for(;a.value||O<t.length;)if(O<t.length&&(a.from-t[O].from||a.startSide-t[O].value.startSide)>=0){let h=t[O++];c.addInner(h.from,h.to,h.value)||l.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(O==t.length||this.chunkEnd(a.chunkIndex)<t[O].from)&&(!o||n>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||n>a.to||s<a.from||o(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||l.push(Hi.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.
`)}static newName(){let e=$l[dl]||1;return $l[dl]=e+1,"\u037C"+e.toString(36)}static mount(e,t,r){let n=e[Ys],s=r&&r.nonce;n?s&&n.setNonce(s):n=new Cs(e,s),n.mount(Array.isArray(t)?t:[t],e)}},pl=new Map,Cs=class{constructor(e,t){let r=e.ownerDocument||e,n=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=pl.get(r);if(s)return e[Ys]=s;this.sheet=new n.CSSStyleSheet,pl.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Ys]=this}mount(e,t){let r=this.sheet,n=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],O=this.modules.indexOf(a);if(O<s&&O>-1&&(this.modules.splice(O,1),s--,O=-1),O==-1){if(this.modules.splice(s++,0,a),r)for(let l=0;l<a.rules.length;l++)r.insertRule(a.rules[l],n++)}else{for(;s<O;)n+=this.modules[s++].rules.length;n+=a.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let O=0;O<this.modules.length;O++)o+=this.modules[O].getRules()+`
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var mt={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:"'"},Ti={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},m$=typeof navigator<"u"&&/Mac/.test(navigator.platform),g$=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(ne=0;ne<10;ne++)mt[48+ne]=mt[96+ne]=String(ne);var ne;for(ne=1;ne<=24;ne++)mt[ne+111]="F"+ne;var ne;for(ne=65;ne<=90;ne++)mt[ne]=String.fromCharCode(ne+32),Ti[ne]=String.fromCharCode(ne);var ne;for(Kr in mt)Ti.hasOwnProperty(Kr)||(Ti[Kr]=mt[Kr]);var Kr;function ml(i){var e=m$&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||g$&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Ti:mt)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}var Qe=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Es=typeof document<"u"?document:{documentElement:{style:{}}},Ls=/Edge\/(\d+)/.exec(Qe.userAgent),Fl=/MSIE \d/.test(Qe.userAgent),Gs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qe.userAgent),kn=!!(Fl||Gs||Ls),gl=!kn&&/gecko\/(\d+)/i.test(Qe.userAgent),Ws=!kn&&/Chrome\/(\d+)/.exec(Qe.userAgent),Ql="webkitFontSmoothing"in Es.documentElement.style,Is=!kn&&/Apple Computer/.test(Qe.vendor),Sl=Is&&(/Mobile\/\w+/.test(Qe.userAgent)||Qe.maxTouchPoints>2),X={mac:Sl||/Mac/.test(Qe.platform),windows:/Win/.test(Qe.platform),linux:/Linux|X11/.test(Qe.platform),ie:kn,ie_version:Fl?Es.documentMode||6:Gs?+Gs[1]:Ls?+Ls[1]:0,gecko:gl,gecko_version:gl?+(/Firefox\/(\d+)/.exec(Qe.userAgent)||[0,0])[1]:0,chrome:!!Ws,chrome_version:Ws?+Ws[1]:0,ios:Sl,android:/Android\b/.test(Qe.userAgent),webkit:Ql,webkit_version:Ql?+(/\bAppleWebKit\/(\d+)/.exec(Qe.userAgent)||[0,0])[1]:0,safari:Is,safari_version:Is?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Qe.userAgent)||[0,0])[1]:0,tabSize:Es.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function zo(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}var fn=Object.create(null);function Yo(i,e,t){if(i==e)return!0;i||(i=fn),e||(e=fn);let r=Object.keys(i),n=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=n.length-(t&&n.indexOf(t)>-1?1:0))return!1;for(let s of r)if(s!=t&&(n.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function Q$(i,e){for(let t=i.attributes.length-1;t>=0;t--){let r=i.attributes[t].name;e[r]==null&&i.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?i.style.cssText=r:i.getAttribute(t)!=r&&i.setAttribute(t,r)}}function Pl(i,e,t){let r=!1;if(e)for(let n in e)t&&n in t||(r=!0,n=="style"?i.style.cssText="":i.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(r=!0,n=="style"?i.style.cssText=t[n]:i.setAttribute(n,t[n]));return r}function S$(i){let e=Object.create(null);for(let t=0;t<i.attributes.length;t++){let r=i.attributes[t];e[r.name]=r.value}return e}var St=class{eq(e){return!1}updateDOM(e,t,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){
`,n=i.state.doc.line(n.number+(t?1:-1)),s=i.bidiSpans(n),l=i.visualLineSide(n,!t)}if(O){if(!O(c))return a}else{if(!r)return l;O=r(c)}a=l}}function J$(i,e,t){let r=i.state.charCategorizer(e),n=r(t);return s=>{let o=r(s);return n==je.Space&&(n=o),n==o}}function ep(i,e,t,r){let n=e.head,s=t?1:-1;if(n==(t?i.state.doc.length:0))return Q.cursor(n,e.assoc);let o=e.goalColumn,a,O=i.contentDOM.getBoundingClientRect(),l=i.coordsAtPos(n,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=i.documentTop;if(l)o==null&&(o=l.left-O.left),a=s<0?l.top:l.bottom;else{let $=i.viewState.lineBlockAt(n);o==null&&(o=Math.min(O.right-O.left,i.defaultCharacterWidth*(n-$.from))),a=(s<0?$.top:$.bottom)+c}let h=O.left+o,f=i.viewState.heightOracle.textHeight>>1,d=r??f;for(let $=0;;$+=f){let p=a+(d+$)*s,m=Oo(i,{x:h,y:p},!1,s);if(t?p>O.bottom:p<O.top)return Q.cursor(m.pos,m.assoc);let g=i.coordsAtPos(m.pos,m.assoc),S=g?(g.top+g.bottom)/2:0;if(!g||(t?S>a:S<a))return Q.cursor(m.pos,m.assoc,void 0,o)}}function ar(i,e,t){for(;;){let r=0;for(let n of i)n.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let O=r||t||(e-s<o-e?-1:1);e=O<0?s:o,r=O}});if(!r)return e}}function xc(i,e){let t=null;for(let r=0;r<e.ranges.length;r++){let n=e.ranges[r],s=null;if(n.empty){let o=ar(i,n.from,0);o!=n.from&&(s=Q.cursor(o,-1))}else{let o=ar(i,n.from,-1),a=ar(i,n.to,1);(o!=n.from||a!=n.to)&&(s=Q.range(n.from==n.anchor?o:a,n.from==n.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?Q.create(t,e.mainIndex):e}function js(i,e,t){let r=ar(i.state.facet(dr).map(n=>n(i)),t.from,e.head>t.from?-1:1);return r==t.from?t:Q.cursor(r,r<t.from?1:-1)}var Le=class{constructor(e,t){this.pos=e,this.assoc=t}};function Oo(i,e,t,r){let n=i.contentDOM.getBoundingClientRect(),s=n.top+i.viewState.paddingTop,{x:o,y:a}=e,O=a-s,l;for(;;){if(O<0)return new Le(0,1);if(O>i.viewState.docHeight)return new Le(i.state.doc.length,-1);if(l=i.elementAtHeight(O),r==null)break;if(l.type==ce.Text){if(r<0?l.to<i.viewport.from:l.from>i.viewport.to)break;let f=i.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(f&&(r<0?f.top<=O+s:f.bottom>=O+s))break}let h=i.viewState.heightOracle.textHeight/2;O=r>0?l.bottom+h:l.top-h}if(i.viewport.from>=l.to||i.viewport.to<=l.from){if(t)return null;if(l.type==ce.Text){let h=H$(i,n,l,o,a);return new Le(h,h==l.from?1:-1)}}if(l.type!=ce.Text)return O<(l.top+l.bottom)/2?new Le(l.from,1):new Le(l.to,-1);let c=i.docView.lineAt(l.from,2);return(!c||c.length!=l.length)&&(c=i.docView.lineAt(l.from,-2)),new lo(i,o,a,i.textDirectionAt(l.from)).scanTile(c,l.from)}var lo=class{constructor(e,t,r,n){this.view=e,this.x=t,this.y=r,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:r,spans:n}=this.bidiSpansAt(e);return n[Ge.find(n,e-r.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:r,spans:n}=this.bidiSpansAt(e);return n[Ge.find(n,e-r.from,-1,t)].dir}bidiIn(e,t){let{spans:r,line:n}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+n.from<t)}scan(e,t){let r=0,n=e.length-1,s=new Set,o=this.bidiIn(e[0],e[n]),a,O,l=-1,c=1e9,h;e:for(;r<n;){let d=n-r,$=r+n>>1;t:if(s.has($)){let m=r+Math.floor(Math.random()*d);for(let g=0;g<d;g++){if(!s.has(m)){$=m;break t}m++,m==n&&(m=r)}break e}s.add($);let p=t($);if(p)for(let m=0;m<p.length;m++){let g=p[m],S=0;if(!(g.width==0&&p.length>1)){if(g.bottom<this.y)(!a||a.bottom<g.bottom)&&(a=g),S=1;else if(g.top>this.y)(!O||O.top>g.top)&&(O=g),S=-1;else{let T=g.left>this.x?this.x-g.left:g.right<this.x?this.x-g.right:0,_=Math.abs(T);_<c&&(l=$,c=_,h=g),T&&(S=T<0==(this.baseDir==H.LTR)?-1:1)}S==-1&&(!o||this.baseDirAt(e[$],1))?n=$:S==1&&(!o||this.baseDirAt(e[$+1],-1))&&(r=$+1)}}}if(!h){let d=a&&(!O||this.y-a.bottom<O.top-this.y)?a:O;return this.y=(d.top+d.bottom)/2,this.scan(e,t)}if(c){if(a&&a.bottom>h.top)return this.y=a.bottom-1,this.scan(e,t);if(O&&O.top<h.bottom)return this.y=O.top+1,this.scan(e,t)}let f=(o?this.dirAt(e[l],1):this.baseDir)==H.LTR;return{i:l,after:this.x>(h.left+h.
`&&i.lineWrapping&&(r&&(r=Q.single(r.main.anchor-1,r.main.head-1)),t={from:s.from,to:s.to,insert:W.of([" "])}),t)return Uo(i,t,r,o);if(r&&!Sn(r,s)){let a=!1,O="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(a=!0),O=i.inputState.lastSelectionOrigin,O=="select.pointer"&&(r=xc(n.facet(dr).map(l=>l(i)),r))),i.dispatch({selection:r,scrollIntoView:a,userEvent:O}),!0}else return!1}function Uo(i,e,t,r=-1){if(X.ios&&i.inputState.flushIOSKey(e))return!0;let n=i.state.selection.main;if(X.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&i.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Xi(i.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>n.head)&&Xi(i.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&Xi(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=rp(i,e,t));return i.state.facet(uc).some(O=>O(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function rp(i,e,t){let r,n=i.state,s=n.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let O=e.from<s.from?-1:1,l=O<0?s.from:s.to,c=ar(n.facet(dr).map(h=>h(i)),l,O);e.from==c&&(o=c)}if(o>-1)r={changes:e,selection:Q.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let O=s.from<e.from?n.sliceDoc(s.from,e.from):"",l=s.to>e.to?n.sliceDoc(e.to,s.to):"";r=n.replaceSelection(i.state.toText(O+e.insert.sliceString(0,void 0,i.state.lineBreak)+l))}else{let O=n.changes(e),l=t&&t.main.to<=O.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),h,f=t&&wc(i,t.main.head);if(f){let $=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-$}}else h=i.state.doc.lineAt(s.head);let d=s.to-e.to;r=n.changeByRange($=>{if($.from==s.from&&$.to==s.to)return{changes:O,range:l||$.map(O)};let p=$.to-d,m=p-c.length;if(i.state.sliceDoc(m,p)!=c||p>=h.from&&m<=h.to)return{range:$};let g=n.changes({from:m,to:p,insert:e.insert}),S=$.to-s.to;return{changes:g,range:l?Q.range(Math.max(0,l.anchor+S),Math.max(0,l.head+S)):$.map(g)}})}else r={changes:O,selection:l&&n.selection.replaceRange(l)}}let a="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,a+=".compose",i.inputState.compositionFirstChange&&(a+=".start",i.inputState.compositionFirstChange=!1)),n.update(r,{userEvent:a,scrollIntoView:!0})}function vc(i,e,t,r){let n=Math.min(i.length,e.length),s=0;for(;s<n&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==n&&i.length==e.length)return null;let o=i.length,a=e.length;for(;o>0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let O=Math.max(0,s-Math.min(o,a));t-=o+O-s}if(o<s&&i.length<e.length){let O=t<=s&&t>=o?s-t:0;s-=O,a=s+(a-o),o=s}else if(a<s){let O=t<=s&&t>=a?s-t:0;s-=O,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function np(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:n,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new Qn(t,r)),(n!=t||s!=r)&&e.push(new Qn(n,s))),e}function sp(i,e){if(i.length==0)return null;let t=i[0].pos,r=i.length==2?i[1].pos:t;return t>-1&&r>-1?Q.single(t+e,r+e):null}function Sn(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}var fo=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],th
`))};if((X.mac||X.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:O,insert:W.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Uo(e,h,Q.single(this.toEditorPos(r.selectionStart,f),this.toEditorPos(r.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let n=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let O=e.coordsForChar(o);s=O&&new DOMRect(O.left,O.top,O.right-O.left,O.bottom-O.top)||s||new DOMRect,n.push(s)}t.updateCharacterBounds(r.rangeStart,n)},this.handlers.textformatupdate=r=>{let n=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let O=this.toEditorPos(s.rangeStart),l=this.toEditorPos(s.rangeEnd);if(O<l){let c=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;n.push(M.mark({attributes:{style:c}}).range(O,l))}}}e.dispatch({effects:gc.of(M.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let n=fr(r.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,o,a,O,l)=>{if(r)return;let c=l.length-(o-s);if(n&&o>=n.to)if(n.from==s&&n.to==o&&n.insert.eq(l)){n=this.pendingContextChange=null,t+=c,this.to+=c;return}else n=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+l.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),l.toString()),this.to+=c}t+=c}),n&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(r,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r
`&&(t="");else{let r=t.indexOf(`
`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let n=this.rangeIndex;;){let s=this.ranges[n].to;if(s>=r||(t=t.slice(0,s-(r-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,a=this.lineAfter(o);t+=a,r=o+a.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let n=this.ranges[this.rangeIndex].to,s=e+t;if(r>0?n>s:n>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,r,n){let s=4;if(this.ranges.length>1){n=this.skipGapsTo(t,n,1),t+=n;let a=this.chunk.length;n=this.skipGapsTo(r,n,-1),r+=n,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=r:this.chunk.push(e,t,r,s),n}parseLine(e){let{line:t,end:r}=this.nextLine(),n=0,{streamParser:s}=this.lang,o=new An(t,e?e.state.tabSize:4,e?At(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=kh(s.token,o,this.state);if(a&&(n=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Y.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:qm,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Y(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Y(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function kh(i,e,t){e.start=e.pos;for(let r=0;r<10;r++){let n=i(e,t);if(e.pos>e.start)return n}throw new Error("Stream parser failed to advance stream.")}var Qa=Object.create(null),Sr=[ie.none],qm=new Tt(Sr),dh=[],$h=Object.create(null),Xh=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Xh[i]=vh(Qa,e);var Un=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Xh)}resolve(e){return e?this.table[e]||(this.table[e]=vh(this.extra,e)):0}},Am=new Un(Qa);function Oa(i,e){dh.indexOf(i)>-1||(dh.push(i),console.warn(e))}function vh(i,e){let t=[];for(let a of e.split(" ")){let O=[];for(let l of a.split(".")){let c=i[l]||u[l];c?typeof c=="function"?O.length?O=O.map(c):Oa(l,`Modifier ${l} used at start of tag`):O.length?Oa(l,`Tag ${l} used as modifier`):O=Array.isArray(c)?c:[c]:Oa(l,`Unknown highlighting tag ${l}`)}for(let l of O)t.push(l)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),n=r+" "+t.map(a=>a.id),s=$h[n];if(s)return s.id;let o=$h[n]=ie.define({id:Sr.length,name:r,props:[se({[r]:t})]});return Sr.push(o),o.id}function jm(i,e){let t=ie.define({id:Sr.length,name:"Document",props:[wt.add(()=>i),de.add(()=>r=>e.getIndent(r))],top:!0});return Sr.push(t),t}var AT={rtl:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:H.RTL}),ltr:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:H.LTR}),auto:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Um=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),r=xa(i.state,t.from);return r.line?Mm(i):r.block?Lm(i):!1};function wa(i,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=i(e,t);return n?(r(t.update(n)),!0):!1}}var Mm=wa(Bm,0);var Em=wa(qh,0);var Lm=wa((i,e)=>qh(i,e,Im(e)),0);function xa(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var yr=50;function Gm(i,{open:e,close:t},r,n){le
\${}
} catch (\${error}) {
\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Pe("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Pe(`if (\${}) {
\${}
} else {
\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),Pe(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),Pe('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Pe('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],CS=au.concat([Pe("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Pe("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Pe("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),nu=new Ci,Ou=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Zr(i){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,i),!0}}var WS=["FunctionDeclaration"],qS={FunctionDeclaration:Zr("function"),ClassDeclaration:Zr("class"),ClassExpression:()=>!0,EnumDeclaration:Zr("constant"),TypeAliasDeclaration:Zr("type"),NamespaceDeclaration:Zr("namespace"),VariableDefinition(i,e){i.matchContext(WS)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function lu(i,e){let t=nu.get(e);if(t)return t;let r=[],n=!0;function s(o,a){let O=i.sliceString(o.from,o.to);r.push({label:O,type:a})}return e.cursor(A.IncludeAnonymous).iterate(o=>{if(n)n=!1;else if(o.name){let a=qS[o.name];if(a&&a(o,s)||Ou.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of lu(i,o.node))r.push(a);return!1}}),nu.set(e,r),r}var su=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,cu=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function AS(i){let e=L(i.state).resolveInner(i.pos,-1);if(cu.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&su.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let r=[];for(let n=e;n;n=n.parent)Ou.has(n.name)&&(r=r.concat(lu(i.state.doc,n)));return{options:r,from:t?e.from:i.pos,validFor:su}}var nt=ue.define({name:"javascript",parser:Hf.configure({props:[de.add({IfStatement:Ye({except:/^\s*({|else\b)/}),TryStatement:Ye({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Qh,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:r?1:2)*i.unit},Block:En({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ye({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),Se.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ut,BlockComment(i){return{from:i.from+2,to:i.to-2}},JSXElement(i){let e=i.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=i.lastChild;return{from:e.to,to:t.type.isError?i.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(i){var e;let t=(e=i.firstChild)===null||e===void 0?void 0:e.nextSibling,r=i.lastChild;return!t||t.type.isError?null:{from:t.to,to:r.type.isError?i.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),hu={test:i=>/^JSX/.test(i.name),facet:Ai({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ka=nt.configure({dialect:"ts"},"typescript"),Ja=nt.configure({dialect:"jsx",props:[Mn.add(i=>i.isTop?[hu]:void 0)]}),eO=nt.configure({dialect:"jsx ts",props:[Mn.add(i=>i.isTop?[hu]:void 0)]},"typescript"),fu=i=>({label:i,type:"keyword"}),uu="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(fu),jS=uu.concat(["declare","implements","private","protected","public"].map(fu));function fi(i={}){let e=i.jsx?i.
`+t.scrub(),s=this.advance(n);return s>-1&&s<n.length?this.complete(e,r,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&_r(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,j(P.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(md(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(j(P.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage($d(e,_r(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=_r(e,this.pos),r=0;if(t>this.pos){let n=pd(e,t,this.start);if(n){let s=uO(e,n.to-this.start);s>0&&(this.nextStage(n),r=s)}}return r||(r=uO(e,this.pos)),r>0&&r<e.length?r:-1}else return uO(e,this.pos)}}};function uO(i,e){for(;e<i.length;e++){let t=i.charCodeAt(e);if(t==10)break;if(!Ne(t))return-1}return e}var SO=class{nextLine(e,t,r){let n=t.depth<e.stack.length?-1:od(t),s=t.next;if(n<0)return!1;let o=j(P.HeaderMark,e.lineStart+t.pos,e.lineStart+n);return e.nextLine(),e.addLeafElement(r,j(s==61?P.SetextHeading1:P.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),o])),!0}finish(){return!1}},cd={LinkReference(i,e){return e.content.charCodeAt(0)==91?new QO(e):null},SetextHeading(){return new SO}},zP=[(i,e)=>sd(e)>=0,(i,e)=>id(e)>=0,(i,e)=>rd(e)>=0,(i,e)=>kO(e,i,!0)>=0,(i,e)=>XO(e,i,!0)>=0,(i,e)=>xO(e,i,!0)>=0,(i,e)=>ld(e,i,!0)>=0],YP={text:"",end:0},PO=class{constructor(e,t,r,n){this.parser=e,this.input=t,this.ranges=n,this.line=new pO,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=n[n.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=n[0].from,this.block=os.create(P.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new bO(r,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!n||e.markers[r].from<n.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let n=r(this,e);if(n!=!1){if(n==!0)return null;e.forward();continue e}}break}let t=new $O(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let n=r(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,t))break e}for(let r of t.parsers)if(r.nextLine(this,e,t))return null;t.content+=`
`+e.scrub();for(let r of e.markers)t.marks.push(r)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=gd(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=YP;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let r=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let s=this.ranges[n].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[n-1].to-r)+o,r=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(t);e.depth<this.stack.length;e.depth++){let n=this.stack[e.depth],s=this.parser.skipContextMarkup[n.type];if(!s)throw new Error("Unhandled block context "+P[n.type]);let o=this.line.markers.length;if(!s(n,this,e)){this.line.markers.length>o&&(n.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),r;if(this.input.lineChunks)r=t==`
`?"":t;else{let n=t.indexOf(`
`);r=n<0?t:t.slice(0,n)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,r=0){this.block=os.create(e,r,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,r=0){this.startContext(this.parser.getNodeType(e),t,r)}addNode(e,t,r){typeof e=="number"&&(e=new Y(this.parser.nodeSet.types[e],Ii,Ii,(r??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(yO(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?hd(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let t=yO(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(P.Paragraph,e.content.length),e.start)}elt(e,t,r,n){return typeof e=="string"?j(this.parser.getNodeType(e),t,r,n):new Os(e,t)}get buffer(){return new as(this.parser.nodeSet)}};function hd(i,e,t,r,n){let s=i[e].to,o=[],a=[],O=t.from+r;function l(c,h){for(;h?c>=s:c>s;){let f=i[e+1].from-s;r+=f,c+=f,e++,s=i[e].to}}for(let c=t.firstChild;c;c=c.nextSibling){l(c.from+r,!0);let h=c.from+r,f,d=n.get(c.tree);d?f=d:c.to+r>s?(f=hd(i,e,c,r,n),l(c.to+r,!1)):f=c.toTree(),o.push(f),a.push(h-O)}return l(t.to+r,!1),new Y(t.type,o,a,t.to+r-O,t.tree?t.tree.propValues:void 0)}var Yr=class i extends bt{constructor(e,t,r,n,s,o,a,O,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=r,this.blockNames=n,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=O,this.wrappers=l,this.nodeTypes=Object.create(null);for(let c of e.types)this.nodeTypes[c.name]=c.id}createParse(e,t,r){let n=new PO(this,e,t,r);for(let s of this.wrappers)n=s(n,e,t,r);return n}configure(e){let t=TO(e);if(!t)return this;let{nodeSet:r,skipContextMarkup:n}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),O=this.inlineParsers.slice(),l=this.inlineNames.slice(),c=this.endLeafBlock.slice(),h=this.wrappers;if(Vr(t.defineNodes)){n=Object.assign({},n);let f=r.types.slice(),d;for(let $ of t.defineNodes){let{name:p,block:m,composite:g,style:S}=typeof $=="string"?{name:$}:$;if(f.some(b=>b.name==p))continue;g&&(n[f.length]=(b,x,w)=>g(x,w,b.value));let T=f.length,_=g?["Block","BlockContext"]:m?T>=P.ATXHeading1&&T<=P.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(ie.define({id:T,name:p,props:_&&[[V.group,_]]})),S&&(d||(d={}),Array.isArray(S)||S instanceof ze?d[p]=S:Object.assign(d,S))}r=new Tt(f),d&&(r=r.extend(se(d)))}if(Vr(t.props)&&(r=r.extend(...t.props)),Vr(t.remove))for(let f of t.remove){let d=this.blockNames.indexOf(f),$=this.inlineNames.indexOf(f);d>-1&&(s[d]=o[d]=void 0),$>-1&&(O[$]=void 0)}if(Vr(t.parseBlock))for(let f of t.parseBlock){let d=a.indexOf(f.name);if(d>-1)s[d]=f.parse,o[d]=f.leaf;else{let $=f.before?ss(a,f.before):f.after?ss(a,f.after)+1:a.length-1;s.splice($,0,f.parse),o.splice($,0,f.leaf),a.splice($,0,f.name)}f.endLeaf&&c.push(f.endLeaf)}if(Vr(t.parseInline))for(let f of t.parseInline){let d=l.indexOf(f.name);if(d>-1)O[d]=f.parse;else{let $=f.before?ss(l,f.before):f.after?ss(l,f.after)+1:l.length-1;O.splice($,0,f.parse),l.splice($,0,f.name)}}return t.wrap&&(h=h.concat(t.wrap)),new i(r,s,o,a,c,n,O,l,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let r=new Wr(this,e,t);e:for(let n=t;n<r.end;){let s=r.char(n);for(let o of this.inlineParsers)if(o){let a=o(r,s,n);if(a>=0){n=a;continue e}}n++}return r.resol
`;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let n=e+this.fragment.offset;for(;r.to<=n;)if(!r.parent())return!1;for(;;){if(r.from>=n)return this.fragment.from<=t;if(!r.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(V.contextHash)==e}takeNodes(e){let t=this.cursor,r=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,O=o,l=a;for(;;){if(t.to-r>n){if(t.type.isAnonymous&&t.firstChild())continue;break}let c=gd(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,c);else{let h=new Y(e.parser.nodeSet.types[P.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,c)}if(t.type.is("Block")&&(WP.indexOf(t.type.id)<0?(o=t.to-r,a=e.block.children.length):(o=O,a=l),O=t.to-r,l=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}};function gd(i,e){let t=i;for(let r=1;r<e.length;r++){let n=e[r-1].to,s=e[r].from;n<i&&(t-=s-n)}return t}var qP=se({"Blockquote/...":u.quote,HorizontalRule:u.contentSeparator,"ATXHeading1/... SetextHeading1/...":u.heading1,"ATXHeading2/... SetextHeading2/...":u.heading2,"ATXHeading3/...":u.heading3,"ATXHeading4/...":u.heading4,"ATXHeading5/...":u.heading5,"ATXHeading6/...":u.heading6,"Comment CommentBlock":u.comment,Escape:u.escape,Entity:u.character,"Emphasis/...":u.emphasis,"StrongEmphasis/...":u.strong,"Link/... Image/...":u.link,"OrderedList/... BulletList/...":u.list,"BlockQuote/...":u.quote,"InlineCode CodeText":u.monospace,"URL Autolink":u.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":u.processingInstruction,"CodeInfo LinkLabel":u.labelName,LinkTitle:u.string,Paragraph:u.content}),Qd=new Yr(new Tt(fd).extend(qP),Object.keys(ns).map(i=>ns[i]),Object.keys(ns).map(i=>cd[i]),Object.keys(ns),zP,td,Object.keys(dO).map(i=>dO[i]),Object.keys(dO),[]);function AP(i,e,t){let r=[];for(let n=i.firstChild,s=e;;n=n.nextSibling){let o=n?n.from:t;if(o>s&&r.push({from:s,to:o}),!n)break;s=n.to}return r}function Sd(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Wi((n,s)=>{let o=n.type.id;if(e&&(o==P.CodeBlock||o==P.FencedCode)){let a="";if(o==P.FencedCode){let l=n.node.getChild(P.CodeInfo);l&&(a=s.read(l.from,l.to))}let O=e(a);if(O)return{parser:O,overlay:l=>l.type.id==P.CodeText,bracketed:o==P.FencedCode}}else if(t&&(o==P.HTMLBlock||o==P.HTMLTag||o==P.CommentBlock))return{parser:t,overlay:AP(n.node,n.from,n.to)};return null})}}var jP={resolve:"Strikethrough",mark:"StrikethroughMark"},UP={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":u.strikethrough}},{name:"StrikethroughMark",style:u.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let r=i.slice(t-1,t),n=i.slice(t+2,t+3),s=/\s|^$/.test(r),o=/\s|^$/.test(n),a=Cr.test(r),O=Cr.test(n);return i.addDelimiter(jP,t,t+2,!o&&(!O||s||a),!s&&(!a||o||O))},after:"Emphasis"}]};function zr(i,e,t=0,r,n=0){let s=0,o=!0,a=-1,O=-1,l=!1,c=()=>{r.push(i.elt("TableCell",n+a,n+O,i.parser.parseInline(e.slice(a,O),n+a)))};for(let h=t;h<e.length;h++){let f=e.charCodeAt(h);f==124&&!l?((!o||a>-1)&&s++,o=!1,r&&(a>-1&&c(),r.push(i.elt("TableDelimiter",h+n,h+n+1))),a=O=-1):(l||f!=32&&f!=9)&&(a<0&&(a=h),O=h+1),l=!l&&f==92}return a>-1&&(s++,r&&c()),s}function Du(i,e){for(let t=e;t<i.length;t++){let r=i.charCodeAt(t);if(r==124)return!0;r==92&&t++}return!1}var Pd=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,cs=class{constructor(){this.rows=null}nextLine(e,t,r){if(this.rows==null){this.rows=!1;let n;if((t.next==45||t.next==58||t.next==124)&&Pd.test(n=t.text.slice(t.pos))){let s=[];zr(e,r.content,0,s,r.start)==zr(e,n,t.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];zr(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,n))}re
`);let t=i.textContent.trimEnd(),r="";e!==null&&(r=e.className.replace("language-",""));let n=document.createElement("div");i.parentNode.insertBefore(n,i);let s=rT(i);s&&n.setAttribute("dir",s);let o=Bi("content-code-block",{parent:n,doc:t,extensions:Ra(n)});new Bt(o).setMode(r,t),i.remove(),iT(o)}function iw(i){let e=i.querySelectorAll("pre");for(let t of e)t$(t)}function rw(){let i=document.querySelectorAll(".page-content pre, .comment-box .content pre");for(let e of i)t$(e)}function nw(i,e,t,r){let n=Bi("content-code-block",{parent:i,doc:t,extensions:Ra(i),root:e}),s=new Bt(n);return s.setMode(r,t),s}function sw(i,e){let t=i.textContent,r={parent:i.parentElement,doc:t,extensions:[...Hn(i.parentElement)]},n=new Bt(Bi("code-editor",r));return n.setMode(e,t),i.style.display="none",n}function ow(i,e){let t=i.value,r={parent:i.parentElement,doc:t,extensions:[...Hn(i.parentElement),k.updateListener.of(o=>{o.docChanged&&(i.value=o.state.doc.toString())})]},n=Bi("code-input",r),s=new Bt(n);return s.setMode(e,t),i.style.display="none",s}function aw(i,e,t,r){let n=i.textContent,s={parent:i.parentElement,doc:n,extensions:[ct.of(r),...Hn(i.parentElement),k.updateListener.of(a=>{e(a)}),k.domEventHandlers(t)]};window.$events.emitPublic(i,"editor-markdown-cm6::pre-init",{editorViewConfig:s});let o=Bi("markdown-editor",s);return new Bt(o).setMode("markdown",""),i.style.display="none",o}export{rw as highlight,iw as highlightWithin,ow as inlineEditor,aw as markdownEditor,sw as popupEditor,nw as wysiwygView};
//# sourceMappingURL=code.js.map