From 316aadd1b055740a03e360f8b26f0bfabe855ad3 Mon Sep 17 00:00:00 2001 From: hackerwins Date: Sat, 19 Oct 2024 14:59:34 +0000 Subject: [PATCH] deploy: 5627a9fbc11ef78ec22b54ea265b83438966da64 --- .../{index-sWQGlqLg.js => index-zudBzjCO.js} | 504 ++++++++++-------- index.html | 2 +- 2 files changed, 269 insertions(+), 237 deletions(-) rename assets/{index-sWQGlqLg.js => index-zudBzjCO.js} (57%) diff --git a/assets/index-sWQGlqLg.js b/assets/index-zudBzjCO.js similarity index 57% rename from assets/index-sWQGlqLg.js rename to assets/index-zudBzjCO.js index 9037c07..3ab7788 100644 --- a/assets/index-sWQGlqLg.js +++ b/assets/index-zudBzjCO.js @@ -1,585 +1,585 @@ -var p2=Object.defineProperty;var m2=(n,e,t)=>e in n?p2(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var te=(n,e,t)=>m2(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();class je{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]=po(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),kr.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=po(this,e,t);let r=[];return this.decompose(e,t,r,0),kr.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),i=new al(this),o=new al(e);for(let s=t,l=t;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(l+=i.value.length,i.done||l>=r)return!0}}iter(e=1){return new al(this,e)}iterRange(e,t=this.length){return new bx(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ax(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]?je.empty:e.length<=32?new et(e):kr.from(et.split(e,[]))}}class et extends je{constructor(e,t=g2(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let o=0;;o++){let s=this.text[o],l=i+s.length;if((t?r:l)>=e)return new x2(i,l,r,s);i=l+1,r++}}decompose(e,t,r,i){let o=e<=0&&t>=this.length?this:new et(Vp(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),l=Qa(o.text,s.text.slice(),0,o.length);if(l.length<=32)r.push(new et(l,s.length+o.length));else{let a=l.length>>1;r.push(new et(l.slice(0,a)),new et(l.slice(a)))}}else r.push(o)}replace(e,t,r){if(!(r instanceof et))return super.replace(e,t,r);[e,t]=po(this,e,t);let i=Qa(this.text,Qa(r.text,Vp(this.text,0,e)),t),o=this.length+r.length-(t-e);return i.length<=32?new et(i,o):kr.from(et.split(i,[]),o)}sliceString(e,t=this.length,r=` -`){[e,t]=po(this,e,t);let i="";for(let o=0,s=0;o<=t&&se&&s&&(i+=r),eo&&(i+=l.slice(Math.max(0,e-o),t-o)),o=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(t.push(new et(r,i)),r=[],i=-1);return i>-1&&t.push(new et(r,i)),t}}class kr extends je{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,i){for(let o=0;;o++){let s=this.children[o],l=i+s.length,a=r+s.lines-1;if((t?a:l)>=e)return s.lineInner(e,t,r,i);i=l+1,r=a+1}}decompose(e,t,r,i){for(let o=0,s=0;s<=t&&o=s){let u=i&((s<=e?1:0)|(a>=t?2:0));s>=e&&a<=t&&!u?r.push(l):l.decompose(e-s,t-s,r,u)}s=a+1}}replace(e,t,r){if([e,t]=po(this,e,t),r.lines=o&&t<=l){let a=s.replace(e-o,t-o,r),u=this.lines-s.lines+a.lines;if(a.lines>4&&a.lines>u>>6){let c=this.children.slice();return c[i]=a,new kr(c,this.length-(t-e)+r.length)}return super.replace(o,l,a)}o=l+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=` -`){[e,t]=po(this,e,t);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=l.sliceString(e-s,t-s,r)),s=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof kr))return 0;let r=0,[i,o,s,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,o+=t){if(i==s||o==l)return r;let a=this.children[i],u=e.children[o];if(a!=u)return r+a.scanIdentical(u,t);r+=a.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let d of e)r+=d.lines;if(r<32){let d=[];for(let p of e)p.flatten(d);return new et(d,t)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,l=[],a=0,u=-1,c=[];function h(d){let p;if(d.lines>o&&d instanceof kr)for(let v of d.children)h(v);else d.lines>s&&(a>s||!a)?(f(),l.push(d)):d instanceof et&&a&&(p=c[c.length-1])instanceof et&&d.lines+p.lines<=32?(a+=d.lines,u+=d.length+1,c[c.length-1]=new et(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>i&&f(),a+=d.lines,u+=d.length+1,c.push(d))}function f(){a!=0&&(l.push(c.length==1?c[0]:kr.from(c,u)),u=-1,a=c.length=0)}for(let d of e)h(d);return f(),l.length==1?l[0]:new kr(l,t)}}je.empty=new et([""],0);function g2(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Qa(n,e,t=0,r=1e9){for(let i=0,o=0,s=!0;o=t&&(a>r&&(l=l.slice(0,r-i)),i0?1:(e instanceof et?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,l=i instanceof et?i.text.length:i.children.length;if(s==(t>0?l: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((o&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(i instanceof et){let a=i.text[s+(t<0?-1:0)];if(this.offsets[r]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[s+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof et?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class bx{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new al(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:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.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!=""}}class Ax{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=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=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(je.prototype[Symbol.iterator]=function(){return this.iter()},al.prototype[Symbol.iterator]=bx.prototype[Symbol.iterator]=Ax.prototype[Symbol.iterator]=function(){return this});class x2{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function po(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}let oo="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(n=>n?parseInt(n,36):1);for(let n=1;nn)return oo[e-1]<=n;return!1}function Wp(n){return n>=127462&&n<=127487}const Kp=8205;function At(n,e,t=!0,r=!0){return(t?_x:v2)(n,e,r)}function _x(n,e,t){if(e==n.length)return e;e&&Tx(n.charCodeAt(e))&&Ex(n.charCodeAt(e-1))&&e--;let r=yt(n,e);for(e+=ar(r);e=0&&Wp(yt(n,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function v2(n,e,t){for(;e>0;){let r=_x(n,e-2,t);if(r=56320&&n<57344}function Ex(n){return n>=55296&&n<56320}function yt(n,e){let t=n.charCodeAt(e);if(!Ex(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return Tx(r)?(t-55296<<10)+(r-56320)+65536:t}function Bd(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ar(n){return n<65536?1:2}const yf=/\r\n?|\n/;var It=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(It||(It={}));class $r{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return o+(e-i);o+=l}else{if(r!=It.Simple&&u>=e&&(r==It.TrackDel&&ie||r==It.TrackBefore&&ie))return null;if(u>e||u==e&&t<0&&!l)return e==i||t<0?o:o+a;o+=a}i=u}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,t=e){for(let r=0,i=0;r=0&&i<=t&&l>=e)return it?"cover":!0;i=l}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new $r(e)}static create(e){return new $r(e)}}class at extends $r{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return vf(this,(t,r,i,o,s)=>e=e.replace(i,i+(r-t),s),!1),e}mapDesc(e,t=!1){return Sf(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,o=0;i=0){t[i]=l,t[i+1]=s;let a=i>>1;for(;r.length0&&Dn(r,t,o.text),o.forward(c),l+=c}let u=e[s++];for(;l>1].toJSON()))}return e}static of(e,t,r){let i=[],o=[],s=0,l=null;function a(c=!1){if(!c&&!i.length)return;sf||h<0||f>t)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${t})`);let p=d?typeof d=="string"?je.of(d.split(r||yf)):d:je.empty,v=p.length;if(h==f&&v==0)return;hs&&Ot(i,h-s,-1),Ot(i,f-h,v),Dn(o,i,p),s=f}}return u(e),a(!l),l}static empty(e){return new at(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;il&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)t.push(o[0],0);else{for(;r.length=0&&t<=0&&t==n[i+1]?n[i]+=e:e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function Dn(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r>1])),!(t||s==n.sections.length||n.sections[s+1]<0);)l=n.sections[s++],a=n.sections[s++];e(i,u,o,c,h),i=u,o=c}}}function Sf(n,e,t,r=!1){let i=[],o=r?[]:null,s=new dl(n),l=new dl(e);for(let a=-1;;)if(s.ins==-1&&l.ins==-1){let u=Math.min(s.len,l.len);Ot(i,u,-1),s.forward(u),l.forward(u)}else if(l.ins>=0&&(s.ins<0||a==s.i||s.off==0&&(l.len=0&&a=0){let u=0,c=s.len;for(;c;)if(l.ins==-1){let h=Math.min(c,l.len);u+=h,c-=h,l.forward(h)}else if(l.ins==0&&l.lena||s.ins>=0&&s.len>a)&&(l||r.length>u),o.forward2(a),s.forward(a)}}}}class dl{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?je.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?je.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class si{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new si(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return re.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return re.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return re.range(e.anchor,e.head)}static create(e,t,r){return new si(e,t,r)}}class re{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:re.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new re(e.ranges.map(t=>si.fromJSON(t)),e.main)}static single(e,t=e){return new re([re.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,t=0){let r=e[t];e.sort((i,o)=>i.from-o.from),t=e.indexOf(r);for(let i=1;io.head?re.range(a,l):re.range(l,a))}}return new re(e,t)}}function wx(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let jd=0;class he{constructor(e,t,r,i,o){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=jd++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new he(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:$d),!!e.static,e.enables)}of(e){return new Za([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Za(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Za(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function $d(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class Za{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=jd++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,l=this.type==2,a=!1,u=!1,c=[];for(let h of this.dependencies)h=="doc"?a=!0:h=="selection"?u=!0:((t=e[h.id])!==null&&t!==void 0?t:1)&1||c.push(e[h.id]);return{create(h){return h.values[s]=r(h),1},update(h,f){if(a&&f.docChanged||u&&(f.docChanged||f.selection)||bf(h,c)){let d=r(h);if(l?!Gp(d,h.values[s],i):!i(d,h.values[s]))return h.values[s]=d,1}return 0},reconfigure:(h,f)=>{let d,p=f.config.address[o];if(p!=null){let v=yu(f,p);if(this.dependencies.every(m=>m instanceof he?f.facet(m)===h.facet(m):m instanceof ft?f.field(m,!1)==h.field(m,!1):!0)||(l?Gp(d=r(h),v,i):i(d=r(h),v)))return h.values[s]=v,0}else d=r(h);return h.values[s]=d,1}}}}function Gp(n,e,t){if(n.length!=e.length)return!1;for(let r=0;rn[a.id]),i=t.map(a=>a.type),o=r.filter(a=>!(a&1)),s=n[e.id]>>1;function l(a){let u=[];for(let c=0;cr===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Xp).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let o=r.values[t],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[t]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}init(e){return[this,Xp.of({field:this,create:e})]}get extension(){return this}}const ni={lowest:4,low:3,default:2,high:1,highest:0};function Yo(n){return e=>new Ox(e,n)}const Li={highest:Yo(ni.highest),high:Yo(ni.high),default:Yo(ni.default),low:Yo(ni.low),lowest:Yo(ni.lowest)};class Ox{constructor(e,t){this.inner=e,this.prec=t}}class Gu{of(e){return new Af(this,e)}reconfigure(e){return Gu.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Af{constructor(e,t){this.compartment=e,this.inner=t}}class xu{constructor(e,t,r,i,o,s){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,r){let i=[],o=Object.create(null),s=new Map;for(let f of b2(e,t,s))f instanceof ft?i.push(f):(o[f.facet.id]||(o[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],u=[];for(let f of i)l[f.id]=u.length<<1,u.push(d=>f.slot(d));let c=r==null?void 0:r.config.facets;for(let f in o){let d=o[f],p=d[0].facet,v=c&&c[f]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,$d(v,d))a.push(r.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=u.length<<1,u.push(y=>m.dynamicSlot(y)));l[p.id]=u.length<<1,u.push(m=>S2(m,p,d))}}let h=u.map(f=>f(l));return new xu(e,s,h,l,a,o)}}function b2(n,e,t){let r=[[],[],[],[],[]],i=new Map;function o(s,l){let a=i.get(s);if(a!=null){if(a<=l)return;let u=r[a].indexOf(s);u>-1&&r[a].splice(u,1),s instanceof Af&&t.delete(s.compartment)}if(i.set(s,l),Array.isArray(s))for(let u of s)o(u,l);else if(s instanceof Af){if(t.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(s.compartment)||s.inner;t.set(s.compartment,u),o(u,l)}else if(s instanceof Ox)o(s.inner,s.prec);else if(s instanceof ft)r[l].push(s),s.provides&&o(s.provides,l);else if(s instanceof Za)r[l].push(s),s.facet.extensions&&o(s.facet.extensions,ni.default);else{let u=s.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(u,l)}}return o(n,ni.default),r.reduce((s,l)=>s.concat(l))}function ul(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function yu(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const Nx=he.define(),_f=he.define({combine:n=>n.some(e=>e),static:!0}),Dx=he.define({combine:n=>n.length?n[0]:void 0,static:!0}),Px=he.define(),Rx=he.define(),Lx=he.define(),kx=he.define({combine:n=>n.length?n[0]:!1});class fn{constructor(e,t){this.type=e,this.value=t}static define(){return new A2}}class A2{of(e){return new fn(this,e)}}class _2{constructor(e){this.map=e}of(e){return new Oe(this,e)}}class Oe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Oe(this.type,t)}is(e){return this.type==e}static define(e={}){return new _2(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(t);o&&r.push(o)}return r}}Oe.reconfigure=Oe.define();Oe.appendConfig=Oe.define();class ct{constructor(e,t,r,i,o,s){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&wx(r,t.newLength),o.some(l=>l.type==ct.time)||(this.annotations=o.concat(ct.time.of(Date.now())))}static create(e,t,r,i,o,s){return new ct(e,t,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ct.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ct.time=fn.define();ct.userEvent=fn.define();ct.addToHistory=fn.define();ct.remote=fn.define();function T2(n,e){let t=[];for(let r=0,i=0;;){let o,s;if(r=n[r]))o=n[r++],s=n[r++];else if(i=0;i--){let o=r[i](n);o instanceof ct?n=o:Array.isArray(o)&&o.length==1&&o[0]instanceof ct?n=o[0]:n=Fx(e,so(o),!1)}return n}function C2(n){let e=n.startState,t=e.facet(Lx),r=n;for(let i=t.length-1;i>=0;i--){let o=t[i](n);o&&Object.keys(o).length&&(r=Ix(r,Tf(e,o,n.changes.newLength),!0))}return r==n?n:ct.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const w2=[];function so(n){return n==null?w2:Array.isArray(n)?n:[n]}var Xe=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(Xe||(Xe={}));const O2=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ef;try{Ef=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function N2(n){if(Ef)return Ef.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||O2.test(t)))return!0}return!1}function D2(n){return e=>{if(!/\S/.test(e))return Xe.Space;if(N2(e))return Xe.Word;for(let t=0;t-1)return Xe.Word;return Xe.Other}}class Me{constructor(e,t,r,i,o,s){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let l=0;li.set(u,a)),t=null),i.set(l.value.compartment,l.value.extension)):l.is(Oe.reconfigure)?(t=null,r=l.value):l.is(Oe.appendConfig)&&(t=null,r=so(r).concat(l.value));let o;t?o=e.startState.values.slice():(t=xu.resolve(r,i,this),o=new Me(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,u)=>u.reconfigure(a,this),null).values);let s=e.startState.facet(_f)?e.newSelection:e.newSelection.asSingle();new Me(t,e.newDoc,s,o,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:re.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),o=[r.range],s=so(r.effects);for(let l=1;ls.spec.fromJSON(l,a)))}}return Me.create({doc:e.doc,selection:re.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=xu.resolve(e.extensions||[],new Map),r=e.doc instanceof je?e.doc:je.of((e.doc||"").split(t.staticFacet(Me.lineSeparator)||yf)),i=e.selection?e.selection instanceof re?e.selection:re.single(e.selection.anchor,e.selection.head):re.single(0);return wx(i,r.length),t.staticFacet(_f)||(i=i.asSingle()),new Me(t,r,i,t.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(Me.tabSize)}get lineBreak(){return this.facet(Me.lineSeparator)||` -`}get readOnly(){return this.facet(kx)}phrase(e,...t){for(let r of this.facet(Me.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>t.length?r:t[o-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let o of this.facet(Nx))for(let s of o(this,t,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return D2(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,l=e-r;for(;s>0;){let a=At(t,s,!1);if(o(t.slice(a,s))!=Xe.Word)break;s=a}for(;ln.length?n[0]:4});Me.lineSeparator=Dx;Me.readOnly=kx;Me.phrases=he.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});Me.languageData=Nx;Me.changeFilter=Px;Me.transactionFilter=Rx;Me.transactionExtender=Lx;Gu.reconfigure=Oe.define();function vr(n,e,t={}){let r={};for(let i of n)for(let o of Object.keys(i)){let s=i[o],l=r[o];if(l===void 0)r[o]=s;else if(!(l===s||s===void 0))if(Object.hasOwnProperty.call(t,o))r[o]=t[o](l,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class fi{eq(e){return this==e}range(e,t=e){return Cf.create(e,t,this)}}fi.prototype.startSide=fi.prototype.endSide=0;fi.prototype.point=!1;fi.prototype.mapMode=It.TrackDel;let Cf=class Mx{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new Mx(e,t,r)}};function wf(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}let P2=class Bx{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let o=r?this.to:this.from;for(let s=i,l=o.length;;){if(s==l)return s;let a=s+l>>1,u=o[a]-e||(r?this.value[a].endSide:this.value[a].startSide)-t;if(a==s)return u>=0?s:l;u>=0?l=a:s=a+1}}between(e,t,r,i){for(let o=this.findIndex(t,-1e9,!0),s=this.findIndex(r,1e9,!1,o);od||f==d&&u.startSide>0&&u.endSide<=0)continue;(d-f||u.endSide-u.startSide)<0||(s<0&&(s=f),u.point&&(l=Math.max(l,d-f)),r.push(u),i.push(f-s),o.push(d-s))}return{mapped:r.length?new Bx(i,o,r,l):null,pos:s}}};class Re{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new Re(e,t,r,i)}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:i=0,filterTo:o=this.length}=e,s=e.filter;if(t.length==0&&!s)return this;if(r&&(t=t.slice().sort(wf)),this.isEmpty)return t.length?Re.of(t):this;let l=new jx(this,null,-1).goto(0),a=0,u=[],c=new Mn;for(;l.value||a=0){let h=t[a++];c.addInner(h.from,h.to,h.value)||u.push(h)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||ol.to||o=o&&e<=o+s.length&&s.between(o,e-o,t-o,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return pl.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return pl.from(e).goto(t)}static compare(e,t,r,i,o=-1){let s=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=o),l=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=o),a=Yp(s,l,r),u=new Jo(s,a,o),c=new Jo(l,a,o);r.iterGaps((h,f,d)=>Jp(u,h,c,f,d,i)),r.empty&&r.length==0&&Jp(u,0,c,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=999999999);let o=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),s=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let l=Yp(o,s),a=new Jo(o,l,0).goto(r),u=new Jo(s,l,0).goto(r);for(;;){if(a.to!=u.to||!Of(a.active,u.active)||a.point&&(!u.point||!a.point.eq(u.point)))return!1;if(a.to>i)return!0;a.next(),u.next()}}static spans(e,t,r,i,o=-1){let s=new Jo(e,null,o).goto(t),l=t,a=s.openStart;for(;;){let u=Math.min(s.to,r);if(s.point){let c=s.activeForPoint(s.to),h=s.pointFroml&&(i.span(l,u,s.active,a),a=s.openEnd(u));if(s.to>r)return a+(s.point&&s.to>r?1:0);l=s.to,s.next()}}static of(e,t=!1){let r=new Mn;for(let i of e instanceof Cf?[e]:t?R2(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Re.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Re.empty;i=i.nextLayer)t=new Re(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Re.empty=new Re([],[],null,-1);function R2(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(wf);e=r}return n}Re.empty.nextLayer=Re.empty;class Mn{finishChunk(e){this.chunks.push(new P2(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new Mn)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(Re.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Re.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Yp(n,e,t){let r=new Map;for(let o of n)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new jx(s,t,r,o));return i.length==1?i[0]:new pl(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)sh(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)sh(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),sh(this.heap,0)}}}function sh(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class Jo{constructor(e,t,r){this.minPoint=r,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=pl.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ba(this.active,e),ba(this.activeTo,e),ba(this.activeRank,e),this.minActive=Qp(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:o}=this.cursor;for(;t0;)t++;Aa(this.active,t,r),Aa(this.activeTo,t,i),Aa(this.activeRank,t,o),e&&Aa(e,t,this.cursor.from),this.minActive=Qp(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&ba(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function Jp(n,e,t,r,i,o){n.goto(e),t.goto(r);let s=r+i,l=r,a=r-e;for(;;){let u=n.to+a-t.to||n.endSide-t.endSide,c=u<0?n.to+a:t.to,h=Math.min(c,s);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&Of(n.activeForPoint(n.to),t.activeForPoint(t.to))||o.comparePoint(l,h,n.point,t.point):h>l&&!Of(n.active,t.active)&&o.compareRange(l,h,n.active,t.active),c>s)break;l=c,u<=0&&n.next(),u>=0&&t.next()}}function Of(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;r--)n[r+1]=n[r];n[e]=t}function Qp(n,e){let t=-1,r=1e9;for(let i=0;i=e)return i;if(i==n.length)break;o+=n.charCodeAt(i)==9?t-o%t:1,i=At(n,i)}return r===!0?-1:n.length}const Df="ͼ",Zp=typeof Symbol>"u"?"__"+Df:Symbol.for(Df),Pf=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),e0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Bn{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,l,a,u){let c=[],h=/^@(\w+)\b/.exec(s[0]),f=h&&h[1]=="keyframes";if(h&&l==null)return a.push(s[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))o(d.split(/,\s*/).map(v=>s.map(m=>v.replace(/&/,m))).reduce((v,m)=>v.concat(m)),p,a);else if(p&&typeof p=="object"){if(!h)throw new RangeError("The value of a property ("+d+") should be a primitive value.");o(i(d),p,c,f)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,v=>"-"+v.toLowerCase())+": "+p+";")}(c.length||f)&&a.push((r&&!h&&!u?s.map(r):s).join(", ")+" {"+c.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=e0[Zp]||1;return e0[Zp]=e+1,Df+e.toString(36)}static mount(e,t,r){let i=e[Pf],o=r&&r.nonce;i?o&&i.setNonce(o):i=new L2(e,o),i.mount(Array.isArray(t)?t:[t],e)}}let t0=new Map;class L2{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=t0.get(r);if(o)return e[Pf]=o;this.sheet=new i.CSSStyleSheet,t0.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Pf]=this}mount(e,t){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(a,1),o--,a=-1),a==-1){if(this.modules.splice(o++,0,l),r)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},k2=typeof navigator<"u"&&/Mac/.test(navigator.platform),I2=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var vt=0;vt<10;vt++)jn[48+vt]=jn[96+vt]=String(vt);for(var vt=1;vt<=24;vt++)jn[vt+111]="F"+vt;for(var vt=65;vt<=90;vt++)jn[vt]=String.fromCharCode(vt+32),ml[vt]=String.fromCharCode(vt);for(var lh in jn)ml.hasOwnProperty(lh)||(ml[lh]=jn[lh]);function F2(n){var e=k2&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||I2&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ml:jn)[n.keyCode]||n.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}function gl(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Rf(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function eu(n,e){if(!e.anchorNode)return!1;try{return Rf(n,e.anchorNode)}catch{return!1}}function xl(n){return n.nodeType==3?pi(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function cl(n,e,t,r){return t?r0(n,e,t,r,-1)||r0(n,e,t,r,1):!1}function di(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function vu(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function r0(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Hr(n))){if(n.nodeName=="DIV")return!1;let o=n.parentNode;if(!o||o.nodeType!=1)return!1;e=di(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?Hr(n):0}else return!1}}function Hr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Xu(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function M2(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function $x(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function B2(n,e,t,r,i,o,s,l){let a=n.ownerDocument,u=a.defaultView||window;for(let c=n,h=!1;c&&!h;)if(c.nodeType==1){let f,d=c==a.body,p=1,v=1;if(d)f=M2(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let g=c.getBoundingClientRect();({scaleX:p,scaleY:v}=$x(c,g)),f={left:g.left,right:g.left+c.clientWidth*p,top:g.top,bottom:g.top+c.clientHeight*v}}let m=0,y=0;if(i=="nearest")e.top0&&e.bottom>f.bottom+y&&(y=e.bottom-f.bottom+y+s)):e.bottom>f.bottom&&(y=e.bottom-f.bottom+s,t<0&&e.top-y0&&e.right>f.right+m&&(m=e.right-f.right+m+o)):e.right>f.right&&(m=e.right-f.right+o,t<0&&e.lefti.clientHeight&&(r=i),!t&&i.scrollWidth>i.clientWidth&&(t=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:t,y:r}}class $2{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?Hr(t):0),r,Math.min(e.focusOffset,r?Hr(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}let Ki=null;function Hx(n){if(n.setActive)return n.setActive();if(Ki)return n.focus(Ki);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Ki==null?{get preventScroll(){return Ki={preventScroll:!0},!0}}:void 0),!Ki){Ki=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}function Ux(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=Hr(t)}else if(t.parentNode&&!vu(t))r=di(t),t=t.parentNode;else return null}}function Vx(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&rt)return h.domBoundsAround(e,t,u);if(f>=e&&i==-1&&(i=a,o=u),u>t&&h.dom.parentNode==this.dom){s=a,l=c;break}c=f,u=f+h.breakAfter}return{from:o,to:l<0?r+this.length:l,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=Hd){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Kx(n,e,t,r,i,o,s,l,a){let{children:u}=n,c=u.length?u[e]:null,h=o.length?o[o.length-1]:null,f=h?h.breakAfter:s;if(!(e==r&&c&&!s&&!f&&o.length<2&&c.merge(t,i,o.length?h:null,t==0,l,a))){if(r0&&(!s&&o.length&&c.merge(t,c.length,o[0],!1,l,0)?c.breakAfter=o.shift().breakAfter:(t2);var pe={mac:l0||/Mac/.test(qt.platform),windows:/Win/.test(qt.platform),linux:/Linux|X11/.test(qt.platform),ie:Yu,ie_version:Xx?Lf.documentMode||6:If?+If[1]:kf?+kf[1]:0,gecko:o0,gecko_version:o0?+(/Firefox\/(\d+)/.exec(qt.userAgent)||[0,0])[1]:0,chrome:!!ah,chrome_version:ah?+ah[1]:0,ios:l0,android:/Android\b/.test(qt.userAgent),webkit:s0,safari:Yx,webkit_version:s0?+(/\bAppleWebKit\/(\d+)/.exec(qt.userAgent)||[0,0])[1]:0,tabSize:Lf.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const q2=256;class gr extends Ue{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof gr)||this.length-(t-e)+r.length>q2||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new gr(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Nt(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return U2(this.dom,e,t)}}class ln extends Ue{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let i of t)i.setParent(this)}setAttrs(e){if(zx(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,i,o,s){return r&&(!(r instanceof ln&&r.mark.eq(this.mark))||e&&o<=0||te&&t.push(r=e&&(i=o),r=a,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new ln(this.mark,t,s)}domAtPos(e){return Jx(this,e)}coordsAt(e,t){return Zx(this,e,t)}}function U2(n,e,t){let r=n.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&t<0||e==r&&t>=0?pe.chrome||pe.gecko||(e?(i--,s=1):o=0)?0:l.length-1];return pe.safari&&!s&&a.width==0&&(a=Array.prototype.find.call(l,u=>u.width)||a),s?Xu(a,s<0):a||null}class Pn extends Ue{static create(e,t,r){return new Pn(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=Pn.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,i,o,s){return r&&(!(r instanceof Pn)||!this.widget.compare(r.widget)||e>0&&o<=0||t0)?Nt.before(this.dom):Nt.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let l=s?i.length-1:0;o=i[l],!(e>0?l==0:l==i.length-1||o.top0?Nt.before(this.dom):Nt.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return je.empty}get isHidden(){return!0}}gr.prototype.children=Pn.prototype.children=mo.prototype.children=Hd;function Jx(n,e){let t=n.dom,{children:r}=n,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==t)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof ln&&i.length&&(r=i[i.length-1])instanceof ln&&r.mark.eq(e.mark)?Qx(r,e.children[0],t-1):(i.push(e),e.setParent(n)),n.length+=e.length}function Zx(n,e,t){let r=null,i=-1,o=null,s=-1;function l(u,c){for(let h=0,f=0;h=c&&(d.children.length?l(d,c-f):(!o||o.isHidden&&t>0)&&(p>c||f==p&&d.getSide()>0)?(o=d,s=c-f):(f-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let o of r)if(o!=t&&(i.indexOf(o)==-1||n[o]!==e[o]))return!1;return!0}function Mf(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function W2(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new $n(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=ey(e,t);r=(o?t?-3e8:-1:5e8)-1,i=(s?t?2e8:1:-6e8)+1}return new $n(e,r,i,t,e.widget||null,!0)}static line(e){return new Fl(e)}static set(e,t=!1){return Re.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ae.none=Re.empty;class Il extends Ae{constructor(e){let{start:t,end:r}=ey(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof Il&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Su(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Il.prototype.point=!1;class Fl extends Ae{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Fl&&this.spec.class==e.spec.class&&Su(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Fl.prototype.mapMode=It.TrackBefore;Fl.prototype.point=!0;class $n extends Ae{constructor(e,t,r,i,o,s){super(t,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?t<=0?It.TrackBefore:It.TrackAfter:It.TrackDel}get type(){return this.startSide!=this.endSide?Mt.WidgetRange:this.startSide<=0?Mt.WidgetBefore:Mt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof $n&&K2(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}$n.prototype.point=!0;function ey(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function K2(n,e){return n==e||!!(n&&e&&n.compare(e))}function Bf(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class ot extends Ue{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,r,i,o,s){if(r){if(!(r instanceof ot))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),Gx(this,e,t,r?r.children.slice():[],o,s),!0}split(e){let t=new ot;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:r,off:i}=this.childPos(e);i&&(t.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Su(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Qx(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=Ff(t,this.attrs||{})),r&&(this.attrs=Ff({class:r},this.attrs||{}))}domAtPos(e){return Jx(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&(zx(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Mf(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&Ue.get(i)instanceof ln;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Ue.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!pe.ios||!this.children.some(o=>o instanceof gr))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof gr)||/[^ -~]/.test(r.text))return null;let i=xl(r.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=Zx(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=t){if(o instanceof ot)return o;if(s>t)break}i=s+o.breakAfter}return null}}class nn extends Ue{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,i,o,s){return r&&(!(r instanceof nn)||!this.widget.compare(r.widget)||e>0&&o<=0||t0}}class jf extends Un{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class hl{constructor(e,t,r,i){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof nn&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ot),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(_a(new mo(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof nn)&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(_a(new gr(this.text.slice(this.textOff,this.textOff+i)),t),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,t,r,i){this.buildText(t-e,r,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof $n){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(r instanceof $n)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new nn(r.widget||go.block,l,r));else{let a=Pn.create(r.widget||go.inline,l,l?0:r.startSide),u=this.atCursorPos&&!a.isEditable&&o<=i.length&&(e0),c=!a.isEditable&&(ei.length||r.startSide<=0),h=this.getLine();this.pendingBuffer==2&&!u&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),u&&(h.append(_a(new mo(1),i),o),o=i.length+Math.max(0,o-i.length)),h.append(_a(a,i),o),this.atCursorPos=c,this.pendingBuffer=c?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=o)}static build(e,t,r,i,o){let s=new hl(e,t,r,o);return s.openEnd=Re.spans(i,t,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function _a(n,e){for(let t of e)n=new ln(t,[n],n.length);return n}class go extends Un{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}go.inline=new go("span");go.block=new go("div");var Ge=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Ge||(Ge={}));const mi=Ge.LTR,zd=Ge.RTL;function ty(n){let e=[];for(let t=0;t=t){if(l.level==r)return s;(o<0||(i!=0?i<0?l.fromt:e[o].level>l.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function ny(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;v-=3)if(Or[v+1]==-d){let m=Or[v+2],y=m&2?i:m&4?m&1?o:i:0;y&&(qe[h]=qe[Or[v]]=y),l=v;break}}else{if(Or.length==189)break;Or[l++]=h,Or[l++]=f,Or[l++]=a}else if((p=qe[h])==2||p==1){let v=p==i;a=v?0:1;for(let m=l-3;m>=0;m-=3){let y=Or[m+2];if(y&2)break;if(v)Or[m+2]|=2;else{if(y&4)break;Or[m+2]|=4}}}}}function Z2(n,e,t,r){for(let i=0,o=r;i<=t.length;i++){let s=i?t[i-1].to:n,l=ia;)p==m&&(p=t[--v].from,m=v?t[v-1].to:n),qe[--p]=d;a=c}else o=u,a++}}}function Hf(n,e,t,r,i,o,s){let l=r%2?2:1;if(r%2==i%2)for(let a=e,u=0;aa&&s.push(new Rn(a,v.from,d));let m=v.direction==mi!=!(d%2);zf(n,m?r+1:r,i,v.inner,v.from,v.to,s),a=v.to}p=v.to}else{if(p==t||(c?qe[p]!=l:qe[p]==l))break;p++}f?Hf(n,a,p,r+1,i,f,s):ae;){let c=!0,h=!1;if(!u||a>o[u-1].to){let v=qe[a-1];v!=l&&(c=!1,h=v==16)}let f=!c&&l==1?[]:null,d=c?r:r+1,p=a;e:for(;;)if(u&&p==o[u-1].to){if(h)break e;let v=o[--u];if(!c)for(let m=v.from,y=u;;){if(m==e)break e;if(y&&o[y-1].to==m)m=o[--y].from;else{if(qe[m-1]==l)break e;break}}if(f)f.push(v);else{v.toqe.length;)qe[qe.length]=256;let r=[],i=e==mi?0:1;return zf(n,i,i,t,0,n.length,r),r}function iy(n){return[new Rn(0,n,0)]}let oy="";function tb(n,e,t,r,i){var o;let s=r.head-n.from,l=Rn.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),a=e[l],u=a.side(i,t);if(s==u){let f=l+=i?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],s=a.side(!i,t),u=a.side(i,t)}let c=At(n.text,s,a.forward(i,t));(ca.to)&&(c=u),oy=n.text.slice(Math.min(s,c),Math.max(s,c));let h=l==(i?e.length-1:0)?null:e[l+(i?1:-1)];return h&&c==u&&h.level+(i?0:1)n.some(e=>e)}),dy=he.define({combine:n=>n.some(e=>e)}),py=he.define();class ao{constructor(e,t="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new ao(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ao(re.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Ta=Oe.define({map:(n,e)=>n.map(e)}),my=Oe.define();function Ft(n,e,t){let r=n.facet(uy);r.length?r[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const wn=he.define({combine:n=>n.length?n[0]:!0});let nb=0;const Qs=he.define();class nt{constructor(e,t,r,i,o){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=t||{};return new nt(nb++,e,r,i,l=>{let a=[Qs.of(l)];return s&&a.push(yl.of(u=>{let c=u.plugin(l);return c?s(c):Ae.none})),o&&a.push(o(l)),a})}static fromClass(e,t){return nt.define(r=>new e(r),t)}}class uh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(Ft(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ft(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){Ft(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const gy=he.define(),Vd=he.define(),yl=he.define(),xy=he.define(),Wd=he.define(),yy=he.define();function u0(n,e){let t=n.state.facet(yy);if(!t.length)return t;let r=t.map(o=>o instanceof Function?o(n):o),i=[];return Re.spans(r,e.from,e.to,{point(){},span(o,s,l,a){let u=o-e.from,c=s-e.from,h=i;for(let f=l.length-1;f>=0;f--,a--){let d=l[f].spec.bidiIsolate,p;if(d==null&&(d=rb(e.text,u,c)),a>0&&h.length&&(p=h[h.length-1]).to==u&&p.direction==d)p.to=c,h=p.inner;else{let v={from:u,to:c,direction:d,inner:[]};h.push(v),h=v.inner}}}}),i}const vy=he.define();function Sy(n){let e=0,t=0,r=0,i=0;for(let o of n.state.facet(vy)){let s=o(n);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(t=Math.max(t,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:t,top:r,bottom:i}}const Zs=he.define();class cr{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new cr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toAc)break;o+=2}if(!a)return r;new cr(a.fromA,a.toA,a.fromB,a.toB).addToSet(r),s=a.toA,l=a.toB}}}class bu{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=at.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,l,a)=>i.push(new cr(o,s,l,a))),this.changedRanges=i}static create(e,t,r){return new bu(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class c0 extends Ue{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ae.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ot],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new cr(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!cb(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?ob(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:u,to:c}=this.hasComposition;r=new cr(u,c,e.changes.mapPos(u,-1),e.changes.mapPos(c,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(pe.ie||pe.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,l=this.updateDeco(),a=ab(s,l,e.changes);return r=cr.extendWithRanges(r,a),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=pe.chrome||pe.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!l)break;let{fromA:a,toA:u,fromB:c,toB:h}=l,f,d,p,v;if(r&&r.range.fromBc){let S=hl.build(this.view.state.doc,c,r.range.fromB,this.decorations,this.dynamicDecorationMap),_=hl.build(this.view.state.doc,r.range.toB,h,this.decorations,this.dynamicDecorationMap);d=S.breakAtStart,p=S.openStart,v=_.openEnd;let b=this.compositionView(r);_.breakAtStart?b.breakAfter=1:_.content.length&&b.merge(b.length,b.length,_.content[0],!1,_.openStart,0)&&(b.breakAfter=_.content[0].breakAfter,_.content.shift()),S.content.length&&b.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),f=S.content.concat(b).concat(_.content)}else({content:f,breakAtStart:d,openStart:p,openEnd:v}=hl.build(this.view.state.doc,c,h,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=o.findPos(u,1),{i:g,off:x}=o.findPos(a,-1);Kx(this,g,x,m,y,f,d,p,v)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(my)&&(this.editContextFormatting=r.value)}compositionView(e){let t=new gr(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new ln(i,[t],t.length);let r=new ot;return r.append(t,0),r}fixCompositionDOM(e){let t=(o,s)=>{s.flags|=8|(s.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(s);let l=Ue.get(o);l&&l!=s&&(l.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];t(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],t(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&eu(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||t||o))return;let s=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),u=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(pe.gecko&&l.empty&&!this.hasComposition&&ib(a)){let h=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(h,a.node.childNodes[a.offset]||null)),a=u=new Nt(h,0),s=!0}let c=this.view.observer.selectionRange;(s||!c.focusNode||(!cl(a.node,a.offset,c.anchorNode,c.anchorOffset)||!cl(u.node,u.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,l))&&(this.view.observer.ignore(()=>{pe.android&&pe.chrome&&this.dom.contains(c.focusNode)&&ub(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=gl(this.view.root);if(h)if(l.empty){if(pe.gecko){let f=sb(a.node,a.offset);if(f&&f!=3){let d=(f==1?Ux:Vx)(a.node,a.offset);d&&(a=new Nt(d.node,d.offset))}}h.collapse(a.node,a.offset),l.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=l.bidiLevel)}else if(h.extend){h.collapse(a.node,a.offset);try{h.extend(u.node,u.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,u]=[u,a]),f.setEnd(u.node,u.offset),f.setStart(a.node,a.offset),h.removeAllRanges(),h.addRange(f)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(a,u)),this.impreciseAnchor=a.precise?null:new Nt(c.anchorNode,c.anchorOffset),this.impreciseHead=u.precise?null:new Nt(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&cl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=gl(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let s=ot.find(this,t.head);if(!s)return;let l=s.posAtStart;if(t.head==l||t.head==l+s.length)return;let a=this.coordsAt(t.head,-1),u=this.coordsAt(t.head,1);if(!a||!u||a.bottom>u.top)return;let c=this.domAtPos(t.head+t.assoc);r.collapse(c.node,c.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&r.collapse(i,o)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let i=e.offset;!r&&i=0;i--){let o=Ue.get(t.childNodes[i]);o instanceof ot&&(r=o.domAtPos(o.length))}return r?new Nt(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=Ue.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t=0;s--){let l=this.children[s],a=o-l.breakAfter,u=a-l.length;if(ae||l.covers(1))&&(!r||l instanceof ot&&!(r instanceof ot&&t>=0)))r=l,i=u;else if(r&&u==e&&a==e&&l instanceof nn&&Math.abs(t)<2){if(l.deco.startSide<0)break;s&&(r=null)}o=u}return r?r.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),i=this.children[t];if(!(i instanceof ot))return null;for(;i.children.length;){let{i:l,off:a}=i.childPos(r,1);for(;;l++){if(l==i.children.length)return null;if((i=i.children[l]).length)break}r=a}if(!(i instanceof gr))return null;let o=At(i.text,r);if(o==r)return null;let s=pi(i.dom,r,o).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Ge.LTR;for(let u=0,c=0;ci)break;if(u>=r){let d=h.dom.getBoundingClientRect();if(t.push(d.height),s){let p=h.dom.lastChild,v=p?xl(p):[];if(v.length){let m=v[v.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=o,this.minWidthFrom=u,this.minWidthTo=f)}}}u=f+h.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Ge.RTL:Ge.LTR}measureTextSize(){for(let o of this.children)if(o instanceof ot){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),t,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=xl(e.firstChild)[0];t=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Wx(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let o=i==t.viewports.length?null:t.viewports[i],s=o?o.from-1:this.length;if(s>r){let l=(t.lineBlockAt(s).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Ae.replace({widget:new jf(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return Ae.set(e)}updateDeco(){let e=1,t=this.view.state.facet(yl).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(xy).map((o,s)=>{let l=typeof o=="function";return l&&(r=!0),l?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push(Re.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=Sy(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;B2(this.view.scrollDOM,s,t.head{re.from&&(t=!0)}),t}function hb(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),o=e-i.from;if(i.length==0)return re.cursor(e);o==0?t=1:o==i.length&&(t=-1);let s=o,l=o;t<0?s=At(i.text,o,!1):l=At(i.text,o);let a=r(i.text.slice(s,l));for(;s>0;){let u=At(i.text,s,!1);if(r(i.text.slice(u,s))!=a)break;s=u}for(;ln?e.left-n:Math.max(0,n-e.right)}function db(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function ch(n,e){return n.tope.top+1}function h0(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Uf(n,e,t){let r,i,o,s,l=!1,a,u,c,h;for(let p=n.firstChild;p;p=p.nextSibling){let v=xl(p);for(let m=0;mx||s==x&&o>g){r=p,i=y,o=g,s=x;let S=x?t0?m0)}g==0?t>y.bottom&&(!c||c.bottomy.top)&&(u=p,h=y):c&&ch(c,y)?c=f0(c,y.bottom):h&&ch(h,y)&&(h=h0(h,y.top))}}if(c&&c.bottom>=t?(r=a,i=c):h&&h.top<=t&&(r=u,i=h),!r)return{node:n,offset:0};let f=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return d0(r,f,t);if(l&&r.contentEditable!="false")return Uf(r,f,t);let d=Array.prototype.indexOf.call(n.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:n,offset:d}}function d0(n,e,t){let r=n.nodeValue.length,i=-1,o=1e9,s=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&h=(c.left+c.right)/2,d=f;if((pe.chrome||pe.gecko)&&pi(n,l).getBoundingClientRect().left==c.right&&(d=!f),h<=0)return{node:n,offset:l+(d?1:0)};i=l+(d?1:0),o=h}}}return{node:n,offset:i>-1?i:s>0?n.nodeValue.length:0}}function Ay(n,e,t,r=-1){var i,o;let s=n.contentDOM.getBoundingClientRect(),l=s.top+n.viewState.paddingTop,a,{docHeight:u}=n.viewState,{x:c,y:h}=e,f=h-l;if(f<0)return 0;if(f>u)return n.state.doc.length;for(let S=n.viewState.heightOracle.textHeight/2,_=!1;a=n.elementAtHeight(f),a.type!=Mt.Text;)for(;f=r>0?a.bottom+S:a.top-S,!(f>=0&&f<=u);){if(_)return t?null:0;_=!0,r=-r}h=l+f;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:p0(n,s,a,c,h);let p=n.dom.ownerDocument,v=n.root.elementFromPoint?n.root:p,m=v.elementFromPoint(c,h);m&&!n.contentDOM.contains(m)&&(m=null),m||(c=Math.max(s.left+1,Math.min(s.right-1,c)),m=v.elementFromPoint(c,h),m&&!n.contentDOM.contains(m)&&(m=null));let y,g=-1;if(m&&((i=n.docView.nearest(m))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(c,h);S&&({offsetNode:y,offset:g}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(c,h);S&&({startContainer:y,startOffset:g}=S,(!n.contentDOM.contains(y)||pe.safari&&pb(y,g,c)||pe.chrome&&mb(y,g,c))&&(y=void 0))}y&&(g=Math.min(Hr(y),g))}if(!y||!n.docView.dom.contains(y)){let S=ot.find(n.docView,d);if(!S)return f>a.top+a.height/2?a.to:a.from;({node:y,offset:g}=Uf(S.dom,c,h))}let x=n.docView.nearest(y);if(!x)return null;if(x.isWidget&&((o=x.dom)===null||o===void 0?void 0:o.nodeType)==1){let S=x.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((i-t.top-(n.defaultLineHeight-l)*.5)/l);o+=a*n.viewState.heightOracle.lineLength}let s=n.state.sliceDoc(t.from,t.to);return t.from+Nf(s,o,n.state.tabSize)}function pb(n,e,t){let r;if(n.nodeType!=3||e!=(r=n.nodeValue.length))return!1;for(let i=n.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return pi(n,r-1,r).getBoundingClientRect().left>t}function mb(n,e,t){if(e!=0)return!1;for(let i=n;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=n.nodeType==1?n.getBoundingClientRect():pi(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function Vf(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let r of t.type)if(r.to>e||r.to==e&&(r.to==t.to||r.type==Mt.Text))return r}return t}function gb(n,e,t,r){let i=Vf(n,e.head),o=!r||i.type!=Mt.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=n.dom.getBoundingClientRect(),l=n.textDirectionAt(i.from),a=n.posAtCoords({x:t==(l==Ge.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(a!=null)return re.cursor(a,t?-1:1)}return re.cursor(t?i.to:i.from,t?-1:1)}function m0(n,e,t,r){let i=n.state.doc.lineAt(e.head),o=n.bidiSpans(i),s=n.textDirectionAt(i.from);for(let l=e,a=null;;){let u=tb(i,o,s,l,t),c=oy;if(!u){if(i.number==(t?n.state.doc.lines:1))return l;c=` -`,i=n.state.doc.line(i.number+(t?1:-1)),o=n.bidiSpans(i),u=n.visualLineSide(i,!t)}if(a){if(!a(c))return l}else{if(!r)return u;a=r(c)}l=u}}function xb(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return o=>{let s=r(o);return i==Xe.Space&&(i=s),i==s}}function yb(n,e,t,r){let i=e.head,o=t?1:-1;if(i==(t?n.state.doc.length:0))return re.cursor(i,e.assoc);let s=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),u=n.coordsAtPos(i,e.assoc||-1),c=n.documentTop;if(u)s==null&&(s=u.left-a.left),l=o<0?u.top:u.bottom;else{let d=n.viewState.lineBlockAt(i);s==null&&(s=Math.min(a.right-a.left,n.defaultCharacterWidth*(i-d.from))),l=(o<0?d.top:d.bottom)+c}let h=a.left+s,f=r??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(f+d)*o,v=Ay(n,{x:h,y:p},!1,o);if(pa.bottom||(o<0?vi)){let m=n.docView.coordsForChar(v),y=!m||p{if(e>o&&ei(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:re.cursor(r,ro)&&this.lineBreak(),i=s}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,l;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(l=i.exec(t))&&(o=l.index,s=l[0].length),this.append(t.slice(r,o<0?t.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let t=Ue.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Sb(e,r.node,r.offset)?t:0))}}function Sb(n,e,t){for(;;){if(!e||t-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let l=o||s?[]:Tb(e),a=new vb(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Eb(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=o&&o.node==l.focusNode&&o.offset==l.focusOffset||!Rf(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),u=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!Rf(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),c=e.viewport;if((pe.ios||pe.chrome)&&e.state.selection.main.empty&&a!=u&&(c.from>0||c.toDate.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:l}=e.bounds,a=i.from,u=null;(o===8||pe.android&&e.text.length=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:(pe.mac||pe.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=re.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:je.of([" "])}):pe.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==` - `&&n.lineWrapping&&(r&&(r=re.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:je.of([" "])}),t)return Kd(n,t,r,o);if(r&&!r.main.eq(i)){let s=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(s=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:s,userEvent:l}),!0}else return!1}function Kd(n,e,t,r=-1){if(pe.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(pe.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&lo(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&lo(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&lo(n.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let s,l=()=>s||(s=Ab(n,e,t));return n.state.facet(cy).some(a=>a(n,e.from,e.to,o,l))||n.dispatch(l()),!0}function Ab(n,e,t){let r,i=n.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=i.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(i.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let u=n.state.sliceDoc(e.from,e.to),c,h=t&&by(n,t.main.head);if(h){let p=e.insert.length-(e.to-e.from);c={from:h.from,to:h.to-p}}else c=n.state.doc.lineAt(o.head);let f=o.to-e.to,d=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:l,range:a||p.map(l)};let v=p.to-f,m=v-u.length;if(p.to-p.from!=d||n.state.sliceDoc(m,v)!=u||p.to>=c.from&&p.from<=c.to)return{range:p};let y=i.changes({from:m,to:v,insert:e.insert}),g=p.to-o.to;return{changes:y,range:a?re.range(Math.max(0,a.anchor+g),Math.max(0,a.head+g)):p.map(y)}})}else r={changes:l,selection:a&&i.selection.replaceRange(a)}}let s="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,s+=".compose",n.inputState.compositionFirstChange&&(s+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function _b(n,e,t,r){let i=Math.min(n.length,e.length),o=0;for(;o0&&l>0&&n.charCodeAt(s-1)==e.charCodeAt(l-1);)s--,l--;if(r=="end"){let a=Math.max(0,o-Math.min(s,l));t-=s+a-o}if(s=s?o-t:0;o-=a,l=o+(l-s),s=o}else if(l=l?o-t:0;o-=a,s=o+(s-l),l=o}return{from:o,toA:s,toB:l}}function Tb(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}=n.observer.selectionRange;return t&&(e.push(new g0(t,r)),(i!=t||o!=r)&&e.push(new g0(i,o))),e}function Eb(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?re.single(t+e,r+e):null}class Cb{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,pe.safari&&e.contentDOM.addEventListener("input",()=>null),pe.gecko&&zb(e.contentDOM.ownerDocument)}handleEvent(e){!kb(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=wb(e),r=this.handlers,i=this.view.contentDOM;for(let o in t)if(o!="scroll"){let s=!t[o].handlers.length,l=r[o];l&&s!=!l.handlers.length&&(i.removeEventListener(o,this.handleEvent),l=null),l||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!t[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Ey.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),pe.android&&pe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return pe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Ty.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Ob.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:pe.safari&&!pe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function x0(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){Ft(t.state,i)}}}function wb(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&t(o).handlers.push(x0(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&t(o).observers.push(x0(r.value,s))}}for(let r in xr)t(r).handlers.push(xr[r]);for(let r in dr)t(r).observers.push(dr[r]);return e}const Ty=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ob="dthko",Ey=[16,17,18,20,91,92,224,225],Ea=6;function Ca(n){return Math.max(0,n)*.7+8}function Nb(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class Db{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=j2(e.contentDOM),this.atoms=e.state.facet(Wd).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Me.allowMultipleSelections)&&Pb(e,t),this.dragging=Lb(e,t)&&Oy(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Nb(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,i=0,o=0,s=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Sy(this.view);e.clientX-a.left<=i+Ea?t=-Ca(i-e.clientX):e.clientX+a.right>=s-Ea&&(t=Ca(e.clientX-s)),e.clientY-a.top<=o+Ea?r=-Ca(o-e.clientY):e.clientY+a.bottom>=l-Ea&&(r=Ca(e.clientY-l)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let r=0;rt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Pb(n,e){let t=n.state.facet(sy);return t.length?t[0](e):pe.mac?e.metaKey:e.ctrlKey}function Rb(n,e){let t=n.state.facet(ly);return t.length?t[0](e):pe.mac?!e.altKey:!e.ctrlKey}function Lb(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=gl(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function kb(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=Ue.get(t))&&r.ignoreEvent(e))return!1;return!0}const xr=Object.create(null),dr=Object.create(null),Cy=pe.ie&&pe.ie_version<15||pe.ios&&pe.webkit_version<604;function Ib(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),wy(n,t.value)},50)}function Ju(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function wy(n,e){e=Ju(n.state,qd,e);let{state:t}=n,r,i=1,o=t.toText(e),s=o.lines==t.selection.ranges.length;if(Wf!=null&&t.selection.ranges.every(a=>a.empty)&&Wf==o.toString()){let a=-1;r=t.changeByRange(u=>{let c=t.doc.lineAt(u.from);if(c.from==a)return{range:u};a=c.from;let h=t.toText((s?o.line(i++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:h},range:re.cursor(u.from+h.length)}})}else s?r=t.changeByRange(a=>{let u=o.line(i++);return{changes:{from:a.from,to:a.to,insert:u.text},range:re.cursor(a.from+u.length)}}):r=t.replaceSelection(o);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}dr.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};xr.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);dr.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};dr.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};xr.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(ay))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=Bb(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new Db(n,e,t,r)),r&&n.observer.ignore(()=>{Hx(n.contentDOM);let o=n.root.activeElement;o&&!o.contains(n.contentDOM)&&o.blur()});let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function y0(n,e,t,r){if(r==1)return re.cursor(e,t);if(r==2)return hb(n.state,e,t);{let i=ot.find(n.docView,e),o=n.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,l=i?i.posAtEnd:o.to;return le>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function Fb(n,e,t,r){let i=ot.find(n.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&v0(t,r,s))return-1;let l=i.coordsAt(o,1);return l&&v0(t,r,l)?1:s&&s.bottom>=r?-1:1}function S0(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Fb(n,t,e.clientX,e.clientY)}}const Mb=pe.ie&&pe.ie_version<=11;let b0=null,A0=0,_0=0;function Oy(n){if(!Mb)return n.detail;let e=b0,t=_0;return b0=n,_0=Date.now(),A0=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(A0+1)%3:1}function Bb(n,e){let t=S0(n,e),r=Oy(e),i=n.state.selection;return{update(o){o.docChanged&&(t.pos=o.changes.mapPos(t.pos),i=i.map(o.changes))},get(o,s,l){let a=S0(n,o),u,c=y0(n,a.pos,a.bias,r);if(t.pos!=a.pos&&!s){let h=y0(n,t.pos,t.bias,r),f=Math.min(h.from,c.from),d=Math.max(h.to,c.to);c=f1&&(u=jb(i,a.pos))?u:l?i.addRange(c):re.create([c])}}}function jb(n,e){for(let t=0;t=e)return re.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}xr.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=t.to||s<=t.from)&&(t=re.range(o,s))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Ju(n.state,Ud,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};xr.dragend=n=>(n.inputState.draggedContent=null,!1);function T0(n,e,t,r){if(t=Ju(n.state,qd,t),!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=n.inputState,s=r&&o&&Rb(n,e)?{from:o.from,to:o.to}:null,l={from:i,insert:t},a=n.state.changes(s?[s,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(i,-1),head:a.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),n.inputState.draggedContent=null}xr.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,o=()=>{++i==t.length&&T0(n,e,r.filter(s=>s!=null).join(n.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[s]=l.result),o()},l.readAsText(t[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return T0(n,e,r,!0),!0}return!1};xr.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Cy?null:e.clipboardData;return t?(wy(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Ib(n),!1)};function $b(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function Hb(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:o}of n.selection.ranges){let s=n.doc.lineAt(o);s.number>i&&(e.push(s.text),t.push({from:s.from,to:Math.min(n.doc.length,s.to+1)})),i=s.number}r=!0}return{text:Ju(n,Ud,e.join(n.lineBreak)),ranges:t,linewise:r}}let Wf=null;xr.copy=xr.cut=(n,e)=>{let{text:t,ranges:r,linewise:i}=Hb(n.state);if(!t&&!i)return!1;Wf=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Cy?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",t),!0):($b(n,t),!1)};const Ny=fn.define();function Dy(n,e){let t=[];for(let r of n.facet(hy)){let i=r(n,e);i&&t.push(i)}return t?n.update({effects:t,annotations:Ny.of(!0)}):null}function Py(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Dy(n.state,e);t?n.dispatch(t):n.update([])}},10)}dr.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),Py(n)};dr.blur=n=>{n.observer.clearSelectionRange(),Py(n)};dr.compositionstart=dr.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};dr.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,pe.chrome&&pe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};dr.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};xr.beforeinput=(n,e)=>{var t,r;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let o=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),s=e.getTargetRanges();if(o&&s.length){let l=s[0],a=n.posAtDOM(l.startContainer,l.startOffset),u=n.posAtDOM(l.endContainer,l.endOffset);return Kd(n,{from:a,to:u,insert:n.state.toText(o)},null),!0}}let i;if(pe.chrome&&pe.android&&(i=Ty.find(o=>o.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return pe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),pe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>dr.compositionend(n,e),20),!1};const E0=new Set;function zb(n){E0.has(n)||(E0.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const C0=["pre-wrap","normal","pre-line","break-spaces"];let xo=!1;function w0(){xo=!1}class qb{constructor(e){this.lineWrapping=e,this.doc=je.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return C0.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=o,a){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ru&&(xo=!0),this.height=e)}replace(e,t,r){return Bt.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let o=this,s=r.doc;for(let l=i.length-1;l>=0;l--){let{fromA:a,toA:u,fromB:c,toB:h}=i[l],f=o.lineAt(a,Ke.ByPosNoHeight,r.setDoc(t),0,0),d=f.to>=u?f:o.lineAt(u,Ke.ByPosNoHeight,r,0,0);for(h+=d.to-u,u=d.to;l>0&&f.from<=i[l-1].toA;)a=i[l-1].fromA,c=i[l-1].fromB,l--,ao*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),r+=1+l.break,i-=l.size}else if(o>i*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,o-=l.size}else break;else if(i=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Qt extends Ry{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,i){return new Ir(i,this.length,r,this.height,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof Qt||i instanceof xt&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xt?i=new Qt(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Bt.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class xt extends Bt{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,o=i-r+1,s,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*o);s=a/o,this.length>o+1&&(l=(this.height-a)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:l}}blockAt(e,t,r,i){let{firstLine:o,lastLine:s,perLine:l,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let u=i+(e0){let o=r[r.length-1];o instanceof xt?r[r.length-1]=new xt(o.length+i):r.push(null,new xt(i-1))}if(e>0){let o=r[0];o instanceof xt?r[0]=new xt(e+o.length):r.unshift(new xt(e-1),null)}return Bt.of(r)}decomposeLeft(e,t){t.push(new xt(e-1),null)}decomposeRight(e,t){t.push(null,new xt(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let o=t+this.length;if(i&&i.from<=t+this.length&&i.more){let s=[],l=Math.max(t,i.from),a=-1;for(i.from>t&&s.push(new xt(i.from-t-1).updateHeight(e,t));l<=o&&i.more;){let c=e.doc.lineAt(l).length;s.length&&s.push(null);let h=i.heights[i.index++];a==-1?a=h:Math.abs(h-a)>=ru&&(a=-2);let f=new Qt(c,h);f.outdated=!1,s.push(f),l+=c+1}l<=o&&s.push(null,new xt(o-l).updateHeight(e,l));let u=Bt.of(s);return(a<0||Math.abs(u.height-this.height)>=ru||Math.abs(a-this.heightMetrics(e,t).perLine)>=ru)&&(xo=!0),Au(this,u)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Vb extends Bt{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let o=r+this.left.height;return el))return u;let c=t==Ke.ByPosNoHeight?Ke.ByPosNoHeight:Ke.ByPos;return a?u.join(this.right.lineAt(l,c,r,s,l)):this.left.lineAt(l,c,r,i,o).join(u)}forEachLine(e,t,r,i,o,s){let l=i+this.left.height,a=o+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,r,l,a,s);else{let u=this.lineAt(a,Ke.ByPos,r,i,o);e=e&&u.from<=t&&s(u),t>u.to&&this.right.forEachLine(u.to+1,t,r,l,a,s)}}replace(e,t,r){let i=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let l of r)o.push(l);if(e>0&&O0(o,s-1),t=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e2*t.size||t.size>2*e.size?Bt.of(this.break?[e,null,t]:[e,t]):(this.left=Au(this.left,e),this.right=Au(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,i){let{left:o,right:s}=this,l=t+o.length+this.break,a=null;return i&&i.from<=t+o.length&&i.more?a=o=o.updateHeight(e,t,r,i):o.updateHeight(e,t,r),i&&i.from<=l+s.length&&i.more?a=s=s.updateHeight(e,l,r,i):s.updateHeight(e,l,r),a?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function O0(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof xt&&(r=n[e+1])instanceof xt&&n.splice(e-1,3,new xt(t.length+1+r.length))}const Wb=5;class Gd{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Qt?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Qt(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e=Wb)&&this.addLineDeco(i,o,s)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Qt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new xt(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Qt)return e;let t=new Qt(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Qt)&&!this.isCovered?this.nodes.push(new Qt(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&h.overflow!="visible"){let f=c.getBoundingClientRect();o=Math.max(o,f.left),s=Math.min(s,f.right),l=Math.max(l,f.top),a=Math.min(u==n.parentNode?i.innerHeight:a,f.bottom)}u=h.position=="absolute"||h.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:o-t.left,right:Math.max(o,s)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Yb(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class fh{constructor(e,t,r,i){this.from=e,this.to=t,this.size=r,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new qb(t),this.stateDeco=e.facet(yl).filter(r=>typeof r!="function"),this.heightMap=Bt.empty().applyChanges(this.stateDeco,je.empty,this.heightOracle.setDoc(e.doc),[new cr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ae.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new wa(o,s))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?D0:new Xd(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(tl(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(yl).filter(c=>typeof c!="function");let i=e.changedRanges,o=cr.extendWithRanges(i,Kb(r,this.stateDeco,e?e.changes:at.empty(this.state.doc.length))),s=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);w0(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||xo)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let u=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(dy)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Ge.RTL:Ge.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),l=t.getBoundingClientRect(),a=s||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,c=0;if(l.width&&l.height){let{scaleX:S,scaleY:_}=$x(t,l);(S>.005&&Math.abs(this.scaleX-S)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=S,this.scaleY=_,u|=8,s=a=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,u|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=qx(e.scrollDOM);let p=(this.printing?Yb:Xb)(t,this.paddingTop),v=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let g=l.width;if((this.contentDOMWidth!=g||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,u|=8),a){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(s=!0),s||i.lineWrapping&&Math.abs(g-this.contentDOMWidth)>i.charWidth){let{lineHeight:_,charWidth:b,textHeight:C}=e.docView.measureTextSize();s=_>0&&i.refresh(o,_,b,C,g/b,S),s&&(e.docView.minWidth=0,u|=8)}v>0&&m>0?c=Math.max(v,m):v<0&&m<0&&(c=Math.min(v,m)),w0();for(let _ of this.viewports){let b=_.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(_);this.heightMap=(s?Bt.empty().applyChanges(this.stateDeco,je.empty,this.heightOracle,[new cr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new Ub(_.from,b))}xo&&(u|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),u|=this.updateForViewport()),(u&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:l}=this,a=new wa(i.lineAt(s-r*1e3,Ke.ByHeight,o,0,0).from,i.lineAt(l+(1-r)*1e3,Ke.ByHeight,o,0,0).to);if(t){let{head:u}=t.range;if(ua.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(u,Ke.ByPos,o,0,0),f;t.y=="center"?f=(h.top+h.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&u=l+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=Ge.LTR&&!r)return[];let l=[],a=(c,h,f,d)=>{if(h-cc&&yy.from>=f.from&&y.to<=f.to&&Math.abs(y.from-c)y.fromg));if(!m){if(hx.from<=h&&x.to>=h)){let x=t.moveToLineBoundary(re.cursor(h),!1,!0).head;x>c&&(h=x)}let y=this.gapSize(f,c,h,d),g=r||y<2e6?y:2e6;m=new fh(c,h,y,g)}l.push(m)},u=c=>{if(c.length2e6)for(let b of e)b.from>=c.from&&b.fromc.from&&a(c.from,d,c,h),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Re.spans(e,this.viewport.from,this.viewport.to,{span(i,o){t.push({from:i,to:o})},point(){}},20);let r=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=t[o].from||i.to!=t[o].to);return this.visibleRanges=t,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||tl(this.heightMap.lineAt(e,Ke.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||tl(this.heightMap.lineAt(this.scaler.fromDOM(e),Ke.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return tl(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class wa{constructor(e,t){this.from=e,this.to=t}}function Qb(n,e,t){let r=[],i=n,o=0;return Re.spans(t,n,e,{span(){},point(s,l){s>i&&(r.push({from:i,to:s}),o+=s-i),i=l}},20),i=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:o,to:s}=e[i],l=s-o;if(r<=l)return o+r;r-=l}}function Na(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function Zb(n,e){for(let t of n)if(e(t))return t}const D0={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Xd{constructor(e,t,r){let i=0,o=0,s=0;this.viewports=r.map(({from:l,to:a})=>{let u=t.lineAt(l,Ke.ByPos,e,0,0).top,c=t.lineAt(a,Ke.ByPos,e,0,0).bottom;return i+=c-u,{from:l,to:a,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let l of this.viewports)l.domTop=s+(l.top-o)*this.scale,s=l.domBottom=l.domTop+(l.bottom-l.top),o=l.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let o=tt.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function tl(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new Ir(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(i=>tl(i,e)):n._content)}const Da=he.define({combine:n=>n.join(" ")}),Kf=he.define({combine:n=>n.indexOf(!0)>-1}),Gf=Bn.newName(),Ly=Bn.newName(),ky=Bn.newName(),Iy={"&light":"."+Ly,"&dark":"."+ky};function Xf(n,e,t){return new Bn(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const eA=Xf("."+Gf,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Iy),tA={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},dh=pe.ie&&pe.ie_version<=11;class rA{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new $2,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(pe.ie&&pe.ie_version<=11||pe.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(pe.chrome&&pe.chrome_version<126)&&(this.editContext=new iA(e),e.state.facet(wn)&&(e.contentDOM.editContext=this.editContext.editContext)),dh&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(wn)?r.root.activeElement!=this.dom:!eu(this.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(pe.ie&&pe.ie_version<=11||pe.android&&pe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&cl(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=gl(e.root);if(!t)return!1;let r=pe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&nA(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let i=eu(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&lo(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),t==-1?{from:t,to:r}=s:(t=Math.min(s.from,t),r=Math.max(s.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&eu(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new bb(this.view,e,t,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,i=_y(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=P0(t,e.previousSibling||e.target.previousSibling,-1),i=P0(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(wn)!=e.state.facet(wn)&&(e.view.contentDOM.editContext=e.state.facet(wn)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function P0(n,e,t){for(;e;){let r=Ue.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function R0(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=n.docView.domAtPos(n.state.selection.main.anchor);return cl(s.node,s.offset,i,o)&&([t,r,i,o]=[i,o,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}}function nA(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return R0(n,i)}let t=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?R0(n,t):null}class iA{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let{anchor:i}=e.state.selection.main,o={from:this.toEditorPos(r.updateRangeStart),to:this.toEditorPos(r.updateRangeEnd),insert:je.of(r.text.split(` -`))};o.from==this.from&&ithis.to&&(o.to=i),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,e.state.readOnly||Kd(e,o,re.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,l=o.underlineThickness;if(s!="None"&&l!="None"){let a=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;i.push(Ae.mark({attributes:{style:a}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:my.of(Ae.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=gl(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,s,l,a,u)=>{if(r)return;let c=u.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(u)){i=this.pendingContextChange=null,t+=c,this.to+=c;return}else i=null,this.revertPending(e.state);if(o+=t,s+=t,s<=this.from)this.from+=c,this.to+=c;else if(othis.to||this.to-this.from+u.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),u.toString()),this.to+=c}t+=c}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(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)}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))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class de{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||H2(e.parent)||document,this.viewState=new N0(e.state||Me.create(e)),e.scrollTo&&e.scrollTo.is(Ta)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Qs).map(i=>new uh(i));for(let i of this.plugins)i.update(this);this.observer=new rA(this),this.inputState=new Cb(this),this.inputState.ensureHandlers(this.plugins),this.docView=new c0(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof ct?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,o=this.state;for(let f of e){if(f.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=f.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(Ny))?(this.inputState.notifiedFocused=s,l=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,a=Dy(o,s),a||(l=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(Me.phrases)!=this.state.facet(Me.phrases))return this.setState(o);i=bu.create(this,o,e),i.flags|=l;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;h=new ao(d.empty?d:re.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(Ta)&&(h=d.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=_u.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Zs)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Da)!=i.state.facet(Da)&&(this.viewState.mustMeasureContent=!0),(t||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(qf))try{f(i)}catch(d){Ft(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!_y(this,c)&&u.force&&lo(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new N0(e),this.plugins=e.facet(Qs).map(r=>new uh(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new c0(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Qs),r=e.state.facet(Qs);if(t!=r){let i=[];for(let o of r){let s=t.indexOf(o);if(s<0)i.push(new uh(o));else{let l=this.plugins[s];l.mustUpdate=e,i.push(l)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(s<0)if(qx(r))o=-1,s=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);o=d.from,s=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];a&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(d=>{try{return d.read(this)}catch(p){return Ft(this.state,p),L0}}),h=bu.create(this,this.state,[]),f=!1;h.flags|=a,t?t.flags|=a:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let d=0;d1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(qf))l(t)}get themeClasses(){return Gf+" "+(this.state.facet(Kf)?ky:Ly)+" "+this.state.facet(Da)}updateAttrs(){let e=k0(this,gy,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(wn)?"true":"false",class:"cm-content",style:`${pe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),k0(this,Vd,t);let r=this.observer.ignore(()=>{let i=Mf(this.contentDOM,this.contentAttrs,t),o=Mf(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(de.announce)){t&&(this.announceDOM.textContent=""),t=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Zs);let e=this.state.facet(de.cspNonce);Bn.mount(this.root,this.styleModules.concat(eA).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tr.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return hh(this,e,m0(this,e,t,r))}moveByGroup(e,t){return hh(this,e,m0(this,e,t,r=>xb(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[t?r.length-1:0];return re.cursor(o.side(t,i)+e.from,o.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,r=!0){return gb(this,e,t,r)}moveVertically(e,t,r){return hh(this,e,yb(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Ay(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[Rn.find(o,e-i.from,-1,t)];return Xu(r,s.dir==Ge.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(fy)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>oA)return iy(e.length);let t=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==t&&(o.fresh||ny(o.isolates,r=u0(this,e))))return o.order;r||(r=u0(this,e));let i=eb(e.text,t,r);return this.bidiCache.push(new _u(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||pe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Hx(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Ta.of(new ao(typeof e=="number"?re.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Ta.of(new ao(re.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return nt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return nt.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=Bn.newName(),i=[Da.of(r),Zs.of(Xf(`.${r}`,e))];return t&&t.dark&&i.push(Kf.of(!0)),i}static baseTheme(e){return Li.lowest(Zs.of(Xf("."+Gf,e,Iy)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&Ue.get(r)||Ue.get(e);return((t=i==null?void 0:i.rootView)===null||t===void 0?void 0:t.view)||null}}de.styleModule=Zs;de.inputHandler=cy;de.clipboardInputFilter=qd;de.clipboardOutputFilter=Ud;de.scrollHandler=py;de.focusChangeEffect=hy;de.perLineTextDirection=fy;de.exceptionSink=uy;de.updateListener=qf;de.editable=wn;de.mouseSelectionStyle=ay;de.dragMovesSelection=ly;de.clickAddsSelectionRange=sy;de.decorations=yl;de.outerDecorations=xy;de.atomicRanges=Wd;de.bidiIsolatedRanges=yy;de.scrollMargins=vy;de.darkTheme=Kf;de.cspNonce=he.define({combine:n=>n.length?n[0]:""});de.contentAttributes=Vd;de.editorAttributes=gy;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=Oe.define();const oA=4096,L0={};class _u{constructor(e,t,r,i,o,s){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,t){if(t.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Ge.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(n):o;s&&Ff(s,t)}return t}const sA=pe.mac?"mac":pe.windows?"win":pe.linux?"linux":"key";function lA(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,o,s,l;for(let a=0;ar.concat(i),[]))),t}function uA(n,e,t){return My(Fy(n.state),e,n,t)}let On=null;const cA=4e3;function hA(n,e=sA){let t=Object.create(null),r=Object.create(null),i=(s,l)=>{let a=r[s];if(a==null)r[s]=l;else if(a!=l)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,l,a,u,c)=>{var h,f;let d=t[s]||(t[s]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>lA(y,e));for(let y=1;y{let S=On={view:x,prefix:g,scope:s};return setTimeout(()=>{On==S&&(On=null)},cA),!0}]})}let v=p.join(" ");i(v,!1);let m=d[v]||(d[v]={preventDefault:!1,stopPropagation:!1,run:((f=(h=d._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});a&&m.run.push(a),u&&(m.preventDefault=!0),c&&(m.stopPropagation=!0)};for(let s of n){let l=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let u of l){let c=t[u]||(t[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=s;for(let f in c)c[f].run.push(d=>h(d,Yf))}let a=s[e]||s.key;if(a)for(let u of l)o(u,a,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(u,"Shift-"+a,s.shift,s.preventDefault,s.stopPropagation)}return t}let Yf=null;function My(n,e,t,r){Yf=e;let i=F2(e),o=yt(i,0),s=ar(o)==i.length&&i!=" ",l="",a=!1,u=!1,c=!1;On&&On.view==t&&On.scope==r&&(l=On.prefix+" ",Ey.indexOf(e.keyCode)<0&&(u=!0,On=null));let h=new Set,f=m=>{if(m){for(let y of m.run)if(!h.has(y)&&(h.add(y),y(t)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),u=!0)}return!1},d=n[r],p,v;return d&&(f(d[l+Pa(i,e,!s)])?a=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(pe.windows&&e.ctrlKey&&e.altKey)&&(p=jn[e.keyCode])&&p!=i?(f(d[l+Pa(p,e,!0)])||e.shiftKey&&(v=ml[e.keyCode])!=i&&v!=p&&f(d[l+Pa(v,e,!1)]))&&(a=!0):s&&e.shiftKey&&f(d[l+Pa(i,e,!0)])&&(a=!0),!a&&f(d._any)&&(a=!0)),u&&(a=!0),a&&c&&e.stopPropagation(),Yf=null,a}class Ml{constructor(e,t,r,i,o){this.className=e,this.left=t,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=By(e);return[new Ml(t,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return fA(e,t,r)}}function By(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Ge.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function F0(n,e,t,r){let i=n.coordsAtPos(e,t*2);if(!i)return r;let o=n.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,l=n.posAtCoords({x:o.left+1,y:s}),a=n.posAtCoords({x:o.right-1,y:s});return l==null||a==null?r:{from:Math.max(r.from,Math.min(l,a)),to:Math.min(r.to,Math.max(l,a))}}function fA(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),o=n.textDirection==Ge.LTR,s=n.contentDOM,l=s.getBoundingClientRect(),a=By(n),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),f=l.right-(c?parseInt(c.paddingRight):0),d=Vf(n,r),p=Vf(n,i),v=d.type==Mt.Text?d:null,m=p.type==Mt.Text?p:null;if(v&&(n.lineWrapping||d.widgetLineBreaks)&&(v=F0(n,r,1,v)),m&&(n.lineWrapping||p.widgetLineBreaks)&&(m=F0(n,i,-1,m)),v&&m&&v.from==m.from&&v.to==m.to)return g(x(t.from,t.to,v));{let _=v?x(t.from,null,v):S(d,!1),b=m?x(null,t.to,m):S(p,!0),C=[];return(v||d).to<(m||p).from-(v&&m?1:0)||d.widgetLineBreaks>1&&_.bottom+n.defaultLineHeight/2k&&se.from=fe)break;X>ie&&j(Math.max(ee,ie),_==null&&ee<=k,Math.min(X,fe),b==null&&X>=V,me.dir)}if(ie=Ee.to+1,ie>=fe)break}return M.length==0&&j(k,_==null,V,b==null,n.textDirection),{top:O,bottom:D,horizontal:M}}function S(_,b){let C=l.top+(b?_.top:_.bottom);return{top:C,bottom:C,horizontal:[]}}}function dA(n,e){return n.constructor==e.constructor&&n.eq(e)}class pA{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(nu)!=e.state.facet(nu)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(nu);for(;t!dA(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[r].constructor&&i.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const nu=he.define();function jy(n){return[nt.define(e=>new pA(e,n)),nu.of(n)]}const $y=!pe.ios,vl=he.define({combine(n){return vr(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function mA(n={}){return[vl.of(n),gA,xA,yA,dy.of(!0)]}function Hy(n){return n.startState.facet(vl)!=n.state.facet(vl)}const gA=jy({above:!0,markers(n){let{state:e}=n,t=e.facet(vl),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||$y:t.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=i.empty?i:re.cursor(i.head,i.head>i.anchor?-1:1);for(let a of Ml.forRange(n,s,l))r.push(a)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Hy(n);return t&&M0(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){M0(e.state,n)},class:"cm-cursorLayer"});function M0(n,e){e.style.animationDuration=n.facet(vl).cursorBlinkRate+"ms"}const xA=jy({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Ml.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Hy(n)},class:"cm-selectionLayer"}),Jf={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};$y&&(Jf[".cm-line"].caretColor=Jf[".cm-content"].caretColor="transparent !important");const yA=Li.highest(de.theme(Jf)),zy=Oe.define({map(n,e){return n==null?null:e.mapPos(n)}}),rl=ft.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(zy)?r.value:t,n)}}),vA=nt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(rl);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(rl)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(rl),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(rl)!=n&&this.view.dispatch({effects:zy.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function SA(){return[rl,vA]}function B0(n,e,t,r,i){e.lastIndex=0;for(let o=n.iterRange(t,r),s=t,l;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;l=e.exec(o.value);)i(s+l.index,l)}function bA(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:i,to:o}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),o=Math.min(n.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class AA{constructor(e){const{regexp:t,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(l,a,u,c)=>i(c,u,u+l[0].length,l,a);else if(typeof r=="function")this.addMatch=(l,a,u,c)=>{let h=r(l,a,u);h&&c(u,u+l[0].length,h)};else if(r)this.addMatch=(l,a,u,c)=>c(u,u+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let t=new Mn,r=t.add.bind(t);for(let{from:i,to:o}of bA(e,this.maxLength))B0(e.state.doc,this.regexp,i,o,(s,l)=>this.addMatch(l,e,s,r));return t.finish()}updateDeco(e,t){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),r,i):t}updateRange(e,t,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),l=Math.min(o.to,i);if(l>s){let a=e.state.doc.lineAt(s),u=a.toa.from;s--)if(this.boundary.test(a.text[s-1-a.from])){c=s;break}for(;lf.push(y.range(v,m));if(a==u)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,e,v,p));t=t.update({filterFrom:c,filterTo:h,filter:(v,m)=>vh,add:f})}}return t}}const Qf=/x/.unicode!=null?"gu":"g",_A=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Qf),TA={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let ph=null;function EA(){var n;if(ph==null&&typeof document<"u"&&document.body){let e=document.body.style;ph=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return ph||!1}const iu=he.define({combine(n){let e=vr(n,{render:null,specialChars:_A,addSpecialChars:null});return(e.replaceTabs=!EA())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Qf)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Qf)),e}});function CA(n={}){return[iu.of(n),wA()]}let j0=null;function wA(){return j0||(j0=nt.fromClass(class{constructor(n){this.view=n,this.decorations=Ae.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(iu)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new AA({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,o=yt(e[0],0);if(o==9){let s=i.lineAt(r),l=t.state.tabSize,a=Po(s.text,l,r-s.from);return Ae.replace({widget:new PA((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Ae.replace({widget:new DA(n,o)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(iu);n.startState.facet(iu)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const OA="•";function NA(n){return n>=32?OA:n==10?"␤":String.fromCharCode(9216+n)}class DA extends Un{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=NA(this.code),r=e.state.phrase("Control character")+" "+(TA[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let o=document.createElement("span");return o.textContent=t,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class PA extends Un{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function RA(){return kA}const LA=Ae.line({class:"cm-activeLine"}),kA=nt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(LA.range(i.from)),e=i.from)}return Ae.set(t)}},{decorations:n=>n.decorations}),Zf=2e3;function IA(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),o=[];if(e.off>Zf||t.off>Zf||e.col<0||t.col<0){let s=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=r;a<=i;a++){let u=n.doc.line(a);u.length<=l&&o.push(re.range(u.from+s,u.to+l))}}else{let s=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=r;a<=i;a++){let u=n.doc.line(a),c=Nf(u.text,s,n.tabSize,!0);if(c<0)o.push(re.cursor(u.to));else{let h=Nf(u.text,l,n.tabSize);o.push(re.range(u.from+c,u.from+h))}}}return o}function FA(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function $0(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,o=i>Zf?-1:i==r.length?FA(n,e.clientX):Po(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:o,off:i}}function MA(n,e){let t=$0(n,e),r=n.state.selection;return t?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(t.line).from),s=i.state.doc.lineAt(o);t={line:s.number,col:t.col,off:Math.min(t.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let l=$0(n,i);if(!l)return r;let a=IA(n.state,t,l);return a.length?s?re.create(a.concat(r.ranges)):re.create(a):r}}:null}function BA(n){let e=t=>t.altKey&&t.button==0;return de.mouseSelectionStyle.of((t,r)=>e(r)?MA(t,r):null)}const jA={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},$A={style:"cursor: crosshair"};function HA(n={}){let[e,t]=jA[n.key||"Alt"],r=nt.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[r,de.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?$A:null})]}const Qo="-10000px";class qy{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,t){var r;let i=e.state.facet(this.facet),o=i.filter(a=>a);if(i===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let s=[],l=t?[]:null;for(let a=0;at[u]=a),t.length=l.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function zA(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const mh=he.define({combine:n=>{var e,t,r;return{position:pe.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||zA}}}),H0=new WeakMap,Jd=nt.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(mh);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new qy(n,Qu,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(mh);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.appendChild(i)}return t.dom.style.position=this.position,t.dom.style.top=Qo,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(pe.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==Qo&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(mh).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:r}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:r,scaleX:i,scaleY:o}=n,s=[];for(let l=0;l=Math.min(t.bottom,r.bottom)||h.rightMath.min(t.right,r.right)+.1){c.style.top=Qo;continue}let d=a.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,v=f.right-f.left,m=(e=H0.get(u))!==null&&e!==void 0?e:f.bottom-f.top,y=u.offset||UA,g=this.view.textDirection==Ge.LTR,x=f.width>r.right-r.left?g?r.left:r.right-f.width:g?Math.max(r.left,Math.min(h.left-(d?14:0)+y.x,r.right-v)):Math.min(Math.max(r.left,h.left-v+(d?14:0)-y.x),r.right-v),S=this.above[l];!a.strictSide&&(S?h.top-(f.bottom-f.top)-y.yr.bottom)&&S==r.bottom-h.bottom>h.top-r.top&&(S=this.above[l]=!S);let _=(S?h.top-r.top:r.bottom-h.bottom)-p;if(_x&&O.topb&&(b=S?O.top-m-2-p:O.bottom+p+2);if(this.position=="absolute"?(c.style.top=(b-n.parent.top)/o+"px",c.style.left=(x-n.parent.left)/i+"px"):(c.style.top=b/o+"px",c.style.left=x/i+"px"),d){let O=h.left+(g?y.x:-y.x)-(x+14-7);d.style.left=O/i+"px"}u.overlap!==!0&&s.push({left:x,top:b,right:C,bottom:b+m}),c.classList.toggle("cm-tooltip-above",S),c.classList.toggle("cm-tooltip-below",!S),u.positioned&&u.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Qo}},{eventObservers:{scroll(){this.maybeMeasure()}}}),qA=de.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),UA={x:0,y:0},Qu=he.define({enables:[Jd,qA]}),Tu=he.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Zu{static create(e){return new Zu(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new qy(e,Tu,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const VA=Qu.compute([Tu],n=>{let e=n.facet(Tu);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:Zu.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class WA{constructor(e,t,r,i,o){this.view=e,this.source=t,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),u=a&&a.dir==Ge.RTL?-1:1;o=t.x{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>Ft(e.state,a,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(Jd),t=e?e.manager.tooltips.findIndex(r=>r.create==Zu.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!KA(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,l=(r=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:s;(s==l?this.view.posAtCoords(this.lastMove)!=s:!GA(this.view,s,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Ra=4;function KA(n,e){let{left:t,right:r,top:i,bottom:o}=n.getBoundingClientRect(),s;if(s=n.querySelector(".cm-tooltip-arrow")){let l=s.getBoundingClientRect();i=Math.min(l.top,i),o=Math.max(l.bottom,o)}return e.clientX>=t-Ra&&e.clientX<=r+Ra&&e.clientY>=i-Ra&&e.clientY<=o+Ra}function GA(n,e,t,r,i,o){let s=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,l)=e&&a<=t}function XA(n,e={}){let t=Oe.define(),r=ft.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let l of i){let a=o.changes.mapPos(l.pos,-1,It.TrackDel);if(a!=null){let u=Object.assign(Object.create(null),l);u.pos=a,u.end!=null&&(u.end=o.changes.mapPos(u.end)),s.push(u)}}i=s}for(let s of o.effects)s.is(t)&&(i=s.value),s.is(YA)&&(i=[]);return i},provide:i=>Tu.from(i)});return{active:r,extension:[r,nt.define(i=>new WA(i,n,r,t,e.hoverTime||300)),VA]}}function Uy(n,e){let t=n.plugin(Jd);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const YA=Oe.define(),z0=he.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Sl(n,e){let t=n.plugin(Vy),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const Vy=nt.fromClass(class{constructor(n){this.input=n.state.facet(bl),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(z0);this.top=new La(n,!0,e.topContainer),this.bottom=new La(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(z0);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new La(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new La(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(bl);if(t!=this.input){let r=t.filter(a=>a),i=[],o=[],s=[],l=[];for(let a of r){let u=this.specs.indexOf(a),c;u<0?(c=a(n.view),l.push(c)):(c=this.panels[u],c.update&&c.update(n)),i.push(c),(c.top?o:s).push(c)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class La{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=q0(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=q0(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function q0(n){let e=n.nextSibling;return n.remove(),e}const bl=he.define({enables:Vy});class zr extends fi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}zr.prototype.elementClass="";zr.prototype.toDOM=void 0;zr.prototype.mapMode=It.TrackBefore;zr.prototype.startSide=zr.prototype.endSide=-1;zr.prototype.point=!0;const ou=he.define(),JA=he.define(),QA={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Re.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},fl=he.define();function Wy(n){return[Ky(),fl.of(Object.assign(Object.assign({},QA),n))]}const U0=he.define({combine:n=>n.some(e=>e)});function Ky(n){return[ZA]}const ZA=nt.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(fl).map(e=>new W0(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(U0),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(U0)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=Re.iter(this.view.state.facet(ou),this.view.viewport.from),r=[],i=this.gutters.map(o=>new e_(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let l of o.type)if(l.type==Mt.Text&&s){ed(t,r,l.from);for(let a of i)a.line(this.view,l,r);s=!1}else if(l.widget)for(let a of i)a.widget(this.view,l)}else if(o.type==Mt.Text){ed(t,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(fl),t=n.state.facet(fl),r=n.docChanged||n.heightChanged||n.viewportChanged||!Re.eq(n.startState.facet(ou),n.state.facet(ou),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let o of t){let s=e.indexOf(o);s<0?i.push(new W0(this.view,o)):(this.gutters[s].update(n),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Ge.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function V0(n){return Array.isArray(n)?n:[n]}function ed(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class e_{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Re.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,o=(t.top-this.height)/e.scaleY,s=t.height/e.scaleY;if(this.i==i.elements.length){let l=new Gy(e,s,o,r);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,s,o,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];ed(this.cursor,i,t.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,t,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),i=r?[r]:null;for(let o of e.state.facet(JA)){let s=o(e,t.widget,t);s&&(i||(i=[])).push(s)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class W0{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let a=o.getBoundingClientRect();s=(a.top+a.bottom)/2}else s=i.clientY;let l=e.lineBlockAtHeight(s-e.documentTop);t.domEventHandlers[r](e,l,i)&&i.preventDefault()});this.markers=V0(t.markers(e)),t.initialSpacer&&(this.spacer=new Gy(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=V0(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Re.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Gy{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),t_(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let l=s,a=oo(l,a,u)||s(l,a,u):s}return r}})}});class gh extends zr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function xh(n,e){return n.state.facet(eo).formatNumber(e,n.state)}const i_=fl.compute([eo],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(r_)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new gh(xh(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let i of e.state.facet(n_)){let o=i(e,t,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(eo)!=e.state.facet(eo),initialSpacer(e){return new gh(xh(e,K0(e.state.doc.lines)))},updateSpacer(e,t){let r=xh(t.view,K0(t.view.state.doc.lines));return r==e.number?e:new gh(r)},domEventHandlers:n.facet(eo).domEventHandlers}));function o_(n={}){return[eo.of(n),Ky(),i_]}function K0(n){let e=9;for(;e{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(s_.range(i)))}return Re.of(e)});function a_(){return l_}function We(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;el.from==l.to||l.from==l.to-1&&r.doc.lineAt(l.from).to==l.from?Ae.widget({widget:new v_(l),diagnostic:l}).range(l.from):Ae.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new ii(s,t,yo(s))}}function yo(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new u_(i,o,s.diagnostic),!1}),r}function Yy(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(Fr).hideOn(n,t,r);if(i!=null)return i;let o=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(s=>s.is(ec))||n.changes.touchesRange(o.from,Math.max(o.to,r)))}function Jy(n,e){return n.field(er,!1)?e:e.concat(Oe.appendConfig.of(i1))}function c_(n,e){return{effects:Jy(n,[ec.of(e)])}}const ec=Oe.define(),Qd=Oe.define(),Qy=Oe.define(),er=ft.define({create(){return new ii(Ae.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let o=e.changes.mapPos(n.selected.from,1);r=yo(t,n.selected.diagnostic,o)||yo(t,null,o)}!t.size&&i&&e.state.facet(Fr).autoPanel&&(i=null),n=new ii(t,i,r)}for(let t of e.effects)if(t.is(ec)){let r=e.state.facet(Fr).autoPanel?t.value.length?Al.open:null:n.panel;n=ii.init(t.value,r,e.state)}else t.is(Qd)?n=new ii(n.diagnostics,t.value?Al.open:null,n.selected):t.is(Qy)&&(n=new ii(n.diagnostics,n.panel,t.value));return n},provide:n=>[bl.from(n,e=>e.panel),de.decorations.from(n,e=>e.diagnostics)]}),h_=Ae.mark({class:"cm-lintRange cm-lintRange-active"});function f_(n,e,t){let{diagnostics:r}=n.state.field(er),i=[],o=2e8,s=0;r.between(e-(t<0?1:0),e+(t>0?1:0),(a,u,{spec:c})=>{e>=a&&e<=u&&(a==u||(e>a||t>0)&&(et1(n,t,!1)))}const d_=n=>{let e=n.state.field(er,!1);(!e||!e.panel)&&n.dispatch({effects:Jy(n.state,[Qd.of(!0)])});let t=Sl(n,Al.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},G0=n=>{let e=n.state.field(er,!1);return!e||!e.panel?!1:(n.dispatch({effects:Qd.of(!1)}),!0)},p_=n=>{let e=n.state.field(er,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},m_=[{key:"Mod-Shift-m",run:d_,preventDefault:!0},{key:"F8",run:p_}],g_=nt.fromClass(class{constructor(n){this.view=n,this.timeout=-1,this.set=!0;let{delay:e}=n.state.facet(Fr);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let n=Date.now();if(nPromise.resolve(r(this.view))),r=>{this.view.state.doc==e.doc&&this.view.dispatch(c_(this.view.state,r.reduce((i,o)=>i.concat(o))))},r=>{Ft(this.view.state,r)})}}update(n){let e=n.state.facet(Fr);(n.docChanged||e!=n.startState.facet(Fr)||e.needsRefresh&&e.needsRefresh(n))&&(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)}});function x_(n,e,t){let r=[],i=-1;for(let o of n)o.then(s=>{r.push(s),clearTimeout(i),r.length==n.length?e(r):setTimeout(()=>e(r),200)},t)}const Fr=he.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},vr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function y_(n,e={}){return[Fr.of({source:n,config:e}),g_,i1]}function e1(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;ro.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function t1(n,e,t){var r;let i=t?e1(e.actions):[];return We("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},We("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let l=!1,a=f=>{if(f.preventDefault(),l)return;l=!0;let d=yo(n.state.field(er).diagnostics,e);d&&o.apply(n,d.from,d.to)},{name:u}=o,c=i[s]?u.indexOf(i[s]):-1,h=c<0?u:[u.slice(0,c),We("u",u.slice(c,c+1)),u.slice(c+1)];return We("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${u}${c<0?"":` (access key "${i[s]})"`}.`},h)}),e.source&&We("div",{class:"cm-diagnosticSource"},e.source))}class v_ extends Un{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return We("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class X0{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=t1(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Al{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)G0(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=e1(o.actions);for(let l=0;l{for(let o=0;oG0(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(er).selected;if(!e)return-1;for(let t=0;t{let u=-1,c;for(let h=r;hr&&(this.items.splice(r,u-r),i=!0)),t&&c.diagnostic==t.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),o=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),r++});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:l})=>{let a=l.height/this.list.offsetHeight;s.topl.bottom&&(this.list.scrollTop+=(s.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(er),r=yo(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Qy.of(r)})}static open(e){return new Al(e)}}function su(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function ka(n){return su(``,'width="6" height="3"')}const S_=de.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:ka("#d11")},".cm-lintRange-warning":{backgroundImage:ka("orange")},".cm-lintRange-info":{backgroundImage:ka("#999")},".cm-lintRange-hint":{backgroundImage:ka("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Y0(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}class r1 extends zr{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,r)=>Y0(t)A_(e,t,r)),t}}function b_(n,e){let t=r=>{let i=e.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientYe.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,b_(n,e)}let{hoverTime:i}=n.state.facet(tc),o=setTimeout(r,i);e.onmouseout=()=>{clearTimeout(o),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}}function __(n,e){let t=Object.create(null);for(let i of e){let o=n.lineAt(i.from);(t[o.from]||(t[o.from]=[])).push(i)}let r=[];for(let i in t)r.push(new r1(t[i]).range(+i));return Re.of(r,!0)}const T_=Wy({class:"cm-gutter-lint",markers:n=>n.state.field(td),widgetMarker:(n,e,t)=>{let r=[];return n.state.field(td).between(t.from,t.to,(i,o,s)=>{r.push(...s.diagnostics)}),r.length?new r1(r):null}}),td=ft.define({create(){return Re.empty},update(n,e){n=n.map(e.changes);let t=e.state.facet(tc).markerFilter;for(let r of e.effects)if(r.is(ec)){let i=r.value;t&&(i=t(i||[],e.state)),n=__(e.state.doc,i.slice(0))}return n}}),Zd=Oe.define(),n1=ft.define({create(){return null},update(n,e){return n&&e.docChanged&&(n=Yy(e,n)?null:Object.assign(Object.assign({},n),{pos:e.changes.mapPos(n.pos)})),e.effects.reduce((t,r)=>r.is(Zd)?r.value:t,n)},provide:n=>Qu.from(n)}),E_=de.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:su('')},".cm-lint-marker-warning":{content:su('')},".cm-lint-marker-error":{content:su('')}}),i1=[er,de.decorations.compute([er],n=>{let{selected:e,panel:t}=n.field(er);return!e||!t||e.from==e.to?Ae.none:Ae.set([h_.range(e.from,e.to)])}),XA(f_,{hideOn:Yy}),S_],tc=he.define({combine(n){return vr(n,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function C_(n={}){return[tc.of(n),td,T_,E_,n1]}const w_=1024;let O_=0;class yh{constructor(e,t){this.from=e,this.to=t}}class Le{constructor(e={}){this.id=O_++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=pr.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}Le.closedBy=new Le({deserialize:n=>n.split(" ")});Le.openedBy=new Le({deserialize:n=>n.split(" ")});Le.group=new Le({deserialize:n=>n.split(" ")});Le.isolate=new Le({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});Le.contextHash=new Le({perNode:!0});Le.lookAhead=new Le({perNode:!0});Le.mounted=new Le({perNode:!0});class Eu{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[Le.mounted.id]}}const N_=Object.create(null);class pr{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):N_,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new pr(e.name||"",t,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Le.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(Le.group),o=-1;o<(i?i.length:0);o++){let s=t[o<0?r.name:i[o]];if(s)return s}}}}pr.none=new pr("",Object.create(null),0,8);const Ia=new WeakMap,J0=new WeakMap;var St;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(St||(St={}));class Dt{constructor(e,t,r,i,o){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,l]of o)this.props[typeof s=="number"?s:s.id]=l}}toString(){let e=Eu.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new nd(this.topNode,e)}cursorAt(e,t=0,r=0){let i=Ia.get(this)||this.topNode,o=new nd(i);return o.moveTo(e,t),Ia.set(this,o._tree),o}get topNode(){return new hr(this,0,0,null)}resolve(e,t=0){let r=_l(Ia.get(this)||this.topNode,e,t,!1);return Ia.set(this,r),r}resolveInner(e,t=0){let r=_l(J0.get(this)||this.topNode,e,t,!0);return J0.set(this,r),r}resolveStack(e,t=0){return R_(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:o=this.length}=e,s=e.mode||0,l=(s&St.IncludeAnonymous)>0;for(let a=this.cursor(s|St.IncludeAnonymous);;){let u=!1;if(a.from<=o&&a.to>=i&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;u=!0}for(;u&&r&&(l||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:rp(pr.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new Dt(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new Dt(pr.none,t,r,i)))}static build(e){return L_(e)}}Dt.empty=new Dt(pr.none,[],[],0);class ep{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ep(this.buffer,this.index)}}class Hn{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return pr.none}toString(){let e=[];for(let t=0;t0));a=s[a+3]);return l}slice(e,t,r){let i=this.buffer,o=new Uint16Array(t-e),s=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function _l(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=u;e+=t){let c=l[e],h=a[e]+s.from;if(o1(i,r,h,h+c.length)){if(c instanceof Hn){if(o&St.ExcludeBuffers)continue;let f=c.findChild(0,c.buffer.length,t,r-h,i);if(f>-1)return new Ln(new D_(s,c,e,h),null,f)}else if(o&St.IncludeAnonymous||!c.type.isAnonymous||tp(c)){let f;if(!(o&St.IgnoreMounts)&&(f=Eu.get(c))&&!f.overlay)return new hr(f.tree,h,e,s);let d=new hr(c,h,e,s);return o&St.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,r,i)}}}if(o&St.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+t:e=t<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,r=0){let i;if(!(r&St.IgnoreOverlays)&&(i=Eu.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:l}of i.overlay)if((t>0?s<=o:s=o:l>o))return new hr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Q0(n,e,t,r){let i=n.cursor(),o=[];if(!i.firstChild())return o;if(t!=null){for(let s=!1;!s;)if(s=i.type.is(t),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function rd(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class D_{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class Ln extends s1{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return o<0?null:new Ln(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,r=0){if(r&St.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new Ln(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Ln(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Ln(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),t.push(0)}return new Dt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function l1(n){if(!n.length)return null;let e=0,t=n[0];for(let o=1;ot.from||s.to=e){let l=new hr(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(_l(l,e,t,!1))}}return i?l1(i):r}class nd{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof hr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof hr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&St.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&St.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&St.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=t+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let l=r._tree.children[o];if(this.mode&St.IncludeAnonymous||l instanceof Hn||!l.type.isAnonymous||tp(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return rd(this._tree,e,i);let s=r[t.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function tp(n){return n.children.some(e=>e instanceof Hn||!e.type.isAnonymous||tp(e))}function L_(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=w_,reused:o=[],minRepeatType:s=r.types.length}=n,l=Array.isArray(t)?new ep(t,t.length):t,a=r.types,u=0,c=0;function h(_,b,C,O,D,M){let{id:j,start:k,end:V,size:se}=l,ie=c,fe=u;for(;se<0;)if(l.next(),se==-1){let Z=o[j];C.push(Z),O.push(k-_);return}else if(se==-3){u=j;return}else if(se==-4){c=j;return}else throw new RangeError(`Unrecognized record size: ${se}`);let Ee=a[j],me,ee,X=k-_;if(V-k<=i&&(ee=m(l.pos-b,D))){let Z=new Uint16Array(ee.size-ee.skip),le=l.pos-ee.size,E=Z.length;for(;l.pos>le;)E=y(ee.start,Z,E);me=new Hn(Z,V-ee.start,r),X=ee.start-_}else{let Z=l.pos-se;l.next();let le=[],E=[],A=j>=s?j:-1,T=0,N=V;for(;l.pos>Z;)A>=0&&l.id==A&&l.size>=0?(l.end<=N-i&&(p(le,E,k,T,l.end,N,A,ie,fe),T=le.length,N=l.end),l.next()):M>2500?f(k,Z,le,E):h(k,Z,le,E,A,M+1);if(A>=0&&T>0&&T-1&&T>0){let R=d(Ee,fe);me=rp(Ee,le,E,0,le.length,0,V-k,R,R)}else me=v(Ee,le,E,V-k,ie-V,fe)}C.push(me),O.push(X)}function f(_,b,C,O){let D=[],M=0,j=-1;for(;l.pos>b;){let{id:k,start:V,end:se,size:ie}=l;if(ie>4)l.next();else{if(j>-1&&V=0;se-=3)k[ie++]=D[se],k[ie++]=D[se+1]-V,k[ie++]=D[se+2]-V,k[ie++]=ie;C.push(new Hn(k,D[2]-V,r)),O.push(V-_)}}function d(_,b){return(C,O,D)=>{let M=0,j=C.length-1,k,V;if(j>=0&&(k=C[j])instanceof Dt){if(!j&&k.type==_&&k.length==D)return k;(V=k.prop(Le.lookAhead))&&(M=O[j]+k.length+V)}return v(_,C,O,D,M,b)}}function p(_,b,C,O,D,M,j,k,V){let se=[],ie=[];for(;_.length>O;)se.push(_.pop()),ie.push(b.pop()+C-D);_.push(v(r.types[j],se,ie,M-D,k-M,V)),b.push(D-C)}function v(_,b,C,O,D,M,j){if(M){let k=[Le.contextHash,M];j=j?[k].concat(j):[k]}if(D>25){let k=[Le.lookAhead,D];j=j?[k].concat(j):[k]}return new Dt(_,b,C,O,j)}function m(_,b){let C=l.fork(),O=0,D=0,M=0,j=C.end-i,k={size:0,start:0,skip:0};e:for(let V=C.pos-_;C.pos>V;){let se=C.size;if(C.id==b&&se>=0){k.size=O,k.start=D,k.skip=M,M+=4,O+=4,C.next();continue}let ie=C.pos-se;if(se<0||ie=s?4:0,Ee=C.start;for(C.next();C.pos>ie;){if(C.size<0)if(C.size==-3)fe+=4;else break e;else C.id>=s&&(fe+=4);C.next()}D=Ee,O+=se,M+=fe}return(b<0||O==_)&&(k.size=O,k.start=D,k.skip=M),k.size>4?k:void 0}function y(_,b,C){let{id:O,start:D,end:M,size:j}=l;if(l.next(),j>=0&&O4){let V=l.pos-(j-4);for(;l.pos>V;)C=y(_,b,C)}b[--C]=k,b[--C]=M-_,b[--C]=D-_,b[--C]=O}else j==-3?u=O:j==-4&&(c=O);return C}let g=[],x=[];for(;l.pos>0;)h(n.start||0,n.bufferStart||0,g,x,-1,0);let S=(e=n.length)!==null&&e!==void 0?e:g.length?x[0]+g[0].length:0;return new Dt(a[n.topID],g.reverse(),x.reverse(),S)}const Z0=new WeakMap;function lu(n,e){if(!n.isAnonymous||e instanceof Hn||e.type!=n)return 1;let t=Z0.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof Dt)){t=1;break}t+=lu(n,r)}Z0.set(e,t)}return t}function rp(n,e,t,r,i,o,s,l,a){let u=0;for(let p=r;p=c)break;b+=C}if(x==S+1){if(b>c){let C=p[S];d(C.children,C.positions,0,C.children.length,v[S]+g);continue}h.push(p[S])}else{let C=v[x-1]+p[x-1].length-_;h.push(rp(n,p,v,S,x,_,C,null,a))}f.push(_+g-o)}}return d(e,t,r,i,0),(l||a)(h,f,s)}class ui{constructor(e,t,r,i,o=!1,s=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new ui(0,e.length,e,0,!1,r)];for(let o of t)o.to>e.length&&i.push(o);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let l=0,a=0,u=0;;l++){let c=l=r)for(;s&&s.from=f.from||h<=f.to||u){let d=Math.max(f.from,a)-u,p=Math.min(f.to,h)-u;f=d>=p?null:new ui(d,p,f.tree,f.offset+u,l>0,!!c)}if(f&&i.push(f),s.to>h)break;s=onew yh(i.from,i.to)):[new yh(0,0)]:[new yh(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let o=i.advance();if(o)return o}}};class I_{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Le({perNode:!0});let F_=0;class lr{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=F_++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof lr&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let i=new lr(r,[],null,[]);if(i.set.push(i),t)for(let o of t.set)i.set.push(o);return i}static defineModifier(e){let t=new Cu(e);return r=>r.modified.indexOf(t)>-1?r:Cu.get(r.base||r,r.modified.concat(t).sort((i,o)=>i.id-o.id))}}let M_=0;class Cu{constructor(e){this.name=e,this.instances=[],this.id=M_++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(l=>l.base==e&&B_(t,l.modified));if(r)return r;let i=[],o=new lr(e.name,i,e,t);for(let l of t)l.instances.push(o);let s=j_(t);for(let l of e.set)if(!l.modified.length)for(let a of s)i.push(Cu.get(l,a));return o}}function B_(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function j_(n){let e=[[]];for(let t=0;tr.length-t.length)}function $_(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let o=[],s=2,l=i;for(let h=0;;){if(l=="..."&&h>0&&h+3==i.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+i);if(o.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==i.length)break;let d=i[h++];if(h==i.length&&d=="!"){s=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);l=i.slice(h)}let a=o.length-1,u=o[a];if(!u)throw new RangeError("Invalid path: "+i);let c=new wu(r,s,a>0?o.slice(0,a):null);e[u]=c.sort(e[u])}}return a1.add(e)}const a1=new Le;class wu{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let l of o)for(let a of l.set){let u=t[a.id];if(u){s=s?s+" "+u:u;break}}return s},scope:r}}function H_(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function z_(n,e,t,r=0,i=n.length){let o=new q_(r,Array.isArray(e)?e:[e],t);o.highlightRange(n.cursor(),r,i,"",o.highlighters),o.flush(i)}class q_{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,o){let{type:s,from:l,to:a}=e;if(l>=r||a<=t)return;s.isTop&&(o=this.highlighters.filter(d=>!d.scope||d.scope(s)));let u=i,c=U_(e)||wu.empty,h=H_(o,c.tags);if(h&&(u&&(u+=" "),u+=h,c.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(t,l),u),c.opaque)return;let f=e.tree&&e.tree.prop(Le.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(f.tree.type)),v=e.firstChild();for(let m=0,y=l;;m++){let g=m=x||!e.nextSibling())););if(!g||x>r)break;y=g.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,g.from+l),Math.min(r,y),"",p),this.startSpan(Math.min(r,y),u))}v&&e.parent()}else if(e.firstChild()){f&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,o),this.startSpan(Math.min(r,e.to),u)}while(e.nextSibling());e.parent()}}}function U_(n){let e=n.type.prop(a1);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const ue=lr.define,Fa=ue(),En=ue(),em=ue(En),tm=ue(En),Cn=ue(),Ma=ue(Cn),vh=ue(Cn),Pr=ue(),Zn=ue(Pr),Nr=ue(),Dr=ue(),id=ue(),Zo=ue(id),Ba=ue(),ce={comment:Fa,lineComment:ue(Fa),blockComment:ue(Fa),docComment:ue(Fa),name:En,variableName:ue(En),typeName:em,tagName:ue(em),propertyName:tm,attributeName:ue(tm),className:ue(En),labelName:ue(En),namespace:ue(En),macroName:ue(En),literal:Cn,string:Ma,docString:ue(Ma),character:ue(Ma),attributeValue:ue(Ma),number:vh,integer:ue(vh),float:ue(vh),bool:ue(Cn),regexp:ue(Cn),escape:ue(Cn),color:ue(Cn),url:ue(Cn),keyword:Nr,self:ue(Nr),null:ue(Nr),atom:ue(Nr),unit:ue(Nr),modifier:ue(Nr),operatorKeyword:ue(Nr),controlKeyword:ue(Nr),definitionKeyword:ue(Nr),moduleKeyword:ue(Nr),operator:Dr,derefOperator:ue(Dr),arithmeticOperator:ue(Dr),logicOperator:ue(Dr),bitwiseOperator:ue(Dr),compareOperator:ue(Dr),updateOperator:ue(Dr),definitionOperator:ue(Dr),typeOperator:ue(Dr),controlOperator:ue(Dr),punctuation:id,separator:ue(id),bracket:Zo,angleBracket:ue(Zo),squareBracket:ue(Zo),paren:ue(Zo),brace:ue(Zo),content:Pr,heading:Zn,heading1:ue(Zn),heading2:ue(Zn),heading3:ue(Zn),heading4:ue(Zn),heading5:ue(Zn),heading6:ue(Zn),contentSeparator:ue(Pr),list:ue(Pr),quote:ue(Pr),emphasis:ue(Pr),strong:ue(Pr),link:ue(Pr),monospace:ue(Pr),strikethrough:ue(Pr),inserted:ue(),deleted:ue(),changed:ue(),invalid:ue(),meta:Ba,documentMeta:ue(Ba),annotation:ue(Ba),processingInstruction:ue(Ba),definition:lr.defineModifier("definition"),constant:lr.defineModifier("constant"),function:lr.defineModifier("function"),standard:lr.defineModifier("standard"),local:lr.defineModifier("local"),special:lr.defineModifier("special")};for(let n in ce){let e=ce[n];e instanceof lr&&(e.name=n)}u1([{tag:ce.link,class:"tok-link"},{tag:ce.heading,class:"tok-heading"},{tag:ce.emphasis,class:"tok-emphasis"},{tag:ce.strong,class:"tok-strong"},{tag:ce.keyword,class:"tok-keyword"},{tag:ce.atom,class:"tok-atom"},{tag:ce.bool,class:"tok-bool"},{tag:ce.url,class:"tok-url"},{tag:ce.labelName,class:"tok-labelName"},{tag:ce.inserted,class:"tok-inserted"},{tag:ce.deleted,class:"tok-deleted"},{tag:ce.literal,class:"tok-literal"},{tag:ce.string,class:"tok-string"},{tag:ce.number,class:"tok-number"},{tag:[ce.regexp,ce.escape,ce.special(ce.string)],class:"tok-string2"},{tag:ce.variableName,class:"tok-variableName"},{tag:ce.local(ce.variableName),class:"tok-variableName tok-local"},{tag:ce.definition(ce.variableName),class:"tok-variableName tok-definition"},{tag:ce.special(ce.variableName),class:"tok-variableName2"},{tag:ce.definition(ce.propertyName),class:"tok-propertyName tok-definition"},{tag:ce.typeName,class:"tok-typeName"},{tag:ce.namespace,class:"tok-namespace"},{tag:ce.className,class:"tok-className"},{tag:ce.macroName,class:"tok-macroName"},{tag:ce.propertyName,class:"tok-propertyName"},{tag:ce.operator,class:"tok-operator"},{tag:ce.comment,class:"tok-comment"},{tag:ce.meta,class:"tok-meta"},{tag:ce.invalid,class:"tok-invalid"},{tag:ce.punctuation,class:"tok-punctuation"}]);var Sh;const nl=new Le,V_=new Le;class Mr{constructor(e,t,r=[],i=""){this.data=e,this.name=i,Me.prototype.hasOwnProperty("tree")||Object.defineProperty(Me.prototype,"tree",{get(){return Pt(this)}}),this.parser=t,this.extension=[zn.of(this),Me.languageData.of((o,s,l)=>{let a=rm(o,s,l),u=a.type.prop(nl);if(!u)return[];let c=o.facet(u),h=a.type.prop(V_);if(h){let f=a.resolve(s-a.from,l);for(let d of h)if(d.test(f,o)){let p=o.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return rm(e,t,r).type.prop(nl)==this.data}findRegions(e){let t=e.facet(zn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(nl)==this.data){r.push({from:s,to:s+o.length});return}let l=o.prop(Le.mounted);if(l){if(l.tree.prop(nl)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+s,to:a.to+s});else r.push({from:s,to:s+o.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+s),r.length>a)return}}for(let a=0;a=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let es=null;class Ou{constructor(e,t,r=[],i,o,s,l,a){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new Ou(e,t,[],Dt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new W_(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Dt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ui.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=es;es=this;try{return e()}finally{es=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=nm(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((u,c,h,f)=>a.push({fromA:u,toA:c,fromB:h,toB:f})),r=ui.applyChanges(r,a),i=Dt.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let c=e.mapPos(u.from,1),h=e.mapPos(u.to,-1);ce.from&&(this.fragments=nm(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends k_{createParse(t,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let a=es;if(a){for(let u of i)a.tempSkipped.push(u);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=s,new Dt(pr.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return es}}function nm(n,e,t){return ui.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class vo{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new vo(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Ou.create(e.facet(zn).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new vo(r)}}Mr.state=ft.define({create:vo.init,update(n,e){for(let t of e.effects)if(t.is(Mr.setState))return t.value;return e.startState.facet(zn)!=e.state.facet(zn)?vo.init(e.state):n.apply(e)}});let c1=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(c1=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const bh=typeof navigator<"u"&&(!((Sh=navigator.scheduling)===null||Sh===void 0)&&Sh.isInputPending)?()=>navigator.scheduling.isInputPending():null,K_=nt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Mr.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Mr.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=c1(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,a=o.context.work(()=>bh&&bh()||Date.now()>s,i+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Mr.setState.of(new vo(o.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ft(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),zn=he.define({combine(n){return n.length?n[0]:null},enables:n=>[Mr.state,K_,de.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]}),G_=he.define(),np=he.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Nu(n){let e=n.facet(np);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Tl(n,e){let t="",r=n.tabSize,i=n.facet(np)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let o=0;o=e?Y_(n,t,e):null}class rc{constructor(e,t={}){this.state=e,this.options=t,this.unit=Nu(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(t<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,t=e.length){return Po(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const X_=new Le;function Y_(n,e,t){let r=e.resolveStack(t),i=r.node.enterUnfinishedNodesBefore(t);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return h1(r,n,t)}function h1(n,e,t){for(let r=n;r;r=r.next){let i=Q_(r.node);if(i)return i(op.create(e,t,r))}return 0}function J_(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Q_(n){let e=n.type.prop(X_);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(Le.closedBy))){let i=n.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>rT(s,!0,1,void 0,o&&!J_(s)?i.from:void 0)}return n.parent==null?Z_:null}function Z_(){return 0}class op extends rc{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new op(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(eT(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return h1(this.context.next,this.base,this.pos)}}function eT(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function tT(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,o=n.state.doc.lineAt(t.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=s)return null;let u=/^ */.exec(o.text.slice(t.to-o.from))[0].length;return{from:t.from,to:t.to+u}}l=a.to}}function rT(n,e,t,r,i){let o=n.textAfter,s=o.match(/^\s*/)[0].length,l=i==n.pos+s,a=tT(n);return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const nT=200;function iT(){return Me.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+nT)return n;let o=t.sliceString(i.from,r);if(!e.some(u=>u.test(o)))return n;let{state:s}=n,l=-1,a=[];for(let{head:u}of s.selection.ranges){let c=s.doc.lineAt(u);if(c.from==l)continue;l=c.from;let h=ip(s,c.from);if(h==null)continue;let f=/^\s*/.exec(c.text)[0],d=Tl(s,h);f!=d&&a.push({from:c.from,to:c.from+f.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const oT=he.define(),sT=new Le;function lT(n,e,t){let r=Pt(n);if(r.lengtht)continue;if(o&&l.from=e&&u.to>t&&(o=u)}}return o}function aT(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Du(n,e,t){for(let r of n.facet(oT)){let i=r(n,e,t);if(i)return i}return lT(n,e,t)}function f1(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const nc=Oe.define({map:f1}),Bl=Oe.define({map:f1});function d1(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const gi=ft.define({create(){return Ae.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(nc)&&!uT(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(g1),i=r?Ae.replace({widget:new gT(r(e.state,t.value))}):im;n=n.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(Bl)&&(n=n.update({filter:(r,i)=>t.value.from!=r||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:r}=e.selection.main;n.between(r,r,(i,o)=>{ir&&(t=!0)}),t&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return n},provide:n=>de.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>o)&&(i={from:o,to:s})}),i}function uT(n,e,t){let r=!1;return n.between(e,e,(i,o)=>{i==e&&o==t&&(r=!0)}),r}function p1(n,e){return n.field(gi,!1)?e:e.concat(Oe.appendConfig.of(x1()))}const cT=n=>{for(let e of d1(n)){let t=Du(n.state,e.from,e.to);if(t)return n.dispatch({effects:p1(n.state,[nc.of(t),m1(n,t)])}),!0}return!1},hT=n=>{if(!n.state.field(gi,!1))return!1;let e=[];for(let t of d1(n)){let r=Pu(n.state,t.from,t.to);r&&e.push(Bl.of(r),m1(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function m1(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return de.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const fT=n=>{let{state:e}=n,t=[];for(let r=0;r{let e=n.state.field(gi,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(Bl.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},pT=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:cT},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:hT},{key:"Ctrl-Alt-[",run:fT},{key:"Ctrl-Alt-]",run:dT}],mT={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},g1=he.define({combine(n){return vr(n,mT)}});function x1(n){return[gi,vT]}function y1(n,e){let{state:t}=n,r=t.facet(g1),i=s=>{let l=n.lineBlockAt(n.posAtDOM(s.target)),a=Pu(n.state,l.from,l.to);a&&n.dispatch({effects:Bl.of(a)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",t.phrase("folded code")),o.title=t.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const im=Ae.replace({widget:new class extends Un{toDOM(n){return y1(n,null)}}});class gT extends Un{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return y1(e,this.value)}}const xT={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Ah extends zr{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function yT(n={}){let e=Object.assign(Object.assign({},xT),n),t=new Ah(e,!0),r=new Ah(e,!1),i=nt.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(zn)!=s.state.facet(zn)||s.startState.field(gi,!1)!=s.state.field(gi,!1)||Pt(s.startState)!=Pt(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let l=new Mn;for(let a of s.viewportLineBlocks){let u=Pu(s.state,a.from,a.to)?r:Du(s.state,a.from,a.to)?t:null;u&&l.add(a.from,a.from,u)}return l.finish()}}),{domEventHandlers:o}=e;return[i,Wy({class:"cm-foldGutter",markers(s){var l;return((l=s.plugin(i))===null||l===void 0?void 0:l.markers)||Re.empty},initialSpacer(){return new Ah(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,l,a)=>{if(o.click&&o.click(s,l,a))return!0;let u=Pu(s.state,l.from,l.to);if(u)return s.dispatch({effects:Bl.of(u)}),!0;let c=Du(s.state,l.from,l.to);return c?(s.dispatch({effects:nc.of(c)}),!0):!1}})}),x1()]}const vT=de.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 ic{constructor(e,t){this.specs=e;let r;function i(l){let a=Bn.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const o=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,s=t.scope;this.scope=s instanceof Mr?l=>l.prop(nl)==s.data:s?l=>l==s:void 0,this.style=u1(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:o}).style,this.module=r?new Bn(r):null,this.themeType=t.themeType}static define(e,t){return new ic(e,t||{})}}const od=he.define(),v1=he.define({combine(n){return n.length?[n[0]]:null}});function _h(n){let e=n.facet(od);return e.length?e:n.facet(v1)}function ST(n,e){let t=[AT],r;return n instanceof ic&&(n.module&&t.push(de.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push(v1.of(n)):r?t.push(od.computeN([de.darkTheme],i=>i.facet(de.darkTheme)==(r=="dark")?[n]:[])):t.push(od.of(n)),t}class bT{constructor(e){this.markCache=Object.create(null),this.tree=Pt(e.state),this.decorations=this.buildDeco(e,_h(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Pt(e.state),r=_h(e.state),i=r!=_h(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return Ae.none;let r=new Mn;for(let{from:i,to:o}of e.visibleRanges)z_(this.tree,t,(s,l,a)=>{r.add(s,l,this.markCache[a]||(this.markCache[a]=Ae.mark({class:a})))},i,o);return r.finish()}}const AT=Li.high(nt.fromClass(bT,{decorations:n=>n.decorations})),_T=ic.define([{tag:ce.meta,color:"#404740"},{tag:ce.link,textDecoration:"underline"},{tag:ce.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ce.emphasis,fontStyle:"italic"},{tag:ce.strong,fontWeight:"bold"},{tag:ce.strikethrough,textDecoration:"line-through"},{tag:ce.keyword,color:"#708"},{tag:[ce.atom,ce.bool,ce.url,ce.contentSeparator,ce.labelName],color:"#219"},{tag:[ce.literal,ce.inserted],color:"#164"},{tag:[ce.string,ce.deleted],color:"#a11"},{tag:[ce.regexp,ce.escape,ce.special(ce.string)],color:"#e40"},{tag:ce.definition(ce.variableName),color:"#00f"},{tag:ce.local(ce.variableName),color:"#30a"},{tag:[ce.typeName,ce.namespace],color:"#085"},{tag:ce.className,color:"#167"},{tag:[ce.special(ce.variableName),ce.macroName],color:"#256"},{tag:ce.definition(ce.propertyName),color:"#00c"},{tag:ce.comment,color:"#940"},{tag:ce.invalid,color:"#f00"}]),TT=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),S1=1e4,b1="()[]{}",A1=he.define({combine(n){return vr(n,{afterCursor:!0,brackets:b1,maxScanDistance:S1,renderMatch:wT})}}),ET=Ae.mark({class:"cm-matchingBracket"}),CT=Ae.mark({class:"cm-nonmatchingBracket"});function wT(n){let e=[],t=n.matched?ET:CT;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const OT=ft.define({create(){return Ae.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(A1);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Br(e.state,i.head,-1,r)||i.head>0&&Br(e.state,i.head-1,1,r)||r.afterCursor&&(Br(e.state,i.head,1,r)||i.headde.decorations.from(n)}),NT=[OT,TT];function DT(n={}){return[A1.of(n),NT]}const PT=new Le;function sd(n,e,t){let r=n.prop(e<0?Le.openedBy:Le.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function ld(n){let e=n.type.prop(PT);return e?e(n.node):n}function Br(n,e,t,r={}){let i=r.maxScanDistance||S1,o=r.brackets||b1,s=Pt(n),l=s.resolveInner(e,t);for(let a=l;a;a=a.parent){let u=sd(a.type,t,o);if(u&&a.from0?e>=c.from&&ec.from&&e<=c.to))return RT(n,e,t,a,c,u,o)}}return LT(n,e,t,s,l.type,i,o)}function RT(n,e,t,r,i,o,s){let l=r.parent,a={from:i.from,to:i.to},u=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(u==0&&o.indexOf(c.type.name)>-1&&c.from0)return null;let u={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let f=0;!c.next().done&&f<=o;){let d=c.value;t<0&&(f+=d.length);let p=e+f*t;for(let v=t>0?0:d.length-1,m=t>0?d.length:-1;v!=m;v+=t){let y=s.indexOf(d[v]);if(!(y<0||r.resolveInner(p+v,1).type!=i))if(y%2==0==t>0)h++;else{if(h==1)return{start:u,end:{from:p+v,to:p+v+1},matched:y>>1==a>>1};h--}}t>0&&(f+=d.length)}return c.done?{start:u,matched:!1}:null}const kT=Object.create(null),om=[pr.none],sm=[],lm=Object.create(null),IT=Object.create(null);for(let[n,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"]])IT[n]=FT(kT,e);function Th(n,e){sm.indexOf(n)>-1||(sm.push(n),console.warn(e))}function FT(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let u of l.split(".")){let c=n[u]||ce[u];c?typeof c=="function"?a.length?a=a.map(c):Th(u,`Modifier ${u} used at start of tag`):a.length?Th(u,`Tag ${u} used as modifier`):a=Array.isArray(c)?c:[c]:Th(u,`Unknown highlighting tag ${u}`)}for(let u of a)t.push(u)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(l=>l.id),o=lm[i];if(o)return o.id;let s=lm[i]=pr.define({id:om.length,name:r,props:[$_({[r]:t})]});return om.push(s),s.id}Ge.RTL,Ge.LTR;const MT=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=lp(n.state,t.from);return r.line?BT(n):r.block?$T(n):!1};function sp(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const BT=sp(qT,0),jT=sp(_1,0),$T=sp((n,e)=>_1(n,e,zT(e)),0);function lp(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const ts=50;function HT(n,{open:e,close:t},r,i){let o=n.sliceDoc(r-ts,r),s=n.sliceDoc(i,i+ts),l=/\s*$/.exec(o)[0].length,a=/^\s*/.exec(s)[0].length,u=o.length-l;if(o.slice(u-e.length,u)==e&&s.slice(a,a+t.length)==t)return{open:{pos:r-l,margin:l&&1},close:{pos:i+a,margin:a&&1}};let c,h;i-r<=2*ts?c=h=n.sliceDoc(r,i):(c=n.sliceDoc(r,r+ts),h=n.sliceDoc(i-ts,i));let f=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(h)[0].length,p=h.length-d-t.length;return c.slice(f,f+e.length)==e&&h.slice(p,p+t.length)==t?{open:{pos:r+f+e.length,margin:/\s/.test(c.charAt(f+e.length))?1:0},close:{pos:i-d-t.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null}function zT(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function _1(n,e,t=e.selection.ranges){let r=t.map(o=>lp(e,o.from).block);if(!r.every(o=>o))return null;let i=t.map((o,s)=>HT(e,r[s],o.from,o.to));if(n!=2&&!i.every(o=>o))return{changes:e.changes(t.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(n!=1&&i.some(o=>o)){let o=[];for(let s=0,l;si&&(o==s||s>h.from)){i=h.from;let f=/^\s*/.exec(h.text)[0].length,d=f==h.length,p=h.text.slice(f,f+u.length)==u?f:-1;fo.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:l,token:a,indent:u,empty:c,single:h}of r)(h||!c)&&o.push({from:l.from+u,insert:a+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(n!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:l,token:a}of r)if(l>=0){let u=s.from+l,c=u+a.length;s.text[c-s.from]==" "&&c++,o.push({from:u,to:c})}return{changes:o}}return null}const ad=fn.define(),UT=fn.define(),VT=he.define(),T1=he.define({combine(n){return vr(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),E1=ft.define({create(){return jr.empty},update(n,e){let t=e.state.facet(T1),r=e.annotation(ad);if(r){let a=Vt.fromTransaction(e,r.selection),u=r.side,c=u==0?n.undone:n.done;return a?c=Ru(c,c.length,t.minDepth,a):c=O1(c,e.startState.selection),new jr(u==0?r.rest:c,u==0?c:r.rest)}let i=e.annotation(UT);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(ct.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let o=Vt.fromTransaction(e),s=e.annotation(ct.time),l=e.annotation(ct.userEvent);return o?n=n.addChanges(o,s,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,s,l,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new jr(n.done.map(Vt.fromJSON),n.undone.map(Vt.fromJSON))}});function WT(n={}){return[E1,T1.of(n),de.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?C1:e.inputType=="historyRedo"?ud:null;return r?(e.preventDefault(),r(t)):!1}})]}function oc(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(E1,!1);if(!i)return!1;let o=i.pop(n,t,e);return o?(r(o),!0):!1}}const C1=oc(0,!1),ud=oc(1,!1),KT=oc(0,!0),GT=oc(1,!0);class Vt{constructor(e,t,r,i,o){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new Vt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Vt(e.changes&&at.fromJSON(e.changes),[],e.mapped&&$r.fromJSON(e.mapped),e.startSelection&&re.fromJSON(e.startSelection),e.selectionsAfter.map(re.fromJSON))}static fromTransaction(e,t){let r=ur;for(let i of e.startState.facet(VT)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Vt(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,ur)}static selection(e){return new Vt(void 0,ur,void 0,void 0,e)}}function Ru(n,e,t,r){let i=e+1>t+20?e-t-1:0,o=n.slice(i,e);return o.push(r),o}function XT(n,e){let t=[],r=!1;return n.iterChangedRanges((i,o)=>t.push(i,o)),e.iterChangedRanges((i,o,s,l)=>{for(let a=0;a=u&&s<=c&&(r=!0)}}),r}function YT(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function w1(n,e){return n.length?e.length?n.concat(e):n:e}const ur=[],JT=200;function O1(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-JT));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),Ru(n,n.length-1,1e9,t.setSelAfter(r)))}else return[Vt.selection([e])]}function QT(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Eh(n,e){if(!n.length)return n;let t=n.length,r=ur;for(;t;){let i=ZT(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=n.slice(0,t);return o[t-1]=i,o}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[Vt.selection(r)]:ur}function ZT(n,e,t){let r=w1(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):ur,t);if(!n.changes)return Vt.selection(r);let i=n.changes.map(e),o=e.mapDesc(n.changes,!0),s=n.mapped?n.mapped.composeDesc(o):o;return new Vt(i,Oe.mapEffects(n.effects,e),s,n.startSelection.map(o),r)}const eE=/^(input\.type|delete)($|\.)/;class jr{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new jr(this.done,this.undone):this}addChanges(e,t,r,i,o){let s=this.done,l=s[s.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||eE.test(r))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):sc(t,e))}function Rt(n){return n.textDirectionAt(n.state.selection.main.head)==Ge.LTR}const D1=n=>N1(n,!Rt(n)),P1=n=>N1(n,Rt(n));function R1(n,e){return Sr(n,t=>t.empty?n.moveByGroup(t,e):sc(t,e))}const rE=n=>R1(n,!Rt(n)),nE=n=>R1(n,Rt(n));function iE(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function lc(n,e,t){let r=Pt(n).resolveInner(e.head),i=t?Le.closedBy:Le.openedBy;for(let a=e.head;;){let u=t?r.childAfter(a):r.childBefore(a);if(!u)break;iE(n,u,i)?r=u:a=t?u.to:u.from}let o=r.type.prop(i),s,l;return o&&(s=t?Br(n,r.from,1):Br(n,r.to,-1))&&s.matched?l=t?s.end.to:s.end.from:l=t?r.to:r.from,re.cursor(l,t?-1:1)}const oE=n=>Sr(n,e=>lc(n.state,e,!Rt(n))),sE=n=>Sr(n,e=>lc(n.state,e,Rt(n)));function L1(n,e){return Sr(n,t=>{if(!t.empty)return sc(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const k1=n=>L1(n,!1),I1=n=>L1(n,!0);function F1(n){let e=n.scrollDOM.clientHeights.empty?n.moveVertically(s,e,t.height):sc(s,e));if(i.eq(r.selection))return!1;let o;if(t.selfScroll){let s=n.coordsAtPos(r.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,u=l.bottom-t.marginBottom;s&&s.top>a&&s.bottomM1(n,!1),cd=n=>M1(n,!0);function Vn(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let o=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=re.cursor(r.from+o))}return i}const lE=n=>Sr(n,e=>Vn(n,e,!0)),aE=n=>Sr(n,e=>Vn(n,e,!1)),uE=n=>Sr(n,e=>Vn(n,e,!Rt(n))),cE=n=>Sr(n,e=>Vn(n,e,Rt(n))),hE=n=>Sr(n,e=>re.cursor(n.lineBlockAt(e.head).from,1)),fE=n=>Sr(n,e=>re.cursor(n.lineBlockAt(e.head).to,-1));function dE(n,e,t){let r=!1,i=Ro(n.selection,o=>{let s=Br(n,o.head,-1)||Br(n,o.head,1)||o.head>0&&Br(n,o.head-1,1)||o.headdE(n,e);function mr(n,e){let t=Ro(n.state.selection,r=>{let i=e(r);return re.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Ur(n.state,t)),!0)}function B1(n,e){return mr(n,t=>n.moveByChar(t,e))}const j1=n=>B1(n,!Rt(n)),$1=n=>B1(n,Rt(n));function H1(n,e){return mr(n,t=>n.moveByGroup(t,e))}const mE=n=>H1(n,!Rt(n)),gE=n=>H1(n,Rt(n)),xE=n=>mr(n,e=>lc(n.state,e,!Rt(n))),yE=n=>mr(n,e=>lc(n.state,e,Rt(n)));function z1(n,e){return mr(n,t=>n.moveVertically(t,e))}const q1=n=>z1(n,!1),U1=n=>z1(n,!0);function V1(n,e){return mr(n,t=>n.moveVertically(t,e,F1(n).height))}const um=n=>V1(n,!1),cm=n=>V1(n,!0),vE=n=>mr(n,e=>Vn(n,e,!0)),SE=n=>mr(n,e=>Vn(n,e,!1)),bE=n=>mr(n,e=>Vn(n,e,!Rt(n))),AE=n=>mr(n,e=>Vn(n,e,Rt(n))),_E=n=>mr(n,e=>re.cursor(n.lineBlockAt(e.head).from)),TE=n=>mr(n,e=>re.cursor(n.lineBlockAt(e.head).to)),hm=({state:n,dispatch:e})=>(e(Ur(n,{anchor:0})),!0),fm=({state:n,dispatch:e})=>(e(Ur(n,{anchor:n.doc.length})),!0),dm=({state:n,dispatch:e})=>(e(Ur(n,{anchor:n.selection.main.anchor,head:0})),!0),pm=({state:n,dispatch:e})=>(e(Ur(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),EE=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),CE=({state:n,dispatch:e})=>{let t=ac(n).map(({from:r,to:i})=>re.range(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:re.create(t),userEvent:"select"})),!0},wE=({state:n,dispatch:e})=>{let t=Ro(n.selection,r=>{let i=Pt(n),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:l}=s;if((l.from=r.to||l.to>r.to&&l.from<=r.from)&&s.next)return re.range(l.to,l.from)}return r});return t.eq(n.selection)?!1:(e(Ur(n,t)),!0)},OE=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=re.create([t.main]):t.main.empty||(r=re.create([re.cursor(t.main.head)])),r?(e(Ur(n,r)),!0):!1};function jl(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(o=>{let{from:s,to:l}=o;if(s==l){let a=e(o);as&&(t="delete.forward",a=ja(n,a,!0)),s=Math.min(s,a),l=Math.max(l,a)}else s=ja(n,s,!1),l=ja(n,l,!0);return s==l?{range:o}:{changes:{from:s,to:l},range:re.cursor(s,si(n)))r.between(e,e,(i,o)=>{ie&&(e=t?o:i)});return e}const W1=(n,e,t)=>jl(n,r=>{let i=r.from,{state:o}=n,s=o.doc.lineAt(i),l,a;if(t&&!e&&i>s.from&&iW1(n,!1,!0),K1=n=>W1(n,!0,!1),G1=(n,e)=>jl(n,t=>{let r=t.head,{state:i}=n,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let l=null;;){if(r==(e?o.to:o.from)){r==t.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let a=At(o.text,r-o.from,e)+o.from,u=o.text.slice(Math.min(r,a)-o.from,Math.max(r,a)-o.from),c=s(u);if(l!=null&&c!=l)break;(u!=" "||r!=t.head)&&(l=c),r=a}return r}),X1=n=>G1(n,!1),NE=n=>G1(n,!0),DE=n=>jl(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headjl(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),RE=n=>jl(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:je.of(["",""])},range:re.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},kE=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,o=n.doc.lineAt(i),s=i==o.from?i-1:At(o.text,i-o.from,!1)+o.from,l=i==o.to?i+1:At(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:l,insert:n.doc.slice(i,l).append(n.doc.slice(s,i))},range:re.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ac(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),o=n.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=n.doc.lineAt(r.to-1)),t>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});t=o.number+1}return e}function Y1(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let o of ac(n)){if(t?o.to==n.doc.length:o.from==0)continue;let s=n.doc.lineAt(t?o.to+1:o.from-1),l=s.length+1;if(t){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+n.lineBreak});for(let a of o.ranges)i.push(re.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:n.lineBreak+s.text});for(let a of o.ranges)i.push(re.range(a.anchor-l,a.head-l))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:re.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const IE=({state:n,dispatch:e})=>Y1(n,e,!1),FE=({state:n,dispatch:e})=>Y1(n,e,!0);function J1(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of ac(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});return e(n.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ME=({state:n,dispatch:e})=>J1(n,e,!1),BE=({state:n,dispatch:e})=>J1(n,e,!0),jE=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(ac(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(n.lineWrapping){let s=n.lineBlockAt(i.head),l=n.coordsAtPos(i.head,i.assoc||1);l&&(o=s.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,o)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function $E(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Pt(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(Le.closedBy))&&o.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const HE=Q1(!1),zE=Q1(!0);function Q1(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,l=e.doc.lineAt(o),a=!n&&o==s&&$E(e,o);n&&(o=s=(s<=l.to?l:e.doc.lineAt(s)).to);let u=new rc(e,{simulateBreak:o,simulateDoubleBreak:!!a}),c=ip(u,o);for(c==null&&(c=Po(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sl.from&&o{let i=[];for(let s=r.from;s<=r.to;){let l=n.doc.lineAt(s);l.number>t&&(r.empty||r.to>l.from)&&(e(l,i,r),t=l.number),s=l.to+1}let o=n.changes(i);return{changes:i,range:re.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const qE=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new rc(n,{overrideIndentation:o=>{let s=t[o];return s??-1}}),i=ap(n,(o,s,l)=>{let a=ip(r,o.from);if(a==null)return;/\S/.test(o.text)||(a=0);let u=/^\s*/.exec(o.text)[0],c=Tl(n,a);(u!=c||l.fromn.readOnly?!1:(e(n.update(ap(n,(t,r)=>{r.push({from:t.from,insert:n.facet(np)})}),{userEvent:"input.indent"})),!0),VE=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ap(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let o=Po(i,n.tabSize),s=0,l=Tl(n,Math.max(0,o-Nu(n)));for(;s(n.setTabFocusMode(),!0),KE=[{key:"Ctrl-b",run:D1,shift:j1,preventDefault:!0},{key:"Ctrl-f",run:P1,shift:$1},{key:"Ctrl-p",run:k1,shift:q1},{key:"Ctrl-n",run:I1,shift:U1},{key:"Ctrl-a",run:hE,shift:_E},{key:"Ctrl-e",run:fE,shift:TE},{key:"Ctrl-d",run:K1},{key:"Ctrl-h",run:hd},{key:"Ctrl-k",run:DE},{key:"Ctrl-Alt-h",run:X1},{key:"Ctrl-o",run:LE},{key:"Ctrl-t",run:kE},{key:"Ctrl-v",run:cd}],GE=[{key:"ArrowLeft",run:D1,shift:j1,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:rE,shift:mE,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:uE,shift:bE,preventDefault:!0},{key:"ArrowRight",run:P1,shift:$1,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:nE,shift:gE,preventDefault:!0},{mac:"Cmd-ArrowRight",run:cE,shift:AE,preventDefault:!0},{key:"ArrowUp",run:k1,shift:q1,preventDefault:!0},{mac:"Cmd-ArrowUp",run:hm,shift:dm},{mac:"Ctrl-ArrowUp",run:am,shift:um},{key:"ArrowDown",run:I1,shift:U1,preventDefault:!0},{mac:"Cmd-ArrowDown",run:fm,shift:pm},{mac:"Ctrl-ArrowDown",run:cd,shift:cm},{key:"PageUp",run:am,shift:um},{key:"PageDown",run:cd,shift:cm},{key:"Home",run:aE,shift:SE,preventDefault:!0},{key:"Mod-Home",run:hm,shift:dm},{key:"End",run:lE,shift:vE,preventDefault:!0},{key:"Mod-End",run:fm,shift:pm},{key:"Enter",run:HE},{key:"Mod-a",run:EE},{key:"Backspace",run:hd,shift:hd},{key:"Delete",run:K1},{key:"Mod-Backspace",mac:"Alt-Backspace",run:X1},{key:"Mod-Delete",mac:"Alt-Delete",run:NE},{mac:"Mod-Backspace",run:PE},{mac:"Mod-Delete",run:RE}].concat(KE.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),XE=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:oE,shift:xE},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:sE,shift:yE},{key:"Alt-ArrowUp",run:IE},{key:"Shift-Alt-ArrowUp",run:ME},{key:"Alt-ArrowDown",run:FE},{key:"Shift-Alt-ArrowDown",run:BE},{key:"Escape",run:OE},{key:"Mod-Enter",run:zE},{key:"Alt-l",mac:"Ctrl-l",run:CE},{key:"Mod-i",run:wE,preventDefault:!0},{key:"Mod-[",run:VE},{key:"Mod-]",run:UE},{key:"Mod-Alt-\\",run:qE},{key:"Shift-Mod-k",run:jE},{key:"Shift-Mod-\\",run:pE},{key:"Mod-/",run:MT},{key:"Alt-A",run:jT},{key:"Ctrl-m",mac:"Shift-Alt-m",run:WE}].concat(GE),mm=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class So{constructor(e,t,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?l=>o(mm(l)):mm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return yt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Bd(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=ar(e);let i=this.normalize(t);for(let o=0,s=r;;o++){let l=i.charCodeAt(o),a=this.match(l,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(a)return this.value=a,this;break}s==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Lu(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=t){let l=new uo(t,e.sliceString(t,r));return Ch.set(e,l),l}if(i.from==t&&i.to==r)return i;let{text:o,from:s}=i;return s>t&&(o=e.sliceString(t,s)+o,s=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Lu(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=uo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(ev.prototype[Symbol.iterator]=tv.prototype[Symbol.iterator]=function(){return this});function YE(n){try{return new RegExp(n,up),!0}catch{return!1}}function Lu(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function fd(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=We("input",{class:"cm-textfield",name:"line",value:e}),r=We("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),n.dispatch({effects:ku.of(!1)}),n.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},We("label",n.state.phrase("Go to line"),": ",t)," ",We("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!o)return;let{state:s}=n,l=s.doc.lineAt(s.selection.main.head),[,a,u,c,h]=o,f=c?+c.slice(1):0,d=u?+u:l.number;if(u&&h){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/s.doc.lines),d=Math.round(s.doc.lines*m)}else u&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,d))),v=re.cursor(p.from+Math.max(0,Math.min(f,p.length)));n.dispatch({effects:[ku.of(!1),de.scrollIntoView(v.from,{y:"center"})],selection:v}),n.focus()}return{dom:r}}const ku=Oe.define(),gm=ft.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(ku)&&(n=t.value);return n},provide:n=>bl.from(n,e=>e?fd:null)}),JE=n=>{let e=Sl(n,fd);if(!e){let t=[ku.of(!0)];n.state.field(gm,!1)==null&&t.push(Oe.appendConfig.of([gm,QE])),n.dispatch({effects:t}),e=Sl(n,fd)}return e&&e.dom.querySelector("input").select(),!0},QE=de.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),ZE={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},eC=he.define({combine(n){return vr(n,ZE,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function tC(n){return[sC,oC]}const rC=Ae.mark({class:"cm-selectionMatch"}),nC=Ae.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function xm(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=Xe.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=Xe.Word)}function iC(n,e,t,r){return n(e.sliceDoc(t,t+1))==Xe.Word&&n(e.sliceDoc(r-1,r))==Xe.Word}const oC=nt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(eC),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Ae.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ae.none;let a=t.wordAt(i.head);if(!a)return Ae.none;s=t.charCategorizer(i.head),o=t.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a200)return Ae.none;if(e.wholeWords){if(o=t.sliceDoc(i.from,i.to),s=t.charCategorizer(i.head),!(xm(s,t,i.from,i.to)&&iC(s,t,i.from,i.to)))return Ae.none}else if(o=t.sliceDoc(i.from,i.to),!o)return Ae.none}let l=[];for(let a of n.visibleRanges){let u=new So(t.doc,o,a.from,a.to);for(;!u.next().done;){let{from:c,to:h}=u.value;if((!s||xm(s,t,c,h))&&(i.empty&&c<=i.from&&h>=i.to?l.push(nC.range(c,h)):(c>=i.to||h<=i.from)&&l.push(rC.range(c,h)),l.length>e.maxMatches))return Ae.none}}return Ae.set(l)}},{decorations:n=>n.decorations}),sC=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),lC=({state:n,dispatch:e})=>{let{selection:t}=n,r=re.create(t.ranges.map(i=>n.wordAt(i.head)||re.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function aC(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),o=i&&i.from==t.from&&i.to==t.to;for(let s=!1,l=new So(n.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(s)return null;l=new So(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(a=>a.from==l.value.from))continue;if(o){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const uC=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(o=>o.from===o.to))return lC({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(o=>n.sliceDoc(o.from,o.to)!=r))return!1;let i=aC(n,r);return i?(e(n.update({selection:n.selection.addRange(re.range(i.from,i.to),!1),effects:de.scrollIntoView(i.to)})),!0):!1},Lo=he.define({combine(n){return vr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new bC(e),scrollToMatch:e=>de.scrollIntoView(e)})}});class rv{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||YE(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?` -`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new dC(this):new hC(this)}getCursor(e,t=0,r){let i=e.doc?e:Me.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Ji(this,i,t,r):Yi(this,i,t,r)}}class nv{constructor(e){this.spec=e}}function Yi(n,e,t,r){return new So(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?cC(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function cC(n,e){return(t,r,i,o)=>((o>t||o+i.length=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let o=Yi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Ji(n,e,t,r){return new ev(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?fC(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function Iu(n,e){return n.slice(At(n,e,!1),e)}function Fu(n,e){return n.slice(e,At(n,e))}function fC(n){return(e,t,r)=>!r[0].length||(n(Iu(r.input,r.index))!=Xe.Word||n(Fu(r.input,r.index))!=Xe.Word)&&(n(Fu(r.input,r.index+r[0].length))!=Xe.Word||n(Iu(r.input,r.index+r[0].length))!=Xe.Word)}class dC extends nv{nextMatch(e,t,r){let i=Ji(this.spec,e,r,e.doc.length).next();return i.done&&(i=Ji(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let o=Math.max(t,r-i*1e4),s=Ji(this.spec,e,o,r),l=null;for(;!s.next().done;)l=s.value;if(l&&(o==t||l.from>o+10))return l;if(o==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let o=Ji(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const El=Oe.define(),cp=Oe.define(),kn=ft.define({create(n){return new wh(dd(n).create(),null)},update(n,e){for(let t of e.effects)t.is(El)?n=new wh(t.value.create(),n.panel):t.is(cp)&&(n=new wh(n.query,t.value?hp:null));return n},provide:n=>bl.from(n,e=>e.panel)});class wh{constructor(e,t){this.query=e,this.panel=t}}const pC=Ae.mark({class:"cm-searchMatch"}),mC=Ae.mark({class:"cm-searchMatch cm-searchMatch-selected"}),gC=nt.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(kn))}update(n){let e=n.state.field(kn);(e!=n.startState.field(kn)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ae.none;let{view:t}=this,r=new Mn;for(let i=0,o=t.visibleRanges,s=o.length;io[i+1].from-2*250;)a=o[++i].to;n.highlight(t.state,l,a,(u,c)=>{let h=t.state.selection.ranges.some(f=>f.from==u&&f.to==c);r.add(u,c,h?mC:pC)})}return r.finish()}},{decorations:n=>n.decorations});function $l(n){return e=>{let t=e.state.field(kn,!1);return t&&t.query.spec.valid?n(e,t):sv(e)}}const Mu=$l((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=re.single(r.from,r.to),o=n.state.facet(Lo);return n.dispatch({selection:i,effects:[fp(n,r),o.scrollToMatch(i.main,n)],userEvent:"select.search"}),ov(n),!0}),Bu=$l((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let o=re.single(i.from,i.to),s=n.state.facet(Lo);return n.dispatch({selection:o,effects:[fp(n,i),s.scrollToMatch(o.main,n)],userEvent:"select.search"}),ov(n),!0}),xC=$l((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:re.create(t.map(r=>re.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),yC=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,o=[],s=0;for(let l=new So(n.doc,n.sliceDoc(r,i));!l.next().done;){if(o.length>1e3)return!1;l.value.from==r&&(s=o.length),o.push(re.range(l.value.from,l.value.to))}return e(n.update({selection:re.create(o,s),userEvent:"select.search.matches"})),!0},ym=$l((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let o=e.nextMatch(t,r,r);if(!o)return!1;let s=[],l,a,u=[];if(o.from==r&&o.to==i&&(a=t.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:a}),o=e.nextMatch(t,o.from,o.to),u.push(de.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),o){let c=s.length==0||s[0].from>=o.to?0:o.to-o.from-a.length;l=re.single(o.from-c,o.to-c),u.push(fp(n,o)),u.push(t.facet(Lo).scrollToMatch(l.main,n))}return n.dispatch({changes:s,selection:l,effects:u,userEvent:"input.replace"}),!0}),vC=$l((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:de.announce.of(r),userEvent:"input.replace.all"}),!0});function hp(n){return n.state.facet(Lo).createPanel(n)}function dd(n,e){var t,r,i,o,s;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let u=n.facet(Lo);return new rv({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:u.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:u.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:u.wholeWord})}function iv(n){let e=Sl(n,hp);return e&&e.dom.querySelector("[main-field]")}function ov(n){let e=iv(n);e&&e==n.root.activeElement&&e.select()}const sv=n=>{let e=n.state.field(kn,!1);if(e&&e.panel){let t=iv(n);if(t&&t!=n.root.activeElement){let r=dd(n.state,e.query.spec);r.valid&&n.dispatch({effects:El.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[cp.of(!0),e?El.of(dd(n.state,e.query.spec)):Oe.appendConfig.of(_C)]});return!0},lv=n=>{let e=n.state.field(kn,!1);if(!e||!e.panel)return!1;let t=Sl(n,hp);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:cp.of(!1)}),!0},SC=[{key:"Mod-f",run:sv,scope:"editor search-panel"},{key:"F3",run:Mu,shift:Bu,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Mu,shift:Bu,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:lv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:yC},{key:"Mod-Alt-g",run:JE},{key:"Mod-d",run:uC,preventDefault:!0}];class bC{constructor(e){this.view=e;let t=this.query=e.state.field(kn).query.spec;this.commit=this.commit.bind(this),this.searchField=We("input",{value:t.search,placeholder:Gt(e,"Find"),"aria-label":Gt(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=We("input",{value:t.replace,placeholder:Gt(e,"Replace"),"aria-label":Gt(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=We("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=We("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=We("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,o,s){return We("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=We("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Mu(e),[Gt(e,"next")]),r("prev",()=>Bu(e),[Gt(e,"previous")]),r("select",()=>xC(e),[Gt(e,"all")]),We("label",null,[this.caseField,Gt(e,"match case")]),We("label",null,[this.reField,Gt(e,"regexp")]),We("label",null,[this.wordField,Gt(e,"by word")]),...e.state.readOnly?[]:[We("br"),this.replaceField,r("replace",()=>ym(e),[Gt(e,"replace")]),r("replaceAll",()=>vC(e),[Gt(e,"replace all")])],We("button",{name:"close",onclick:()=>lv(e),"aria-label":Gt(e,"close"),type:"button"},["×"])])}commit(){let e=new rv({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:El.of(e)}))}keydown(e){uA(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Bu:Mu)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ym(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(El)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Lo).top}}function Gt(n,e){return n.state.phrase(e)}const $a=30,Ha=/[\s\.,:;?!]/;function fp(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,o=Math.max(r.from,e-$a),s=Math.min(i,t+$a),l=n.state.sliceDoc(o,s);if(o!=r.from){for(let a=0;a<$a;a++)if(!Ha.test(l[a+1])&&Ha.test(l[a])){l=l.slice(a);break}}if(s!=i){for(let a=l.length-1;a>l.length-$a;a--)if(!Ha.test(l[a-1])&&Ha.test(l[a])){l=l.slice(0,a);break}}return de.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${r.number}.`)}const AC=de.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"}}),_C=[kn,Li.low(gC),AC];class av{constructor(e,t,r,i){this.state=e,this.pos=t,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Pt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),o=i.search(uv(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function vm(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function TC(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:TC(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:t}:null}}class Sm{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function In(n){return n.selection.main.from}function uv(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?n:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const cv=fn.define();function CC(n,e,t,r){let{main:i}=n.selection,o=t-i.from,s=r-i.from;return Object.assign(Object.assign({},n.changeByRange(l=>{if(l!=i&&t!=r&&n.sliceDoc(l.from+o,l.from+s)!=n.sliceDoc(t,r))return{range:l};let a=n.toText(e);return{changes:{from:l.from+o,to:r==i.from?l.to:l.from+s,insert:a},range:re.cursor(l.from+o+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const bm=new WeakMap;function wC(n){if(!Array.isArray(n))return n;let e=bm.get(n);return e||bm.set(n,e=EC(n)),e}const ju=Oe.define(),Cl=Oe.define();class OC{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(b=Bd(_))!=b.toLowerCase()?1:b!=b.toUpperCase()?2:0;(!g||C==1&&m||S==0&&C!=0)&&(t[h]==_||r[h]==_&&(f=!0)?s[h++]=g:s.length&&(y=!1)),S=C,g+=ar(_)}return h==a&&s[0]==0&&y?this.result(-100+(f?-200:0),s,e):d==a&&p==0?this.ret(-200-e.length+(v==e.length?0:-100),[0,v]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,v]):h==a?this.result(-100+(f?-200:0)+-700+(y?0:-1100),s,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],o=0;for(let s of t){let l=s+(this.astral?ar(yt(r,s)):1);o&&i[o-1]==s?i[o-1]=l:(i[o++]=s,i[o++]=l)}return this.ret(e-r.length,i)}}class NC{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:DC,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>Am(e(r),t(r)),optionClass:(e,t)=>r=>Am(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Am(n,e){return n?e?n+" "+e:n:e}function DC(n,e,t,r,i,o){let s=n.textDirection==Ge.RTL,l=s,a=!1,u="top",c,h,f=e.left-i.left,d=i.right-e.right,p=r.right-r.left,v=r.bottom-r.top;if(l&&f=v||g>e.top?c=t.bottom-e.top:(u="bottom",c=e.bottom-t.top)}let m=(e.bottom-e.top)/o.offsetHeight,y=(e.right-e.left)/o.offsetWidth;return{style:`${u}: ${c/m}px; max-width: ${h/y}px`,class:"cm-completionInfo-"+(a?s?"left-narrow":"right-narrow":l?"left":"right")}}function PC(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let u=0;ua&&s.appendChild(document.createTextNode(l.slice(a,c)));let f=s.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(l.slice(c,h))),f.className="cm-completionMatchedText",a=h}return at.position-r.position).map(t=>t.render)}function Oh(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class RC{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:o,selected:s}=i.open,l=e.state.facet(bt);this.optionContent=PC(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Oh(o.length,s,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:u}=e.state.field(t).open;for(let c=a.target,h;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(h=/-(\d+)$/.exec(c.id))&&+h[1]{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(bt).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Cl.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:l}=r.open;(!i.open||i.open.options!=o)&&(this.range=Oh(o.length,s,e.state.facet(bt).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),l!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Oh(t.options.length,t.selected,this.view.state.facet(bt).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>Ft(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return t&&kC(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,t.bottom)-10||i.bottomr.from||r.from==0))if(o=f,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let d=i.appendChild(document.createElement("completion-section"));d.textContent=f}}const c=i.appendChild(document.createElement("li"));c.id=t+"-"+s,c.setAttribute("role","option");let h=this.optionClass(l);h&&(c.className=h);for(let f of this.optionContent){let d=f(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew RC(t,n,e)}function kC(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.topt.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function _m(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function IC(n,e){let t=[],r=null,i=u=>{t.push(u);let{section:c}=u.completion;if(c){r||(r=[]);let h=typeof c=="string"?c:c.name;r.some(f=>f.name==h)||r.push(typeof c=="string"?{name:h}:c)}},o=e.facet(bt);for(let u of n)if(u.hasResult()){let c=u.result.getMatch;if(u.result.filter===!1)for(let h of u.result.options)i(new Sm(h,u.source,c?c(h):[],1e9-t.length));else{let h=e.sliceDoc(u.from,u.to),f,d=o.filterStrict?new NC(h):new OC(h);for(let p of u.result.options)if(f=d.match(p.label)){let v=p.displayLabel?c?c(p,f.matched):[]:f.matched;i(new Sm(p,u.source,v,f.score+(p.boost||0)))}}}if(r){let u=Object.create(null),c=0,h=(f,d)=>{var p,v;return((p=f.rank)!==null&&p!==void 0?p:1e9)-((v=d.rank)!==null&&v!==void 0?v:1e9)||(f.nameh.score-c.score||a(c.completion,h.completion))){let c=u.completion;!l||l.label!=c.label||l.detail!=c.detail||l.type!=null&&c.type!=null&&l.type!=c.type||l.apply!=c.apply||l.boost!=c.boost?s.push(u):_m(u.completion)>_m(l)&&(s[s.length-1]=u),l=u.completion}return s}class to{constructor(e,t,r,i,o,s){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new to(this.options,Tm(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,o){let s=IC(e,t);if(!s.length)return i&&e.some(a=>a.state==1)?new to(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let l=t.facet(bt).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let a=i.options[i.selected].completion;for(let u=0;uu.hasResult()?Math.min(a,u.from):a,1e8),create:HC,above:o.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new to(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class $u{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new $u(jC,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(bt),o=(r.override||t.languageDataAt("autocomplete",In(t)).map(wC)).map(l=>(this.active.find(u=>u.source==l)||new Zt(l,this.active.some(u=>u.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((l,a)=>l==this.active[a])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!FC(o,this.active)?s=to.build(o,t,this.id,s,r):s&&s.disabled&&!o.some(l=>l.state==1)&&(s=null),!s&&o.every(l=>l.state!=1)&&o.some(l=>l.hasResult())&&(o=o.map(l=>l.hasResult()?new Zt(l.source,0):l));for(let l of e.effects)l.is(dv)&&(s=s&&s.setSelected(l.value,this.id));return o==this.active&&s==this.open?this:new $u(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?MC:BC}}function FC(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const jC=[];function hv(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(cv);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Zt{constructor(e,t,r=-1){this.source=e,this.state=t,this.explicitPos=r}hasResult(){return!1}update(e,t){let r=hv(e,t),i=this;(r&8||r&16&&this.touches(e))&&(i=new Zt(i.source,0)),r&4&&i.state==0&&(i=new Zt(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(ju))i=new Zt(i.source,1,o.value?In(e.state):-1);else if(o.is(Cl))i=new Zt(i.source,0);else if(o.is(fv))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(e,t){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Zt(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(In(e.state))}}class co extends Zt{constructor(e,t,r,i,o){super(e,2,t),this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),l=In(e.state);if((this.explicitPos<0?l<=o:ls||!i||t&2&&In(e.startState)==this.from)return new Zt(this.source,t&4?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return $C(i.validFor,e.state,o,s)?new co(this.source,a,i,o,s):i.update&&(i=i.update(i,o,s,new av(e.state,l,a>=0)))?new co(this.source,a,i,i.from,(r=i.to)!==null&&r!==void 0?r:In(e.state)):new Zt(this.source,1,a)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new co(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Zt(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function $C(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):uv(n,!0).test(i)}const fv=Oe.define({map(n,e){return n.map(t=>t.map(e))}}),dv=Oe.define(),Ut=ft.define({create(){return $u.start()},update(n,e){return n.update(e)},provide:n=>[Qu.from(n,e=>e.tooltip),de.contentAttributes.from(n,e=>e.attrs)]});function dp(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(Ut).active.find(i=>i.source==e.source);return r instanceof co?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},CC(n.state,t,r.from,r.to)),{annotations:cv.of(e.completion)})):t(n,e.completion,r.from,r.to),!0):!1}const HC=LC(Ut,dp);function za(n,e="option"){return t=>{let r=t.state.field(Ut,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(n?1:-1):n?0:s-1;return l<0?l=e=="page"?0:s-1:l>=s&&(l=e=="page"?s-1:0),t.dispatch({effects:dv.of(l)}),!0}}const zC=n=>{let e=n.state.field(Ut,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Ut,!1)?(n.dispatch({effects:ju.of(!0)}),!0):!1,qC=n=>{let e=n.state.field(Ut,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Cl.of(null)}),!0)};class UC{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const VC=50,WC=1e3,KC=nt.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Ut).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Ut),t=n.state.facet(bt);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ut)==e)return;let r=n.transactions.some(o=>{let s=hv(o,t);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;oVC&&Date.now()-s.time>WC){for(let l of s.context.abortListeners)try{l()}catch(a){Ft(this.view.state,a)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(o=>o.effects.some(s=>s.is(ju)))&&(this.pendingStart=!0);let i=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of n.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Ut);for(let t of e.active)t.state==1&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=In(e),r=new av(e,t,n.explicitPos==t,this.view),i=new UC(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:Cl.of(null)}),Ft(this.view.state,o)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(bt).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(bt);for(let r=0;rs.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new Zt(i.active.source,0);for(let l of i.updates)s=s.update(l,t);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:fv.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Ut,!1);if(e&&e.tooltip&&this.view.state.facet(bt).closeOnBlur){let t=e.open&&Uy(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Cl.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ju.of(!1)}),20),this.composing=0}}}),GC=typeof navigator=="object"&&/Win/.test(navigator.platform),XC=Li.highest(de.domEventHandlers({keydown(n,e){let t=e.state.field(Ut,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(GC&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(n.key)>-1&&dp(e,r),!1}})),YC=de.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),wl={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},li=Oe.define({map(n,e){let t=e.mapPos(n,-1,It.TrackAfter);return t??void 0}}),pp=new class extends fi{};pp.startSide=1;pp.endSide=-1;const pv=ft.define({create(){return Re.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(li)&&(n=n.update({add:[pp.range(t.value,t.value+1)]}));return n}});function JC(){return[ZC,pv]}const Nh="()[]{}<>";function mv(n){for(let e=0;e{if((QC?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(r.length>2||r.length==2&&ar(yt(r,0))==1||e!=i.from||t!=i.to)return!1;let o=rw(n.state,r);return o?(n.dispatch(o),!0):!1}),ew=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=gv(n,n.selection.main.head).brackets||wl.brackets,i=null,o=n.changeByRange(s=>{if(s.empty){let l=nw(n.doc,s.head);for(let a of r)if(a==l&&uc(n.doc,s.head)==mv(yt(a,0)))return{changes:{from:s.head-a.length,to:s.head+a.length},range:re.cursor(s.head-a.length)}}return{range:i=s}});return i||e(n.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},tw=[{key:"Backspace",run:ew}];function rw(n,e){let t=gv(n,n.selection.main.head),r=t.brackets||wl.brackets;for(let i of r){let o=mv(yt(i,0));if(e==i)return o==i?sw(n,i,r.indexOf(i+i+i)>-1,t):iw(n,i,o,t.before||wl.before);if(e==o&&xv(n,n.selection.main.from))return ow(n,i,o)}return null}function xv(n,e){let t=!1;return n.field(pv).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function uc(n,e){let t=n.sliceString(e,e+2);return t.slice(0,ar(yt(t,0)))}function nw(n,e){let t=n.sliceString(e-2,e);return ar(yt(t,0))==t.length?t:t.slice(1)}function iw(n,e,t,r){let i=null,o=n.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:t,from:s.to}],effects:li.of(s.to+e.length),range:re.range(s.anchor+e.length,s.head+e.length)};let l=uc(n.doc,s.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+t,from:s.head},effects:li.of(s.head+e.length),range:re.cursor(s.head+e.length)}:{range:i=s}});return i?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function ow(n,e,t){let r=null,i=n.changeByRange(o=>o.empty&&uc(n.doc,o.head)==t?{changes:{from:o.head,to:o.head+t.length,insert:t},range:re.cursor(o.head+t.length)}:r={range:o});return r?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function sw(n,e,t,r){let i=r.stringPrefixes||wl.stringPrefixes,o=null,s=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:li.of(l.to+e.length),range:re.range(l.anchor+e.length,l.head+e.length)};let a=l.head,u=uc(n.doc,a),c;if(u==e){if(Cm(n,a))return{changes:{insert:e+e,from:a},effects:li.of(a+e.length),range:re.cursor(a+e.length)};if(xv(n,a)){let f=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+f.length,insert:f},range:re.cursor(a+f.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=wm(n,a-2*e.length,i))>-1&&Cm(n,c))return{changes:{insert:e+e+e+e,from:a},effects:li.of(a+e.length),range:re.cursor(a+e.length)};if(n.charCategorizer(a)(u)!=Xe.Word&&wm(n,a,i)>-1&&!lw(n,a,e,i))return{changes:{insert:e+e,from:a},effects:li.of(a+e.length),range:re.cursor(a+e.length)}}return{range:o=l}});return o?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Cm(n,e){let t=Pt(n).resolveInner(e+1);return t.parent&&t.from==e}function lw(n,e,t,r){let i=Pt(n).resolveInner(e,-1),o=r.reduce((s,l)=>Math.max(s,l.length),0);for(let s=0;s<5;s++){let l=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+o)),a=l.indexOf(t);if(!a||a>-1&&r.indexOf(l.slice(0,a))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function wm(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=Xe.Word)return e;for(let i of t){let o=e-i.length;if(n.sliceDoc(o,e)==i&&r(n.sliceDoc(o-1,o))!=Xe.Word)return o}return-1}function aw(n={}){return[XC,Ut,bt.of(n),KC,uw,YC]}const yv=[{key:"Ctrl-Space",run:Em},{mac:"Alt-`",run:Em},{key:"Escape",run:qC},{key:"ArrowDown",run:za(!0)},{key:"ArrowUp",run:za(!1)},{key:"PageDown",run:za(!0,"page")},{key:"PageUp",run:za(!1,"page")},{key:"Enter",run:zC}],uw=Li.highest(Yd.computeN([bt],n=>n.facet(bt).defaultKeymap?[yv]:[])),cw=[o_(),a_(),CA(),WT(),yT(),mA(),SA(),Me.allowMultipleSelections.of(!0),iT(),ST(_T,{fallback:!0}),DT(),JC(),aw(),BA(),HA(),RA(),tC(),Yd.of([...tw,...XE,...SC,...tE,...pT,...yv,...m_])];var w=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pd={},vv={};/*! +var OS=Object.defineProperty;var NS=(n,e,t)=>e in n?OS(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var te=(n,e,t)=>NS(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();class je{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]=xo(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),Ir.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=xo(this,e,t);let r=[];return this.decompose(e,t,r,0),Ir.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),i=new hl(this),o=new hl(e);for(let s=t,l=t;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(l+=i.value.length,i.done||l>=r)return!0}}iter(e=1){return new hl(this,e)}iterRange(e,t=this.length){return new Ox(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Nx(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]?je.empty:e.length<=32?new et(e):Ir.from(et.split(e,[]))}}class et extends je{constructor(e,t=DS(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let o=0;;o++){let s=this.text[o],l=i+s.length;if((t?r:l)>=e)return new PS(i,l,r,s);i=l+1,r++}}decompose(e,t,r,i){let o=e<=0&&t>=this.length?this:new et(Qp(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),l=ru(o.text,s.text.slice(),0,o.length);if(l.length<=32)r.push(new et(l,s.length+o.length));else{let a=l.length>>1;r.push(new et(l.slice(0,a)),new et(l.slice(a)))}}else r.push(o)}replace(e,t,r){if(!(r instanceof et))return super.replace(e,t,r);[e,t]=xo(this,e,t);let i=ru(this.text,ru(r.text,Qp(this.text,0,e)),t),o=this.length+r.length-(t-e);return i.length<=32?new et(i,o):Ir.from(et.split(i,[]),o)}sliceString(e,t=this.length,r=` +`){[e,t]=xo(this,e,t);let i="";for(let o=0,s=0;o<=t&&se&&s&&(i+=r),eo&&(i+=l.slice(Math.max(0,e-o),t-o)),o=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(t.push(new et(r,i)),r=[],i=-1);return i>-1&&t.push(new et(r,i)),t}}class Ir extends je{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,i){for(let o=0;;o++){let s=this.children[o],l=i+s.length,a=r+s.lines-1;if((t?a:l)>=e)return s.lineInner(e,t,r,i);i=l+1,r=a+1}}decompose(e,t,r,i){for(let o=0,s=0;s<=t&&o=s){let u=i&((s<=e?1:0)|(a>=t?2:0));s>=e&&a<=t&&!u?r.push(l):l.decompose(e-s,t-s,r,u)}s=a+1}}replace(e,t,r){if([e,t]=xo(this,e,t),r.lines=o&&t<=l){let a=s.replace(e-o,t-o,r),u=this.lines-s.lines+a.lines;if(a.lines>4&&a.lines>u>>6){let c=this.children.slice();return c[i]=a,new Ir(c,this.length-(t-e)+r.length)}return super.replace(o,l,a)}o=l+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=` +`){[e,t]=xo(this,e,t);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=l.sliceString(e-s,t-s,r)),s=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ir))return 0;let r=0,[i,o,s,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,o+=t){if(i==s||o==l)return r;let a=this.children[i],u=e.children[o];if(a!=u)return r+a.scanIdentical(u,t);r+=a.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let d of e)r+=d.lines;if(r<32){let d=[];for(let p of e)p.flatten(d);return new et(d,t)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,l=[],a=0,u=-1,c=[];function h(d){let p;if(d.lines>o&&d instanceof Ir)for(let v of d.children)h(v);else d.lines>s&&(a>s||!a)?(f(),l.push(d)):d instanceof et&&a&&(p=c[c.length-1])instanceof et&&d.lines+p.lines<=32?(a+=d.lines,u+=d.length+1,c[c.length-1]=new et(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>i&&f(),a+=d.lines,u+=d.length+1,c.push(d))}function f(){a!=0&&(l.push(c.length==1?c[0]:Ir.from(c,u)),u=-1,a=c.length=0)}for(let d of e)h(d);return f(),l.length==1?l[0]:new Ir(l,t)}}je.empty=new et([""],0);function DS(n){let e=-1;for(let t of n)e+=t.length+1;return e}function ru(n,e,t=0,r=1e9){for(let i=0,o=0,s=!0;o=t&&(a>r&&(l=l.slice(0,r-i)),i0?1:(e instanceof et?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,l=i instanceof et?i.text.length:i.children.length;if(s==(t>0?l: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((o&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(i instanceof et){let a=i.text[s+(t<0?-1:0)];if(this.offsets[r]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[s+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof et?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Ox{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new hl(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:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.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!=""}}class Nx{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=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=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(je.prototype[Symbol.iterator]=function(){return this.iter()},hl.prototype[Symbol.iterator]=Ox.prototype[Symbol.iterator]=Nx.prototype[Symbol.iterator]=function(){return this});class PS{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function xo(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}let ao="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(n=>n?parseInt(n,36):1);for(let n=1;nn)return ao[e-1]<=n;return!1}function Zp(n){return n>=127462&&n<=127487}const e0=8205;function At(n,e,t=!0,r=!0){return(t?Dx:LS)(n,e,r)}function Dx(n,e,t){if(e==n.length)return e;e&&Px(n.charCodeAt(e))&&Rx(n.charCodeAt(e-1))&&e--;let r=yt(n,e);for(e+=ar(r);e=0&&Zp(yt(n,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function LS(n,e,t){for(;e>0;){let r=Dx(n,e-2,t);if(r=56320&&n<57344}function Rx(n){return n>=55296&&n<56320}function yt(n,e){let t=n.charCodeAt(e);if(!Rx(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return Px(r)?(t-55296<<10)+(r-56320)+65536:t}function Wd(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ar(n){return n<65536?1:2}const Ef=/\r\n?|\n/;var kt=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(kt||(kt={}));class Hr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return o+(e-i);o+=l}else{if(r!=kt.Simple&&u>=e&&(r==kt.TrackDel&&ie||r==kt.TrackBefore&&ie))return null;if(u>e||u==e&&t<0&&!l)return e==i||t<0?o:o+a;o+=a}i=u}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,t=e){for(let r=0,i=0;r=0&&i<=t&&l>=e)return it?"cover":!0;i=l}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Hr(e)}static create(e){return new Hr(e)}}class at extends Hr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Cf(this,(t,r,i,o,s)=>e=e.replace(i,i+(r-t),s),!1),e}mapDesc(e,t=!1){return wf(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,o=0;i=0){t[i]=l,t[i+1]=s;let a=i>>1;for(;r.length0&&Pn(r,t,o.text),o.forward(c),l+=c}let u=e[s++];for(;l>1].toJSON()))}return e}static of(e,t,r){let i=[],o=[],s=0,l=null;function a(c=!1){if(!c&&!i.length)return;sf||h<0||f>t)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${t})`);let p=d?typeof d=="string"?je.of(d.split(r||Ef)):d:je.empty,v=p.length;if(h==f&&v==0)return;hs&&Ot(i,h-s,-1),Ot(i,f-h,v),Pn(o,i,p),s=f}}return u(e),a(!l),l}static empty(e){return new at(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;il&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)t.push(o[0],0);else{for(;r.length=0&&t<=0&&t==n[i+1]?n[i]+=e:e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function Pn(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r>1])),!(t||s==n.sections.length||n.sections[s+1]<0);)l=n.sections[s++],a=n.sections[s++];e(i,u,o,c,h),i=u,o=c}}}function wf(n,e,t,r=!1){let i=[],o=r?[]:null,s=new gl(n),l=new gl(e);for(let a=-1;;)if(s.ins==-1&&l.ins==-1){let u=Math.min(s.len,l.len);Ot(i,u,-1),s.forward(u),l.forward(u)}else if(l.ins>=0&&(s.ins<0||a==s.i||s.off==0&&(l.len=0&&a=0){let u=0,c=s.len;for(;c;)if(l.ins==-1){let h=Math.min(c,l.len);u+=h,c-=h,l.forward(h)}else if(l.ins==0&&l.lena||s.ins>=0&&s.len>a)&&(l||r.length>u),o.forward2(a),s.forward(a)}}}}class gl{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?je.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?je.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ci{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new ci(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return re.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return re.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return re.range(e.anchor,e.head)}static create(e,t,r){return new ci(e,t,r)}}class re{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:re.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new re(e.ranges.map(t=>ci.fromJSON(t)),e.main)}static single(e,t=e){return new re([re.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,t=0){let r=e[t];e.sort((i,o)=>i.from-o.from),t=e.indexOf(r);for(let i=1;io.head?re.range(a,l):re.range(l,a))}}return new re(e,t)}}function kx(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Kd=0;class he{constructor(e,t,r,i,o){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=Kd++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new he(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:Gd),!!e.static,e.enables)}of(e){return new nu([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nu(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nu(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function Gd(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class nu{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=Kd++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,l=this.type==2,a=!1,u=!1,c=[];for(let h of this.dependencies)h=="doc"?a=!0:h=="selection"?u=!0:((t=e[h.id])!==null&&t!==void 0?t:1)&1||c.push(e[h.id]);return{create(h){return h.values[s]=r(h),1},update(h,f){if(a&&f.docChanged||u&&(f.docChanged||f.selection)||Of(h,c)){let d=r(h);if(l?!t0(d,h.values[s],i):!i(d,h.values[s]))return h.values[s]=d,1}return 0},reconfigure:(h,f)=>{let d,p=f.config.address[o];if(p!=null){let v=Au(f,p);if(this.dependencies.every(m=>m instanceof he?f.facet(m)===h.facet(m):m instanceof ft?f.field(m,!1)==h.field(m,!1):!0)||(l?t0(d=r(h),v,i):i(d=r(h),v)))return h.values[s]=v,0}else d=r(h);return h.values[s]=d,1}}}}function t0(n,e,t){if(n.length!=e.length)return!1;for(let r=0;rn[a.id]),i=t.map(a=>a.type),o=r.filter(a=>!(a&1)),s=n[e.id]>>1;function l(a){let u=[];for(let c=0;cr===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(r0).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let o=r.values[t],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[t]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}init(e){return[this,r0.of({field:this,create:e})]}get extension(){return this}}const li={lowest:4,low:3,default:2,high:1,highest:0};function Qo(n){return e=>new Ix(e,n)}const Fi={highest:Qo(li.highest),high:Qo(li.high),default:Qo(li.default),low:Qo(li.low),lowest:Qo(li.lowest)};class Ix{constructor(e,t){this.inner=e,this.prec=t}}class Qu{of(e){return new Nf(this,e)}reconfigure(e){return Qu.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Nf{constructor(e,t){this.compartment=e,this.inner=t}}class Su{constructor(e,t,r,i,o,s){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,r){let i=[],o=Object.create(null),s=new Map;for(let f of IS(e,t,s))f instanceof ft?i.push(f):(o[f.facet.id]||(o[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],u=[];for(let f of i)l[f.id]=u.length<<1,u.push(d=>f.slot(d));let c=r==null?void 0:r.config.facets;for(let f in o){let d=o[f],p=d[0].facet,v=c&&c[f]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,Gd(v,d))a.push(r.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=u.length<<1,u.push(y=>m.dynamicSlot(y)));l[p.id]=u.length<<1,u.push(m=>kS(m,p,d))}}let h=u.map(f=>f(l));return new Su(e,s,h,l,a,o)}}function IS(n,e,t){let r=[[],[],[],[],[]],i=new Map;function o(s,l){let a=i.get(s);if(a!=null){if(a<=l)return;let u=r[a].indexOf(s);u>-1&&r[a].splice(u,1),s instanceof Nf&&t.delete(s.compartment)}if(i.set(s,l),Array.isArray(s))for(let u of s)o(u,l);else if(s instanceof Nf){if(t.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(s.compartment)||s.inner;t.set(s.compartment,u),o(u,l)}else if(s instanceof Ix)o(s.inner,s.prec);else if(s instanceof ft)r[l].push(s),s.provides&&o(s.provides,l);else if(s instanceof nu)r[l].push(s),s.facet.extensions&&o(s.facet.extensions,li.default);else{let u=s.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(u,l)}}return o(n,li.default),r.reduce((s,l)=>s.concat(l))}function fl(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function Au(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const Mx=he.define(),Df=he.define({combine:n=>n.some(e=>e),static:!0}),Fx=he.define({combine:n=>n.length?n[0]:void 0,static:!0}),Bx=he.define(),jx=he.define(),$x=he.define(),Hx=he.define({combine:n=>n.length?n[0]:!1});class pn{constructor(e,t){this.type=e,this.value=t}static define(){return new MS}}class MS{of(e){return new pn(this,e)}}class FS{constructor(e){this.map=e}of(e){return new Oe(this,e)}}class Oe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Oe(this.type,t)}is(e){return this.type==e}static define(e={}){return new FS(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(t);o&&r.push(o)}return r}}Oe.reconfigure=Oe.define();Oe.appendConfig=Oe.define();class ct{constructor(e,t,r,i,o,s){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&kx(r,t.newLength),o.some(l=>l.type==ct.time)||(this.annotations=o.concat(ct.time.of(Date.now())))}static create(e,t,r,i,o,s){return new ct(e,t,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ct.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ct.time=pn.define();ct.userEvent=pn.define();ct.addToHistory=pn.define();ct.remote=pn.define();function BS(n,e){let t=[];for(let r=0,i=0;;){let o,s;if(r=n[r]))o=n[r++],s=n[r++];else if(i=0;i--){let o=r[i](n);o instanceof ct?n=o:Array.isArray(o)&&o.length==1&&o[0]instanceof ct?n=o[0]:n=qx(e,uo(o),!1)}return n}function $S(n){let e=n.startState,t=e.facet($x),r=n;for(let i=t.length-1;i>=0;i--){let o=t[i](n);o&&Object.keys(o).length&&(r=zx(r,Pf(e,o,n.changes.newLength),!0))}return r==n?n:ct.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const HS=[];function uo(n){return n==null?HS:Array.isArray(n)?n:[n]}var Xe=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(Xe||(Xe={}));const zS=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Rf;try{Rf=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function qS(n){if(Rf)return Rf.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||zS.test(t)))return!0}return!1}function US(n){return e=>{if(!/\S/.test(e))return Xe.Space;if(qS(e))return Xe.Word;for(let t=0;t-1)return Xe.Word;return Xe.Other}}class Fe{constructor(e,t,r,i,o,s){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let l=0;li.set(u,a)),t=null),i.set(l.value.compartment,l.value.extension)):l.is(Oe.reconfigure)?(t=null,r=l.value):l.is(Oe.appendConfig)&&(t=null,r=uo(r).concat(l.value));let o;t?o=e.startState.values.slice():(t=Su.resolve(r,i,this),o=new Fe(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,u)=>u.reconfigure(a,this),null).values);let s=e.startState.facet(Df)?e.newSelection:e.newSelection.asSingle();new Fe(t,e.newDoc,s,o,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:re.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),o=[r.range],s=uo(r.effects);for(let l=1;ls.spec.fromJSON(l,a)))}}return Fe.create({doc:e.doc,selection:re.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=Su.resolve(e.extensions||[],new Map),r=e.doc instanceof je?e.doc:je.of((e.doc||"").split(t.staticFacet(Fe.lineSeparator)||Ef)),i=e.selection?e.selection instanceof re?e.selection:re.single(e.selection.anchor,e.selection.head):re.single(0);return kx(i,r.length),t.staticFacet(Df)||(i=i.asSingle()),new Fe(t,r,i,t.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(Fe.tabSize)}get lineBreak(){return this.facet(Fe.lineSeparator)||` +`}get readOnly(){return this.facet(Hx)}phrase(e,...t){for(let r of this.facet(Fe.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>t.length?r:t[o-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let o of this.facet(Mx))for(let s of o(this,t,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return US(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,l=e-r;for(;s>0;){let a=At(t,s,!1);if(o(t.slice(a,s))!=Xe.Word)break;s=a}for(;ln.length?n[0]:4});Fe.lineSeparator=Fx;Fe.readOnly=Hx;Fe.phrases=he.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});Fe.languageData=Mx;Fe.changeFilter=Bx;Fe.transactionFilter=jx;Fe.transactionExtender=$x;Qu.reconfigure=Oe.define();function vr(n,e,t={}){let r={};for(let i of n)for(let o of Object.keys(i)){let s=i[o],l=r[o];if(l===void 0)r[o]=s;else if(!(l===s||s===void 0))if(Object.hasOwnProperty.call(t,o))r[o]=t[o](l,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class gi{eq(e){return this==e}range(e,t=e){return Lf.create(e,t,this)}}gi.prototype.startSide=gi.prototype.endSide=0;gi.prototype.point=!1;gi.prototype.mapMode=kt.TrackDel;let Lf=class Ux{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new Ux(e,t,r)}};function kf(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}let VS=class Vx{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let o=r?this.to:this.from;for(let s=i,l=o.length;;){if(s==l)return s;let a=s+l>>1,u=o[a]-e||(r?this.value[a].endSide:this.value[a].startSide)-t;if(a==s)return u>=0?s:l;u>=0?l=a:s=a+1}}between(e,t,r,i){for(let o=this.findIndex(t,-1e9,!0),s=this.findIndex(r,1e9,!1,o);od||f==d&&u.startSide>0&&u.endSide<=0)continue;(d-f||u.endSide-u.startSide)<0||(s<0&&(s=f),u.point&&(l=Math.max(l,d-f)),r.push(u),i.push(f-s),o.push(d-s))}return{mapped:r.length?new Vx(i,o,r,l):null,pos:s}}};class Re{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new Re(e,t,r,i)}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:i=0,filterTo:o=this.length}=e,s=e.filter;if(t.length==0&&!s)return this;if(r&&(t=t.slice().sort(kf)),this.isEmpty)return t.length?Re.of(t):this;let l=new Wx(this,null,-1).goto(0),a=0,u=[],c=new Bn;for(;l.value||a=0){let h=t[a++];c.addInner(h.from,h.to,h.value)||u.push(h)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||ol.to||o=o&&e<=o+s.length&&s.between(o,e-o,t-o,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return xl.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return xl.from(e).goto(t)}static compare(e,t,r,i,o=-1){let s=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=o),l=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=o),a=n0(s,l,r),u=new Zo(s,a,o),c=new Zo(l,a,o);r.iterGaps((h,f,d)=>i0(u,h,c,f,d,i)),r.empty&&r.length==0&&i0(u,0,c,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=999999999);let o=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),s=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let l=n0(o,s),a=new Zo(o,l,0).goto(r),u=new Zo(s,l,0).goto(r);for(;;){if(a.to!=u.to||!If(a.active,u.active)||a.point&&(!u.point||!a.point.eq(u.point)))return!1;if(a.to>i)return!0;a.next(),u.next()}}static spans(e,t,r,i,o=-1){let s=new Zo(e,null,o).goto(t),l=t,a=s.openStart;for(;;){let u=Math.min(s.to,r);if(s.point){let c=s.activeForPoint(s.to),h=s.pointFroml&&(i.span(l,u,s.active,a),a=s.openEnd(u));if(s.to>r)return a+(s.point&&s.to>r?1:0);l=s.to,s.next()}}static of(e,t=!1){let r=new Bn;for(let i of e instanceof Lf?[e]:t?WS(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Re.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Re.empty;i=i.nextLayer)t=new Re(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Re.empty=new Re([],[],null,-1);function WS(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(kf);e=r}return n}Re.empty.nextLayer=Re.empty;class Bn{finishChunk(e){this.chunks.push(new VS(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new Bn)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(Re.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Re.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function n0(n,e,t){let r=new Map;for(let o of n)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new Wx(s,t,r,o));return i.length==1?i[0]:new xl(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)dh(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)dh(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),dh(this.heap,0)}}}function dh(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class Zo{constructor(e,t,r){this.minPoint=r,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=xl.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ca(this.active,e),Ca(this.activeTo,e),Ca(this.activeRank,e),this.minActive=o0(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:o}=this.cursor;for(;t0;)t++;wa(this.active,t,r),wa(this.activeTo,t,i),wa(this.activeRank,t,o),e&&wa(e,t,this.cursor.from),this.minActive=o0(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Ca(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function i0(n,e,t,r,i,o){n.goto(e),t.goto(r);let s=r+i,l=r,a=r-e;for(;;){let u=n.to+a-t.to||n.endSide-t.endSide,c=u<0?n.to+a:t.to,h=Math.min(c,s);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&If(n.activeForPoint(n.to),t.activeForPoint(t.to))||o.comparePoint(l,h,n.point,t.point):h>l&&!If(n.active,t.active)&&o.compareRange(l,h,n.active,t.active),c>s)break;l=c,u<=0&&n.next(),u>=0&&t.next()}}function If(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;r--)n[r+1]=n[r];n[e]=t}function o0(n,e){let t=-1,r=1e9;for(let i=0;i=e)return i;if(i==n.length)break;o+=n.charCodeAt(i)==9?t-o%t:1,i=At(n,i)}return r===!0?-1:n.length}const Ff="ͼ",s0=typeof Symbol>"u"?"__"+Ff:Symbol.for(Ff),Bf=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),l0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class jn{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,l,a,u){let c=[],h=/^@(\w+)\b/.exec(s[0]),f=h&&h[1]=="keyframes";if(h&&l==null)return a.push(s[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))o(d.split(/,\s*/).map(v=>s.map(m=>v.replace(/&/,m))).reduce((v,m)=>v.concat(m)),p,a);else if(p&&typeof p=="object"){if(!h)throw new RangeError("The value of a property ("+d+") should be a primitive value.");o(i(d),p,c,f)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,v=>"-"+v.toLowerCase())+": "+p+";")}(c.length||f)&&a.push((r&&!h&&!u?s.map(r):s).join(", ")+" {"+c.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=l0[s0]||1;return l0[s0]=e+1,Ff+e.toString(36)}static mount(e,t,r){let i=e[Bf],o=r&&r.nonce;i?o&&i.setNonce(o):i=new KS(e,o),i.mount(Array.isArray(t)?t:[t],e)}}let a0=new Map;class KS{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=a0.get(r);if(o)return e[Bf]=o;this.sheet=new i.CSSStyleSheet,a0.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Bf]=this}mount(e,t){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(a,1),o--,a=-1),a==-1){if(this.modules.splice(o++,0,l),r)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},GS=typeof navigator<"u"&&/Mac/.test(navigator.platform),XS=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var vt=0;vt<10;vt++)$n[48+vt]=$n[96+vt]=String(vt);for(var vt=1;vt<=24;vt++)$n[vt+111]="F"+vt;for(var vt=65;vt<=90;vt++)$n[vt]=String.fromCharCode(vt+32),yl[vt]=String.fromCharCode(vt);for(var ph in $n)yl.hasOwnProperty(ph)||(yl[ph]=$n[ph]);function YS(n){var e=GS&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||XS&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?yl:$n)[n.keyCode]||n.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}function vl(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function jf(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function iu(n,e){if(!e.anchorNode)return!1;try{return jf(n,e.anchorNode)}catch{return!1}}function bl(n){return n.nodeType==3?yi(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function dl(n,e,t,r){return t?u0(n,e,t,r,-1)||u0(n,e,t,r,1):!1}function xi(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function _u(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function u0(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:zr(n))){if(n.nodeName=="DIV")return!1;let o=n.parentNode;if(!o||o.nodeType!=1)return!1;e=xi(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?zr(n):0}else return!1}}function zr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Zu(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function JS(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Kx(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function QS(n,e,t,r,i,o,s,l){let a=n.ownerDocument,u=a.defaultView||window;for(let c=n,h=!1;c&&!h;)if(c.nodeType==1){let f,d=c==a.body,p=1,v=1;if(d)f=JS(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let g=c.getBoundingClientRect();({scaleX:p,scaleY:v}=Kx(c,g)),f={left:g.left,right:g.left+c.clientWidth*p,top:g.top,bottom:g.top+c.clientHeight*v}}let m=0,y=0;if(i=="nearest")e.top0&&e.bottom>f.bottom+y&&(y=e.bottom-f.bottom+y+s)):e.bottom>f.bottom&&(y=e.bottom-f.bottom+s,t<0&&e.top-y0&&e.right>f.right+m&&(m=e.right-f.right+m+o)):e.right>f.right&&(m=e.right-f.right+o,t<0&&e.lefti.clientHeight&&(r=i),!t&&i.scrollWidth>i.clientWidth&&(t=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:t,y:r}}class e2{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?zr(t):0),r,Math.min(e.focusOffset,r?zr(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}let Yi=null;function Gx(n){if(n.setActive)return n.setActive();if(Yi)return n.focus(Yi);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Yi==null?{get preventScroll(){return Yi={preventScroll:!0},!0}}:void 0),!Yi){Yi=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}function Jx(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=zr(t)}else if(t.parentNode&&!_u(t))r=xi(t),t=t.parentNode;else return null}}function Qx(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&rt)return h.domBoundsAround(e,t,u);if(f>=e&&i==-1&&(i=a,o=u),u>t&&h.dom.parentNode==this.dom){s=a,l=c;break}c=f,u=f+h.breakAfter}return{from:o,to:l<0?r+this.length:l,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=Xd){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function ey(n,e,t,r,i,o,s,l,a){let{children:u}=n,c=u.length?u[e]:null,h=o.length?o[o.length-1]:null,f=h?h.breakAfter:s;if(!(e==r&&c&&!s&&!f&&o.length<2&&c.merge(t,i,o.length?h:null,t==0,l,a))){if(r0&&(!s&&o.length&&c.merge(t,c.length,o[0],!1,l,0)?c.breakAfter=o.shift().breakAfter:(t2);var pe={mac:p0||/Mac/.test(zt.platform),windows:/Win/.test(zt.platform),linux:/Linux|X11/.test(zt.platform),ie:ec,ie_version:ry?$f.documentMode||6:zf?+zf[1]:Hf?+Hf[1]:0,gecko:f0,gecko_version:f0?+(/Firefox\/(\d+)/.exec(zt.userAgent)||[0,0])[1]:0,chrome:!!mh,chrome_version:mh?+mh[1]:0,ios:p0,android:/Android\b/.test(zt.userAgent),webkit:d0,safari:ny,webkit_version:d0?+(/\bAppleWebKit\/(\d+)/.exec(zt.userAgent)||[0,0])[1]:0,tabSize:$f.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const n2=256;class gr extends Ue{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof gr)||this.length-(t-e)+r.length>n2||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new gr(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Nt(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return i2(this.dom,e,t)}}class an extends Ue{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let i of t)i.setParent(this)}setAttrs(e){if(Xx(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,i,o,s){return r&&(!(r instanceof an&&r.mark.eq(this.mark))||e&&o<=0||te&&t.push(r=e&&(i=o),r=a,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new an(this.mark,t,s)}domAtPos(e){return iy(this,e)}coordsAt(e,t){return sy(this,e,t)}}function i2(n,e,t){let r=n.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&t<0||e==r&&t>=0?pe.chrome||pe.gecko||(e?(i--,s=1):o=0)?0:l.length-1];return pe.safari&&!s&&a.width==0&&(a=Array.prototype.find.call(l,u=>u.width)||a),s?Zu(a,s<0):a||null}class Rn extends Ue{static create(e,t,r){return new Rn(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=Rn.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,i,o,s){return r&&(!(r instanceof Rn)||!this.widget.compare(r.widget)||e>0&&o<=0||t0)?Nt.before(this.dom):Nt.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let l=s?i.length-1:0;o=i[l],!(e>0?l==0:l==i.length-1||o.top0?Nt.before(this.dom):Nt.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return je.empty}get isHidden(){return!0}}gr.prototype.children=Rn.prototype.children=yo.prototype.children=Xd;function iy(n,e){let t=n.dom,{children:r}=n,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==t)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof an&&i.length&&(r=i[i.length-1])instanceof an&&r.mark.eq(e.mark)?oy(r,e.children[0],t-1):(i.push(e),e.setParent(n)),n.length+=e.length}function sy(n,e,t){let r=null,i=-1,o=null,s=-1;function l(u,c){for(let h=0,f=0;h=c&&(d.children.length?l(d,c-f):(!o||o.isHidden&&t>0)&&(p>c||f==p&&d.getSide()>0)?(o=d,s=c-f):(f-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let o of r)if(o!=t&&(i.indexOf(o)==-1||n[o]!==e[o]))return!1;return!0}function Uf(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function s2(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Hn(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=ly(e,t);r=(o?t?-3e8:-1:5e8)-1,i=(s?t?2e8:1:-6e8)+1}return new Hn(e,r,i,t,e.widget||null,!0)}static line(e){return new jl(e)}static set(e,t=!1){return Re.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ae.none=Re.empty;class Bl extends Ae{constructor(e){let{start:t,end:r}=ly(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof Bl&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Tu(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Bl.prototype.point=!1;class jl extends Ae{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof jl&&this.spec.class==e.spec.class&&Tu(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}jl.prototype.mapMode=kt.TrackBefore;jl.prototype.point=!0;class Hn extends Ae{constructor(e,t,r,i,o,s){super(t,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?t<=0?kt.TrackBefore:kt.TrackAfter:kt.TrackDel}get type(){return this.startSide!=this.endSide?Mt.WidgetRange:this.startSide<=0?Mt.WidgetBefore:Mt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Hn&&l2(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Hn.prototype.point=!0;function ly(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function l2(n,e){return n==e||!!(n&&e&&n.compare(e))}function Vf(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class ot extends Ue{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,r,i,o,s){if(r){if(!(r instanceof ot))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),ty(this,e,t,r?r.children.slice():[],o,s),!0}split(e){let t=new ot;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:r,off:i}=this.childPos(e);i&&(t.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Tu(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){oy(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=qf(t,this.attrs||{})),r&&(this.attrs=qf({class:r},this.attrs||{}))}domAtPos(e){return iy(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&(Xx(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Uf(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&Ue.get(i)instanceof an;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Ue.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!pe.ios||!this.children.some(o=>o instanceof gr))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof gr)||/[^ -~]/.test(r.text))return null;let i=bl(r.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=sy(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=t){if(o instanceof ot)return o;if(s>t)break}i=s+o.breakAfter}return null}}class on extends Ue{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,i,o,s){return r&&(!(r instanceof on)||!this.widget.compare(r.widget)||e>0&&o<=0||t0}}class Wf extends Vn{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class pl{constructor(e,t,r,i){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof on&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ot),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Oa(new yo(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof on)&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(Oa(new gr(this.text.slice(this.textOff,this.textOff+i)),t),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,t,r,i){this.buildText(t-e,r,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof Hn){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(r instanceof Hn)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new on(r.widget||vo.block,l,r));else{let a=Rn.create(r.widget||vo.inline,l,l?0:r.startSide),u=this.atCursorPos&&!a.isEditable&&o<=i.length&&(e0),c=!a.isEditable&&(ei.length||r.startSide<=0),h=this.getLine();this.pendingBuffer==2&&!u&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),u&&(h.append(Oa(new yo(1),i),o),o=i.length+Math.max(0,o-i.length)),h.append(Oa(a,i),o),this.atCursorPos=c,this.pendingBuffer=c?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=o)}static build(e,t,r,i,o){let s=new pl(e,t,r,o);return s.openEnd=Re.spans(i,t,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function Oa(n,e){for(let t of e)n=new an(t,[n],n.length);return n}class vo extends Vn{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}vo.inline=new vo("span");vo.block=new vo("div");var Ge=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Ge||(Ge={}));const vi=Ge.LTR,Yd=Ge.RTL;function ay(n){let e=[];for(let t=0;t=t){if(l.level==r)return s;(o<0||(i!=0?i<0?l.fromt:e[o].level>l.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function cy(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;v-=3)if(Nr[v+1]==-d){let m=Nr[v+2],y=m&2?i:m&4?m&1?o:i:0;y&&(qe[h]=qe[Nr[v]]=y),l=v;break}}else{if(Nr.length==189)break;Nr[l++]=h,Nr[l++]=f,Nr[l++]=a}else if((p=qe[h])==2||p==1){let v=p==i;a=v?0:1;for(let m=l-3;m>=0;m-=3){let y=Nr[m+2];if(y&2)break;if(v)Nr[m+2]|=2;else{if(y&4)break;Nr[m+2]|=4}}}}}function d2(n,e,t,r){for(let i=0,o=r;i<=t.length;i++){let s=i?t[i-1].to:n,l=ia;)p==m&&(p=t[--v].from,m=v?t[v-1].to:n),qe[--p]=d;a=c}else o=u,a++}}}function Gf(n,e,t,r,i,o,s){let l=r%2?2:1;if(r%2==i%2)for(let a=e,u=0;aa&&s.push(new Ln(a,v.from,d));let m=v.direction==vi!=!(d%2);Xf(n,m?r+1:r,i,v.inner,v.from,v.to,s),a=v.to}p=v.to}else{if(p==t||(c?qe[p]!=l:qe[p]==l))break;p++}f?Gf(n,a,p,r+1,i,f,s):ae;){let c=!0,h=!1;if(!u||a>o[u-1].to){let v=qe[a-1];v!=l&&(c=!1,h=v==16)}let f=!c&&l==1?[]:null,d=c?r:r+1,p=a;e:for(;;)if(u&&p==o[u-1].to){if(h)break e;let v=o[--u];if(!c)for(let m=v.from,y=u;;){if(m==e)break e;if(y&&o[y-1].to==m)m=o[--y].from;else{if(qe[m-1]==l)break e;break}}if(f)f.push(v);else{v.toqe.length;)qe[qe.length]=256;let r=[],i=e==vi?0:1;return Xf(n,i,i,t,0,n.length,r),r}function hy(n){return[new Ln(0,n,0)]}let fy="";function m2(n,e,t,r,i){var o;let s=r.head-n.from,l=Ln.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),a=e[l],u=a.side(i,t);if(s==u){let f=l+=i?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],s=a.side(!i,t),u=a.side(i,t)}let c=At(n.text,s,a.forward(i,t));(ca.to)&&(c=u),fy=n.text.slice(Math.min(s,c),Math.max(s,c));let h=l==(i?e.length-1:0)?null:e[l+(i?1:-1)];return h&&c==u&&h.level+(i?0:1)n.some(e=>e)}),by=he.define({combine:n=>n.some(e=>e)}),Sy=he.define();class ho{constructor(e,t="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new ho(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ho(re.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Na=Oe.define({map:(n,e)=>n.map(e)}),Ay=Oe.define();function It(n,e,t){let r=n.facet(gy);r.length?r[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const On=he.define({combine:n=>n.length?n[0]:!0});let x2=0;const tl=he.define();class nt{constructor(e,t,r,i,o){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=t||{};return new nt(x2++,e,r,i,l=>{let a=[tl.of(l)];return s&&a.push(Sl.of(u=>{let c=u.plugin(l);return c?s(c):Ae.none})),o&&a.push(o(l)),a})}static fromClass(e,t){return nt.define(r=>new e(r),t)}}class gh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(It(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){It(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){It(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const _y=he.define(),Zd=he.define(),Sl=he.define(),Ty=he.define(),ep=he.define(),Ey=he.define();function g0(n,e){let t=n.state.facet(Ey);if(!t.length)return t;let r=t.map(o=>o instanceof Function?o(n):o),i=[];return Re.spans(r,e.from,e.to,{point(){},span(o,s,l,a){let u=o-e.from,c=s-e.from,h=i;for(let f=l.length-1;f>=0;f--,a--){let d=l[f].spec.bidiIsolate,p;if(d==null&&(d=g2(e.text,u,c)),a>0&&h.length&&(p=h[h.length-1]).to==u&&p.direction==d)p.to=c,h=p.inner;else{let v={from:u,to:c,direction:d,inner:[]};h.push(v),h=v.inner}}}}),i}const Cy=he.define();function wy(n){let e=0,t=0,r=0,i=0;for(let o of n.state.facet(Cy)){let s=o(n);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(t=Math.max(t,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:t,top:r,bottom:i}}const rl=he.define();class cr{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new cr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toAc)break;o+=2}if(!a)return r;new cr(a.fromA,a.toA,a.fromB,a.toB).addToSet(r),s=a.toA,l=a.toB}}}class Eu{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=at.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,l,a)=>i.push(new cr(o,s,l,a))),this.changedRanges=i}static create(e,t,r){return new Eu(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class x0 extends Ue{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ae.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ot],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new cr(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!T2(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?v2(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:u,to:c}=this.hasComposition;r=new cr(u,c,e.changes.mapPos(u,-1),e.changes.mapPos(c,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(pe.ie||pe.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,l=this.updateDeco(),a=A2(s,l,e.changes);return r=cr.extendWithRanges(r,a),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=pe.chrome||pe.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!l)break;let{fromA:a,toA:u,fromB:c,toB:h}=l,f,d,p,v;if(r&&r.range.fromBc){let b=pl.build(this.view.state.doc,c,r.range.fromB,this.decorations,this.dynamicDecorationMap),_=pl.build(this.view.state.doc,r.range.toB,h,this.decorations,this.dynamicDecorationMap);d=b.breakAtStart,p=b.openStart,v=_.openEnd;let S=this.compositionView(r);_.breakAtStart?S.breakAfter=1:_.content.length&&S.merge(S.length,S.length,_.content[0],!1,_.openStart,0)&&(S.breakAfter=_.content[0].breakAfter,_.content.shift()),b.content.length&&S.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),f=b.content.concat(S).concat(_.content)}else({content:f,breakAtStart:d,openStart:p,openEnd:v}=pl.build(this.view.state.doc,c,h,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=o.findPos(u,1),{i:g,off:x}=o.findPos(a,-1);ey(this,g,x,m,y,f,d,p,v)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(Ay)&&(this.editContextFormatting=r.value)}compositionView(e){let t=new gr(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new an(i,[t],t.length);let r=new ot;return r.append(t,0),r}fixCompositionDOM(e){let t=(o,s)=>{s.flags|=8|(s.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(s);let l=Ue.get(o);l&&l!=s&&(l.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];t(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],t(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&iu(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||t||o))return;let s=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),u=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(pe.gecko&&l.empty&&!this.hasComposition&&y2(a)){let h=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(h,a.node.childNodes[a.offset]||null)),a=u=new Nt(h,0),s=!0}let c=this.view.observer.selectionRange;(s||!c.focusNode||(!dl(a.node,a.offset,c.anchorNode,c.anchorOffset)||!dl(u.node,u.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,l))&&(this.view.observer.ignore(()=>{pe.android&&pe.chrome&&this.dom.contains(c.focusNode)&&_2(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=vl(this.view.root);if(h)if(l.empty){if(pe.gecko){let f=b2(a.node,a.offset);if(f&&f!=3){let d=(f==1?Jx:Qx)(a.node,a.offset);d&&(a=new Nt(d.node,d.offset))}}h.collapse(a.node,a.offset),l.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=l.bidiLevel)}else if(h.extend){h.collapse(a.node,a.offset);try{h.extend(u.node,u.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,u]=[u,a]),f.setEnd(u.node,u.offset),f.setStart(a.node,a.offset),h.removeAllRanges(),h.addRange(f)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(a,u)),this.impreciseAnchor=a.precise?null:new Nt(c.anchorNode,c.anchorOffset),this.impreciseHead=u.precise?null:new Nt(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&dl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=vl(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let s=ot.find(this,t.head);if(!s)return;let l=s.posAtStart;if(t.head==l||t.head==l+s.length)return;let a=this.coordsAt(t.head,-1),u=this.coordsAt(t.head,1);if(!a||!u||a.bottom>u.top)return;let c=this.domAtPos(t.head+t.assoc);r.collapse(c.node,c.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&r.collapse(i,o)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let i=e.offset;!r&&i=0;i--){let o=Ue.get(t.childNodes[i]);o instanceof ot&&(r=o.domAtPos(o.length))}return r?new Nt(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=Ue.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t=0;s--){let l=this.children[s],a=o-l.breakAfter,u=a-l.length;if(ae||l.covers(1))&&(!r||l instanceof ot&&!(r instanceof ot&&t>=0)))r=l,i=u;else if(r&&u==e&&a==e&&l instanceof on&&Math.abs(t)<2){if(l.deco.startSide<0)break;s&&(r=null)}o=u}return r?r.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),i=this.children[t];if(!(i instanceof ot))return null;for(;i.children.length;){let{i:l,off:a}=i.childPos(r,1);for(;;l++){if(l==i.children.length)return null;if((i=i.children[l]).length)break}r=a}if(!(i instanceof gr))return null;let o=At(i.text,r);if(o==r)return null;let s=yi(i.dom,r,o).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Ge.LTR;for(let u=0,c=0;ci)break;if(u>=r){let d=h.dom.getBoundingClientRect();if(t.push(d.height),s){let p=h.dom.lastChild,v=p?bl(p):[];if(v.length){let m=v[v.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=o,this.minWidthFrom=u,this.minWidthTo=f)}}}u=f+h.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Ge.RTL:Ge.LTR}measureTextSize(){for(let o of this.children)if(o instanceof ot){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),t,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=bl(e.firstChild)[0];t=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Zx(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let o=i==t.viewports.length?null:t.viewports[i],s=o?o.from-1:this.length;if(s>r){let l=(t.lineBlockAt(s).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Ae.replace({widget:new Wf(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return Ae.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Sl).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(Ty).map((o,s)=>{let l=typeof o=="function";return l&&(r=!0),l?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push(Re.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=wy(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;QS(this.view.scrollDOM,s,t.head{re.from&&(t=!0)}),t}function E2(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),o=e-i.from;if(i.length==0)return re.cursor(e);o==0?t=1:o==i.length&&(t=-1);let s=o,l=o;t<0?s=At(i.text,o,!1):l=At(i.text,o);let a=r(i.text.slice(s,l));for(;s>0;){let u=At(i.text,s,!1);if(r(i.text.slice(u,s))!=a)break;s=u}for(;ln?e.left-n:Math.max(0,n-e.right)}function w2(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function xh(n,e){return n.tope.top+1}function y0(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Jf(n,e,t){let r,i,o,s,l=!1,a,u,c,h;for(let p=n.firstChild;p;p=p.nextSibling){let v=bl(p);for(let m=0;mx||s==x&&o>g){r=p,i=y,o=g,s=x;let b=x?t0?m0)}g==0?t>y.bottom&&(!c||c.bottomy.top)&&(u=p,h=y):c&&xh(c,y)?c=v0(c,y.bottom):h&&xh(h,y)&&(h=y0(h,y.top))}}if(c&&c.bottom>=t?(r=a,i=c):h&&h.top<=t&&(r=u,i=h),!r)return{node:n,offset:0};let f=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return b0(r,f,t);if(l&&r.contentEditable!="false")return Jf(r,f,t);let d=Array.prototype.indexOf.call(n.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:n,offset:d}}function b0(n,e,t){let r=n.nodeValue.length,i=-1,o=1e9,s=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&h=(c.left+c.right)/2,d=f;if((pe.chrome||pe.gecko)&&yi(n,l).getBoundingClientRect().left==c.right&&(d=!f),h<=0)return{node:n,offset:l+(d?1:0)};i=l+(d?1:0),o=h}}}return{node:n,offset:i>-1?i:s>0?n.nodeValue.length:0}}function Ny(n,e,t,r=-1){var i,o;let s=n.contentDOM.getBoundingClientRect(),l=s.top+n.viewState.paddingTop,a,{docHeight:u}=n.viewState,{x:c,y:h}=e,f=h-l;if(f<0)return 0;if(f>u)return n.state.doc.length;for(let b=n.viewState.heightOracle.textHeight/2,_=!1;a=n.elementAtHeight(f),a.type!=Mt.Text;)for(;f=r>0?a.bottom+b:a.top-b,!(f>=0&&f<=u);){if(_)return t?null:0;_=!0,r=-r}h=l+f;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:S0(n,s,a,c,h);let p=n.dom.ownerDocument,v=n.root.elementFromPoint?n.root:p,m=v.elementFromPoint(c,h);m&&!n.contentDOM.contains(m)&&(m=null),m||(c=Math.max(s.left+1,Math.min(s.right-1,c)),m=v.elementFromPoint(c,h),m&&!n.contentDOM.contains(m)&&(m=null));let y,g=-1;if(m&&((i=n.docView.nearest(m))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let b=p.caretPositionFromPoint(c,h);b&&({offsetNode:y,offset:g}=b)}else if(p.caretRangeFromPoint){let b=p.caretRangeFromPoint(c,h);b&&({startContainer:y,startOffset:g}=b,(!n.contentDOM.contains(y)||pe.safari&&O2(y,g,c)||pe.chrome&&N2(y,g,c))&&(y=void 0))}y&&(g=Math.min(zr(y),g))}if(!y||!n.docView.dom.contains(y)){let b=ot.find(n.docView,d);if(!b)return f>a.top+a.height/2?a.to:a.from;({node:y,offset:g}=Jf(b.dom,c,h))}let x=n.docView.nearest(y);if(!x)return null;if(x.isWidget&&((o=x.dom)===null||o===void 0?void 0:o.nodeType)==1){let b=x.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((i-t.top-(n.defaultLineHeight-l)*.5)/l);o+=a*n.viewState.heightOracle.lineLength}let s=n.state.sliceDoc(t.from,t.to);return t.from+Mf(s,o,n.state.tabSize)}function O2(n,e,t){let r;if(n.nodeType!=3||e!=(r=n.nodeValue.length))return!1;for(let i=n.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return yi(n,r-1,r).getBoundingClientRect().left>t}function N2(n,e,t){if(e!=0)return!1;for(let i=n;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=n.nodeType==1?n.getBoundingClientRect():yi(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function Qf(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let r of t.type)if(r.to>e||r.to==e&&(r.to==t.to||r.type==Mt.Text))return r}return t}function D2(n,e,t,r){let i=Qf(n,e.head),o=!r||i.type!=Mt.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=n.dom.getBoundingClientRect(),l=n.textDirectionAt(i.from),a=n.posAtCoords({x:t==(l==Ge.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(a!=null)return re.cursor(a,t?-1:1)}return re.cursor(t?i.to:i.from,t?-1:1)}function A0(n,e,t,r){let i=n.state.doc.lineAt(e.head),o=n.bidiSpans(i),s=n.textDirectionAt(i.from);for(let l=e,a=null;;){let u=m2(i,o,s,l,t),c=fy;if(!u){if(i.number==(t?n.state.doc.lines:1))return l;c=` +`,i=n.state.doc.line(i.number+(t?1:-1)),o=n.bidiSpans(i),u=n.visualLineSide(i,!t)}if(a){if(!a(c))return l}else{if(!r)return u;a=r(c)}l=u}}function P2(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return o=>{let s=r(o);return i==Xe.Space&&(i=s),i==s}}function R2(n,e,t,r){let i=e.head,o=t?1:-1;if(i==(t?n.state.doc.length:0))return re.cursor(i,e.assoc);let s=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),u=n.coordsAtPos(i,e.assoc||-1),c=n.documentTop;if(u)s==null&&(s=u.left-a.left),l=o<0?u.top:u.bottom;else{let d=n.viewState.lineBlockAt(i);s==null&&(s=Math.min(a.right-a.left,n.defaultCharacterWidth*(i-d.from))),l=(o<0?d.top:d.bottom)+c}let h=a.left+s,f=r??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(f+d)*o,v=Ny(n,{x:h,y:p},!1,o);if(pa.bottom||(o<0?vi)){let m=n.docView.coordsForChar(v),y=!m||p{if(e>o&&ei(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:re.cursor(r,ro)&&this.lineBreak(),i=s}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,l;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(l=i.exec(t))&&(o=l.index,s=l[0].length),this.append(t.slice(r,o<0?t.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let t=Ue.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(k2(e,r.node,r.offset)?t:0))}}function k2(n,e,t){for(;;){if(!e||t-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let l=o||s?[]:B2(e),a=new L2(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=j2(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=o&&o.node==l.focusNode&&o.offset==l.focusOffset||!jf(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),u=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!jf(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),c=e.viewport;if((pe.ios||pe.chrome)&&e.state.selection.main.empty&&a!=u&&(c.from>0||c.toDate.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:l}=e.bounds,a=i.from,u=null;(o===8||pe.android&&e.text.length=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:(pe.mac||pe.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=re.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:je.of([" "])}):pe.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==` + `&&n.lineWrapping&&(r&&(r=re.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:je.of([" "])}),t)return tp(n,t,r,o);if(r&&!r.main.eq(i)){let s=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(s=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:s,userEvent:l}),!0}else return!1}function tp(n,e,t,r=-1){if(pe.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(pe.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&co(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&co(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&co(n.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let s,l=()=>s||(s=M2(n,e,t));return n.state.facet(xy).some(a=>a(n,e.from,e.to,o,l))||n.dispatch(l()),!0}function M2(n,e,t){let r,i=n.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=i.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(i.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let u=n.state.sliceDoc(e.from,e.to),c,h=t&&Oy(n,t.main.head);if(h){let p=e.insert.length-(e.to-e.from);c={from:h.from,to:h.to-p}}else c=n.state.doc.lineAt(o.head);let f=o.to-e.to,d=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:l,range:a||p.map(l)};let v=p.to-f,m=v-u.length;if(p.to-p.from!=d||n.state.sliceDoc(m,v)!=u||p.to>=c.from&&p.from<=c.to)return{range:p};let y=i.changes({from:m,to:v,insert:e.insert}),g=p.to-o.to;return{changes:y,range:a?re.range(Math.max(0,a.anchor+g),Math.max(0,a.head+g)):p.map(y)}})}else r={changes:l,selection:a&&i.selection.replaceRange(a)}}let s="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,s+=".compose",n.inputState.compositionFirstChange&&(s+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function F2(n,e,t,r){let i=Math.min(n.length,e.length),o=0;for(;o0&&l>0&&n.charCodeAt(s-1)==e.charCodeAt(l-1);)s--,l--;if(r=="end"){let a=Math.max(0,o-Math.min(s,l));t-=s+a-o}if(s=s?o-t:0;o-=a,l=o+(l-s),s=o}else if(l=l?o-t:0;o-=a,s=o+(s-l),l=o}return{from:o,toA:s,toB:l}}function B2(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}=n.observer.selectionRange;return t&&(e.push(new _0(t,r)),(i!=t||o!=r)&&e.push(new _0(i,o))),e}function j2(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?re.single(t+e,r+e):null}class $2{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,pe.safari&&e.contentDOM.addEventListener("input",()=>null),pe.gecko&&rA(e.contentDOM.ownerDocument)}handleEvent(e){!G2(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=H2(e),r=this.handlers,i=this.view.contentDOM;for(let o in t)if(o!="scroll"){let s=!t[o].handlers.length,l=r[o];l&&s!=!l.handlers.length&&(i.removeEventListener(o,this.handleEvent),l=null),l||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!t[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Ry.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),pe.android&&pe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return pe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Py.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||z2.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:pe.safari&&!pe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function T0(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){It(t.state,i)}}}function H2(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&t(o).handlers.push(T0(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&t(o).observers.push(T0(r.value,s))}}for(let r in xr)t(r).handlers.push(xr[r]);for(let r in dr)t(r).observers.push(dr[r]);return e}const Py=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],z2="dthko",Ry=[16,17,18,20,91,92,224,225],Da=6;function Pa(n){return Math.max(0,n)*.7+8}function q2(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class U2{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=ZS(e.contentDOM),this.atoms=e.state.facet(ep).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Fe.allowMultipleSelections)&&V2(e,t),this.dragging=K2(e,t)&&Iy(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&q2(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,i=0,o=0,s=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=wy(this.view);e.clientX-a.left<=i+Da?t=-Pa(i-e.clientX):e.clientX+a.right>=s-Da&&(t=Pa(e.clientX-s)),e.clientY-a.top<=o+Da?r=-Pa(o-e.clientY):e.clientY+a.bottom>=l-Da&&(r=Pa(e.clientY-l)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let r=0;rt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function V2(n,e){let t=n.state.facet(dy);return t.length?t[0](e):pe.mac?e.metaKey:e.ctrlKey}function W2(n,e){let t=n.state.facet(py);return t.length?t[0](e):pe.mac?!e.altKey:!e.ctrlKey}function K2(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=vl(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function G2(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=Ue.get(t))&&r.ignoreEvent(e))return!1;return!0}const xr=Object.create(null),dr=Object.create(null),Ly=pe.ie&&pe.ie_version<15||pe.ios&&pe.webkit_version<604;function X2(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),ky(n,t.value)},50)}function tc(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function ky(n,e){e=tc(n.state,Jd,e);let{state:t}=n,r,i=1,o=t.toText(e),s=o.lines==t.selection.ranges.length;if(Zf!=null&&t.selection.ranges.every(a=>a.empty)&&Zf==o.toString()){let a=-1;r=t.changeByRange(u=>{let c=t.doc.lineAt(u.from);if(c.from==a)return{range:u};a=c.from;let h=t.toText((s?o.line(i++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:h},range:re.cursor(u.from+h.length)}})}else s?r=t.changeByRange(a=>{let u=o.line(i++);return{changes:{from:a.from,to:a.to,insert:u.text},range:re.cursor(a.from+u.length)}}):r=t.replaceSelection(o);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}dr.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};xr.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);dr.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};dr.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};xr.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(my))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=Q2(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new U2(n,e,t,r)),r&&n.observer.ignore(()=>{Gx(n.contentDOM);let o=n.root.activeElement;o&&!o.contains(n.contentDOM)&&o.blur()});let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function E0(n,e,t,r){if(r==1)return re.cursor(e,t);if(r==2)return E2(n.state,e,t);{let i=ot.find(n.docView,e),o=n.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,l=i?i.posAtEnd:o.to;return le>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function Y2(n,e,t,r){let i=ot.find(n.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&C0(t,r,s))return-1;let l=i.coordsAt(o,1);return l&&C0(t,r,l)?1:s&&s.bottom>=r?-1:1}function w0(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Y2(n,t,e.clientX,e.clientY)}}const J2=pe.ie&&pe.ie_version<=11;let O0=null,N0=0,D0=0;function Iy(n){if(!J2)return n.detail;let e=O0,t=D0;return O0=n,D0=Date.now(),N0=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(N0+1)%3:1}function Q2(n,e){let t=w0(n,e),r=Iy(e),i=n.state.selection;return{update(o){o.docChanged&&(t.pos=o.changes.mapPos(t.pos),i=i.map(o.changes))},get(o,s,l){let a=w0(n,o),u,c=E0(n,a.pos,a.bias,r);if(t.pos!=a.pos&&!s){let h=E0(n,t.pos,t.bias,r),f=Math.min(h.from,c.from),d=Math.max(h.to,c.to);c=f1&&(u=Z2(i,a.pos))?u:l?i.addRange(c):re.create([c])}}}function Z2(n,e){for(let t=0;t=e)return re.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}xr.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=t.to||s<=t.from)&&(t=re.range(o,s))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",tc(n.state,Qd,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};xr.dragend=n=>(n.inputState.draggedContent=null,!1);function P0(n,e,t,r){if(t=tc(n.state,Jd,t),!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=n.inputState,s=r&&o&&W2(n,e)?{from:o.from,to:o.to}:null,l={from:i,insert:t},a=n.state.changes(s?[s,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(i,-1),head:a.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),n.inputState.draggedContent=null}xr.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,o=()=>{++i==t.length&&P0(n,e,r.filter(s=>s!=null).join(n.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[s]=l.result),o()},l.readAsText(t[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return P0(n,e,r,!0),!0}return!1};xr.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Ly?null:e.clipboardData;return t?(ky(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(X2(n),!1)};function eA(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function tA(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:o}of n.selection.ranges){let s=n.doc.lineAt(o);s.number>i&&(e.push(s.text),t.push({from:s.from,to:Math.min(n.doc.length,s.to+1)})),i=s.number}r=!0}return{text:tc(n,Qd,e.join(n.lineBreak)),ranges:t,linewise:r}}let Zf=null;xr.copy=xr.cut=(n,e)=>{let{text:t,ranges:r,linewise:i}=tA(n.state);if(!t&&!i)return!1;Zf=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Ly?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",t),!0):(eA(n,t),!1)};const My=pn.define();function Fy(n,e){let t=[];for(let r of n.facet(yy)){let i=r(n,e);i&&t.push(i)}return t?n.update({effects:t,annotations:My.of(!0)}):null}function By(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Fy(n.state,e);t?n.dispatch(t):n.update([])}},10)}dr.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),By(n)};dr.blur=n=>{n.observer.clearSelectionRange(),By(n)};dr.compositionstart=dr.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};dr.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,pe.chrome&&pe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};dr.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};xr.beforeinput=(n,e)=>{var t,r;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let o=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),s=e.getTargetRanges();if(o&&s.length){let l=s[0],a=n.posAtDOM(l.startContainer,l.startOffset),u=n.posAtDOM(l.endContainer,l.endOffset);return tp(n,{from:a,to:u,insert:n.state.toText(o)},null),!0}}let i;if(pe.chrome&&pe.android&&(i=Py.find(o=>o.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return pe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),pe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>dr.compositionend(n,e),20),!1};const R0=new Set;function rA(n){R0.has(n)||(R0.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const L0=["pre-wrap","normal","pre-line","break-spaces"];let bo=!1;function k0(){bo=!1}class nA{constructor(e){this.lineWrapping=e,this.doc=je.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return L0.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=o,a){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>su&&(bo=!0),this.height=e)}replace(e,t,r){return Ft.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let o=this,s=r.doc;for(let l=i.length-1;l>=0;l--){let{fromA:a,toA:u,fromB:c,toB:h}=i[l],f=o.lineAt(a,Ke.ByPosNoHeight,r.setDoc(t),0,0),d=f.to>=u?f:o.lineAt(u,Ke.ByPosNoHeight,r,0,0);for(h+=d.to-u,u=d.to;l>0&&f.from<=i[l-1].toA;)a=i[l-1].fromA,c=i[l-1].fromB,l--,ao*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),r+=1+l.break,i-=l.size}else if(o>i*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,o-=l.size}else break;else if(i=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Jt extends jy{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,i){return new Mr(i,this.length,r,this.height,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof Jt||i instanceof xt&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xt?i=new Jt(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Ft.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class xt extends Ft{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,o=i-r+1,s,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*o);s=a/o,this.length>o+1&&(l=(this.height-a)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:l}}blockAt(e,t,r,i){let{firstLine:o,lastLine:s,perLine:l,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let u=i+(e0){let o=r[r.length-1];o instanceof xt?r[r.length-1]=new xt(o.length+i):r.push(null,new xt(i-1))}if(e>0){let o=r[0];o instanceof xt?r[0]=new xt(e+o.length):r.unshift(new xt(e-1),null)}return Ft.of(r)}decomposeLeft(e,t){t.push(new xt(e-1),null)}decomposeRight(e,t){t.push(null,new xt(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let o=t+this.length;if(i&&i.from<=t+this.length&&i.more){let s=[],l=Math.max(t,i.from),a=-1;for(i.from>t&&s.push(new xt(i.from-t-1).updateHeight(e,t));l<=o&&i.more;){let c=e.doc.lineAt(l).length;s.length&&s.push(null);let h=i.heights[i.index++];a==-1?a=h:Math.abs(h-a)>=su&&(a=-2);let f=new Jt(c,h);f.outdated=!1,s.push(f),l+=c+1}l<=o&&s.push(null,new xt(o-l).updateHeight(e,l));let u=Ft.of(s);return(a<0||Math.abs(u.height-this.height)>=su||Math.abs(a-this.heightMetrics(e,t).perLine)>=su)&&(bo=!0),Cu(this,u)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class oA extends Ft{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let o=r+this.left.height;return el))return u;let c=t==Ke.ByPosNoHeight?Ke.ByPosNoHeight:Ke.ByPos;return a?u.join(this.right.lineAt(l,c,r,s,l)):this.left.lineAt(l,c,r,i,o).join(u)}forEachLine(e,t,r,i,o,s){let l=i+this.left.height,a=o+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,r,l,a,s);else{let u=this.lineAt(a,Ke.ByPos,r,i,o);e=e&&u.from<=t&&s(u),t>u.to&&this.right.forEachLine(u.to+1,t,r,l,a,s)}}replace(e,t,r){let i=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let l of r)o.push(l);if(e>0&&I0(o,s-1),t=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e2*t.size||t.size>2*e.size?Ft.of(this.break?[e,null,t]:[e,t]):(this.left=Cu(this.left,e),this.right=Cu(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,i){let{left:o,right:s}=this,l=t+o.length+this.break,a=null;return i&&i.from<=t+o.length&&i.more?a=o=o.updateHeight(e,t,r,i):o.updateHeight(e,t,r),i&&i.from<=l+s.length&&i.more?a=s=s.updateHeight(e,l,r,i):s.updateHeight(e,l,r),a?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function I0(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof xt&&(r=n[e+1])instanceof xt&&n.splice(e-1,3,new xt(t.length+1+r.length))}const sA=5;class rp{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Jt?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Jt(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e=sA)&&this.addLineDeco(i,o,s)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Jt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new xt(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Jt)return e;let t=new Jt(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Jt)&&!this.isCovered?this.nodes.push(new Jt(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&h.overflow!="visible"){let f=c.getBoundingClientRect();o=Math.max(o,f.left),s=Math.min(s,f.right),l=Math.max(l,f.top),a=Math.min(u==n.parentNode?i.innerHeight:a,f.bottom)}u=h.position=="absolute"||h.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:o-t.left,right:Math.max(o,s)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function cA(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class vh{constructor(e,t,r,i){this.from=e,this.to=t,this.size=r,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new nA(t),this.stateDeco=e.facet(Sl).filter(r=>typeof r!="function"),this.heightMap=Ft.empty().applyChanges(this.stateDeco,je.empty,this.heightOracle.setDoc(e.doc),[new cr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ae.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new Ra(o,s))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?F0:new np(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(il(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Sl).filter(c=>typeof c!="function");let i=e.changedRanges,o=cr.extendWithRanges(i,lA(r,this.stateDeco,e?e.changes:at.empty(this.state.doc.length))),s=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);k0(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||bo)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let u=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(by)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Ge.RTL:Ge.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),l=t.getBoundingClientRect(),a=s||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,c=0;if(l.width&&l.height){let{scaleX:b,scaleY:_}=Kx(t,l);(b>.005&&Math.abs(this.scaleX-b)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=b,this.scaleY=_,u|=8,s=a=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,u|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Yx(e.scrollDOM);let p=(this.printing?cA:uA)(t,this.paddingTop),v=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let g=l.width;if((this.contentDOMWidth!=g||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,u|=8),a){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(s=!0),s||i.lineWrapping&&Math.abs(g-this.contentDOMWidth)>i.charWidth){let{lineHeight:_,charWidth:S,textHeight:C}=e.docView.measureTextSize();s=_>0&&i.refresh(o,_,S,C,g/S,b),s&&(e.docView.minWidth=0,u|=8)}v>0&&m>0?c=Math.max(v,m):v<0&&m<0&&(c=Math.min(v,m)),k0();for(let _ of this.viewports){let S=_.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(_);this.heightMap=(s?Ft.empty().applyChanges(this.stateDeco,je.empty,this.heightOracle,[new cr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new iA(_.from,S))}bo&&(u|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),u|=this.updateForViewport()),(u&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:l}=this,a=new Ra(i.lineAt(s-r*1e3,Ke.ByHeight,o,0,0).from,i.lineAt(l+(1-r)*1e3,Ke.ByHeight,o,0,0).to);if(t){let{head:u}=t.range;if(ua.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(u,Ke.ByPos,o,0,0),f;t.y=="center"?f=(h.top+h.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&u=l+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=Ge.LTR&&!r)return[];let l=[],a=(c,h,f,d)=>{if(h-cc&&yy.from>=f.from&&y.to<=f.to&&Math.abs(y.from-c)y.fromg));if(!m){if(hx.from<=h&&x.to>=h)){let x=t.moveToLineBoundary(re.cursor(h),!1,!0).head;x>c&&(h=x)}let y=this.gapSize(f,c,h,d),g=r||y<2e6?y:2e6;m=new vh(c,h,y,g)}l.push(m)},u=c=>{if(c.length2e6)for(let S of e)S.from>=c.from&&S.fromc.from&&a(c.from,d,c,h),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Re.spans(e,this.viewport.from,this.viewport.to,{span(i,o){t.push({from:i,to:o})},point(){}},20);let r=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=t[o].from||i.to!=t[o].to);return this.visibleRanges=t,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||il(this.heightMap.lineAt(e,Ke.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||il(this.heightMap.lineAt(this.scaler.fromDOM(e),Ke.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return il(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ra{constructor(e,t){this.from=e,this.to=t}}function fA(n,e,t){let r=[],i=n,o=0;return Re.spans(t,n,e,{span(){},point(s,l){s>i&&(r.push({from:i,to:s}),o+=s-i),i=l}},20),i=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:o,to:s}=e[i],l=s-o;if(r<=l)return o+r;r-=l}}function ka(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function dA(n,e){for(let t of n)if(e(t))return t}const F0={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class np{constructor(e,t,r){let i=0,o=0,s=0;this.viewports=r.map(({from:l,to:a})=>{let u=t.lineAt(l,Ke.ByPos,e,0,0).top,c=t.lineAt(a,Ke.ByPos,e,0,0).bottom;return i+=c-u,{from:l,to:a,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let l of this.viewports)l.domTop=s+(l.top-o)*this.scale,s=l.domBottom=l.domTop+(l.bottom-l.top),o=l.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let o=tt.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function il(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new Mr(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(i=>il(i,e)):n._content)}const Ia=he.define({combine:n=>n.join(" ")}),ed=he.define({combine:n=>n.indexOf(!0)>-1}),td=jn.newName(),$y=jn.newName(),Hy=jn.newName(),zy={"&light":"."+$y,"&dark":"."+Hy};function rd(n,e,t){return new jn(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const pA=rd("."+td,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},zy),mA={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},bh=pe.ie&&pe.ie_version<=11;class gA{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new e2,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(pe.ie&&pe.ie_version<=11||pe.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(pe.chrome&&pe.chrome_version<126)&&(this.editContext=new yA(e),e.state.facet(On)&&(e.contentDOM.editContext=this.editContext.editContext)),bh&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(On)?r.root.activeElement!=this.dom:!iu(this.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(pe.ie&&pe.ie_version<=11||pe.android&&pe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&dl(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=vl(e.root);if(!t)return!1;let r=pe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&xA(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let i=iu(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&co(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),t==-1?{from:t,to:r}=s:(t=Math.min(s.from,t),r=Math.max(s.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&iu(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new I2(this.view,e,t,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,i=Dy(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=B0(t,e.previousSibling||e.target.previousSibling,-1),i=B0(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(On)!=e.state.facet(On)&&(e.view.contentDOM.editContext=e.state.facet(On)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function B0(n,e,t){for(;e;){let r=Ue.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function j0(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=n.docView.domAtPos(n.state.selection.main.anchor);return dl(s.node,s.offset,i,o)&&([t,r,i,o]=[i,o,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}}function xA(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return j0(n,i)}let t=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?j0(n,t):null}class yA{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let{anchor:i}=e.state.selection.main,o={from:this.toEditorPos(r.updateRangeStart),to:this.toEditorPos(r.updateRangeEnd),insert:je.of(r.text.split(` +`))};o.from==this.from&&ithis.to&&(o.to=i),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,e.state.readOnly||tp(e,o,re.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,l=o.underlineThickness;if(s!="None"&&l!="None"){let a=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;i.push(Ae.mark({attributes:{style:a}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:Ay.of(Ae.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=vl(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,s,l,a,u)=>{if(r)return;let c=u.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(u)){i=this.pendingContextChange=null,t+=c,this.to+=c;return}else i=null,this.revertPending(e.state);if(o+=t,s+=t,s<=this.from)this.from+=c,this.to+=c;else if(othis.to||this.to-this.from+u.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),u.toString()),this.to+=c}t+=c}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(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)}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))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class de{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||t2(e.parent)||document,this.viewState=new M0(e.state||Fe.create(e)),e.scrollTo&&e.scrollTo.is(Na)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(tl).map(i=>new gh(i));for(let i of this.plugins)i.update(this);this.observer=new gA(this),this.inputState=new $2(this),this.inputState.ensureHandlers(this.plugins),this.docView=new x0(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof ct?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,o=this.state;for(let f of e){if(f.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=f.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(My))?(this.inputState.notifiedFocused=s,l=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,a=Fy(o,s),a||(l=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(Fe.phrases)!=this.state.facet(Fe.phrases))return this.setState(o);i=Eu.create(this,o,e),i.flags|=l;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;h=new ho(d.empty?d:re.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(Na)&&(h=d.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=wu.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(rl)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Ia)!=i.state.facet(Ia)&&(this.viewState.mustMeasureContent=!0),(t||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(Yf))try{f(i)}catch(d){It(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Dy(this,c)&&u.force&&co(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new M0(e),this.plugins=e.facet(tl).map(r=>new gh(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new x0(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(tl),r=e.state.facet(tl);if(t!=r){let i=[];for(let o of r){let s=t.indexOf(o);if(s<0)i.push(new gh(o));else{let l=this.plugins[s];l.mustUpdate=e,i.push(l)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(s<0)if(Yx(r))o=-1,s=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);o=d.from,s=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];a&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(d=>{try{return d.read(this)}catch(p){return It(this.state,p),$0}}),h=Eu.create(this,this.state,[]),f=!1;h.flags|=a,t?t.flags|=a:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let d=0;d1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Yf))l(t)}get themeClasses(){return td+" "+(this.state.facet(ed)?Hy:$y)+" "+this.state.facet(Ia)}updateAttrs(){let e=H0(this,_y,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(On)?"true":"false",class:"cm-content",style:`${pe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),H0(this,Zd,t);let r=this.observer.ignore(()=>{let i=Uf(this.contentDOM,this.contentAttrs,t),o=Uf(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(de.announce)){t&&(this.announceDOM.textContent=""),t=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(rl);let e=this.state.facet(de.cspNonce);jn.mount(this.root,this.styleModules.concat(pA).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tr.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return yh(this,e,A0(this,e,t,r))}moveByGroup(e,t){return yh(this,e,A0(this,e,t,r=>P2(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[t?r.length-1:0];return re.cursor(o.side(t,i)+e.from,o.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,r=!0){return D2(this,e,t,r)}moveVertically(e,t,r){return yh(this,e,R2(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Ny(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[Ln.find(o,e-i.from,-1,t)];return Zu(r,s.dir==Ge.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(vy)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>vA)return hy(e.length);let t=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==t&&(o.fresh||cy(o.isolates,r=g0(this,e))))return o.order;r||(r=g0(this,e));let i=p2(e.text,t,r);return this.bidiCache.push(new wu(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||pe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Gx(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Na.of(new ho(typeof e=="number"?re.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Na.of(new ho(re.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return nt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return nt.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=jn.newName(),i=[Ia.of(r),rl.of(rd(`.${r}`,e))];return t&&t.dark&&i.push(ed.of(!0)),i}static baseTheme(e){return Fi.lowest(rl.of(rd("."+td,e,zy)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&Ue.get(r)||Ue.get(e);return((t=i==null?void 0:i.rootView)===null||t===void 0?void 0:t.view)||null}}de.styleModule=rl;de.inputHandler=xy;de.clipboardInputFilter=Jd;de.clipboardOutputFilter=Qd;de.scrollHandler=Sy;de.focusChangeEffect=yy;de.perLineTextDirection=vy;de.exceptionSink=gy;de.updateListener=Yf;de.editable=On;de.mouseSelectionStyle=my;de.dragMovesSelection=py;de.clickAddsSelectionRange=dy;de.decorations=Sl;de.outerDecorations=Ty;de.atomicRanges=ep;de.bidiIsolatedRanges=Ey;de.scrollMargins=Cy;de.darkTheme=ed;de.cspNonce=he.define({combine:n=>n.length?n[0]:""});de.contentAttributes=Zd;de.editorAttributes=_y;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=Oe.define();const vA=4096,$0={};class wu{constructor(e,t,r,i,o,s){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,t){if(t.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Ge.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(n):o;s&&qf(s,t)}return t}const bA=pe.mac?"mac":pe.windows?"win":pe.linux?"linux":"key";function SA(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,o,s,l;for(let a=0;ar.concat(i),[]))),t}function _A(n,e,t){return Uy(qy(n.state),e,n,t)}let Nn=null;const TA=4e3;function EA(n,e=bA){let t=Object.create(null),r=Object.create(null),i=(s,l)=>{let a=r[s];if(a==null)r[s]=l;else if(a!=l)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,l,a,u,c)=>{var h,f;let d=t[s]||(t[s]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>SA(y,e));for(let y=1;y{let b=Nn={view:x,prefix:g,scope:s};return setTimeout(()=>{Nn==b&&(Nn=null)},TA),!0}]})}let v=p.join(" ");i(v,!1);let m=d[v]||(d[v]={preventDefault:!1,stopPropagation:!1,run:((f=(h=d._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});a&&m.run.push(a),u&&(m.preventDefault=!0),c&&(m.stopPropagation=!0)};for(let s of n){let l=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let u of l){let c=t[u]||(t[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=s;for(let f in c)c[f].run.push(d=>h(d,nd))}let a=s[e]||s.key;if(a)for(let u of l)o(u,a,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(u,"Shift-"+a,s.shift,s.preventDefault,s.stopPropagation)}return t}let nd=null;function Uy(n,e,t,r){nd=e;let i=YS(e),o=yt(i,0),s=ar(o)==i.length&&i!=" ",l="",a=!1,u=!1,c=!1;Nn&&Nn.view==t&&Nn.scope==r&&(l=Nn.prefix+" ",Ry.indexOf(e.keyCode)<0&&(u=!0,Nn=null));let h=new Set,f=m=>{if(m){for(let y of m.run)if(!h.has(y)&&(h.add(y),y(t)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),u=!0)}return!1},d=n[r],p,v;return d&&(f(d[l+Ma(i,e,!s)])?a=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(pe.windows&&e.ctrlKey&&e.altKey)&&(p=$n[e.keyCode])&&p!=i?(f(d[l+Ma(p,e,!0)])||e.shiftKey&&(v=yl[e.keyCode])!=i&&v!=p&&f(d[l+Ma(v,e,!1)]))&&(a=!0):s&&e.shiftKey&&f(d[l+Ma(i,e,!0)])&&(a=!0),!a&&f(d._any)&&(a=!0)),u&&(a=!0),a&&c&&e.stopPropagation(),nd=null,a}class $l{constructor(e,t,r,i,o){this.className=e,this.left=t,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=Vy(e);return[new $l(t,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return CA(e,t,r)}}function Vy(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Ge.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function q0(n,e,t,r){let i=n.coordsAtPos(e,t*2);if(!i)return r;let o=n.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,l=n.posAtCoords({x:o.left+1,y:s}),a=n.posAtCoords({x:o.right-1,y:s});return l==null||a==null?r:{from:Math.max(r.from,Math.min(l,a)),to:Math.min(r.to,Math.max(l,a))}}function CA(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),o=n.textDirection==Ge.LTR,s=n.contentDOM,l=s.getBoundingClientRect(),a=Vy(n),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),f=l.right-(c?parseInt(c.paddingRight):0),d=Qf(n,r),p=Qf(n,i),v=d.type==Mt.Text?d:null,m=p.type==Mt.Text?p:null;if(v&&(n.lineWrapping||d.widgetLineBreaks)&&(v=q0(n,r,1,v)),m&&(n.lineWrapping||p.widgetLineBreaks)&&(m=q0(n,i,-1,m)),v&&m&&v.from==m.from&&v.to==m.to)return g(x(t.from,t.to,v));{let _=v?x(t.from,null,v):b(d,!1),S=m?x(null,t.to,m):b(p,!0),C=[];return(v||d).to<(m||p).from-(v&&m?1:0)||d.widgetLineBreaks>1&&_.bottom+n.defaultLineHeight/2I&&se.from=fe)break;Y>ie&&$(Math.max(ee,ie),_==null&&ee<=I,Math.min(Y,fe),S==null&&Y>=V,me.dir)}if(ie=Ee.to+1,ie>=fe)break}return B.length==0&&$(I,_==null,V,S==null,n.textDirection),{top:O,bottom:D,horizontal:B}}function b(_,S){let C=l.top+(S?_.top:_.bottom);return{top:C,bottom:C,horizontal:[]}}}function wA(n,e){return n.constructor==e.constructor&&n.eq(e)}class OA{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(lu)!=e.state.facet(lu)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(lu);for(;t!wA(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[r].constructor&&i.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const lu=he.define();function Wy(n){return[nt.define(e=>new OA(e,n)),lu.of(n)]}const Ky=!pe.ios,Al=he.define({combine(n){return vr(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function NA(n={}){return[Al.of(n),DA,PA,RA,by.of(!0)]}function Gy(n){return n.startState.facet(Al)!=n.state.facet(Al)}const DA=Wy({above:!0,markers(n){let{state:e}=n,t=e.facet(Al),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||Ky:t.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=i.empty?i:re.cursor(i.head,i.head>i.anchor?-1:1);for(let a of $l.forRange(n,s,l))r.push(a)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Gy(n);return t&&U0(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){U0(e.state,n)},class:"cm-cursorLayer"});function U0(n,e){e.style.animationDuration=n.facet(Al).cursorBlinkRate+"ms"}const PA=Wy({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:$l.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Gy(n)},class:"cm-selectionLayer"}),id={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Ky&&(id[".cm-line"].caretColor=id[".cm-content"].caretColor="transparent !important");const RA=Fi.highest(de.theme(id)),Xy=Oe.define({map(n,e){return n==null?null:e.mapPos(n)}}),ol=ft.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(Xy)?r.value:t,n)}}),LA=nt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(ol);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(ol)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(ol),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(ol)!=n&&this.view.dispatch({effects:Xy.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function kA(){return[ol,LA]}function V0(n,e,t,r,i){e.lastIndex=0;for(let o=n.iterRange(t,r),s=t,l;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;l=e.exec(o.value);)i(s+l.index,l)}function IA(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:i,to:o}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),o=Math.min(n.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class MA{constructor(e){const{regexp:t,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(l,a,u,c)=>i(c,u,u+l[0].length,l,a);else if(typeof r=="function")this.addMatch=(l,a,u,c)=>{let h=r(l,a,u);h&&c(u,u+l[0].length,h)};else if(r)this.addMatch=(l,a,u,c)=>c(u,u+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let t=new Bn,r=t.add.bind(t);for(let{from:i,to:o}of IA(e,this.maxLength))V0(e.state.doc,this.regexp,i,o,(s,l)=>this.addMatch(l,e,s,r));return t.finish()}updateDeco(e,t){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),r,i):t}updateRange(e,t,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),l=Math.min(o.to,i);if(l>s){let a=e.state.doc.lineAt(s),u=a.toa.from;s--)if(this.boundary.test(a.text[s-1-a.from])){c=s;break}for(;lf.push(y.range(v,m));if(a==u)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,e,v,p));t=t.update({filterFrom:c,filterTo:h,filter:(v,m)=>vh,add:f})}}return t}}const od=/x/.unicode!=null?"gu":"g",FA=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,od),BA={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Sh=null;function jA(){var n;if(Sh==null&&typeof document<"u"&&document.body){let e=document.body.style;Sh=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Sh||!1}const au=he.define({combine(n){let e=vr(n,{render:null,specialChars:FA,addSpecialChars:null});return(e.replaceTabs=!jA())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,od)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,od)),e}});function $A(n={}){return[au.of(n),HA()]}let W0=null;function HA(){return W0||(W0=nt.fromClass(class{constructor(n){this.view=n,this.decorations=Ae.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(au)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new MA({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,o=yt(e[0],0);if(o==9){let s=i.lineAt(r),l=t.state.tabSize,a=ko(s.text,l,r-s.from);return Ae.replace({widget:new VA((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Ae.replace({widget:new UA(n,o)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(au);n.startState.facet(au)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const zA="•";function qA(n){return n>=32?zA:n==10?"␤":String.fromCharCode(9216+n)}class UA extends Vn{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=qA(this.code),r=e.state.phrase("Control character")+" "+(BA[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let o=document.createElement("span");return o.textContent=t,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class VA extends Vn{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function WA(){return GA}const KA=Ae.line({class:"cm-activeLine"}),GA=nt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(KA.range(i.from)),e=i.from)}return Ae.set(t)}},{decorations:n=>n.decorations}),sd=2e3;function XA(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),o=[];if(e.off>sd||t.off>sd||e.col<0||t.col<0){let s=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=r;a<=i;a++){let u=n.doc.line(a);u.length<=l&&o.push(re.range(u.from+s,u.to+l))}}else{let s=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=r;a<=i;a++){let u=n.doc.line(a),c=Mf(u.text,s,n.tabSize,!0);if(c<0)o.push(re.cursor(u.to));else{let h=Mf(u.text,l,n.tabSize);o.push(re.range(u.from+c,u.from+h))}}}return o}function YA(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function K0(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,o=i>sd?-1:i==r.length?YA(n,e.clientX):ko(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:o,off:i}}function JA(n,e){let t=K0(n,e),r=n.state.selection;return t?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(t.line).from),s=i.state.doc.lineAt(o);t={line:s.number,col:t.col,off:Math.min(t.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let l=K0(n,i);if(!l)return r;let a=XA(n.state,t,l);return a.length?s?re.create(a.concat(r.ranges)):re.create(a):r}}:null}function QA(n){let e=t=>t.altKey&&t.button==0;return de.mouseSelectionStyle.of((t,r)=>e(r)?JA(t,r):null)}const ZA={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},e_={style:"cursor: crosshair"};function t_(n={}){let[e,t]=ZA[n.key||"Alt"],r=nt.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[r,de.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?e_:null})]}const es="-10000px";class Yy{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,t){var r;let i=e.state.facet(this.facet),o=i.filter(a=>a);if(i===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let s=[],l=t?[]:null;for(let a=0;at[u]=a),t.length=l.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function r_(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Ah=he.define({combine:n=>{var e,t,r;return{position:pe.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||r_}}}),G0=new WeakMap,op=nt.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Ah);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Yy(n,rc,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(Ah);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.appendChild(i)}return t.dom.style.position=this.position,t.dom.style.top=es,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(pe.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==es&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(Ah).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:r}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:r,scaleX:i,scaleY:o}=n,s=[];for(let l=0;l=Math.min(t.bottom,r.bottom)||h.rightMath.min(t.right,r.right)+.1){c.style.top=es;continue}let d=a.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,v=f.right-f.left,m=(e=G0.get(u))!==null&&e!==void 0?e:f.bottom-f.top,y=u.offset||i_,g=this.view.textDirection==Ge.LTR,x=f.width>r.right-r.left?g?r.left:r.right-f.width:g?Math.max(r.left,Math.min(h.left-(d?14:0)+y.x,r.right-v)):Math.min(Math.max(r.left,h.left-v+(d?14:0)-y.x),r.right-v),b=this.above[l];!a.strictSide&&(b?h.top-(f.bottom-f.top)-y.yr.bottom)&&b==r.bottom-h.bottom>h.top-r.top&&(b=this.above[l]=!b);let _=(b?h.top-r.top:r.bottom-h.bottom)-p;if(_x&&O.topS&&(S=b?O.top-m-2-p:O.bottom+p+2);if(this.position=="absolute"?(c.style.top=(S-n.parent.top)/o+"px",c.style.left=(x-n.parent.left)/i+"px"):(c.style.top=S/o+"px",c.style.left=x/i+"px"),d){let O=h.left+(g?y.x:-y.x)-(x+14-7);d.style.left=O/i+"px"}u.overlap!==!0&&s.push({left:x,top:S,right:C,bottom:S+m}),c.classList.toggle("cm-tooltip-above",b),c.classList.toggle("cm-tooltip-below",!b),u.positioned&&u.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=es}},{eventObservers:{scroll(){this.maybeMeasure()}}}),n_=de.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),i_={x:0,y:0},rc=he.define({enables:[op,n_]}),Ou=he.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class nc{static create(e){return new nc(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Yy(e,Ou,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const o_=rc.compute([Ou],n=>{let e=n.facet(Ou);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:nc.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class s_{constructor(e,t,r,i,o){this.view=e,this.source=t,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),u=a&&a.dir==Ge.RTL?-1:1;o=t.x{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>It(e.state,a,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(op),t=e?e.manager.tooltips.findIndex(r=>r.create==nc.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!l_(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,l=(r=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:s;(s==l?this.view.posAtCoords(this.lastMove)!=s:!a_(this.view,s,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Fa=4;function l_(n,e){let{left:t,right:r,top:i,bottom:o}=n.getBoundingClientRect(),s;if(s=n.querySelector(".cm-tooltip-arrow")){let l=s.getBoundingClientRect();i=Math.min(l.top,i),o=Math.max(l.bottom,o)}return e.clientX>=t-Fa&&e.clientX<=r+Fa&&e.clientY>=i-Fa&&e.clientY<=o+Fa}function a_(n,e,t,r,i,o){let s=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,l)=e&&a<=t}function u_(n,e={}){let t=Oe.define(),r=ft.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let l of i){let a=o.changes.mapPos(l.pos,-1,kt.TrackDel);if(a!=null){let u=Object.assign(Object.create(null),l);u.pos=a,u.end!=null&&(u.end=o.changes.mapPos(u.end)),s.push(u)}}i=s}for(let s of o.effects)s.is(t)&&(i=s.value),s.is(c_)&&(i=[]);return i},provide:i=>Ou.from(i)});return{active:r,extension:[r,nt.define(i=>new s_(i,n,r,t,e.hoverTime||300)),o_]}}function Jy(n,e){let t=n.plugin(op);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const c_=Oe.define(),X0=he.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function _l(n,e){let t=n.plugin(Qy),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const Qy=nt.fromClass(class{constructor(n){this.input=n.state.facet(Tl),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(X0);this.top=new Ba(n,!0,e.topContainer),this.bottom=new Ba(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(X0);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ba(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ba(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Tl);if(t!=this.input){let r=t.filter(a=>a),i=[],o=[],s=[],l=[];for(let a of r){let u=this.specs.indexOf(a),c;u<0?(c=a(n.view),l.push(c)):(c=this.panels[u],c.update&&c.update(n)),i.push(c),(c.top?o:s).push(c)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Ba{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Y0(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Y0(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Y0(n){let e=n.nextSibling;return n.remove(),e}const Tl=he.define({enables:Qy});class qr extends gi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}qr.prototype.elementClass="";qr.prototype.toDOM=void 0;qr.prototype.mapMode=kt.TrackBefore;qr.prototype.startSide=qr.prototype.endSide=-1;qr.prototype.point=!0;const uu=he.define(),h_=he.define(),f_={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Re.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ml=he.define();function Zy(n){return[e1(),ml.of(Object.assign(Object.assign({},f_),n))]}const J0=he.define({combine:n=>n.some(e=>e)});function e1(n){return[d_]}const d_=nt.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(ml).map(e=>new Z0(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(J0),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(J0)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=Re.iter(this.view.state.facet(uu),this.view.viewport.from),r=[],i=this.gutters.map(o=>new p_(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let l of o.type)if(l.type==Mt.Text&&s){ld(t,r,l.from);for(let a of i)a.line(this.view,l,r);s=!1}else if(l.widget)for(let a of i)a.widget(this.view,l)}else if(o.type==Mt.Text){ld(t,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(ml),t=n.state.facet(ml),r=n.docChanged||n.heightChanged||n.viewportChanged||!Re.eq(n.startState.facet(uu),n.state.facet(uu),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let o of t){let s=e.indexOf(o);s<0?i.push(new Z0(this.view,o)):(this.gutters[s].update(n),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Ge.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Q0(n){return Array.isArray(n)?n:[n]}function ld(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class p_{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Re.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,o=(t.top-this.height)/e.scaleY,s=t.height/e.scaleY;if(this.i==i.elements.length){let l=new t1(e,s,o,r);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,s,o,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];ld(this.cursor,i,t.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,t,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),i=r?[r]:null;for(let o of e.state.facet(h_)){let s=o(e,t.widget,t);s&&(i||(i=[])).push(s)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Z0{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let a=o.getBoundingClientRect();s=(a.top+a.bottom)/2}else s=i.clientY;let l=e.lineBlockAtHeight(s-e.documentTop);t.domEventHandlers[r](e,l,i)&&i.preventDefault()});this.markers=Q0(t.markers(e)),t.initialSpacer&&(this.spacer=new t1(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Q0(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Re.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class t1{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),m_(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let l=s,a=oo(l,a,u)||s(l,a,u):s}return r}})}});class _h extends qr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Th(n,e){return n.state.facet(no).formatNumber(e,n.state)}const y_=ml.compute([no],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(g_)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new _h(Th(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let i of e.state.facet(x_)){let o=i(e,t,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(no)!=e.state.facet(no),initialSpacer(e){return new _h(Th(e,em(e.state.doc.lines)))},updateSpacer(e,t){let r=Th(t.view,em(t.view.state.doc.lines));return r==e.number?e:new _h(r)},domEventHandlers:n.facet(no).domEventHandlers}));function v_(n={}){return[no.of(n),e1(),y_]}function em(n){let e=9;for(;e{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(b_.range(i)))}return Re.of(e)});function A_(){return S_}function We(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;el.from==l.to||l.from==l.to-1&&r.doc.lineAt(l.from).to==l.from?Ae.widget({widget:new L_(l),diagnostic:l}).range(l.from):Ae.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new ai(s,t,So(s))}}function So(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new __(i,o,s.diagnostic),!1}),r}function n1(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(Fr).hideOn(n,t,r);if(i!=null)return i;let o=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(s=>s.is(ic))||n.changes.touchesRange(o.from,Math.max(o.to,r)))}function i1(n,e){return n.field(Zt,!1)?e:e.concat(Oe.appendConfig.of(h1))}function T_(n,e){return{effects:i1(n,[ic.of(e)])}}const ic=Oe.define(),sp=Oe.define(),o1=Oe.define(),Zt=ft.define({create(){return new ai(Ae.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let o=e.changes.mapPos(n.selected.from,1);r=So(t,n.selected.diagnostic,o)||So(t,null,o)}!t.size&&i&&e.state.facet(Fr).autoPanel&&(i=null),n=new ai(t,i,r)}for(let t of e.effects)if(t.is(ic)){let r=e.state.facet(Fr).autoPanel?t.value.length?El.open:null:n.panel;n=ai.init(t.value,r,e.state)}else t.is(sp)?n=new ai(n.diagnostics,t.value?El.open:null,n.selected):t.is(o1)&&(n=new ai(n.diagnostics,n.panel,t.value));return n},provide:n=>[Tl.from(n,e=>e.panel),de.decorations.from(n,e=>e.diagnostics)]}),E_=Ae.mark({class:"cm-lintRange cm-lintRange-active"});function C_(n,e,t){let{diagnostics:r}=n.state.field(Zt),i=[],o=2e8,s=0;r.between(e-(t<0?1:0),e+(t>0?1:0),(a,u,{spec:c})=>{e>=a&&e<=u&&(a==u||(e>a||t>0)&&(ea1(n,t,!1)))}const w_=n=>{let e=n.state.field(Zt,!1);(!e||!e.panel)&&n.dispatch({effects:i1(n.state,[sp.of(!0)])});let t=_l(n,El.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},tm=n=>{let e=n.state.field(Zt,!1);return!e||!e.panel?!1:(n.dispatch({effects:sp.of(!1)}),!0)},O_=n=>{let e=n.state.field(Zt,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},N_=[{key:"Mod-Shift-m",run:w_,preventDefault:!0},{key:"F8",run:O_}],D_=nt.fromClass(class{constructor(n){this.view=n,this.timeout=-1,this.set=!0;let{delay:e}=n.state.facet(Fr);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let n=Date.now();if(nPromise.resolve(r(this.view))),r=>{this.view.state.doc==e.doc&&this.view.dispatch(T_(this.view.state,r.reduce((i,o)=>i.concat(o))))},r=>{It(this.view.state,r)})}}update(n){let e=n.state.facet(Fr);(n.docChanged||e!=n.startState.facet(Fr)||e.needsRefresh&&e.needsRefresh(n))&&(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)}});function P_(n,e,t){let r=[],i=-1;for(let o of n)o.then(s=>{r.push(s),clearTimeout(i),r.length==n.length?e(r):setTimeout(()=>e(r),200)},t)}const Fr=he.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},vr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function R_(n,e={}){return[Fr.of({source:n,config:e}),D_,h1]}function l1(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;ro.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function a1(n,e,t){var r;let i=t?l1(e.actions):[];return We("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},We("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let l=!1,a=f=>{if(f.preventDefault(),l)return;l=!0;let d=So(n.state.field(Zt).diagnostics,e);d&&o.apply(n,d.from,d.to)},{name:u}=o,c=i[s]?u.indexOf(i[s]):-1,h=c<0?u:[u.slice(0,c),We("u",u.slice(c,c+1)),u.slice(c+1)];return We("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${u}${c<0?"":` (access key "${i[s]})"`}.`},h)}),e.source&&We("div",{class:"cm-diagnosticSource"},e.source))}class L_ extends Vn{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return We("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class rm{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=a1(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class El{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)tm(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=l1(o.actions);for(let l=0;l{for(let o=0;otm(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Zt).selected;if(!e)return-1;for(let t=0;t{let u=-1,c;for(let h=r;hr&&(this.items.splice(r,u-r),i=!0)),t&&c.diagnostic==t.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),o=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),r++});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:l})=>{let a=l.height/this.list.offsetHeight;s.topl.bottom&&(this.list.scrollTop+=(s.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Zt),r=So(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:o1.of(r)})}static open(e){return new El(e)}}function cu(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function ja(n){return cu(``,'width="6" height="3"')}const k_=de.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:ja("#d11")},".cm-lintRange-warning":{backgroundImage:ja("orange")},".cm-lintRange-info":{backgroundImage:ja("#999")},".cm-lintRange-hint":{backgroundImage:ja("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function nm(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}class u1 extends qr{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,r)=>nm(t)M_(e,t,r)),t}}function I_(n,e){let t=r=>{let i=e.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientYe.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,I_(n,e)}let{hoverTime:i}=n.state.facet(oc),o=setTimeout(r,i);e.onmouseout=()=>{clearTimeout(o),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}}function F_(n,e){let t=Object.create(null);for(let i of e){let o=n.lineAt(i.from);(t[o.from]||(t[o.from]=[])).push(i)}let r=[];for(let i in t)r.push(new u1(t[i]).range(+i));return Re.of(r,!0)}const B_=Zy({class:"cm-gutter-lint",markers:n=>n.state.field(ad),widgetMarker:(n,e,t)=>{let r=[];return n.state.field(ad).between(t.from,t.to,(i,o,s)=>{r.push(...s.diagnostics)}),r.length?new u1(r):null}}),ad=ft.define({create(){return Re.empty},update(n,e){n=n.map(e.changes);let t=e.state.facet(oc).markerFilter;for(let r of e.effects)if(r.is(ic)){let i=r.value;t&&(i=t(i||[],e.state)),n=F_(e.state.doc,i.slice(0))}return n}}),lp=Oe.define(),c1=ft.define({create(){return null},update(n,e){return n&&e.docChanged&&(n=n1(e,n)?null:Object.assign(Object.assign({},n),{pos:e.changes.mapPos(n.pos)})),e.effects.reduce((t,r)=>r.is(lp)?r.value:t,n)},provide:n=>rc.from(n)}),j_=de.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:cu('')},".cm-lint-marker-warning":{content:cu('')},".cm-lint-marker-error":{content:cu('')}}),h1=[Zt,de.decorations.compute([Zt],n=>{let{selected:e,panel:t}=n.field(Zt);return!e||!t||e.from==e.to?Ae.none:Ae.set([E_.range(e.from,e.to)])}),u_(C_,{hideOn:n1}),k_],oc=he.define({combine(n){return vr(n,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function $_(n={}){return[oc.of(n),ad,B_,j_,c1]}const H_=1024;let z_=0;class Eh{constructor(e,t){this.from=e,this.to=t}}class Le{constructor(e={}){this.id=z_++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=pr.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}Le.closedBy=new Le({deserialize:n=>n.split(" ")});Le.openedBy=new Le({deserialize:n=>n.split(" ")});Le.group=new Le({deserialize:n=>n.split(" ")});Le.isolate=new Le({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});Le.contextHash=new Le({perNode:!0});Le.lookAhead=new Le({perNode:!0});Le.mounted=new Le({perNode:!0});class Nu{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[Le.mounted.id]}}const q_=Object.create(null);class pr{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):q_,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new pr(e.name||"",t,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Le.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(Le.group),o=-1;o<(i?i.length:0);o++){let s=t[o<0?r.name:i[o]];if(s)return s}}}}pr.none=new pr("",Object.create(null),0,8);const $a=new WeakMap,im=new WeakMap;var bt;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(bt||(bt={}));let er=class ud{constructor(e,t,r,i,o){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,l]of o)this.props[typeof s=="number"?s:s.id]=l}}toString(){let e=Nu.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new hd(this.topNode,e)}cursorAt(e,t=0,r=0){let i=$a.get(this)||this.topNode,o=new hd(i);return o.moveTo(e,t),$a.set(this,o._tree),o}get topNode(){return new hr(this,0,0,null)}resolve(e,t=0){let r=Cl($a.get(this)||this.topNode,e,t,!1);return $a.set(this,r),r}resolveInner(e,t=0){let r=Cl(im.get(this)||this.topNode,e,t,!0);return im.set(this,r),r}resolveStack(e,t=0){return W_(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:o=this.length}=e,s=e.mode||0,l=(s&bt.IncludeAnonymous)>0;for(let a=this.cursor(s|bt.IncludeAnonymous);;){let u=!1;if(a.from<=o&&a.to>=i&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;u=!0}for(;u&&r&&(l||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:cp(pr.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new ud(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new ud(pr.none,t,r,i)))}static build(e){return K_(e)}};er.empty=new er(pr.none,[],[],0);class ap{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ap(this.buffer,this.index)}}class zn{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return pr.none}toString(){let e=[];for(let t=0;t0));a=s[a+3]);return l}slice(e,t,r){let i=this.buffer,o=new Uint16Array(t-e),s=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function Cl(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=u;e+=t){let c=l[e],h=a[e]+s.from;if(f1(i,r,h,h+c.length)){if(c instanceof zn){if(o&bt.ExcludeBuffers)continue;let f=c.findChild(0,c.buffer.length,t,r-h,i);if(f>-1)return new kn(new U_(s,c,e,h),null,f)}else if(o&bt.IncludeAnonymous||!c.type.isAnonymous||up(c)){let f;if(!(o&bt.IgnoreMounts)&&(f=Nu.get(c))&&!f.overlay)return new hr(f.tree,h,e,s);let d=new hr(c,h,e,s);return o&bt.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,r,i)}}}if(o&bt.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+t:e=t<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,r=0){let i;if(!(r&bt.IgnoreOverlays)&&(i=Nu.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:l}of i.overlay)if((t>0?s<=o:s=o:l>o))return new hr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function om(n,e,t,r){let i=n.cursor(),o=[];if(!i.firstChild())return o;if(t!=null){for(let s=!1;!s;)if(s=i.type.is(t),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function cd(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class U_{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class kn extends d1{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return o<0?null:new kn(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,r=0){if(r&bt.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new kn(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new kn(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new kn(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),t.push(0)}return new er(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function p1(n){if(!n.length)return null;let e=0,t=n[0];for(let o=1;ot.from||s.to=e){let l=new hr(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(Cl(l,e,t,!1))}}return i?p1(i):r}class hd{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof hr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof hr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&bt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&bt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&bt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=t+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let l=r._tree.children[o];if(this.mode&bt.IncludeAnonymous||l instanceof zn||!l.type.isAnonymous||up(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return cd(this._tree,e,i);let s=r[t.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function up(n){return n.children.some(e=>e instanceof zn||!e.type.isAnonymous||up(e))}function K_(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=H_,reused:o=[],minRepeatType:s=r.types.length}=n,l=Array.isArray(t)?new ap(t,t.length):t,a=r.types,u=0,c=0;function h(_,S,C,O,D,B){let{id:$,start:I,end:V,size:se}=l,ie=c,fe=u;for(;se<0;)if(l.next(),se==-1){let Z=o[$];C.push(Z),O.push(I-_);return}else if(se==-3){u=$;return}else if(se==-4){c=$;return}else throw new RangeError(`Unrecognized record size: ${se}`);let Ee=a[$],me,ee,Y=I-_;if(V-I<=i&&(ee=m(l.pos-S,D))){let Z=new Uint16Array(ee.size-ee.skip),le=l.pos-ee.size,E=Z.length;for(;l.pos>le;)E=y(ee.start,Z,E);me=new zn(Z,V-ee.start,r),Y=ee.start-_}else{let Z=l.pos-se;l.next();let le=[],E=[],A=$>=s?$:-1,T=0,N=V;for(;l.pos>Z;)A>=0&&l.id==A&&l.size>=0?(l.end<=N-i&&(p(le,E,I,T,l.end,N,A,ie,fe),T=le.length,N=l.end),l.next()):B>2500?f(I,Z,le,E):h(I,Z,le,E,A,B+1);if(A>=0&&T>0&&T-1&&T>0){let R=d(Ee,fe);me=cp(Ee,le,E,0,le.length,0,V-I,R,R)}else me=v(Ee,le,E,V-I,ie-V,fe)}C.push(me),O.push(Y)}function f(_,S,C,O){let D=[],B=0,$=-1;for(;l.pos>S;){let{id:I,start:V,end:se,size:ie}=l;if(ie>4)l.next();else{if($>-1&&V<$)break;$<0&&($=se-i),D.push(I,V,se),B++,l.next()}}if(B){let I=new Uint16Array(B*4),V=D[D.length-2];for(let se=D.length-3,ie=0;se>=0;se-=3)I[ie++]=D[se],I[ie++]=D[se+1]-V,I[ie++]=D[se+2]-V,I[ie++]=ie;C.push(new zn(I,D[2]-V,r)),O.push(V-_)}}function d(_,S){return(C,O,D)=>{let B=0,$=C.length-1,I,V;if($>=0&&(I=C[$])instanceof er){if(!$&&I.type==_&&I.length==D)return I;(V=I.prop(Le.lookAhead))&&(B=O[$]+I.length+V)}return v(_,C,O,D,B,S)}}function p(_,S,C,O,D,B,$,I,V){let se=[],ie=[];for(;_.length>O;)se.push(_.pop()),ie.push(S.pop()+C-D);_.push(v(r.types[$],se,ie,B-D,I-B,V)),S.push(D-C)}function v(_,S,C,O,D,B,$){if(B){let I=[Le.contextHash,B];$=$?[I].concat($):[I]}if(D>25){let I=[Le.lookAhead,D];$=$?[I].concat($):[I]}return new er(_,S,C,O,$)}function m(_,S){let C=l.fork(),O=0,D=0,B=0,$=C.end-i,I={size:0,start:0,skip:0};e:for(let V=C.pos-_;C.pos>V;){let se=C.size;if(C.id==S&&se>=0){I.size=O,I.start=D,I.skip=B,B+=4,O+=4,C.next();continue}let ie=C.pos-se;if(se<0||ie=s?4:0,Ee=C.start;for(C.next();C.pos>ie;){if(C.size<0)if(C.size==-3)fe+=4;else break e;else C.id>=s&&(fe+=4);C.next()}D=Ee,O+=se,B+=fe}return(S<0||O==_)&&(I.size=O,I.start=D,I.skip=B),I.size>4?I:void 0}function y(_,S,C){let{id:O,start:D,end:B,size:$}=l;if(l.next(),$>=0&&O4){let V=l.pos-($-4);for(;l.pos>V;)C=y(_,S,C)}S[--C]=I,S[--C]=B-_,S[--C]=D-_,S[--C]=O}else $==-3?u=O:$==-4&&(c=O);return C}let g=[],x=[];for(;l.pos>0;)h(n.start||0,n.bufferStart||0,g,x,-1,0);let b=(e=n.length)!==null&&e!==void 0?e:g.length?x[0]+g[0].length:0;return new er(a[n.topID],g.reverse(),x.reverse(),b)}const sm=new WeakMap;function hu(n,e){if(!n.isAnonymous||e instanceof zn||e.type!=n)return 1;let t=sm.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof er)){t=1;break}t+=hu(n,r)}sm.set(e,t)}return t}function cp(n,e,t,r,i,o,s,l,a){let u=0;for(let p=r;p=c)break;S+=C}if(x==b+1){if(S>c){let C=p[b];d(C.children,C.positions,0,C.children.length,v[b]+g);continue}h.push(p[b])}else{let C=v[x-1]+p[x-1].length-_;h.push(cp(n,p,v,b,x,_,C,null,a))}f.push(_+g-o)}}return d(e,t,r,i,0),(l||a)(h,f,s)}class di{constructor(e,t,r,i,o=!1,s=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new di(0,e.length,e,0,!1,r)];for(let o of t)o.to>e.length&&i.push(o);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let l=0,a=0,u=0;;l++){let c=l=r)for(;s&&s.from=f.from||h<=f.to||u){let d=Math.max(f.from,a)-u,p=Math.min(f.to,h)-u;f=d>=p?null:new di(d,p,f.tree,f.offset+u,l>0,!!c)}if(f&&i.push(f),s.to>h)break;s=onew Eh(i.from,i.to)):[new Eh(0,0)]:[new Eh(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let o=i.advance();if(o)return o}}};class X_{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Le({perNode:!0});let Y_=0;class lr{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=Y_++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof lr&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let i=new lr(r,[],null,[]);if(i.set.push(i),t)for(let o of t.set)i.set.push(o);return i}static defineModifier(e){let t=new Du(e);return r=>r.modified.indexOf(t)>-1?r:Du.get(r.base||r,r.modified.concat(t).sort((i,o)=>i.id-o.id))}}let J_=0;class Du{constructor(e){this.name=e,this.instances=[],this.id=J_++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(l=>l.base==e&&Q_(t,l.modified));if(r)return r;let i=[],o=new lr(e.name,i,e,t);for(let l of t)l.instances.push(o);let s=Z_(t);for(let l of e.set)if(!l.modified.length)for(let a of s)i.push(Du.get(l,a));return o}}function Q_(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function Z_(n){let e=[[]];for(let t=0;tr.length-t.length)}function eT(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let o=[],s=2,l=i;for(let h=0;;){if(l=="..."&&h>0&&h+3==i.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+i);if(o.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==i.length)break;let d=i[h++];if(h==i.length&&d=="!"){s=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);l=i.slice(h)}let a=o.length-1,u=o[a];if(!u)throw new RangeError("Invalid path: "+i);let c=new Pu(r,s,a>0?o.slice(0,a):null);e[u]=c.sort(e[u])}}return m1.add(e)}const m1=new Le;class Pu{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let l of o)for(let a of l.set){let u=t[a.id];if(u){s=s?s+" "+u:u;break}}return s},scope:r}}function tT(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function rT(n,e,t,r=0,i=n.length){let o=new nT(r,Array.isArray(e)?e:[e],t);o.highlightRange(n.cursor(),r,i,"",o.highlighters),o.flush(i)}class nT{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,o){let{type:s,from:l,to:a}=e;if(l>=r||a<=t)return;s.isTop&&(o=this.highlighters.filter(d=>!d.scope||d.scope(s)));let u=i,c=iT(e)||Pu.empty,h=tT(o,c.tags);if(h&&(u&&(u+=" "),u+=h,c.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(t,l),u),c.opaque)return;let f=e.tree&&e.tree.prop(Le.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(f.tree.type)),v=e.firstChild();for(let m=0,y=l;;m++){let g=m=x||!e.nextSibling())););if(!g||x>r)break;y=g.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,g.from+l),Math.min(r,y),"",p),this.startSpan(Math.min(r,y),u))}v&&e.parent()}else if(e.firstChild()){f&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,o),this.startSpan(Math.min(r,e.to),u)}while(e.nextSibling());e.parent()}}}function iT(n){let e=n.type.prop(m1);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const ue=lr.define,Ha=ue(),Cn=ue(),lm=ue(Cn),am=ue(Cn),wn=ue(),za=ue(wn),Ch=ue(wn),Rr=ue(),ni=ue(Rr),Dr=ue(),Pr=ue(),fd=ue(),ts=ue(fd),qa=ue(),ce={comment:Ha,lineComment:ue(Ha),blockComment:ue(Ha),docComment:ue(Ha),name:Cn,variableName:ue(Cn),typeName:lm,tagName:ue(lm),propertyName:am,attributeName:ue(am),className:ue(Cn),labelName:ue(Cn),namespace:ue(Cn),macroName:ue(Cn),literal:wn,string:za,docString:ue(za),character:ue(za),attributeValue:ue(za),number:Ch,integer:ue(Ch),float:ue(Ch),bool:ue(wn),regexp:ue(wn),escape:ue(wn),color:ue(wn),url:ue(wn),keyword:Dr,self:ue(Dr),null:ue(Dr),atom:ue(Dr),unit:ue(Dr),modifier:ue(Dr),operatorKeyword:ue(Dr),controlKeyword:ue(Dr),definitionKeyword:ue(Dr),moduleKeyword:ue(Dr),operator:Pr,derefOperator:ue(Pr),arithmeticOperator:ue(Pr),logicOperator:ue(Pr),bitwiseOperator:ue(Pr),compareOperator:ue(Pr),updateOperator:ue(Pr),definitionOperator:ue(Pr),typeOperator:ue(Pr),controlOperator:ue(Pr),punctuation:fd,separator:ue(fd),bracket:ts,angleBracket:ue(ts),squareBracket:ue(ts),paren:ue(ts),brace:ue(ts),content:Rr,heading:ni,heading1:ue(ni),heading2:ue(ni),heading3:ue(ni),heading4:ue(ni),heading5:ue(ni),heading6:ue(ni),contentSeparator:ue(Rr),list:ue(Rr),quote:ue(Rr),emphasis:ue(Rr),strong:ue(Rr),link:ue(Rr),monospace:ue(Rr),strikethrough:ue(Rr),inserted:ue(),deleted:ue(),changed:ue(),invalid:ue(),meta:qa,documentMeta:ue(qa),annotation:ue(qa),processingInstruction:ue(qa),definition:lr.defineModifier("definition"),constant:lr.defineModifier("constant"),function:lr.defineModifier("function"),standard:lr.defineModifier("standard"),local:lr.defineModifier("local"),special:lr.defineModifier("special")};for(let n in ce){let e=ce[n];e instanceof lr&&(e.name=n)}g1([{tag:ce.link,class:"tok-link"},{tag:ce.heading,class:"tok-heading"},{tag:ce.emphasis,class:"tok-emphasis"},{tag:ce.strong,class:"tok-strong"},{tag:ce.keyword,class:"tok-keyword"},{tag:ce.atom,class:"tok-atom"},{tag:ce.bool,class:"tok-bool"},{tag:ce.url,class:"tok-url"},{tag:ce.labelName,class:"tok-labelName"},{tag:ce.inserted,class:"tok-inserted"},{tag:ce.deleted,class:"tok-deleted"},{tag:ce.literal,class:"tok-literal"},{tag:ce.string,class:"tok-string"},{tag:ce.number,class:"tok-number"},{tag:[ce.regexp,ce.escape,ce.special(ce.string)],class:"tok-string2"},{tag:ce.variableName,class:"tok-variableName"},{tag:ce.local(ce.variableName),class:"tok-variableName tok-local"},{tag:ce.definition(ce.variableName),class:"tok-variableName tok-definition"},{tag:ce.special(ce.variableName),class:"tok-variableName2"},{tag:ce.definition(ce.propertyName),class:"tok-propertyName tok-definition"},{tag:ce.typeName,class:"tok-typeName"},{tag:ce.namespace,class:"tok-namespace"},{tag:ce.className,class:"tok-className"},{tag:ce.macroName,class:"tok-macroName"},{tag:ce.propertyName,class:"tok-propertyName"},{tag:ce.operator,class:"tok-operator"},{tag:ce.comment,class:"tok-comment"},{tag:ce.meta,class:"tok-meta"},{tag:ce.invalid,class:"tok-invalid"},{tag:ce.punctuation,class:"tok-punctuation"}]);var wh;const sl=new Le,oT=new Le;class Br{constructor(e,t,r=[],i=""){this.data=e,this.name=i,Fe.prototype.hasOwnProperty("tree")||Object.defineProperty(Fe.prototype,"tree",{get(){return Dt(this)}}),this.parser=t,this.extension=[qn.of(this),Fe.languageData.of((o,s,l)=>{let a=um(o,s,l),u=a.type.prop(sl);if(!u)return[];let c=o.facet(u),h=a.type.prop(oT);if(h){let f=a.resolve(s-a.from,l);for(let d of h)if(d.test(f,o)){let p=o.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return um(e,t,r).type.prop(sl)==this.data}findRegions(e){let t=e.facet(qn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(sl)==this.data){r.push({from:s,to:s+o.length});return}let l=o.prop(Le.mounted);if(l){if(l.tree.prop(sl)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+s,to:a.to+s});else r.push({from:s,to:s+o.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+s),r.length>a)return}}for(let a=0;a=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let rs=null;class Ru{constructor(e,t,r=[],i,o,s,l,a){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new Ru(e,t,[],er.empty,0,r,[],null)}startParse(){return this.parser.startParse(new sT(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=er.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(di.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=rs;rs=this;try{return e()}finally{rs=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=cm(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((u,c,h,f)=>a.push({fromA:u,toA:c,fromB:h,toB:f})),r=di.applyChanges(r,a),i=er.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let c=e.mapPos(u.from,1),h=e.mapPos(u.to,-1);ce.from&&(this.fragments=cm(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends G_{createParse(t,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let a=rs;if(a){for(let u of i)a.tempSkipped.push(u);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=s,new er(pr.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return rs}}function cm(n,e,t){return di.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ao{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new Ao(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Ru.create(e.facet(qn).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new Ao(r)}}Br.state=ft.define({create:Ao.init,update(n,e){for(let t of e.effects)if(t.is(Br.setState))return t.value;return e.startState.facet(qn)!=e.state.facet(qn)?Ao.init(e.state):n.apply(e)}});let x1=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(x1=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Oh=typeof navigator<"u"&&(!((wh=navigator.scheduling)===null||wh===void 0)&&wh.isInputPending)?()=>navigator.scheduling.isInputPending():null,lT=nt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Br.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Br.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=x1(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,a=o.context.work(()=>Oh&&Oh()||Date.now()>s,i+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Br.setState.of(new Ao(o.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>It(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),qn=he.define({combine(n){return n.length?n[0]:null},enables:n=>[Br.state,lT,de.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]}),aT=he.define(),hp=he.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Lu(n){let e=n.facet(hp);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function wl(n,e){let t="",r=n.tabSize,i=n.facet(hp)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let o=0;o=e?cT(n,t,e):null}class sc{constructor(e,t={}){this.state=e,this.options=t,this.unit=Lu(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(t<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,t=e.length){return ko(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const uT=new Le;function cT(n,e,t){let r=e.resolveStack(t),i=r.node.enterUnfinishedNodesBefore(t);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return y1(r,n,t)}function y1(n,e,t){for(let r=n;r;r=r.next){let i=fT(r.node);if(i)return i(dp.create(e,t,r))}return 0}function hT(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function fT(n){let e=n.type.prop(uT);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(Le.closedBy))){let i=n.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>gT(s,!0,1,void 0,o&&!hT(s)?i.from:void 0)}return n.parent==null?dT:null}function dT(){return 0}class dp extends sc{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new dp(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(pT(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return y1(this.context.next,this.base,this.pos)}}function pT(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function mT(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,o=n.state.doc.lineAt(t.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=s)return null;let u=/^ */.exec(o.text.slice(t.to-o.from))[0].length;return{from:t.from,to:t.to+u}}l=a.to}}function gT(n,e,t,r,i){let o=n.textAfter,s=o.match(/^\s*/)[0].length,l=i==n.pos+s,a=mT(n);return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const xT=200;function yT(){return Fe.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+xT)return n;let o=t.sliceString(i.from,r);if(!e.some(u=>u.test(o)))return n;let{state:s}=n,l=-1,a=[];for(let{head:u}of s.selection.ranges){let c=s.doc.lineAt(u);if(c.from==l)continue;l=c.from;let h=fp(s,c.from);if(h==null)continue;let f=/^\s*/.exec(c.text)[0],d=wl(s,h);f!=d&&a.push({from:c.from,to:c.from+f.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const vT=he.define(),bT=new Le;function ST(n,e,t){let r=Dt(n);if(r.lengtht)continue;if(o&&l.from=e&&u.to>t&&(o=u)}}return o}function AT(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function ku(n,e,t){for(let r of n.facet(vT)){let i=r(n,e,t);if(i)return i}return ST(n,e,t)}function v1(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const lc=Oe.define({map:v1}),Hl=Oe.define({map:v1});function b1(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const bi=ft.define({create(){return Ae.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(lc)&&!_T(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(_1),i=r?Ae.replace({widget:new DT(r(e.state,t.value))}):hm;n=n.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(Hl)&&(n=n.update({filter:(r,i)=>t.value.from!=r||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:r}=e.selection.main;n.between(r,r,(i,o)=>{ir&&(t=!0)}),t&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return n},provide:n=>de.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>o)&&(i={from:o,to:s})}),i}function _T(n,e,t){let r=!1;return n.between(e,e,(i,o)=>{i==e&&o==t&&(r=!0)}),r}function S1(n,e){return n.field(bi,!1)?e:e.concat(Oe.appendConfig.of(T1()))}const TT=n=>{for(let e of b1(n)){let t=ku(n.state,e.from,e.to);if(t)return n.dispatch({effects:S1(n.state,[lc.of(t),A1(n,t)])}),!0}return!1},ET=n=>{if(!n.state.field(bi,!1))return!1;let e=[];for(let t of b1(n)){let r=Iu(n.state,t.from,t.to);r&&e.push(Hl.of(r),A1(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function A1(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return de.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const CT=n=>{let{state:e}=n,t=[];for(let r=0;r{let e=n.state.field(bi,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(Hl.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},OT=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:TT},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ET},{key:"Ctrl-Alt-[",run:CT},{key:"Ctrl-Alt-]",run:wT}],NT={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},_1=he.define({combine(n){return vr(n,NT)}});function T1(n){return[bi,LT]}function E1(n,e){let{state:t}=n,r=t.facet(_1),i=s=>{let l=n.lineBlockAt(n.posAtDOM(s.target)),a=Iu(n.state,l.from,l.to);a&&n.dispatch({effects:Hl.of(a)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",t.phrase("folded code")),o.title=t.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const hm=Ae.replace({widget:new class extends Vn{toDOM(n){return E1(n,null)}}});class DT extends Vn{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return E1(e,this.value)}}const PT={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Nh extends qr{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function RT(n={}){let e=Object.assign(Object.assign({},PT),n),t=new Nh(e,!0),r=new Nh(e,!1),i=nt.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(qn)!=s.state.facet(qn)||s.startState.field(bi,!1)!=s.state.field(bi,!1)||Dt(s.startState)!=Dt(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let l=new Bn;for(let a of s.viewportLineBlocks){let u=Iu(s.state,a.from,a.to)?r:ku(s.state,a.from,a.to)?t:null;u&&l.add(a.from,a.from,u)}return l.finish()}}),{domEventHandlers:o}=e;return[i,Zy({class:"cm-foldGutter",markers(s){var l;return((l=s.plugin(i))===null||l===void 0?void 0:l.markers)||Re.empty},initialSpacer(){return new Nh(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,l,a)=>{if(o.click&&o.click(s,l,a))return!0;let u=Iu(s.state,l.from,l.to);if(u)return s.dispatch({effects:Hl.of(u)}),!0;let c=ku(s.state,l.from,l.to);return c?(s.dispatch({effects:lc.of(c)}),!0):!1}})}),T1()]}const LT=de.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 ac{constructor(e,t){this.specs=e;let r;function i(l){let a=jn.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const o=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,s=t.scope;this.scope=s instanceof Br?l=>l.prop(sl)==s.data:s?l=>l==s:void 0,this.style=g1(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:o}).style,this.module=r?new jn(r):null,this.themeType=t.themeType}static define(e,t){return new ac(e,t||{})}}const dd=he.define(),C1=he.define({combine(n){return n.length?[n[0]]:null}});function Dh(n){let e=n.facet(dd);return e.length?e:n.facet(C1)}function kT(n,e){let t=[MT],r;return n instanceof ac&&(n.module&&t.push(de.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push(C1.of(n)):r?t.push(dd.computeN([de.darkTheme],i=>i.facet(de.darkTheme)==(r=="dark")?[n]:[])):t.push(dd.of(n)),t}class IT{constructor(e){this.markCache=Object.create(null),this.tree=Dt(e.state),this.decorations=this.buildDeco(e,Dh(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Dt(e.state),r=Dh(e.state),i=r!=Dh(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return Ae.none;let r=new Bn;for(let{from:i,to:o}of e.visibleRanges)rT(this.tree,t,(s,l,a)=>{r.add(s,l,this.markCache[a]||(this.markCache[a]=Ae.mark({class:a})))},i,o);return r.finish()}}const MT=Fi.high(nt.fromClass(IT,{decorations:n=>n.decorations})),FT=ac.define([{tag:ce.meta,color:"#404740"},{tag:ce.link,textDecoration:"underline"},{tag:ce.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ce.emphasis,fontStyle:"italic"},{tag:ce.strong,fontWeight:"bold"},{tag:ce.strikethrough,textDecoration:"line-through"},{tag:ce.keyword,color:"#708"},{tag:[ce.atom,ce.bool,ce.url,ce.contentSeparator,ce.labelName],color:"#219"},{tag:[ce.literal,ce.inserted],color:"#164"},{tag:[ce.string,ce.deleted],color:"#a11"},{tag:[ce.regexp,ce.escape,ce.special(ce.string)],color:"#e40"},{tag:ce.definition(ce.variableName),color:"#00f"},{tag:ce.local(ce.variableName),color:"#30a"},{tag:[ce.typeName,ce.namespace],color:"#085"},{tag:ce.className,color:"#167"},{tag:[ce.special(ce.variableName),ce.macroName],color:"#256"},{tag:ce.definition(ce.propertyName),color:"#00c"},{tag:ce.comment,color:"#940"},{tag:ce.invalid,color:"#f00"}]),BT=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),w1=1e4,O1="()[]{}",N1=he.define({combine(n){return vr(n,{afterCursor:!0,brackets:O1,maxScanDistance:w1,renderMatch:HT})}}),jT=Ae.mark({class:"cm-matchingBracket"}),$T=Ae.mark({class:"cm-nonmatchingBracket"});function HT(n){let e=[],t=n.matched?jT:$T;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const zT=ft.define({create(){return Ae.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(N1);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=jr(e.state,i.head,-1,r)||i.head>0&&jr(e.state,i.head-1,1,r)||r.afterCursor&&(jr(e.state,i.head,1,r)||i.headde.decorations.from(n)}),qT=[zT,BT];function UT(n={}){return[N1.of(n),qT]}const VT=new Le;function pd(n,e,t){let r=n.prop(e<0?Le.openedBy:Le.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function md(n){let e=n.type.prop(VT);return e?e(n.node):n}function jr(n,e,t,r={}){let i=r.maxScanDistance||w1,o=r.brackets||O1,s=Dt(n),l=s.resolveInner(e,t);for(let a=l;a;a=a.parent){let u=pd(a.type,t,o);if(u&&a.from0?e>=c.from&&ec.from&&e<=c.to))return WT(n,e,t,a,c,u,o)}}return KT(n,e,t,s,l.type,i,o)}function WT(n,e,t,r,i,o,s){let l=r.parent,a={from:i.from,to:i.to},u=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(u==0&&o.indexOf(c.type.name)>-1&&c.from0)return null;let u={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let f=0;!c.next().done&&f<=o;){let d=c.value;t<0&&(f+=d.length);let p=e+f*t;for(let v=t>0?0:d.length-1,m=t>0?d.length:-1;v!=m;v+=t){let y=s.indexOf(d[v]);if(!(y<0||r.resolveInner(p+v,1).type!=i))if(y%2==0==t>0)h++;else{if(h==1)return{start:u,end:{from:p+v,to:p+v+1},matched:y>>1==a>>1};h--}}t>0&&(f+=d.length)}return c.done?{start:u,matched:!1}:null}const GT=Object.create(null),fm=[pr.none],dm=[],pm=Object.create(null),XT=Object.create(null);for(let[n,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"]])XT[n]=YT(GT,e);function Ph(n,e){dm.indexOf(n)>-1||(dm.push(n),console.warn(e))}function YT(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let u of l.split(".")){let c=n[u]||ce[u];c?typeof c=="function"?a.length?a=a.map(c):Ph(u,`Modifier ${u} used at start of tag`):a.length?Ph(u,`Tag ${u} used as modifier`):a=Array.isArray(c)?c:[c]:Ph(u,`Unknown highlighting tag ${u}`)}for(let u of a)t.push(u)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(l=>l.id),o=pm[i];if(o)return o.id;let s=pm[i]=pr.define({id:fm.length,name:r,props:[eT({[r]:t})]});return fm.push(s),s.id}Ge.RTL,Ge.LTR;const JT=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=mp(n.state,t.from);return r.line?QT(n):r.block?eE(n):!1};function pp(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const QT=pp(nE,0),ZT=pp(D1,0),eE=pp((n,e)=>D1(n,e,rE(e)),0);function mp(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const ns=50;function tE(n,{open:e,close:t},r,i){let o=n.sliceDoc(r-ns,r),s=n.sliceDoc(i,i+ns),l=/\s*$/.exec(o)[0].length,a=/^\s*/.exec(s)[0].length,u=o.length-l;if(o.slice(u-e.length,u)==e&&s.slice(a,a+t.length)==t)return{open:{pos:r-l,margin:l&&1},close:{pos:i+a,margin:a&&1}};let c,h;i-r<=2*ns?c=h=n.sliceDoc(r,i):(c=n.sliceDoc(r,r+ns),h=n.sliceDoc(i-ns,i));let f=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(h)[0].length,p=h.length-d-t.length;return c.slice(f,f+e.length)==e&&h.slice(p,p+t.length)==t?{open:{pos:r+f+e.length,margin:/\s/.test(c.charAt(f+e.length))?1:0},close:{pos:i-d-t.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null}function rE(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function D1(n,e,t=e.selection.ranges){let r=t.map(o=>mp(e,o.from).block);if(!r.every(o=>o))return null;let i=t.map((o,s)=>tE(e,r[s],o.from,o.to));if(n!=2&&!i.every(o=>o))return{changes:e.changes(t.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(n!=1&&i.some(o=>o)){let o=[];for(let s=0,l;si&&(o==s||s>h.from)){i=h.from;let f=/^\s*/.exec(h.text)[0].length,d=f==h.length,p=h.text.slice(f,f+u.length)==u?f:-1;fo.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:l,token:a,indent:u,empty:c,single:h}of r)(h||!c)&&o.push({from:l.from+u,insert:a+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(n!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:l,token:a}of r)if(l>=0){let u=s.from+l,c=u+a.length;s.text[c-s.from]==" "&&c++,o.push({from:u,to:c})}return{changes:o}}return null}const gd=pn.define(),iE=pn.define(),oE=he.define(),P1=he.define({combine(n){return vr(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),R1=ft.define({create(){return $r.empty},update(n,e){let t=e.state.facet(P1),r=e.annotation(gd);if(r){let a=Ut.fromTransaction(e,r.selection),u=r.side,c=u==0?n.undone:n.done;return a?c=Mu(c,c.length,t.minDepth,a):c=I1(c,e.startState.selection),new $r(u==0?r.rest:c,u==0?c:r.rest)}let i=e.annotation(iE);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(ct.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let o=Ut.fromTransaction(e),s=e.annotation(ct.time),l=e.annotation(ct.userEvent);return o?n=n.addChanges(o,s,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,s,l,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new $r(n.done.map(Ut.fromJSON),n.undone.map(Ut.fromJSON))}});function sE(n={}){return[R1,P1.of(n),de.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?L1:e.inputType=="historyRedo"?xd:null;return r?(e.preventDefault(),r(t)):!1}})]}function uc(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(R1,!1);if(!i)return!1;let o=i.pop(n,t,e);return o?(r(o),!0):!1}}const L1=uc(0,!1),xd=uc(1,!1),lE=uc(0,!0),aE=uc(1,!0);class Ut{constructor(e,t,r,i,o){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new Ut(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ut(e.changes&&at.fromJSON(e.changes),[],e.mapped&&Hr.fromJSON(e.mapped),e.startSelection&&re.fromJSON(e.startSelection),e.selectionsAfter.map(re.fromJSON))}static fromTransaction(e,t){let r=ur;for(let i of e.startState.facet(oE)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Ut(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,ur)}static selection(e){return new Ut(void 0,ur,void 0,void 0,e)}}function Mu(n,e,t,r){let i=e+1>t+20?e-t-1:0,o=n.slice(i,e);return o.push(r),o}function uE(n,e){let t=[],r=!1;return n.iterChangedRanges((i,o)=>t.push(i,o)),e.iterChangedRanges((i,o,s,l)=>{for(let a=0;a=u&&s<=c&&(r=!0)}}),r}function cE(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function k1(n,e){return n.length?e.length?n.concat(e):n:e}const ur=[],hE=200;function I1(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-hE));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),Mu(n,n.length-1,1e9,t.setSelAfter(r)))}else return[Ut.selection([e])]}function fE(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Rh(n,e){if(!n.length)return n;let t=n.length,r=ur;for(;t;){let i=dE(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=n.slice(0,t);return o[t-1]=i,o}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[Ut.selection(r)]:ur}function dE(n,e,t){let r=k1(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):ur,t);if(!n.changes)return Ut.selection(r);let i=n.changes.map(e),o=e.mapDesc(n.changes,!0),s=n.mapped?n.mapped.composeDesc(o):o;return new Ut(i,Oe.mapEffects(n.effects,e),s,n.startSelection.map(o),r)}const pE=/^(input\.type|delete)($|\.)/;class $r{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new $r(this.done,this.undone):this}addChanges(e,t,r,i,o){let s=this.done,l=s[s.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||pE.test(r))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):cc(t,e))}function Pt(n){return n.textDirectionAt(n.state.selection.main.head)==Ge.LTR}const F1=n=>M1(n,!Pt(n)),B1=n=>M1(n,Pt(n));function j1(n,e){return br(n,t=>t.empty?n.moveByGroup(t,e):cc(t,e))}const gE=n=>j1(n,!Pt(n)),xE=n=>j1(n,Pt(n));function yE(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function hc(n,e,t){let r=Dt(n).resolveInner(e.head),i=t?Le.closedBy:Le.openedBy;for(let a=e.head;;){let u=t?r.childAfter(a):r.childBefore(a);if(!u)break;yE(n,u,i)?r=u:a=t?u.to:u.from}let o=r.type.prop(i),s,l;return o&&(s=t?jr(n,r.from,1):jr(n,r.to,-1))&&s.matched?l=t?s.end.to:s.end.from:l=t?r.to:r.from,re.cursor(l,t?-1:1)}const vE=n=>br(n,e=>hc(n.state,e,!Pt(n))),bE=n=>br(n,e=>hc(n.state,e,Pt(n)));function $1(n,e){return br(n,t=>{if(!t.empty)return cc(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const H1=n=>$1(n,!1),z1=n=>$1(n,!0);function q1(n){let e=n.scrollDOM.clientHeights.empty?n.moveVertically(s,e,t.height):cc(s,e));if(i.eq(r.selection))return!1;let o;if(t.selfScroll){let s=n.coordsAtPos(r.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,u=l.bottom-t.marginBottom;s&&s.top>a&&s.bottomU1(n,!1),yd=n=>U1(n,!0);function Wn(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let o=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=re.cursor(r.from+o))}return i}const SE=n=>br(n,e=>Wn(n,e,!0)),AE=n=>br(n,e=>Wn(n,e,!1)),_E=n=>br(n,e=>Wn(n,e,!Pt(n))),TE=n=>br(n,e=>Wn(n,e,Pt(n))),EE=n=>br(n,e=>re.cursor(n.lineBlockAt(e.head).from,1)),CE=n=>br(n,e=>re.cursor(n.lineBlockAt(e.head).to,-1));function wE(n,e,t){let r=!1,i=Io(n.selection,o=>{let s=jr(n,o.head,-1)||jr(n,o.head,1)||o.head>0&&jr(n,o.head-1,1)||o.headwE(n,e);function mr(n,e){let t=Io(n.state.selection,r=>{let i=e(r);return re.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Vr(n.state,t)),!0)}function V1(n,e){return mr(n,t=>n.moveByChar(t,e))}const W1=n=>V1(n,!Pt(n)),K1=n=>V1(n,Pt(n));function G1(n,e){return mr(n,t=>n.moveByGroup(t,e))}const NE=n=>G1(n,!Pt(n)),DE=n=>G1(n,Pt(n)),PE=n=>mr(n,e=>hc(n.state,e,!Pt(n))),RE=n=>mr(n,e=>hc(n.state,e,Pt(n)));function X1(n,e){return mr(n,t=>n.moveVertically(t,e))}const Y1=n=>X1(n,!1),J1=n=>X1(n,!0);function Q1(n,e){return mr(n,t=>n.moveVertically(t,e,q1(n).height))}const gm=n=>Q1(n,!1),xm=n=>Q1(n,!0),LE=n=>mr(n,e=>Wn(n,e,!0)),kE=n=>mr(n,e=>Wn(n,e,!1)),IE=n=>mr(n,e=>Wn(n,e,!Pt(n))),ME=n=>mr(n,e=>Wn(n,e,Pt(n))),FE=n=>mr(n,e=>re.cursor(n.lineBlockAt(e.head).from)),BE=n=>mr(n,e=>re.cursor(n.lineBlockAt(e.head).to)),ym=({state:n,dispatch:e})=>(e(Vr(n,{anchor:0})),!0),vm=({state:n,dispatch:e})=>(e(Vr(n,{anchor:n.doc.length})),!0),bm=({state:n,dispatch:e})=>(e(Vr(n,{anchor:n.selection.main.anchor,head:0})),!0),Sm=({state:n,dispatch:e})=>(e(Vr(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),jE=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),$E=({state:n,dispatch:e})=>{let t=fc(n).map(({from:r,to:i})=>re.range(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:re.create(t),userEvent:"select"})),!0},HE=({state:n,dispatch:e})=>{let t=Io(n.selection,r=>{let i=Dt(n),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:l}=s;if((l.from=r.to||l.to>r.to&&l.from<=r.from)&&s.next)return re.range(l.to,l.from)}return r});return t.eq(n.selection)?!1:(e(Vr(n,t)),!0)},zE=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=re.create([t.main]):t.main.empty||(r=re.create([re.cursor(t.main.head)])),r?(e(Vr(n,r)),!0):!1};function zl(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(o=>{let{from:s,to:l}=o;if(s==l){let a=e(o);as&&(t="delete.forward",a=Ua(n,a,!0)),s=Math.min(s,a),l=Math.max(l,a)}else s=Ua(n,s,!1),l=Ua(n,l,!0);return s==l?{range:o}:{changes:{from:s,to:l},range:re.cursor(s,si(n)))r.between(e,e,(i,o)=>{ie&&(e=t?o:i)});return e}const Z1=(n,e,t)=>zl(n,r=>{let i=r.from,{state:o}=n,s=o.doc.lineAt(i),l,a;if(t&&!e&&i>s.from&&iZ1(n,!1,!0),ev=n=>Z1(n,!0,!1),tv=(n,e)=>zl(n,t=>{let r=t.head,{state:i}=n,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let l=null;;){if(r==(e?o.to:o.from)){r==t.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let a=At(o.text,r-o.from,e)+o.from,u=o.text.slice(Math.min(r,a)-o.from,Math.max(r,a)-o.from),c=s(u);if(l!=null&&c!=l)break;(u!=" "||r!=t.head)&&(l=c),r=a}return r}),rv=n=>tv(n,!1),qE=n=>tv(n,!0),UE=n=>zl(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headzl(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),WE=n=>zl(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:je.of(["",""])},range:re.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},GE=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,o=n.doc.lineAt(i),s=i==o.from?i-1:At(o.text,i-o.from,!1)+o.from,l=i==o.to?i+1:At(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:l,insert:n.doc.slice(i,l).append(n.doc.slice(s,i))},range:re.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function fc(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),o=n.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=n.doc.lineAt(r.to-1)),t>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});t=o.number+1}return e}function nv(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let o of fc(n)){if(t?o.to==n.doc.length:o.from==0)continue;let s=n.doc.lineAt(t?o.to+1:o.from-1),l=s.length+1;if(t){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+n.lineBreak});for(let a of o.ranges)i.push(re.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:n.lineBreak+s.text});for(let a of o.ranges)i.push(re.range(a.anchor-l,a.head-l))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:re.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const XE=({state:n,dispatch:e})=>nv(n,e,!1),YE=({state:n,dispatch:e})=>nv(n,e,!0);function iv(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of fc(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});return e(n.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const JE=({state:n,dispatch:e})=>iv(n,e,!1),QE=({state:n,dispatch:e})=>iv(n,e,!0),ZE=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(fc(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(n.lineWrapping){let s=n.lineBlockAt(i.head),l=n.coordsAtPos(i.head,i.assoc||1);l&&(o=s.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,o)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function eC(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Dt(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(Le.closedBy))&&o.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const tC=ov(!1),rC=ov(!0);function ov(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,l=e.doc.lineAt(o),a=!n&&o==s&&eC(e,o);n&&(o=s=(s<=l.to?l:e.doc.lineAt(s)).to);let u=new sc(e,{simulateBreak:o,simulateDoubleBreak:!!a}),c=fp(u,o);for(c==null&&(c=ko(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sl.from&&o{let i=[];for(let s=r.from;s<=r.to;){let l=n.doc.lineAt(s);l.number>t&&(r.empty||r.to>l.from)&&(e(l,i,r),t=l.number),s=l.to+1}let o=n.changes(i);return{changes:i,range:re.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const nC=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new sc(n,{overrideIndentation:o=>{let s=t[o];return s??-1}}),i=gp(n,(o,s,l)=>{let a=fp(r,o.from);if(a==null)return;/\S/.test(o.text)||(a=0);let u=/^\s*/.exec(o.text)[0],c=wl(n,a);(u!=c||l.fromn.readOnly?!1:(e(n.update(gp(n,(t,r)=>{r.push({from:t.from,insert:n.facet(hp)})}),{userEvent:"input.indent"})),!0),oC=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(gp(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let o=ko(i,n.tabSize),s=0,l=wl(n,Math.max(0,o-Lu(n)));for(;s(n.setTabFocusMode(),!0),lC=[{key:"Ctrl-b",run:F1,shift:W1,preventDefault:!0},{key:"Ctrl-f",run:B1,shift:K1},{key:"Ctrl-p",run:H1,shift:Y1},{key:"Ctrl-n",run:z1,shift:J1},{key:"Ctrl-a",run:EE,shift:FE},{key:"Ctrl-e",run:CE,shift:BE},{key:"Ctrl-d",run:ev},{key:"Ctrl-h",run:vd},{key:"Ctrl-k",run:UE},{key:"Ctrl-Alt-h",run:rv},{key:"Ctrl-o",run:KE},{key:"Ctrl-t",run:GE},{key:"Ctrl-v",run:yd}],aC=[{key:"ArrowLeft",run:F1,shift:W1,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:gE,shift:NE,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:_E,shift:IE,preventDefault:!0},{key:"ArrowRight",run:B1,shift:K1,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:xE,shift:DE,preventDefault:!0},{mac:"Cmd-ArrowRight",run:TE,shift:ME,preventDefault:!0},{key:"ArrowUp",run:H1,shift:Y1,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ym,shift:bm},{mac:"Ctrl-ArrowUp",run:mm,shift:gm},{key:"ArrowDown",run:z1,shift:J1,preventDefault:!0},{mac:"Cmd-ArrowDown",run:vm,shift:Sm},{mac:"Ctrl-ArrowDown",run:yd,shift:xm},{key:"PageUp",run:mm,shift:gm},{key:"PageDown",run:yd,shift:xm},{key:"Home",run:AE,shift:kE,preventDefault:!0},{key:"Mod-Home",run:ym,shift:bm},{key:"End",run:SE,shift:LE,preventDefault:!0},{key:"Mod-End",run:vm,shift:Sm},{key:"Enter",run:tC},{key:"Mod-a",run:jE},{key:"Backspace",run:vd,shift:vd},{key:"Delete",run:ev},{key:"Mod-Backspace",mac:"Alt-Backspace",run:rv},{key:"Mod-Delete",mac:"Alt-Delete",run:qE},{mac:"Mod-Backspace",run:VE},{mac:"Mod-Delete",run:WE}].concat(lC.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),uC=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:vE,shift:PE},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:bE,shift:RE},{key:"Alt-ArrowUp",run:XE},{key:"Shift-Alt-ArrowUp",run:JE},{key:"Alt-ArrowDown",run:YE},{key:"Shift-Alt-ArrowDown",run:QE},{key:"Escape",run:zE},{key:"Mod-Enter",run:rC},{key:"Alt-l",mac:"Ctrl-l",run:$E},{key:"Mod-i",run:HE,preventDefault:!0},{key:"Mod-[",run:oC},{key:"Mod-]",run:iC},{key:"Mod-Alt-\\",run:nC},{key:"Shift-Mod-k",run:ZE},{key:"Shift-Mod-\\",run:OE},{key:"Mod-/",run:JT},{key:"Alt-A",run:ZT},{key:"Ctrl-m",mac:"Shift-Alt-m",run:sC}].concat(aC),Am=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class _o{constructor(e,t,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?l=>o(Am(l)):Am,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return yt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Wd(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=ar(e);let i=this.normalize(t);for(let o=0,s=r;;o++){let l=i.charCodeAt(o),a=this.match(l,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(a)return this.value=a,this;break}s==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Fu(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=t){let l=new fo(t,e.sliceString(t,r));return Lh.set(e,l),l}if(i.from==t&&i.to==r)return i;let{text:o,from:s}=i;return s>t&&(o=e.sliceString(t,s)+o,s=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Fu(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=fo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(lv.prototype[Symbol.iterator]=av.prototype[Symbol.iterator]=function(){return this});function cC(n){try{return new RegExp(n,xp),!0}catch{return!1}}function Fu(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function bd(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=We("input",{class:"cm-textfield",name:"line",value:e}),r=We("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),n.dispatch({effects:Bu.of(!1)}),n.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},We("label",n.state.phrase("Go to line"),": ",t)," ",We("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!o)return;let{state:s}=n,l=s.doc.lineAt(s.selection.main.head),[,a,u,c,h]=o,f=c?+c.slice(1):0,d=u?+u:l.number;if(u&&h){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/s.doc.lines),d=Math.round(s.doc.lines*m)}else u&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,d))),v=re.cursor(p.from+Math.max(0,Math.min(f,p.length)));n.dispatch({effects:[Bu.of(!1),de.scrollIntoView(v.from,{y:"center"})],selection:v}),n.focus()}return{dom:r}}const Bu=Oe.define(),_m=ft.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Bu)&&(n=t.value);return n},provide:n=>Tl.from(n,e=>e?bd:null)}),hC=n=>{let e=_l(n,bd);if(!e){let t=[Bu.of(!0)];n.state.field(_m,!1)==null&&t.push(Oe.appendConfig.of([_m,fC])),n.dispatch({effects:t}),e=_l(n,bd)}return e&&e.dom.querySelector("input").select(),!0},fC=de.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),dC={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},pC=he.define({combine(n){return vr(n,dC,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function mC(n){return[bC,vC]}const gC=Ae.mark({class:"cm-selectionMatch"}),xC=Ae.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Tm(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=Xe.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=Xe.Word)}function yC(n,e,t,r){return n(e.sliceDoc(t,t+1))==Xe.Word&&n(e.sliceDoc(r-1,r))==Xe.Word}const vC=nt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(pC),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Ae.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ae.none;let a=t.wordAt(i.head);if(!a)return Ae.none;s=t.charCategorizer(i.head),o=t.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a200)return Ae.none;if(e.wholeWords){if(o=t.sliceDoc(i.from,i.to),s=t.charCategorizer(i.head),!(Tm(s,t,i.from,i.to)&&yC(s,t,i.from,i.to)))return Ae.none}else if(o=t.sliceDoc(i.from,i.to),!o)return Ae.none}let l=[];for(let a of n.visibleRanges){let u=new _o(t.doc,o,a.from,a.to);for(;!u.next().done;){let{from:c,to:h}=u.value;if((!s||Tm(s,t,c,h))&&(i.empty&&c<=i.from&&h>=i.to?l.push(xC.range(c,h)):(c>=i.to||h<=i.from)&&l.push(gC.range(c,h)),l.length>e.maxMatches))return Ae.none}}return Ae.set(l)}},{decorations:n=>n.decorations}),bC=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),SC=({state:n,dispatch:e})=>{let{selection:t}=n,r=re.create(t.ranges.map(i=>n.wordAt(i.head)||re.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function AC(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),o=i&&i.from==t.from&&i.to==t.to;for(let s=!1,l=new _o(n.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(s)return null;l=new _o(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(a=>a.from==l.value.from))continue;if(o){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const _C=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(o=>o.from===o.to))return SC({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(o=>n.sliceDoc(o.from,o.to)!=r))return!1;let i=AC(n,r);return i?(e(n.update({selection:n.selection.addRange(re.range(i.from,i.to),!1),effects:de.scrollIntoView(i.to)})),!0):!1},Mo=he.define({combine(n){return vr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new IC(e),scrollToMatch:e=>de.scrollIntoView(e)})}});class uv{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||cC(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?` +`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new wC(this):new EC(this)}getCursor(e,t=0,r){let i=e.doc?e:Fe.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?eo(this,i,t,r):Zi(this,i,t,r)}}class cv{constructor(e){this.spec=e}}function Zi(n,e,t,r){return new _o(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?TC(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function TC(n,e){return(t,r,i,o)=>((o>t||o+i.length=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let o=Zi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function eo(n,e,t,r){return new lv(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?CC(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function ju(n,e){return n.slice(At(n,e,!1),e)}function $u(n,e){return n.slice(e,At(n,e))}function CC(n){return(e,t,r)=>!r[0].length||(n(ju(r.input,r.index))!=Xe.Word||n($u(r.input,r.index))!=Xe.Word)&&(n($u(r.input,r.index+r[0].length))!=Xe.Word||n(ju(r.input,r.index+r[0].length))!=Xe.Word)}class wC extends cv{nextMatch(e,t,r){let i=eo(this.spec,e,r,e.doc.length).next();return i.done&&(i=eo(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let o=Math.max(t,r-i*1e4),s=eo(this.spec,e,o,r),l=null;for(;!s.next().done;)l=s.value;if(l&&(o==t||l.from>o+10))return l;if(o==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let o=eo(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const Ol=Oe.define(),yp=Oe.define(),In=ft.define({create(n){return new kh(Sd(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ol)?n=new kh(t.value.create(),n.panel):t.is(yp)&&(n=new kh(n.query,t.value?vp:null));return n},provide:n=>Tl.from(n,e=>e.panel)});class kh{constructor(e,t){this.query=e,this.panel=t}}const OC=Ae.mark({class:"cm-searchMatch"}),NC=Ae.mark({class:"cm-searchMatch cm-searchMatch-selected"}),DC=nt.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(In))}update(n){let e=n.state.field(In);(e!=n.startState.field(In)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ae.none;let{view:t}=this,r=new Bn;for(let i=0,o=t.visibleRanges,s=o.length;io[i+1].from-2*250;)a=o[++i].to;n.highlight(t.state,l,a,(u,c)=>{let h=t.state.selection.ranges.some(f=>f.from==u&&f.to==c);r.add(u,c,h?NC:OC)})}return r.finish()}},{decorations:n=>n.decorations});function ql(n){return e=>{let t=e.state.field(In,!1);return t&&t.query.spec.valid?n(e,t):dv(e)}}const Hu=ql((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=re.single(r.from,r.to),o=n.state.facet(Mo);return n.dispatch({selection:i,effects:[bp(n,r),o.scrollToMatch(i.main,n)],userEvent:"select.search"}),fv(n),!0}),zu=ql((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let o=re.single(i.from,i.to),s=n.state.facet(Mo);return n.dispatch({selection:o,effects:[bp(n,i),s.scrollToMatch(o.main,n)],userEvent:"select.search"}),fv(n),!0}),PC=ql((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:re.create(t.map(r=>re.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),RC=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,o=[],s=0;for(let l=new _o(n.doc,n.sliceDoc(r,i));!l.next().done;){if(o.length>1e3)return!1;l.value.from==r&&(s=o.length),o.push(re.range(l.value.from,l.value.to))}return e(n.update({selection:re.create(o,s),userEvent:"select.search.matches"})),!0},Em=ql((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let o=e.nextMatch(t,r,r);if(!o)return!1;let s=[],l,a,u=[];if(o.from==r&&o.to==i&&(a=t.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:a}),o=e.nextMatch(t,o.from,o.to),u.push(de.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),o){let c=s.length==0||s[0].from>=o.to?0:o.to-o.from-a.length;l=re.single(o.from-c,o.to-c),u.push(bp(n,o)),u.push(t.facet(Mo).scrollToMatch(l.main,n))}return n.dispatch({changes:s,selection:l,effects:u,userEvent:"input.replace"}),!0}),LC=ql((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:de.announce.of(r),userEvent:"input.replace.all"}),!0});function vp(n){return n.state.facet(Mo).createPanel(n)}function Sd(n,e){var t,r,i,o,s;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let u=n.facet(Mo);return new uv({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:u.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:u.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:u.wholeWord})}function hv(n){let e=_l(n,vp);return e&&e.dom.querySelector("[main-field]")}function fv(n){let e=hv(n);e&&e==n.root.activeElement&&e.select()}const dv=n=>{let e=n.state.field(In,!1);if(e&&e.panel){let t=hv(n);if(t&&t!=n.root.activeElement){let r=Sd(n.state,e.query.spec);r.valid&&n.dispatch({effects:Ol.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[yp.of(!0),e?Ol.of(Sd(n.state,e.query.spec)):Oe.appendConfig.of(FC)]});return!0},pv=n=>{let e=n.state.field(In,!1);if(!e||!e.panel)return!1;let t=_l(n,vp);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:yp.of(!1)}),!0},kC=[{key:"Mod-f",run:dv,scope:"editor search-panel"},{key:"F3",run:Hu,shift:zu,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Hu,shift:zu,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:pv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:RC},{key:"Mod-Alt-g",run:hC},{key:"Mod-d",run:_C,preventDefault:!0}];class IC{constructor(e){this.view=e;let t=this.query=e.state.field(In).query.spec;this.commit=this.commit.bind(this),this.searchField=We("input",{value:t.search,placeholder:Kt(e,"Find"),"aria-label":Kt(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=We("input",{value:t.replace,placeholder:Kt(e,"Replace"),"aria-label":Kt(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=We("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=We("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=We("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,o,s){return We("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=We("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Hu(e),[Kt(e,"next")]),r("prev",()=>zu(e),[Kt(e,"previous")]),r("select",()=>PC(e),[Kt(e,"all")]),We("label",null,[this.caseField,Kt(e,"match case")]),We("label",null,[this.reField,Kt(e,"regexp")]),We("label",null,[this.wordField,Kt(e,"by word")]),...e.state.readOnly?[]:[We("br"),this.replaceField,r("replace",()=>Em(e),[Kt(e,"replace")]),r("replaceAll",()=>LC(e),[Kt(e,"replace all")])],We("button",{name:"close",onclick:()=>pv(e),"aria-label":Kt(e,"close"),type:"button"},["×"])])}commit(){let e=new uv({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Ol.of(e)}))}keydown(e){_A(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?zu:Hu)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Em(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Ol)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Mo).top}}function Kt(n,e){return n.state.phrase(e)}const Va=30,Wa=/[\s\.,:;?!]/;function bp(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,o=Math.max(r.from,e-Va),s=Math.min(i,t+Va),l=n.state.sliceDoc(o,s);if(o!=r.from){for(let a=0;al.length-Va;a--)if(!Wa.test(l[a-1])&&Wa.test(l[a])){l=l.slice(0,a);break}}return de.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${r.number}.`)}const MC=de.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"}}),FC=[In,Fi.low(DC),MC];class mv{constructor(e,t,r,i){this.state=e,this.pos=t,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Dt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),o=i.search(gv(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function Cm(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function BC(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:BC(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:t}:null}}class wm{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function Mn(n){return n.selection.main.from}function gv(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?n:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const xv=pn.define();function $C(n,e,t,r){let{main:i}=n.selection,o=t-i.from,s=r-i.from;return Object.assign(Object.assign({},n.changeByRange(l=>{if(l!=i&&t!=r&&n.sliceDoc(l.from+o,l.from+s)!=n.sliceDoc(t,r))return{range:l};let a=n.toText(e);return{changes:{from:l.from+o,to:r==i.from?l.to:l.from+s,insert:a},range:re.cursor(l.from+o+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Om=new WeakMap;function HC(n){if(!Array.isArray(n))return n;let e=Om.get(n);return e||Om.set(n,e=jC(n)),e}const qu=Oe.define(),Nl=Oe.define();class zC{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(S=Wd(_))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!g||C==1&&m||b==0&&C!=0)&&(t[h]==_||r[h]==_&&(f=!0)?s[h++]=g:s.length&&(y=!1)),b=C,g+=ar(_)}return h==a&&s[0]==0&&y?this.result(-100+(f?-200:0),s,e):d==a&&p==0?this.ret(-200-e.length+(v==e.length?0:-100),[0,v]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,v]):h==a?this.result(-100+(f?-200:0)+-700+(y?0:-1100),s,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],o=0;for(let s of t){let l=s+(this.astral?ar(yt(r,s)):1);o&&i[o-1]==s?i[o-1]=l:(i[o++]=s,i[o++]=l)}return this.ret(e-r.length,i)}}class qC{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:UC,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>Nm(e(r),t(r)),optionClass:(e,t)=>r=>Nm(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Nm(n,e){return n?e?n+" "+e:n:e}function UC(n,e,t,r,i,o){let s=n.textDirection==Ge.RTL,l=s,a=!1,u="top",c,h,f=e.left-i.left,d=i.right-e.right,p=r.right-r.left,v=r.bottom-r.top;if(l&&f=v||g>e.top?c=t.bottom-e.top:(u="bottom",c=e.bottom-t.top)}let m=(e.bottom-e.top)/o.offsetHeight,y=(e.right-e.left)/o.offsetWidth;return{style:`${u}: ${c/m}px; max-width: ${h/y}px`,class:"cm-completionInfo-"+(a?s?"left-narrow":"right-narrow":l?"left":"right")}}function VC(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let u=0;ua&&s.appendChild(document.createTextNode(l.slice(a,c)));let f=s.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(l.slice(c,h))),f.className="cm-completionMatchedText",a=h}return at.position-r.position).map(t=>t.render)}function Ih(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class WC{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:o,selected:s}=i.open,l=e.state.facet(St);this.optionContent=VC(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Ih(o.length,s,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:u}=e.state.field(t).open;for(let c=a.target,h;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(h=/-(\d+)$/.exec(c.id))&&+h[1]{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(St).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Nl.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:l}=r.open;(!i.open||i.open.options!=o)&&(this.range=Ih(o.length,s,e.state.facet(St).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),l!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Ih(t.options.length,t.selected,this.view.state.facet(St).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>It(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return t&&GC(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,t.bottom)-10||i.bottomr.from||r.from==0))if(o=f,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let d=i.appendChild(document.createElement("completion-section"));d.textContent=f}}const c=i.appendChild(document.createElement("li"));c.id=t+"-"+s,c.setAttribute("role","option");let h=this.optionClass(l);h&&(c.className=h);for(let f of this.optionContent){let d=f(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew WC(t,n,e)}function GC(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.topt.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function Dm(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function XC(n,e){let t=[],r=null,i=u=>{t.push(u);let{section:c}=u.completion;if(c){r||(r=[]);let h=typeof c=="string"?c:c.name;r.some(f=>f.name==h)||r.push(typeof c=="string"?{name:h}:c)}},o=e.facet(St);for(let u of n)if(u.hasResult()){let c=u.result.getMatch;if(u.result.filter===!1)for(let h of u.result.options)i(new wm(h,u.source,c?c(h):[],1e9-t.length));else{let h=e.sliceDoc(u.from,u.to),f,d=o.filterStrict?new qC(h):new zC(h);for(let p of u.result.options)if(f=d.match(p.label)){let v=p.displayLabel?c?c(p,f.matched):[]:f.matched;i(new wm(p,u.source,v,f.score+(p.boost||0)))}}}if(r){let u=Object.create(null),c=0,h=(f,d)=>{var p,v;return((p=f.rank)!==null&&p!==void 0?p:1e9)-((v=d.rank)!==null&&v!==void 0?v:1e9)||(f.nameh.score-c.score||a(c.completion,h.completion))){let c=u.completion;!l||l.label!=c.label||l.detail!=c.detail||l.type!=null&&c.type!=null&&l.type!=c.type||l.apply!=c.apply||l.boost!=c.boost?s.push(u):Dm(u.completion)>Dm(l)&&(s[s.length-1]=u),l=u.completion}return s}class io{constructor(e,t,r,i,o,s){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new io(this.options,Pm(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,o){let s=XC(e,t);if(!s.length)return i&&e.some(a=>a.state==1)?new io(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let l=t.facet(St).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let a=i.options[i.selected].completion;for(let u=0;uu.hasResult()?Math.min(a,u.from):a,1e8),create:tw,above:o.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new io(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Uu{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new Uu(ZC,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(St),o=(r.override||t.languageDataAt("autocomplete",Mn(t)).map(HC)).map(l=>(this.active.find(u=>u.source==l)||new Qt(l,this.active.some(u=>u.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((l,a)=>l==this.active[a])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!YC(o,this.active)?s=io.build(o,t,this.id,s,r):s&&s.disabled&&!o.some(l=>l.state==1)&&(s=null),!s&&o.every(l=>l.state!=1)&&o.some(l=>l.hasResult())&&(o=o.map(l=>l.hasResult()?new Qt(l.source,0):l));for(let l of e.effects)l.is(bv)&&(s=s&&s.setSelected(l.value,this.id));return o==this.active&&s==this.open?this:new Uu(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?JC:QC}}function YC(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const ZC=[];function yv(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(xv);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Qt{constructor(e,t,r=-1){this.source=e,this.state=t,this.explicitPos=r}hasResult(){return!1}update(e,t){let r=yv(e,t),i=this;(r&8||r&16&&this.touches(e))&&(i=new Qt(i.source,0)),r&4&&i.state==0&&(i=new Qt(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(qu))i=new Qt(i.source,1,o.value?Mn(e.state):-1);else if(o.is(Nl))i=new Qt(i.source,0);else if(o.is(vv))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(e,t){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Qt(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Mn(e.state))}}class po extends Qt{constructor(e,t,r,i,o){super(e,2,t),this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),l=Mn(e.state);if((this.explicitPos<0?l<=o:ls||!i||t&2&&Mn(e.startState)==this.from)return new Qt(this.source,t&4?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return ew(i.validFor,e.state,o,s)?new po(this.source,a,i,o,s):i.update&&(i=i.update(i,o,s,new mv(e.state,l,a>=0)))?new po(this.source,a,i,i.from,(r=i.to)!==null&&r!==void 0?r:Mn(e.state)):new Qt(this.source,1,a)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new po(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Qt(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function ew(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):gv(n,!0).test(i)}const vv=Oe.define({map(n,e){return n.map(t=>t.map(e))}}),bv=Oe.define(),qt=ft.define({create(){return Uu.start()},update(n,e){return n.update(e)},provide:n=>[rc.from(n,e=>e.tooltip),de.contentAttributes.from(n,e=>e.attrs)]});function Sp(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(qt).active.find(i=>i.source==e.source);return r instanceof po?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},$C(n.state,t,r.from,r.to)),{annotations:xv.of(e.completion)})):t(n,e.completion,r.from,r.to),!0):!1}const tw=KC(qt,Sp);function Ka(n,e="option"){return t=>{let r=t.state.field(qt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(n?1:-1):n?0:s-1;return l<0?l=e=="page"?0:s-1:l>=s&&(l=e=="page"?s-1:0),t.dispatch({effects:bv.of(l)}),!0}}const rw=n=>{let e=n.state.field(qt,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(qt,!1)?(n.dispatch({effects:qu.of(!0)}),!0):!1,nw=n=>{let e=n.state.field(qt,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Nl.of(null)}),!0)};class iw{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const ow=50,sw=1e3,lw=nt.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(qt).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(qt),t=n.state.facet(St);if(!n.selectionSet&&!n.docChanged&&n.startState.field(qt)==e)return;let r=n.transactions.some(o=>{let s=yv(o,t);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;oow&&Date.now()-s.time>sw){for(let l of s.context.abortListeners)try{l()}catch(a){It(this.view.state,a)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(o=>o.effects.some(s=>s.is(qu)))&&(this.pendingStart=!0);let i=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of n.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(qt);for(let t of e.active)t.state==1&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=Mn(e),r=new mv(e,t,n.explicitPos==t,this.view),i=new iw(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:Nl.of(null)}),It(this.view.state,o)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(St).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(St);for(let r=0;rs.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new Qt(i.active.source,0);for(let l of i.updates)s=s.update(l,t);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:vv.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(qt,!1);if(e&&e.tooltip&&this.view.state.facet(St).closeOnBlur){let t=e.open&&Jy(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Nl.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:qu.of(!1)}),20),this.composing=0}}}),aw=typeof navigator=="object"&&/Win/.test(navigator.platform),uw=Fi.highest(de.domEventHandlers({keydown(n,e){let t=e.state.field(qt,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(aw&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(n.key)>-1&&Sp(e,r),!1}})),cw=de.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Dl={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},hi=Oe.define({map(n,e){let t=e.mapPos(n,-1,kt.TrackAfter);return t??void 0}}),Ap=new class extends gi{};Ap.startSide=1;Ap.endSide=-1;const Sv=ft.define({create(){return Re.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(hi)&&(n=n.update({add:[Ap.range(t.value,t.value+1)]}));return n}});function hw(){return[dw,Sv]}const Mh="()[]{}<>";function Av(n){for(let e=0;e{if((fw?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(r.length>2||r.length==2&&ar(yt(r,0))==1||e!=i.from||t!=i.to)return!1;let o=gw(n.state,r);return o?(n.dispatch(o),!0):!1}),pw=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=_v(n,n.selection.main.head).brackets||Dl.brackets,i=null,o=n.changeByRange(s=>{if(s.empty){let l=xw(n.doc,s.head);for(let a of r)if(a==l&&dc(n.doc,s.head)==Av(yt(a,0)))return{changes:{from:s.head-a.length,to:s.head+a.length},range:re.cursor(s.head-a.length)}}return{range:i=s}});return i||e(n.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},mw=[{key:"Backspace",run:pw}];function gw(n,e){let t=_v(n,n.selection.main.head),r=t.brackets||Dl.brackets;for(let i of r){let o=Av(yt(i,0));if(e==i)return o==i?bw(n,i,r.indexOf(i+i+i)>-1,t):yw(n,i,o,t.before||Dl.before);if(e==o&&Tv(n,n.selection.main.from))return vw(n,i,o)}return null}function Tv(n,e){let t=!1;return n.field(Sv).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function dc(n,e){let t=n.sliceString(e,e+2);return t.slice(0,ar(yt(t,0)))}function xw(n,e){let t=n.sliceString(e-2,e);return ar(yt(t,0))==t.length?t:t.slice(1)}function yw(n,e,t,r){let i=null,o=n.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:t,from:s.to}],effects:hi.of(s.to+e.length),range:re.range(s.anchor+e.length,s.head+e.length)};let l=dc(n.doc,s.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+t,from:s.head},effects:hi.of(s.head+e.length),range:re.cursor(s.head+e.length)}:{range:i=s}});return i?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function vw(n,e,t){let r=null,i=n.changeByRange(o=>o.empty&&dc(n.doc,o.head)==t?{changes:{from:o.head,to:o.head+t.length,insert:t},range:re.cursor(o.head+t.length)}:r={range:o});return r?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function bw(n,e,t,r){let i=r.stringPrefixes||Dl.stringPrefixes,o=null,s=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:hi.of(l.to+e.length),range:re.range(l.anchor+e.length,l.head+e.length)};let a=l.head,u=dc(n.doc,a),c;if(u==e){if(Lm(n,a))return{changes:{insert:e+e,from:a},effects:hi.of(a+e.length),range:re.cursor(a+e.length)};if(Tv(n,a)){let f=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+f.length,insert:f},range:re.cursor(a+f.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=km(n,a-2*e.length,i))>-1&&Lm(n,c))return{changes:{insert:e+e+e+e,from:a},effects:hi.of(a+e.length),range:re.cursor(a+e.length)};if(n.charCategorizer(a)(u)!=Xe.Word&&km(n,a,i)>-1&&!Sw(n,a,e,i))return{changes:{insert:e+e,from:a},effects:hi.of(a+e.length),range:re.cursor(a+e.length)}}return{range:o=l}});return o?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Lm(n,e){let t=Dt(n).resolveInner(e+1);return t.parent&&t.from==e}function Sw(n,e,t,r){let i=Dt(n).resolveInner(e,-1),o=r.reduce((s,l)=>Math.max(s,l.length),0);for(let s=0;s<5;s++){let l=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+o)),a=l.indexOf(t);if(!a||a>-1&&r.indexOf(l.slice(0,a))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function km(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=Xe.Word)return e;for(let i of t){let o=e-i.length;if(n.sliceDoc(o,e)==i&&r(n.sliceDoc(o-1,o))!=Xe.Word)return o}return-1}function Aw(n={}){return[uw,qt,St.of(n),lw,_w,cw]}const Ev=[{key:"Ctrl-Space",run:Rm},{mac:"Alt-`",run:Rm},{key:"Escape",run:nw},{key:"ArrowDown",run:Ka(!0)},{key:"ArrowUp",run:Ka(!1)},{key:"PageDown",run:Ka(!0,"page")},{key:"PageUp",run:Ka(!1,"page")},{key:"Enter",run:rw}],_w=Fi.highest(ip.computeN([St],n=>n.facet(St).defaultKeymap?[Ev]:[])),Tw=[v_(),A_(),$A(),sE(),RT(),NA(),kA(),Fe.allowMultipleSelections.of(!0),yT(),kT(FT,{fallback:!0}),UT(),hw(),Aw(),QA(),t_(),WA(),mC(),ip.of([...mw,...uC,...kC,...mE,...OT,...Ev,...N_])];var w=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ad={},Cv={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(vv,"__esModule",{value:!0});var Sv={};/*! + */Object.defineProperty(Cv,"__esModule",{value:!0});var wv={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Sv,"__esModule",{value:!0});var cc={};function hw(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bv={exports:{}},it=bv.exports={},Rr,Lr;function md(){throw new Error("setTimeout has not been defined")}function gd(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Rr=setTimeout:Rr=md}catch{Rr=md}try{typeof clearTimeout=="function"?Lr=clearTimeout:Lr=gd}catch{Lr=gd}})();function Av(n){if(Rr===setTimeout)return setTimeout(n,0);if((Rr===md||!Rr)&&setTimeout)return Rr=setTimeout,setTimeout(n,0);try{return Rr(n,0)}catch{try{return Rr.call(null,n,0)}catch{return Rr.call(this,n,0)}}}function fw(n){if(Lr===clearTimeout)return clearTimeout(n);if((Lr===gd||!Lr)&&clearTimeout)return Lr=clearTimeout,clearTimeout(n);try{return Lr(n)}catch{try{return Lr.call(null,n)}catch{return Lr.call(this,n)}}}var rn=[],ho=!1,ai,au=-1;function dw(){!ho||!ai||(ho=!1,ai.length?rn=ai.concat(rn):au=-1,rn.length&&_v())}function _v(){if(!ho){var n=Av(dw);ho=!0;for(var e=rn.length;e;){for(ai=rn,rn=[];++au1)for(var t=1;t"u"||!dt?De:dt(Uint8Array),hi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?De:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?De:ArrayBuffer,"%ArrayIteratorPrototype%":Gi&&dt?dt([][Symbol.iterator]()):De,"%AsyncFromSyncIteratorPrototype%":De,"%AsyncFunction%":Qi,"%AsyncGenerator%":Qi,"%AsyncGeneratorFunction%":Qi,"%AsyncIteratorPrototype%":Qi,"%Atomics%":typeof Atomics>"u"?De:Atomics,"%BigInt%":typeof BigInt>"u"?De:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?De:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?De:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?De:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Mw,"%eval%":eval,"%EvalError%":Bw,"%Float32Array%":typeof Float32Array>"u"?De:Float32Array,"%Float64Array%":typeof Float64Array>"u"?De:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?De:FinalizationRegistry,"%Function%":wv,"%GeneratorFunction%":Qi,"%Int8Array%":typeof Int8Array>"u"?De:Int8Array,"%Int16Array%":typeof Int16Array>"u"?De:Int16Array,"%Int32Array%":typeof Int32Array>"u"?De:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Gi&&dt?dt(dt([][Symbol.iterator]())):De,"%JSON%":typeof JSON=="object"?JSON:De,"%Map%":typeof Map>"u"?De:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Gi||!dt?De:dt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?De:Promise,"%Proxy%":typeof Proxy>"u"?De:Proxy,"%RangeError%":jw,"%ReferenceError%":$w,"%Reflect%":typeof Reflect>"u"?De:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?De:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Gi||!dt?De:dt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?De:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Gi&&dt?dt(""[Symbol.iterator]()):De,"%Symbol%":Gi?Symbol:De,"%SyntaxError%":bo,"%ThrowTypeError%":zw,"%TypedArray%":Uw,"%TypeError%":fo,"%Uint8Array%":typeof Uint8Array>"u"?De:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?De:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?De:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?De:Uint32Array,"%URIError%":Hw,"%WeakMap%":typeof WeakMap>"u"?De:WeakMap,"%WeakRef%":typeof WeakRef>"u"?De:WeakRef,"%WeakSet%":typeof WeakSet>"u"?De:WeakSet};if(dt)try{null.error}catch(n){var Vw=dt(dt(n));hi["%Error.prototype%"]=Vw}var Ww=function n(e){var t;if(e==="%AsyncFunction%")t=Lh("async function () {}");else if(e==="%GeneratorFunction%")t=Lh("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Lh("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&dt&&(t=dt(i.prototype))}return hi[e]=t,t},Dm={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Hl=xp,Hu=Fw,Kw=Hl.call(Function.call,Array.prototype.concat),Gw=Hl.call(Function.apply,Array.prototype.splice),Pm=Hl.call(Function.call,String.prototype.replace),zu=Hl.call(Function.call,String.prototype.slice),Xw=Hl.call(Function.call,RegExp.prototype.exec),Yw=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Jw=/\\(\\)?/g,Qw=function(e){var t=zu(e,0,1),r=zu(e,-1);if(t==="%"&&r!=="%")throw new bo("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new bo("invalid intrinsic syntax, expected opening `%`");var i=[];return Pm(e,Yw,function(o,s,l,a){i[i.length]=l?Pm(a,Jw,"$1"):s||o}),i},Zw=function(e,t){var r=e,i;if(Hu(Dm,r)&&(i=Dm[r],r="%"+i[0]+"%"),Hu(hi,r)){var o=hi[r];if(o===Qi&&(o=Ww(r)),typeof o>"u"&&!t)throw new fo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new bo("intrinsic "+e+" does not exist!")},zl=function(e,t){if(typeof e!="string"||e.length===0)throw new fo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new fo('"allowMissing" argument must be a boolean');if(Xw(/^%?[^%]*%?$/,e)===null)throw new bo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Qw(e),i=r.length>0?r[0]:"",o=Zw("%"+i+"%",t),s=o.name,l=o.value,a=!1,u=o.alias;u&&(i=u[0],Gw(r,Kw([0,1],u)));for(var c=1,h=!0;c=r.length){var v=ci(l,f);h=!!v,h&&"get"in v&&!("originalValue"in v.get)?l=v.get:l=l[f]}else h=Hu(l,f),l=l[f];h&&!a&&(hi[s]=l)}}return l},Ov={exports:{}},Ih,Rm;function yp(){if(Rm)return Ih;Rm=1;var n=zl,e=n("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Ih=e,Ih}var eO=zl,uu=eO("%Object.getOwnPropertyDescriptor%",!0);if(uu)try{uu([],"length")}catch{uu=null}var vp=uu,Lm=yp(),tO=Cv,Xi=hc,km=vp,Nv=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Xi("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Xi("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Xi("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Xi("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Xi("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Xi("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,a=!!km&&km(e,t);if(Lm)Lm(e,t,{configurable:s===null&&a?a.configurable:!s,enumerable:i===null&&a?a.enumerable:!i,value:r,writable:o===null&&a?a.writable:!o});else if(l||!i&&!o&&!s)e[t]=r;else throw new tO("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},xd=yp(),Dv=function(){return!!xd};Dv.hasArrayLengthDefineBug=function(){if(!xd)return null;try{return xd([],"length",{value:1}).length!==1}catch{return!0}};var Pv=Dv,rO=zl,Im=Nv,nO=Pv(),Fm=vp,Mm=hc,iO=rO("%Math.floor%"),oO=function(e,t){if(typeof e!="function")throw new Mm("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||iO(t)!==t)throw new Mm("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&Fm){var s=Fm(e,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(o=!1)}return(i||o||!r)&&(nO?Im(e,"length",t,!0,!0):Im(e,"length",t)),e};(function(n){var e=xp,t=zl,r=oO,i=hc,o=t("%Function.prototype.apply%"),s=t("%Function.prototype.call%"),l=t("%Reflect.apply%",!0)||e.call(s,o),a=yp(),u=t("%Math.max%");n.exports=function(f){if(typeof f!="function")throw new i("a function is required");var d=l(e,s,arguments);return r(d,1+u(0,f.length-(arguments.length-1)),!0)};var c=function(){return l(e,o,arguments)};a?a(n.exports,"apply",{value:c}):n.exports.apply=c})(Ov);var fc=Ov.exports,Rv=zl,Lv=fc,sO=Lv(Rv("String.prototype.indexOf")),dc=function(e,t){var r=Rv(e,!!t);return typeof r=="function"&&sO(e,".prototype.")>-1?Lv(r):r},lO=gp(),aO=dc,yd=aO("Object.prototype.toString"),pc=function(e){return lO&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:yd(e)==="[object Arguments]"},kv=function(e){return pc(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&yd(e)!=="[object Array]"&&yd(e.callee)==="[object Function]"},uO=function(){return pc(arguments)}();pc.isLegacyArguments=kv;var cO=uO?pc:kv,hO=Object.prototype.toString,fO=Function.prototype.toString,dO=/^\s*(?:function)?\*/,Iv=gp(),Fh=Object.getPrototypeOf,pO=function(){if(!Iv)return!1;try{return Function("return function*() {}")()}catch{}},Mh,mO=function(e){if(typeof e!="function")return!1;if(dO.test(fO.call(e)))return!0;if(!Iv){var t=hO.call(e);return t==="[object GeneratorFunction]"}if(!Fh)return!1;if(typeof Mh>"u"){var r=pO();Mh=r?Fh(r):!1}return Fh(e)===Mh},Fv=Function.prototype.toString,ro=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,vd,cu;if(typeof ro=="function"&&typeof Object.defineProperty=="function")try{vd=Object.defineProperty({},"length",{get:function(){throw cu}}),cu={},ro(function(){throw 42},null,vd)}catch(n){n!==cu&&(ro=null)}else ro=null;var gO=/^\s*class\b/,Sd=function(e){try{var t=Fv.call(e);return gO.test(t)}catch{return!1}},Bh=function(e){try{return Sd(e)?!1:(Fv.call(e),!0)}catch{return!1}},hu=Object.prototype.toString,xO="[object Object]",yO="[object Function]",vO="[object GeneratorFunction]",SO="[object HTMLAllCollection]",bO="[object HTML document.all class]",AO="[object HTMLCollection]",_O=typeof Symbol=="function"&&!!Symbol.toStringTag,TO=!(0 in[,]),bd=function(){return!1};if(typeof document=="object"){var EO=document.all;hu.call(EO)===hu.call(document.all)&&(bd=function(e){if((TO||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=hu.call(e);return(t===SO||t===bO||t===AO||t===xO)&&e("")==null}catch{}return!1})}var CO=ro?function(e){if(bd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{ro(e,null,vd)}catch(t){if(t!==cu)return!1}return!Sd(e)&&Bh(e)}:function(e){if(bd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(_O)return Bh(e);if(Sd(e))return!1;var t=hu.call(e);return t!==yO&&t!==vO&&!/^\[object HTML/.test(t)?!1:Bh(e)},wO=CO,OO=Object.prototype.toString,Mv=Object.prototype.hasOwnProperty,NO=function(e,t,r){for(var i=0,o=e.length;i=3&&(i=r),OO.call(e)==="[object Array]"?NO(e,t,i):typeof e=="string"?DO(e,t,i):PO(e,t,i)},LO=RO,kO=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],jh=kO,IO=typeof globalThis>"u"?w:globalThis,FO=function(){for(var e=[],t=0;t"u"?w:globalThis,Ad=MO(),bp=Sp("String.prototype.slice"),$h=Object.getPrototypeOf,jO=Sp("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1?t:t!=="Object"?!1:HO(e)}return fu?$O(e):null},zO=jv,qO=function(e){return!!zO(e)};(function(n){var e=cO,t=mO,r=jv,i=qO;function o(H){return H.call.bind(H)}var s=typeof BigInt<"u",l=typeof Symbol<"u",a=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),h=o(Boolean.prototype.valueOf);if(s)var f=o(BigInt.prototype.valueOf);if(l)var d=o(Symbol.prototype.valueOf);function p(H,G){if(typeof H!="object")return!1;try{return G(H),!0}catch{return!1}}n.isArgumentsObject=e,n.isGeneratorFunction=t,n.isTypedArray=i;function v(H){return typeof Promise<"u"&&H instanceof Promise||H!==null&&typeof H=="object"&&typeof H.then=="function"&&typeof H.catch=="function"}n.isPromise=v;function m(H){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(H):i(H)||E(H)}n.isArrayBufferView=m;function y(H){return r(H)==="Uint8Array"}n.isUint8Array=y;function g(H){return r(H)==="Uint8ClampedArray"}n.isUint8ClampedArray=g;function x(H){return r(H)==="Uint16Array"}n.isUint16Array=x;function S(H){return r(H)==="Uint32Array"}n.isUint32Array=S;function _(H){return r(H)==="Int8Array"}n.isInt8Array=_;function b(H){return r(H)==="Int16Array"}n.isInt16Array=b;function C(H){return r(H)==="Int32Array"}n.isInt32Array=C;function O(H){return r(H)==="Float32Array"}n.isFloat32Array=O;function D(H){return r(H)==="Float64Array"}n.isFloat64Array=D;function M(H){return r(H)==="BigInt64Array"}n.isBigInt64Array=M;function j(H){return r(H)==="BigUint64Array"}n.isBigUint64Array=j;function k(H){return a(H)==="[object Map]"}k.working=typeof Map<"u"&&k(new Map);function V(H){return typeof Map>"u"?!1:k.working?k(H):H instanceof Map}n.isMap=V;function se(H){return a(H)==="[object Set]"}se.working=typeof Set<"u"&&se(new Set);function ie(H){return typeof Set>"u"?!1:se.working?se(H):H instanceof Set}n.isSet=ie;function fe(H){return a(H)==="[object WeakMap]"}fe.working=typeof WeakMap<"u"&&fe(new WeakMap);function Ee(H){return typeof WeakMap>"u"?!1:fe.working?fe(H):H instanceof WeakMap}n.isWeakMap=Ee;function me(H){return a(H)==="[object WeakSet]"}me.working=typeof WeakSet<"u"&&me(new WeakSet);function ee(H){return me(H)}n.isWeakSet=ee;function X(H){return a(H)==="[object ArrayBuffer]"}X.working=typeof ArrayBuffer<"u"&&X(new ArrayBuffer);function Z(H){return typeof ArrayBuffer>"u"?!1:X.working?X(H):H instanceof ArrayBuffer}n.isArrayBuffer=Z;function le(H){return a(H)==="[object DataView]"}le.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&le(new DataView(new ArrayBuffer(1),0,1));function E(H){return typeof DataView>"u"?!1:le.working?le(H):H instanceof DataView}n.isDataView=E;var A=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function T(H){return a(H)==="[object SharedArrayBuffer]"}function N(H){return typeof A>"u"?!1:(typeof T.working>"u"&&(T.working=T(new A)),T.working?T(H):H instanceof A)}n.isSharedArrayBuffer=N;function R(H){return a(H)==="[object AsyncFunction]"}n.isAsyncFunction=R;function P(H){return a(H)==="[object Map Iterator]"}n.isMapIterator=P;function L(H){return a(H)==="[object Set Iterator]"}n.isSetIterator=L;function z(H){return a(H)==="[object Generator]"}n.isGeneratorObject=z;function W(H){return a(H)==="[object WebAssembly.Module]"}n.isWebAssemblyCompiledModule=W;function Y(H){return p(H,u)}n.isNumberObject=Y;function I(H){return p(H,c)}n.isStringObject=I;function F(H){return p(H,h)}n.isBooleanObject=F;function U(H){return s&&p(H,f)}n.isBigIntObject=U;function Q(H){return l&&p(H,d)}n.isSymbolObject=Q;function ne(H){return Y(H)||I(H)||F(H)||U(H)||Q(H)}n.isBoxedPrimitive=ne;function oe(H){return typeof Uint8Array<"u"&&(Z(H)||N(H))}n.isAnyArrayBuffer=oe,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(H){Object.defineProperty(n,H,{enumerable:!1,value:function(){throw new Error(H+" is not supported in userland")}})})})(Ev);var UO=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},_d={exports:{}};typeof Object.create=="function"?_d.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:_d.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var VO=_d.exports;(function(n){var e={},t=Object.getOwnPropertyDescriptors||function(A){for(var T=Object.keys(A),N={},R=0;R=R)return z;switch(z){case"%s":return String(N[T++]);case"%d":return Number(N[T++]);case"%j":try{return JSON.stringify(N[T++])}catch{return"[Circular]"}default:return z}}),L=N[T];T"u")return function(){return n.deprecate(E,A).apply(this,arguments)};var T=!1;function N(){if(!T){if(tt.throwDeprecation)throw new Error(A);tt.traceDeprecation?console.trace(A):console.error(A),T=!0}return E.apply(this,arguments)}return N};var i={},o=/^$/;if(e.NODE_DEBUG){var s=e.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+s+"$","i")}n.debuglog=function(E){if(E=E.toUpperCase(),!i[E])if(o.test(E)){var A=tt.pid;i[E]=function(){var T=n.format.apply(n,arguments);console.error("%s %d: %s",E,A,T)}}else i[E]=function(){};return i[E]};function l(E,A){var T={seen:[],stylize:u};return arguments.length>=3&&(T.depth=arguments[2]),arguments.length>=4&&(T.colors=arguments[3]),g(A)?T.showHidden=A:A&&n._extend(T,A),O(T.showHidden)&&(T.showHidden=!1),O(T.depth)&&(T.depth=2),O(T.colors)&&(T.colors=!1),O(T.customInspect)&&(T.customInspect=!0),T.colors&&(T.stylize=a),h(T,E,T.depth)}n.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(E,A){var T=l.styles[A];return T?"\x1B["+l.colors[T][0]+"m"+E+"\x1B["+l.colors[T][1]+"m":E}function u(E,A){return E}function c(E){var A={};return E.forEach(function(T,N){A[T]=!0}),A}function h(E,A,T){if(E.customInspect&&A&&V(A.inspect)&&A.inspect!==n.inspect&&!(A.constructor&&A.constructor.prototype===A)){var N=A.inspect(T,E);return b(N)||(N=h(E,N,T)),N}var R=f(E,A);if(R)return R;var P=Object.keys(A),L=c(P);if(E.showHidden&&(P=Object.getOwnPropertyNames(A)),k(A)&&(P.indexOf("message")>=0||P.indexOf("description")>=0))return d(A);if(P.length===0){if(V(A)){var z=A.name?": "+A.name:"";return E.stylize("[Function"+z+"]","special")}if(D(A))return E.stylize(RegExp.prototype.toString.call(A),"regexp");if(j(A))return E.stylize(Date.prototype.toString.call(A),"date");if(k(A))return d(A)}var W="",Y=!1,I=["{","}"];if(y(A)&&(Y=!0,I=["[","]"]),V(A)){var F=A.name?": "+A.name:"";W=" [Function"+F+"]"}if(D(A)&&(W=" "+RegExp.prototype.toString.call(A)),j(A)&&(W=" "+Date.prototype.toUTCString.call(A)),k(A)&&(W=" "+d(A)),P.length===0&&(!Y||A.length==0))return I[0]+W+I[1];if(T<0)return D(A)?E.stylize(RegExp.prototype.toString.call(A),"regexp"):E.stylize("[Object]","special");E.seen.push(A);var U;return Y?U=p(E,A,T,L,P):U=P.map(function(Q){return v(E,A,T,L,Q,Y)}),E.seen.pop(),m(U,W,I)}function f(E,A){if(O(A))return E.stylize("undefined","undefined");if(b(A)){var T="'"+JSON.stringify(A).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return E.stylize(T,"string")}if(_(A))return E.stylize(""+A,"number");if(g(A))return E.stylize(""+A,"boolean");if(x(A))return E.stylize("null","null")}function d(E){return"["+Error.prototype.toString.call(E)+"]"}function p(E,A,T,N,R){for(var P=[],L=0,z=A.length;L1)for(var t=1;t"u"||!dt?De:dt(Uint8Array),mi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?De:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?De:ArrayBuffer,"%ArrayIteratorPrototype%":Ji&&dt?dt([][Symbol.iterator]()):De,"%AsyncFromSyncIteratorPrototype%":De,"%AsyncFunction%":to,"%AsyncGenerator%":to,"%AsyncGeneratorFunction%":to,"%AsyncIteratorPrototype%":to,"%Atomics%":typeof Atomics>"u"?De:Atomics,"%BigInt%":typeof BigInt>"u"?De:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?De:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?De:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?De:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Jw,"%eval%":eval,"%EvalError%":Qw,"%Float32Array%":typeof Float32Array>"u"?De:Float32Array,"%Float64Array%":typeof Float64Array>"u"?De:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?De:FinalizationRegistry,"%Function%":kv,"%GeneratorFunction%":to,"%Int8Array%":typeof Int8Array>"u"?De:Int8Array,"%Int16Array%":typeof Int16Array>"u"?De:Int16Array,"%Int32Array%":typeof Int32Array>"u"?De:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ji&&dt?dt(dt([][Symbol.iterator]())):De,"%JSON%":typeof JSON=="object"?JSON:De,"%Map%":typeof Map>"u"?De:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ji||!dt?De:dt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?De:Promise,"%Proxy%":typeof Proxy>"u"?De:Proxy,"%RangeError%":Zw,"%ReferenceError%":eO,"%Reflect%":typeof Reflect>"u"?De:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?De:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ji||!dt?De:dt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?De:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ji&&dt?dt(""[Symbol.iterator]()):De,"%Symbol%":Ji?Symbol:De,"%SyntaxError%":To,"%ThrowTypeError%":rO,"%TypedArray%":iO,"%TypeError%":go,"%Uint8Array%":typeof Uint8Array>"u"?De:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?De:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?De:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?De:Uint32Array,"%URIError%":tO,"%WeakMap%":typeof WeakMap>"u"?De:WeakMap,"%WeakRef%":typeof WeakRef>"u"?De:WeakRef,"%WeakSet%":typeof WeakSet>"u"?De:WeakSet};if(dt)try{null.error}catch(n){var oO=dt(dt(n));mi["%Error.prototype%"]=oO}var sO=function n(e){var t;if(e==="%AsyncFunction%")t=$h("async function () {}");else if(e==="%GeneratorFunction%")t=$h("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=$h("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&dt&&(t=dt(i.prototype))}return mi[e]=t,t},Fm={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ul=Ep,Vu=Yw,lO=Ul.call(Function.call,Array.prototype.concat),aO=Ul.call(Function.apply,Array.prototype.splice),Bm=Ul.call(Function.call,String.prototype.replace),Wu=Ul.call(Function.call,String.prototype.slice),uO=Ul.call(Function.call,RegExp.prototype.exec),cO=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,hO=/\\(\\)?/g,fO=function(e){var t=Wu(e,0,1),r=Wu(e,-1);if(t==="%"&&r!=="%")throw new To("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new To("invalid intrinsic syntax, expected opening `%`");var i=[];return Bm(e,cO,function(o,s,l,a){i[i.length]=l?Bm(a,hO,"$1"):s||o}),i},dO=function(e,t){var r=e,i;if(Vu(Fm,r)&&(i=Fm[r],r="%"+i[0]+"%"),Vu(mi,r)){var o=mi[r];if(o===to&&(o=sO(r)),typeof o>"u"&&!t)throw new go("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new To("intrinsic "+e+" does not exist!")},Vl=function(e,t){if(typeof e!="string"||e.length===0)throw new go("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new go('"allowMissing" argument must be a boolean');if(uO(/^%?[^%]*%?$/,e)===null)throw new To("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=fO(e),i=r.length>0?r[0]:"",o=dO("%"+i+"%",t),s=o.name,l=o.value,a=!1,u=o.alias;u&&(i=u[0],aO(r,lO([0,1],u)));for(var c=1,h=!0;c=r.length){var v=pi(l,f);h=!!v,h&&"get"in v&&!("originalValue"in v.get)?l=v.get:l=l[f]}else h=Vu(l,f),l=l[f];h&&!a&&(mi[s]=l)}}return l},Iv={exports:{}},zh,jm;function Cp(){if(jm)return zh;jm=1;var n=Vl,e=n("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return zh=e,zh}var pO=Vl,du=pO("%Object.getOwnPropertyDescriptor%",!0);if(du)try{du([],"length")}catch{du=null}var wp=du,$m=Cp(),mO=Lv,Qi=mc,Hm=wp,Mv=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Qi("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Qi("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qi("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qi("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qi("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qi("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,a=!!Hm&&Hm(e,t);if($m)$m(e,t,{configurable:s===null&&a?a.configurable:!s,enumerable:i===null&&a?a.enumerable:!i,value:r,writable:o===null&&a?a.writable:!o});else if(l||!i&&!o&&!s)e[t]=r;else throw new mO("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ed=Cp(),Fv=function(){return!!Ed};Fv.hasArrayLengthDefineBug=function(){if(!Ed)return null;try{return Ed([],"length",{value:1}).length!==1}catch{return!0}};var Bv=Fv,gO=Vl,zm=Mv,xO=Bv(),qm=wp,Um=mc,yO=gO("%Math.floor%"),vO=function(e,t){if(typeof e!="function")throw new Um("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||yO(t)!==t)throw new Um("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&qm){var s=qm(e,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(o=!1)}return(i||o||!r)&&(xO?zm(e,"length",t,!0,!0):zm(e,"length",t)),e};(function(n){var e=Ep,t=Vl,r=vO,i=mc,o=t("%Function.prototype.apply%"),s=t("%Function.prototype.call%"),l=t("%Reflect.apply%",!0)||e.call(s,o),a=Cp(),u=t("%Math.max%");n.exports=function(f){if(typeof f!="function")throw new i("a function is required");var d=l(e,s,arguments);return r(d,1+u(0,f.length-(arguments.length-1)),!0)};var c=function(){return l(e,o,arguments)};a?a(n.exports,"apply",{value:c}):n.exports.apply=c})(Iv);var gc=Iv.exports,jv=Vl,$v=gc,bO=$v(jv("String.prototype.indexOf")),xc=function(e,t){var r=jv(e,!!t);return typeof r=="function"&&bO(e,".prototype.")>-1?$v(r):r},SO=Tp(),AO=xc,Cd=AO("Object.prototype.toString"),yc=function(e){return SO&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Cd(e)==="[object Arguments]"},Hv=function(e){return yc(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Cd(e)!=="[object Array]"&&Cd(e.callee)==="[object Function]"},_O=function(){return yc(arguments)}();yc.isLegacyArguments=Hv;var TO=_O?yc:Hv,EO=Object.prototype.toString,CO=Function.prototype.toString,wO=/^\s*(?:function)?\*/,zv=Tp(),qh=Object.getPrototypeOf,OO=function(){if(!zv)return!1;try{return Function("return function*() {}")()}catch{}},Uh,NO=function(e){if(typeof e!="function")return!1;if(wO.test(CO.call(e)))return!0;if(!zv){var t=EO.call(e);return t==="[object GeneratorFunction]"}if(!qh)return!1;if(typeof Uh>"u"){var r=OO();Uh=r?qh(r):!1}return qh(e)===Uh},qv=Function.prototype.toString,oo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,wd,pu;if(typeof oo=="function"&&typeof Object.defineProperty=="function")try{wd=Object.defineProperty({},"length",{get:function(){throw pu}}),pu={},oo(function(){throw 42},null,wd)}catch(n){n!==pu&&(oo=null)}else oo=null;var DO=/^\s*class\b/,Od=function(e){try{var t=qv.call(e);return DO.test(t)}catch{return!1}},Vh=function(e){try{return Od(e)?!1:(qv.call(e),!0)}catch{return!1}},mu=Object.prototype.toString,PO="[object Object]",RO="[object Function]",LO="[object GeneratorFunction]",kO="[object HTMLAllCollection]",IO="[object HTML document.all class]",MO="[object HTMLCollection]",FO=typeof Symbol=="function"&&!!Symbol.toStringTag,BO=!(0 in[,]),Nd=function(){return!1};if(typeof document=="object"){var jO=document.all;mu.call(jO)===mu.call(document.all)&&(Nd=function(e){if((BO||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=mu.call(e);return(t===kO||t===IO||t===MO||t===PO)&&e("")==null}catch{}return!1})}var $O=oo?function(e){if(Nd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{oo(e,null,wd)}catch(t){if(t!==pu)return!1}return!Od(e)&&Vh(e)}:function(e){if(Nd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(FO)return Vh(e);if(Od(e))return!1;var t=mu.call(e);return t!==RO&&t!==LO&&!/^\[object HTML/.test(t)?!1:Vh(e)},HO=$O,zO=Object.prototype.toString,Uv=Object.prototype.hasOwnProperty,qO=function(e,t,r){for(var i=0,o=e.length;i=3&&(i=r),zO.call(e)==="[object Array]"?qO(e,t,i):typeof e=="string"?UO(e,t,i):VO(e,t,i)},KO=WO,GO=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Wh=GO,XO=typeof globalThis>"u"?w:globalThis,YO=function(){for(var e=[],t=0;t"u"?w:globalThis,Dd=JO(),Np=Op("String.prototype.slice"),Kh=Object.getPrototypeOf,ZO=Op("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1?t:t!=="Object"?!1:tN(e)}return gu?eN(e):null},rN=Wv,nN=function(e){return!!rN(e)};(function(n){var e=TO,t=NO,r=Wv,i=nN;function o(H){return H.call.bind(H)}var s=typeof BigInt<"u",l=typeof Symbol<"u",a=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),h=o(Boolean.prototype.valueOf);if(s)var f=o(BigInt.prototype.valueOf);if(l)var d=o(Symbol.prototype.valueOf);function p(H,G){if(typeof H!="object")return!1;try{return G(H),!0}catch{return!1}}n.isArgumentsObject=e,n.isGeneratorFunction=t,n.isTypedArray=i;function v(H){return typeof Promise<"u"&&H instanceof Promise||H!==null&&typeof H=="object"&&typeof H.then=="function"&&typeof H.catch=="function"}n.isPromise=v;function m(H){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(H):i(H)||E(H)}n.isArrayBufferView=m;function y(H){return r(H)==="Uint8Array"}n.isUint8Array=y;function g(H){return r(H)==="Uint8ClampedArray"}n.isUint8ClampedArray=g;function x(H){return r(H)==="Uint16Array"}n.isUint16Array=x;function b(H){return r(H)==="Uint32Array"}n.isUint32Array=b;function _(H){return r(H)==="Int8Array"}n.isInt8Array=_;function S(H){return r(H)==="Int16Array"}n.isInt16Array=S;function C(H){return r(H)==="Int32Array"}n.isInt32Array=C;function O(H){return r(H)==="Float32Array"}n.isFloat32Array=O;function D(H){return r(H)==="Float64Array"}n.isFloat64Array=D;function B(H){return r(H)==="BigInt64Array"}n.isBigInt64Array=B;function $(H){return r(H)==="BigUint64Array"}n.isBigUint64Array=$;function I(H){return a(H)==="[object Map]"}I.working=typeof Map<"u"&&I(new Map);function V(H){return typeof Map>"u"?!1:I.working?I(H):H instanceof Map}n.isMap=V;function se(H){return a(H)==="[object Set]"}se.working=typeof Set<"u"&&se(new Set);function ie(H){return typeof Set>"u"?!1:se.working?se(H):H instanceof Set}n.isSet=ie;function fe(H){return a(H)==="[object WeakMap]"}fe.working=typeof WeakMap<"u"&&fe(new WeakMap);function Ee(H){return typeof WeakMap>"u"?!1:fe.working?fe(H):H instanceof WeakMap}n.isWeakMap=Ee;function me(H){return a(H)==="[object WeakSet]"}me.working=typeof WeakSet<"u"&&me(new WeakSet);function ee(H){return me(H)}n.isWeakSet=ee;function Y(H){return a(H)==="[object ArrayBuffer]"}Y.working=typeof ArrayBuffer<"u"&&Y(new ArrayBuffer);function Z(H){return typeof ArrayBuffer>"u"?!1:Y.working?Y(H):H instanceof ArrayBuffer}n.isArrayBuffer=Z;function le(H){return a(H)==="[object DataView]"}le.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&le(new DataView(new ArrayBuffer(1),0,1));function E(H){return typeof DataView>"u"?!1:le.working?le(H):H instanceof DataView}n.isDataView=E;var A=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function T(H){return a(H)==="[object SharedArrayBuffer]"}function N(H){return typeof A>"u"?!1:(typeof T.working>"u"&&(T.working=T(new A)),T.working?T(H):H instanceof A)}n.isSharedArrayBuffer=N;function R(H){return a(H)==="[object AsyncFunction]"}n.isAsyncFunction=R;function P(H){return a(H)==="[object Map Iterator]"}n.isMapIterator=P;function L(H){return a(H)==="[object Set Iterator]"}n.isSetIterator=L;function z(H){return a(H)==="[object Generator]"}n.isGeneratorObject=z;function W(H){return a(H)==="[object WebAssembly.Module]"}n.isWebAssemblyCompiledModule=W;function J(H){return p(H,u)}n.isNumberObject=J;function M(H){return p(H,c)}n.isStringObject=M;function F(H){return p(H,h)}n.isBooleanObject=F;function U(H){return s&&p(H,f)}n.isBigIntObject=U;function Q(H){return l&&p(H,d)}n.isSymbolObject=Q;function ne(H){return J(H)||M(H)||F(H)||U(H)||Q(H)}n.isBoxedPrimitive=ne;function oe(H){return typeof Uint8Array<"u"&&(Z(H)||N(H))}n.isAnyArrayBuffer=oe,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(H){Object.defineProperty(n,H,{enumerable:!1,value:function(){throw new Error(H+" is not supported in userland")}})})})(Rv);var iN=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},Pd={exports:{}};typeof Object.create=="function"?Pd.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Pd.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var oN=Pd.exports;(function(n){var e={},t=Object.getOwnPropertyDescriptors||function(A){for(var T=Object.keys(A),N={},R=0;R=R)return z;switch(z){case"%s":return String(N[T++]);case"%d":return Number(N[T++]);case"%j":try{return JSON.stringify(N[T++])}catch{return"[Circular]"}default:return z}}),L=N[T];T"u")return function(){return n.deprecate(E,A).apply(this,arguments)};var T=!1;function N(){if(!T){if(tt.throwDeprecation)throw new Error(A);tt.traceDeprecation?console.trace(A):console.error(A),T=!0}return E.apply(this,arguments)}return N};var i={},o=/^$/;if(e.NODE_DEBUG){var s=e.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+s+"$","i")}n.debuglog=function(E){if(E=E.toUpperCase(),!i[E])if(o.test(E)){var A=tt.pid;i[E]=function(){var T=n.format.apply(n,arguments);console.error("%s %d: %s",E,A,T)}}else i[E]=function(){};return i[E]};function l(E,A){var T={seen:[],stylize:u};return arguments.length>=3&&(T.depth=arguments[2]),arguments.length>=4&&(T.colors=arguments[3]),g(A)?T.showHidden=A:A&&n._extend(T,A),O(T.showHidden)&&(T.showHidden=!1),O(T.depth)&&(T.depth=2),O(T.colors)&&(T.colors=!1),O(T.customInspect)&&(T.customInspect=!0),T.colors&&(T.stylize=a),h(T,E,T.depth)}n.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(E,A){var T=l.styles[A];return T?"\x1B["+l.colors[T][0]+"m"+E+"\x1B["+l.colors[T][1]+"m":E}function u(E,A){return E}function c(E){var A={};return E.forEach(function(T,N){A[T]=!0}),A}function h(E,A,T){if(E.customInspect&&A&&V(A.inspect)&&A.inspect!==n.inspect&&!(A.constructor&&A.constructor.prototype===A)){var N=A.inspect(T,E);return S(N)||(N=h(E,N,T)),N}var R=f(E,A);if(R)return R;var P=Object.keys(A),L=c(P);if(E.showHidden&&(P=Object.getOwnPropertyNames(A)),I(A)&&(P.indexOf("message")>=0||P.indexOf("description")>=0))return d(A);if(P.length===0){if(V(A)){var z=A.name?": "+A.name:"";return E.stylize("[Function"+z+"]","special")}if(D(A))return E.stylize(RegExp.prototype.toString.call(A),"regexp");if($(A))return E.stylize(Date.prototype.toString.call(A),"date");if(I(A))return d(A)}var W="",J=!1,M=["{","}"];if(y(A)&&(J=!0,M=["[","]"]),V(A)){var F=A.name?": "+A.name:"";W=" [Function"+F+"]"}if(D(A)&&(W=" "+RegExp.prototype.toString.call(A)),$(A)&&(W=" "+Date.prototype.toUTCString.call(A)),I(A)&&(W=" "+d(A)),P.length===0&&(!J||A.length==0))return M[0]+W+M[1];if(T<0)return D(A)?E.stylize(RegExp.prototype.toString.call(A),"regexp"):E.stylize("[Object]","special");E.seen.push(A);var U;return J?U=p(E,A,T,L,P):U=P.map(function(Q){return v(E,A,T,L,Q,J)}),E.seen.pop(),m(U,W,M)}function f(E,A){if(O(A))return E.stylize("undefined","undefined");if(S(A)){var T="'"+JSON.stringify(A).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return E.stylize(T,"string")}if(_(A))return E.stylize(""+A,"number");if(g(A))return E.stylize(""+A,"boolean");if(x(A))return E.stylize("null","null")}function d(E){return"["+Error.prototype.toString.call(E)+"]"}function p(E,A,T,N,R){for(var P=[],L=0,z=A.length;L-1&&(P?z=z.split(` -`).map(function(Y){return" "+Y}).join(` +`).map(function(J){return" "+J}).join(` `).slice(2):z=` `+z.split(` -`).map(function(Y){return" "+Y}).join(` +`).map(function(J){return" "+J}).join(` `))):z=E.stylize("[Circular]","special")),O(L)){if(P&&R.match(/^\d+$/))return z;L=JSON.stringify(""+R),L.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(L=L.slice(1,-1),L=E.stylize(L,"name")):(L=L.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),L=E.stylize(L,"string"))}return L+": "+z}function m(E,A,T){var N=E.reduce(function(R,P){return P.indexOf(` `)>=0,R+P.replace(/\u001b\[\d\d?m/g,"").length+1},0);return N>60?T[0]+(A===""?"":A+` `)+" "+E.join(`, - `)+" "+T[1]:T[0]+A+" "+E.join(", ")+" "+T[1]}n.types=Ev;function y(E){return Array.isArray(E)}n.isArray=y;function g(E){return typeof E=="boolean"}n.isBoolean=g;function x(E){return E===null}n.isNull=x;function S(E){return E==null}n.isNullOrUndefined=S;function _(E){return typeof E=="number"}n.isNumber=_;function b(E){return typeof E=="string"}n.isString=b;function C(E){return typeof E=="symbol"}n.isSymbol=C;function O(E){return E===void 0}n.isUndefined=O;function D(E){return M(E)&&ie(E)==="[object RegExp]"}n.isRegExp=D,n.types.isRegExp=D;function M(E){return typeof E=="object"&&E!==null}n.isObject=M;function j(E){return M(E)&&ie(E)==="[object Date]"}n.isDate=j,n.types.isDate=j;function k(E){return M(E)&&(ie(E)==="[object Error]"||E instanceof Error)}n.isError=k,n.types.isNativeError=k;function V(E){return typeof E=="function"}n.isFunction=V;function se(E){return E===null||typeof E=="boolean"||typeof E=="number"||typeof E=="string"||typeof E=="symbol"||typeof E>"u"}n.isPrimitive=se,n.isBuffer=UO;function ie(E){return Object.prototype.toString.call(E)}function fe(E){return E<10?"0"+E.toString(10):E.toString(10)}var Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function me(){var E=new Date,A=[fe(E.getHours()),fe(E.getMinutes()),fe(E.getSeconds())].join(":");return[E.getDate(),Ee[E.getMonth()],A].join(" ")}n.log=function(){console.log("%s - %s",me(),n.format.apply(n,arguments))},n.inherits=VO,n._extend=function(E,A){if(!A||!M(A))return E;for(var T=Object.keys(A),N=T.length;N--;)E[T[N]]=A[T[N]];return E};function ee(E,A){return Object.prototype.hasOwnProperty.call(E,A)}var X=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;n.promisify=function(A){if(typeof A!="function")throw new TypeError('The "original" argument must be of type Function');if(X&&A[X]){var T=A[X];if(typeof T!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(T,X,{value:T,enumerable:!1,writable:!1,configurable:!0}),T}function T(){for(var N,R,P=new Promise(function(W,Y){N=W,R=Y}),L=[],z=0;z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u(g){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},u(g)}var c={},h,f;function d(g,x,S){S||(S=Error);function _(C,O,D){return typeof x=="string"?x:x(C,O,D)}var b=function(C){r(D,C);var O=o(D);function D(M,j,k){var V;return t(this,D),V=O.call(this,_(M,j,k)),V.code=g,V}return e(D)}(S);c[g]=b}function p(g,x){if(Array.isArray(g)){var S=g.length;return g=g.map(function(_){return String(_)}),S>2?"one of ".concat(x," ").concat(g.slice(0,S-1).join(", "),", or ")+g[S-1]:S===2?"one of ".concat(x," ").concat(g[0]," or ").concat(g[1]):"of ".concat(x," ").concat(g[0])}else return"of ".concat(x," ").concat(String(g))}function v(g,x,S){return g.substr(0,x.length)===x}function m(g,x,S){return(S===void 0||S>g.length)&&(S=g.length),g.substring(S-x.length,S)===x}function y(g,x,S){return typeof S!="number"&&(S=0),S+x.length>g.length?!1:g.indexOf(x,S)!==-1}return d("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),d("ERR_INVALID_ARG_TYPE",function(g,x,S){h===void 0&&(h=jt()),h(typeof g=="string","'name' must be a string");var _;typeof x=="string"&&v(x,"not ")?(_="must not be",x=x.replace(/^not /,"")):_="must be";var b;if(m(g," argument"))b="The ".concat(g," ").concat(_," ").concat(p(x,"type"));else{var C=y(g,".")?"property":"argument";b='The "'.concat(g,'" ').concat(C," ").concat(_," ").concat(p(x,"type"))}return b+=". Received type ".concat(n(S)),b},TypeError),d("ERR_INVALID_ARG_VALUE",function(g,x){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=xi);var _=f.inspect(x);return _.length>128&&(_="".concat(_.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(S,". Received ").concat(_)},TypeError),d("ERR_INVALID_RETURN_VALUE",function(g,x,S){var _;return S&&S.constructor&&S.constructor.name?_="instance of ".concat(S.constructor.name):_="type ".concat(n(S)),"Expected ".concat(g,' to be returned from the "').concat(x,'"')+" function but got ".concat(_,".")},TypeError),d("ERR_MISSING_ARGS",function(){for(var g=arguments.length,x=new Array(g),S=0;S0,"At least one arg needs to be specified");var _="The ",b=x.length;switch(x=x.map(function(C){return'"'.concat(C,'"')}),b){case 1:_+="".concat(x[0]," argument");break;case 2:_+="".concat(x[0]," and ").concat(x[1]," arguments");break;default:_+=x.slice(0,b-1).join(", "),_+=", and ".concat(x[b-1]," arguments");break}return"".concat(_," must be specified")},TypeError),Ph.codes=c,Ph}var Hh,Hm;function WO(){if(Hm)return Hh;Hm=1;function n(ee,X){var Z=Object.keys(ee);if(Object.getOwnPropertySymbols){var le=Object.getOwnPropertySymbols(ee);X&&(le=le.filter(function(E){return Object.getOwnPropertyDescriptor(ee,E).enumerable})),Z.push.apply(Z,le)}return Z}function e(ee){for(var X=1;X"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function v(ee){return Function.toString.call(ee).indexOf("[native code]")!==-1}function m(ee,X){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(le,E){return le.__proto__=E,le},m(ee,X)}function y(ee){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},y(ee)}function g(ee){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},g(ee)}var x=xi,S=x.inspect,_=$v(),b=_.codes.ERR_INVALID_ARG_TYPE;function C(ee,X,Z){return(Z===void 0||Z>ee.length)&&(Z=ee.length),ee.substring(Z-X.length,Z)===X}function O(ee,X){if(X=Math.floor(X),ee.length==0||X==0)return"";var Z=ee.length*X;for(X=Math.floor(Math.log(X)/Math.log(2));X;)ee+=ee,X--;return ee+=ee.substring(0,Z-ee.length),ee}var D="",M="",j="",k="",V={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},se=10;function ie(ee){var X=Object.keys(ee),Z=Object.create(Object.getPrototypeOf(ee));return X.forEach(function(le){Z[le]=ee[le]}),Object.defineProperty(Z,"message",{value:ee.message}),Z}function fe(ee){return S(ee,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Ee(ee,X,Z){var le="",E="",A=0,T="",N=!1,R=fe(ee),P=R.split(` -`),L=fe(X).split(` -`),z=0,W="";if(Z==="strictEqual"&&g(ee)==="object"&&g(X)==="object"&&ee!==null&&X!==null&&(Z="strictEqualObject"),P.length===1&&L.length===1&&P[0]!==L[0]){var Y=P[0].length+L[0].length;if(Y<=se){if((g(ee)!=="object"||ee===null)&&(g(X)!=="object"||X===null)&&(ee!==0||X!==0))return"".concat(V[Z],` + `)+" "+T[1]:T[0]+A+" "+E.join(", ")+" "+T[1]}n.types=Rv;function y(E){return Array.isArray(E)}n.isArray=y;function g(E){return typeof E=="boolean"}n.isBoolean=g;function x(E){return E===null}n.isNull=x;function b(E){return E==null}n.isNullOrUndefined=b;function _(E){return typeof E=="number"}n.isNumber=_;function S(E){return typeof E=="string"}n.isString=S;function C(E){return typeof E=="symbol"}n.isSymbol=C;function O(E){return E===void 0}n.isUndefined=O;function D(E){return B(E)&&ie(E)==="[object RegExp]"}n.isRegExp=D,n.types.isRegExp=D;function B(E){return typeof E=="object"&&E!==null}n.isObject=B;function $(E){return B(E)&&ie(E)==="[object Date]"}n.isDate=$,n.types.isDate=$;function I(E){return B(E)&&(ie(E)==="[object Error]"||E instanceof Error)}n.isError=I,n.types.isNativeError=I;function V(E){return typeof E=="function"}n.isFunction=V;function se(E){return E===null||typeof E=="boolean"||typeof E=="number"||typeof E=="string"||typeof E=="symbol"||typeof E>"u"}n.isPrimitive=se,n.isBuffer=iN;function ie(E){return Object.prototype.toString.call(E)}function fe(E){return E<10?"0"+E.toString(10):E.toString(10)}var Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function me(){var E=new Date,A=[fe(E.getHours()),fe(E.getMinutes()),fe(E.getSeconds())].join(":");return[E.getDate(),Ee[E.getMonth()],A].join(" ")}n.log=function(){console.log("%s - %s",me(),n.format.apply(n,arguments))},n.inherits=oN,n._extend=function(E,A){if(!A||!B(A))return E;for(var T=Object.keys(A),N=T.length;N--;)E[T[N]]=A[T[N]];return E};function ee(E,A){return Object.prototype.hasOwnProperty.call(E,A)}var Y=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;n.promisify=function(A){if(typeof A!="function")throw new TypeError('The "original" argument must be of type Function');if(Y&&A[Y]){var T=A[Y];if(typeof T!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(T,Y,{value:T,enumerable:!1,writable:!1,configurable:!0}),T}function T(){for(var N,R,P=new Promise(function(W,J){N=W,R=J}),L=[],z=0;z"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u(g){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(b){return b.__proto__||Object.getPrototypeOf(b)},u(g)}var c={},h,f;function d(g,x,b){b||(b=Error);function _(C,O,D){return typeof x=="string"?x:x(C,O,D)}var S=function(C){r(D,C);var O=o(D);function D(B,$,I){var V;return t(this,D),V=O.call(this,_(B,$,I)),V.code=g,V}return e(D)}(b);c[g]=S}function p(g,x){if(Array.isArray(g)){var b=g.length;return g=g.map(function(_){return String(_)}),b>2?"one of ".concat(x," ").concat(g.slice(0,b-1).join(", "),", or ")+g[b-1]:b===2?"one of ".concat(x," ").concat(g[0]," or ").concat(g[1]):"of ".concat(x," ").concat(g[0])}else return"of ".concat(x," ").concat(String(g))}function v(g,x,b){return g.substr(0,x.length)===x}function m(g,x,b){return(b===void 0||b>g.length)&&(b=g.length),g.substring(b-x.length,b)===x}function y(g,x,b){return typeof b!="number"&&(b=0),b+x.length>g.length?!1:g.indexOf(x,b)!==-1}return d("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),d("ERR_INVALID_ARG_TYPE",function(g,x,b){h===void 0&&(h=Bt()),h(typeof g=="string","'name' must be a string");var _;typeof x=="string"&&v(x,"not ")?(_="must not be",x=x.replace(/^not /,"")):_="must be";var S;if(m(g," argument"))S="The ".concat(g," ").concat(_," ").concat(p(x,"type"));else{var C=y(g,".")?"property":"argument";S='The "'.concat(g,'" ').concat(C," ").concat(_," ").concat(p(x,"type"))}return S+=". Received type ".concat(n(b)),S},TypeError),d("ERR_INVALID_ARG_VALUE",function(g,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=Si);var _=f.inspect(x);return _.length>128&&(_="".concat(_.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(b,". Received ").concat(_)},TypeError),d("ERR_INVALID_RETURN_VALUE",function(g,x,b){var _;return b&&b.constructor&&b.constructor.name?_="instance of ".concat(b.constructor.name):_="type ".concat(n(b)),"Expected ".concat(g,' to be returned from the "').concat(x,'"')+" function but got ".concat(_,".")},TypeError),d("ERR_MISSING_ARGS",function(){for(var g=arguments.length,x=new Array(g),b=0;b0,"At least one arg needs to be specified");var _="The ",S=x.length;switch(x=x.map(function(C){return'"'.concat(C,'"')}),S){case 1:_+="".concat(x[0]," argument");break;case 2:_+="".concat(x[0]," and ").concat(x[1]," arguments");break;default:_+=x.slice(0,S-1).join(", "),_+=", and ".concat(x[S-1]," arguments");break}return"".concat(_," must be specified")},TypeError),Bh.codes=c,Bh}var Gh,Gm;function sN(){if(Gm)return Gh;Gm=1;function n(ee,Y){var Z=Object.keys(ee);if(Object.getOwnPropertySymbols){var le=Object.getOwnPropertySymbols(ee);Y&&(le=le.filter(function(E){return Object.getOwnPropertyDescriptor(ee,E).enumerable})),Z.push.apply(Z,le)}return Z}function e(ee){for(var Y=1;Y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function v(ee){return Function.toString.call(ee).indexOf("[native code]")!==-1}function m(ee,Y){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(le,E){return le.__proto__=E,le},m(ee,Y)}function y(ee){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},y(ee)}function g(ee){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},g(ee)}var x=Si,b=x.inspect,_=Kv(),S=_.codes.ERR_INVALID_ARG_TYPE;function C(ee,Y,Z){return(Z===void 0||Z>ee.length)&&(Z=ee.length),ee.substring(Z-Y.length,Z)===Y}function O(ee,Y){if(Y=Math.floor(Y),ee.length==0||Y==0)return"";var Z=ee.length*Y;for(Y=Math.floor(Math.log(Y)/Math.log(2));Y;)ee+=ee,Y--;return ee+=ee.substring(0,Z-ee.length),ee}var D="",B="",$="",I="",V={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},se=10;function ie(ee){var Y=Object.keys(ee),Z=Object.create(Object.getPrototypeOf(ee));return Y.forEach(function(le){Z[le]=ee[le]}),Object.defineProperty(Z,"message",{value:ee.message}),Z}function fe(ee){return b(ee,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Ee(ee,Y,Z){var le="",E="",A=0,T="",N=!1,R=fe(ee),P=R.split(` +`),L=fe(Y).split(` +`),z=0,W="";if(Z==="strictEqual"&&g(ee)==="object"&&g(Y)==="object"&&ee!==null&&Y!==null&&(Z="strictEqualObject"),P.length===1&&L.length===1&&P[0]!==L[0]){var J=P[0].length+L[0].length;if(J<=se){if((g(ee)!=="object"||ee===null)&&(g(Y)!=="object"||Y===null)&&(ee!==0||Y!==0))return"".concat(V[Z],` `)+"".concat(P[0]," !== ").concat(L[0],` -`)}else if(Z!=="strictEqualObject"){var I=tt.stderr&&tt.stderr.isTTY?tt.stderr.columns:80;if(Y2&&(W=` +`)}else if(Z!=="strictEqualObject"){var M=tt.stderr&&tt.stderr.isTTY?tt.stderr.columns:80;if(J2&&(W=` `.concat(O(" ",z),"^"),z=0)}}}for(var F=P[P.length-1],U=L[L.length-1];F===U&&(z++<2?T=` `.concat(F).concat(T):le=F,P.pop(),L.pop(),!(P.length===0||L.length===0));)F=P[P.length-1],U=L[L.length-1];var Q=Math.max(P.length,L.length);if(Q===0){var ne=R.split(` -`);if(ne.length>30)for(ne[26]="".concat(D,"...").concat(k);ne.length>27;)ne.pop();return"".concat(V.notIdentical,` +`);if(ne.length>30)for(ne[26]="".concat(D,"...").concat(I);ne.length>27;)ne.pop();return"".concat(V.notIdentical,` `).concat(ne.join(` `),` `)}z>3&&(T=` -`.concat(D,"...").concat(k).concat(T),N=!0),le!==""&&(T=` +`.concat(D,"...").concat(I).concat(T),N=!0),le!==""&&(T=` `.concat(le).concat(T),le="");var oe=0,H=V[Z]+` -`.concat(M,"+ actual").concat(k," ").concat(j,"- expected").concat(k),G=" ".concat(D,"...").concat(k," Lines skipped");for(z=0;z1&&z>2&&(ge>4?(E+=` -`.concat(D,"...").concat(k),N=!0):ge>3&&(E+=` +`.concat(B,"+ actual").concat(I," ").concat($,"- expected").concat(I),G=" ".concat(D,"...").concat(I," Lines skipped");for(z=0;z1&&z>2&&(ge>4?(E+=` +`.concat(D,"...").concat(I),N=!0):ge>3&&(E+=` `.concat(L[z-2]),oe++),E+=` `.concat(L[z-1]),oe++),A=z,le+=` -`.concat(j,"-").concat(k," ").concat(L[z]),oe++;else if(L.length1&&z>2&&(ge>4?(E+=` -`.concat(D,"...").concat(k),N=!0):ge>3&&(E+=` +`.concat($,"-").concat(I," ").concat(L[z]),oe++;else if(L.length1&&z>2&&(ge>4?(E+=` +`.concat(D,"...").concat(I),N=!0):ge>3&&(E+=` `.concat(P[z-2]),oe++),E+=` `.concat(P[z-1]),oe++),A=z,E+=` -`.concat(M,"+").concat(k," ").concat(P[z]),oe++;else{var ke=L[z],He=P[z],B=He!==ke&&(!C(He,",")||He.slice(0,-1)!==ke);B&&C(ke,",")&&ke.slice(0,-1)===He&&(B=!1,He+=","),B?(ge>1&&z>2&&(ge>4?(E+=` -`.concat(D,"...").concat(k),N=!0):ge>3&&(E+=` +`.concat(B,"+").concat(I," ").concat(P[z]),oe++;else{var ke=L[z],He=P[z],j=He!==ke&&(!C(He,",")||He.slice(0,-1)!==ke);j&&C(ke,",")&&ke.slice(0,-1)===He&&(j=!1,He+=","),j?(ge>1&&z>2&&(ge>4?(E+=` +`.concat(D,"...").concat(I),N=!0):ge>3&&(E+=` `.concat(P[z-2]),oe++),E+=` `.concat(P[z-1]),oe++),A=z,E+=` -`.concat(M,"+").concat(k," ").concat(He),le+=` -`.concat(j,"-").concat(k," ").concat(ke),oe+=2):(E+=le,le="",(ge===1||z===0)&&(E+=` +`.concat(B,"+").concat(I," ").concat(He),le+=` +`.concat($,"-").concat(I," ").concat(ke),oe+=2):(E+=le,le="",(ge===1||z===0)&&(E+=` `.concat(He),oe++))}if(oe>20&&z30)for(Y[26]="".concat(D,"...").concat(k);Y.length>27;)Y.pop();Y.length===1?A=Z.call(this,"".concat(W," ").concat(Y[0])):A=Z.call(this,"".concat(W,` +`).concat(D,"...").concat(I).concat(le,` +`)+"".concat(D,"...").concat(I)}return"".concat(H).concat(N?G:"",` +`).concat(E).concat(le).concat(T).concat(W)}var me=function(ee,Y){a(le,ee);var Z=u(le);function le(E){var A;if(r(this,le),g(E)!=="object"||E===null)throw new S("options","Object",E);var T=E.message,N=E.operator,R=E.stackStartFn,P=E.actual,L=E.expected,z=Error.stackTraceLimit;if(Error.stackTraceLimit=0,T!=null)A=Z.call(this,String(T));else if(tt.stderr&&tt.stderr.isTTY&&(tt.stderr&&tt.stderr.getColorDepth&&tt.stderr.getColorDepth()!==1?(D="\x1B[34m",B="\x1B[32m",I="\x1B[39m",$="\x1B[31m"):(D="",B="",I="",$="")),g(P)==="object"&&P!==null&&g(L)==="object"&&L!==null&&"stack"in P&&P instanceof Error&&"stack"in L&&L instanceof Error&&(P=ie(P),L=ie(L)),N==="deepStrictEqual"||N==="strictEqual")A=Z.call(this,Ee(P,L,N));else if(N==="notDeepStrictEqual"||N==="notStrictEqual"){var W=V[N],J=fe(P).split(` +`);if(N==="notStrictEqual"&&g(P)==="object"&&P!==null&&(W=V.notStrictEqualObject),J.length>30)for(J[26]="".concat(D,"...").concat(I);J.length>27;)J.pop();J.length===1?A=Z.call(this,"".concat(W," ").concat(J[0])):A=Z.call(this,"".concat(W,` -`).concat(Y.join(` +`).concat(J.join(` `),` -`))}else{var I=fe(P),F="",U=V[N];N==="notDeepEqual"||N==="notEqual"?(I="".concat(V[N],` +`))}else{var M=fe(P),F="",U=V[N];N==="notDeepEqual"||N==="notEqual"?(M="".concat(V[N],` -`).concat(I),I.length>1024&&(I="".concat(I.slice(0,1021),"..."))):(F="".concat(fe(L)),I.length>512&&(I="".concat(I.slice(0,509),"...")),F.length>512&&(F="".concat(F.slice(0,509),"...")),N==="deepEqual"||N==="equal"?I="".concat(U,` +`).concat(M),M.length>1024&&(M="".concat(M.slice(0,1021),"..."))):(F="".concat(fe(L)),M.length>512&&(M="".concat(M.slice(0,509),"...")),F.length>512&&(F="".concat(F.slice(0,509),"...")),N==="deepEqual"||N==="equal"?M="".concat(U,` -`).concat(I,` +`).concat(M,` should equal -`):F=" ".concat(N," ").concat(F)),A=Z.call(this,"".concat(I).concat(F))}return Error.stackTraceLimit=z,A.generatedMessage=!T,Object.defineProperty(h(A),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),A.code="ERR_ASSERTION",A.actual=P,A.expected=L,A.operator=N,Error.captureStackTrace&&Error.captureStackTrace(h(A),R),A.stack,A.name="AssertionError",c(A)}return o(le,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:X,value:function(A,T){return S(this,e(e({},T),{},{customInspect:!1,depth:0}))}}]),le}(f(Error),S.custom);return Hh=me,Hh}var zm=Object.prototype.toString,Hv=function(e){var t=zm.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&zm.call(e.callee)==="[object Function]"),r},zh,qm;function KO(){if(qm)return zh;qm=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Hv,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(f){var d=f.constructor;return d&&d.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&e.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{a(window[f])}catch{return!0}}catch{return!0}return!1}(),h=function(f){if(typeof window>"u"||!c)return a(f);try{return a(f)}catch{return!1}};n=function(d){var p=d!==null&&typeof d=="object",v=t.call(d)==="[object Function]",m=r(d),y=p&&t.call(d)==="[object String]",g=[];if(!p&&!v&&!m)throw new TypeError("Object.keys called on a non-object");var x=s&&v;if(y&&d.length>0&&!e.call(d,0))for(var S=0;S0)for(var _=0;_2?arguments[2]:{},f=n(c);e&&(f=r.call(f,Object.getOwnPropertySymbols(c)));for(var d=0;dB.length)&&(q=B.length);for(var ae=0,ye=new Array(q);ae10)return!0;for(var q=0;q57)return!0}return B.length===10&&B>=Math.pow(2,32)}function me(B){return Object.keys(B).filter(Ee).concat(h(B).filter(Object.prototype.propertyIsEnumerable.bind(B)))}/*! +`):F=" ".concat(N," ").concat(F)),A=Z.call(this,"".concat(M).concat(F))}return Error.stackTraceLimit=z,A.generatedMessage=!T,Object.defineProperty(h(A),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),A.code="ERR_ASSERTION",A.actual=P,A.expected=L,A.operator=N,Error.captureStackTrace&&Error.captureStackTrace(h(A),R),A.stack,A.name="AssertionError",c(A)}return o(le,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:Y,value:function(A,T){return b(this,e(e({},T),{},{customInspect:!1,depth:0}))}}]),le}(f(Error),b.custom);return Gh=me,Gh}var Xm=Object.prototype.toString,Gv=function(e){var t=Xm.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Xm.call(e.callee)==="[object Function]"),r},Xh,Ym;function lN(){if(Ym)return Xh;Ym=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Gv,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(f){var d=f.constructor;return d&&d.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&e.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{a(window[f])}catch{return!0}}catch{return!0}return!1}(),h=function(f){if(typeof window>"u"||!c)return a(f);try{return a(f)}catch{return!1}};n=function(d){var p=d!==null&&typeof d=="object",v=t.call(d)==="[object Function]",m=r(d),y=p&&t.call(d)==="[object String]",g=[];if(!p&&!v&&!m)throw new TypeError("Object.keys called on a non-object");var x=s&&v;if(y&&d.length>0&&!e.call(d,0))for(var b=0;b0)for(var _=0;_2?arguments[2]:{},f=n(c);e&&(f=r.call(f,Object.getOwnPropertySymbols(c)));for(var d=0;dj.length)&&(q=j.length);for(var ae=0,ye=new Array(q);ae10)return!0;for(var q=0;q57)return!0}return j.length===10&&j>=Math.pow(2,32)}function me(j){return Object.keys(j).filter(Ee).concat(h(j).filter(Object.prototype.propertyIsEnumerable.bind(j)))}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function ee(B,q){if(B===q)return 0;for(var ae=B.length,ye=q.length,ve=0,Ne=Math.min(ae,ye);ve1?N-1:0),P=1;P1?N-1:0),P=1;P1?N-1:0),P=1;P1?N-1:0),P=1;P1?N-1:0),P=1;P1?N-1:0),P=1;P1?N-1:0),P=1;P1?N-1:0),P=1;P{}}J.SuppressWarnings=fN;var pn={};(function(n){/*! + */Object.defineProperty(X,"__esModule",{value:!0});X.SuppressWarnings=X.Override=X.Nullable=X.NotNull=void 0;function _N(n,e,t){}X.NotNull=_N;function TN(n,e,t){}X.Nullable=TN;function EN(n,e,t){}X.Override=EN;function CN(n){return(e,t,r)=>{}}X.SuppressWarnings=CN;var gn={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(n,"__esModule",{value:!0}),n.IntStream=void 0,function(e){e.EOF=-1,e.UNKNOWN_SOURCE_NAME=""}(n.IntStream||(n.IntStream={}))})(pn);/*! + */Object.defineProperty(n,"__esModule",{value:!0}),n.IntStream=void 0,function(e){e.EOF=-1,e.UNKNOWN_SOURCE_NAME=""}(n.IntStream||(n.IntStream={}))})(gn);/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Vr=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(cc,"__esModule",{value:!0});cc.ANTLRInputStream=void 0;const dN=jt(),Wr=J,qa=pn;class br{constructor(e){this.p=0,this.data=e,this.n=e.length}reset(){this.p=0}consume(){if(this.p>=this.n)throw dN(this.LA(1)===qa.IntStream.EOF),new Error("cannot consume EOF");this.p=this.n?qa.IntStream.EOF:this.data.charCodeAt(this.p+e-1)}LT(e){return this.LA(e)}get index(){return this.p}get size(){return this.n}mark(){return-1}release(e){}seek(e){if(e<=this.p){this.p=e;return}for(e=Math.min(e,this.n);this.p=this.n&&(r=this.n-1);let i=r-t+1;return t>=this.n?"":this.data.substr(t,i)}get sourceName(){return this.name?this.name:qa.IntStream.UNKNOWN_SOURCE_NAME}toString(){return this.data}}Vr([Wr.Override],br.prototype,"consume",null);Vr([Wr.Override],br.prototype,"LA",null);Vr([Wr.Override],br.prototype,"index",null);Vr([Wr.Override],br.prototype,"size",null);Vr([Wr.Override],br.prototype,"mark",null);Vr([Wr.Override],br.prototype,"release",null);Vr([Wr.Override],br.prototype,"seek",null);Vr([Wr.Override],br.prototype,"getText",null);Vr([Wr.Override],br.prototype,"sourceName",null);Vr([Wr.Override],br.prototype,"toString",null);cc.ANTLRInputStream=br;var rs={},ns={},Kr={};(function(n){/*! + */var Wr=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(pc,"__esModule",{value:!0});pc.ANTLRInputStream=void 0;const wN=Bt(),Kr=X,Ga=gn;class Sr{constructor(e){this.p=0,this.data=e,this.n=e.length}reset(){this.p=0}consume(){if(this.p>=this.n)throw wN(this.LA(1)===Ga.IntStream.EOF),new Error("cannot consume EOF");this.p=this.n?Ga.IntStream.EOF:this.data.charCodeAt(this.p+e-1)}LT(e){return this.LA(e)}get index(){return this.p}get size(){return this.n}mark(){return-1}release(e){}seek(e){if(e<=this.p){this.p=e;return}for(e=Math.min(e,this.n);this.p=this.n&&(r=this.n-1);let i=r-t+1;return t>=this.n?"":this.data.substr(t,i)}get sourceName(){return this.name?this.name:Ga.IntStream.UNKNOWN_SOURCE_NAME}toString(){return this.data}}Wr([Kr.Override],Sr.prototype,"consume",null);Wr([Kr.Override],Sr.prototype,"LA",null);Wr([Kr.Override],Sr.prototype,"index",null);Wr([Kr.Override],Sr.prototype,"size",null);Wr([Kr.Override],Sr.prototype,"mark",null);Wr([Kr.Override],Sr.prototype,"release",null);Wr([Kr.Override],Sr.prototype,"seek",null);Wr([Kr.Override],Sr.prototype,"getText",null);Wr([Kr.Override],Sr.prototype,"sourceName",null);Wr([Kr.Override],Sr.prototype,"toString",null);pc.ANTLRInputStream=Sr;var is={},os={},Gr={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u};Object.defineProperty(n,"__esModule",{value:!0}),n.ATNState=void 0;const t=J;class r{constructor(){this.stateNumber=r.INVALID_STATE_NUMBER,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.optimizedTransitions=this.transitions}getStateNumber(){return this.stateNumber}get nonStopStateNumber(){return this.getStateNumber()}hashCode(){return this.stateNumber}equals(o){return o instanceof r?this.stateNumber===o.stateNumber:!1}get isNonGreedyExitState(){return!1}toString(){return String(this.stateNumber)}getTransitions(){return this.transitions.slice(0)}get numberOfTransitions(){return this.transitions.length}addTransition(o,s){if(this.transitions.length===0)this.epsilonOnlyTransitions=o.isEpsilon;else if(this.epsilonOnlyTransitions!==o.isEpsilon)throw this.epsilonOnlyTransitions=!1,new Error("ATN state "+this.stateNumber+" has both epsilon and non-epsilon transitions.");this.transitions.splice(s!==void 0?s:this.transitions.length,0,o)}transition(o){return this.transitions[o]}setTransition(o,s){this.transitions[o]=s}removeTransition(o){return this.transitions.splice(o,1)[0]}get onlyHasEpsilonTransitions(){return this.epsilonOnlyTransitions}setRuleIndex(o){this.ruleIndex=o}get isOptimized(){return this.optimizedTransitions!==this.transitions}get numberOfOptimizedTransitions(){return this.optimizedTransitions.length}getOptimizedTransition(o){return this.optimizedTransitions[o]}addOptimizedTransition(o){this.isOptimized||(this.optimizedTransitions=new Array),this.optimizedTransitions.push(o)}setOptimizedTransition(o,s){if(!this.isOptimized)throw new Error("This ATNState is not optimized.");this.optimizedTransitions[o]=s}removeOptimizedTransition(o){if(!this.isOptimized)throw new Error("This ATNState is not optimized.");this.optimizedTransitions.splice(o,1)}}e([t.Override],r.prototype,"hashCode",null),e([t.Override],r.prototype,"equals",null),e([t.Override],r.prototype,"toString",null),n.ATNState=r,function(i){i.INVALID_STATE_NUMBER=-1}(r=n.ATNState||(n.ATNState={}))})(Kr);var mt={};(function(n){/*! + */var e=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u};Object.defineProperty(n,"__esModule",{value:!0}),n.ATNState=void 0;const t=X;class r{constructor(){this.stateNumber=r.INVALID_STATE_NUMBER,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.optimizedTransitions=this.transitions}getStateNumber(){return this.stateNumber}get nonStopStateNumber(){return this.getStateNumber()}hashCode(){return this.stateNumber}equals(o){return o instanceof r?this.stateNumber===o.stateNumber:!1}get isNonGreedyExitState(){return!1}toString(){return String(this.stateNumber)}getTransitions(){return this.transitions.slice(0)}get numberOfTransitions(){return this.transitions.length}addTransition(o,s){if(this.transitions.length===0)this.epsilonOnlyTransitions=o.isEpsilon;else if(this.epsilonOnlyTransitions!==o.isEpsilon)throw this.epsilonOnlyTransitions=!1,new Error("ATN state "+this.stateNumber+" has both epsilon and non-epsilon transitions.");this.transitions.splice(s!==void 0?s:this.transitions.length,0,o)}transition(o){return this.transitions[o]}setTransition(o,s){this.transitions[o]=s}removeTransition(o){return this.transitions.splice(o,1)[0]}get onlyHasEpsilonTransitions(){return this.epsilonOnlyTransitions}setRuleIndex(o){this.ruleIndex=o}get isOptimized(){return this.optimizedTransitions!==this.transitions}get numberOfOptimizedTransitions(){return this.optimizedTransitions.length}getOptimizedTransition(o){return this.optimizedTransitions[o]}addOptimizedTransition(o){this.isOptimized||(this.optimizedTransitions=new Array),this.optimizedTransitions.push(o)}setOptimizedTransition(o,s){if(!this.isOptimized)throw new Error("This ATNState is not optimized.");this.optimizedTransitions[o]=s}removeOptimizedTransition(o){if(!this.isOptimized)throw new Error("This ATNState is not optimized.");this.optimizedTransitions.splice(o,1)}}e([t.Override],r.prototype,"hashCode",null),e([t.Override],r.prototype,"equals",null),e([t.Override],r.prototype,"toString",null),n.ATNState=r,function(i){i.INVALID_STATE_NUMBER=-1}(r=n.ATNState||(n.ATNState={}))})(Gr);var mt={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(n,"__esModule",{value:!0}),n.ATNStateType=void 0,function(e){e[e.INVALID_TYPE=0]="INVALID_TYPE",e[e.BASIC=1]="BASIC",e[e.RULE_START=2]="RULE_START",e[e.BLOCK_START=3]="BLOCK_START",e[e.PLUS_BLOCK_START=4]="PLUS_BLOCK_START",e[e.STAR_BLOCK_START=5]="STAR_BLOCK_START",e[e.TOKEN_START=6]="TOKEN_START",e[e.RULE_STOP=7]="RULE_STOP",e[e.BLOCK_END=8]="BLOCK_END",e[e.STAR_LOOP_BACK=9]="STAR_LOOP_BACK",e[e.STAR_LOOP_ENTRY=10]="STAR_LOOP_ENTRY",e[e.PLUS_LOOP_BACK=11]="PLUS_LOOP_BACK",e[e.LOOP_END=12]="LOOP_END"}(n.ATNStateType||(n.ATNStateType={}))})(mt);var ko={},Gr={};/*! + */Object.defineProperty(n,"__esModule",{value:!0}),n.ATNStateType=void 0,function(e){e[e.INVALID_TYPE=0]="INVALID_TYPE",e[e.BASIC=1]="BASIC",e[e.RULE_START=2]="RULE_START",e[e.BLOCK_START=3]="BLOCK_START",e[e.PLUS_BLOCK_START=4]="PLUS_BLOCK_START",e[e.STAR_BLOCK_START=5]="STAR_BLOCK_START",e[e.TOKEN_START=6]="TOKEN_START",e[e.RULE_STOP=7]="RULE_STOP",e[e.BLOCK_END=8]="BLOCK_END",e[e.STAR_LOOP_BACK=9]="STAR_LOOP_BACK",e[e.STAR_LOOP_ENTRY=10]="STAR_LOOP_ENTRY",e[e.PLUS_LOOP_BACK=11]="PLUS_LOOP_BACK",e[e.LOOP_END=12]="LOOP_END"}(n.ATNStateType||(n.ATNStateType={}))})(mt);var Fo={},Xr={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Gr,"__esModule",{value:!0});var Ye=Gr.RecognitionException=void 0;class pN extends Error{constructor(e,t,r,i){super(i),this._offendingState=-1,this._recognizer=e,this.input=t,this.ctx=r,e&&(this._offendingState=e.state)}get offendingState(){return this._offendingState}setOffendingState(e){this._offendingState=e}get expectedTokens(){if(this._recognizer)return this._recognizer.atn.getExpectedTokens(this._offendingState,this.ctx)}get context(){return this.ctx}get inputStream(){return this.input}getOffendingToken(e){if(!(e&&e!==this._recognizer))return this.offendingToken}setOffendingToken(e,t){e===this._recognizer&&(this.offendingToken=t)}get recognizer(){return this._recognizer}}Ye=Gr.RecognitionException=pN;var ql={},Io={},Ar={};/*! + */Object.defineProperty(Xr,"__esModule",{value:!0});var Ye=Xr.RecognitionException=void 0;class ON extends Error{constructor(e,t,r,i){super(i),this._offendingState=-1,this._recognizer=e,this.input=t,this.ctx=r,e&&(this._offendingState=e.state)}get offendingState(){return this._offendingState}setOffendingState(e){this._offendingState=e}get expectedTokens(){if(this._recognizer)return this._recognizer.atn.getExpectedTokens(this._offendingState,this.ctx)}get context(){return this.ctx}get inputStream(){return this.input}getOffendingToken(e){if(!(e&&e!==this._recognizer))return this.offendingToken}setOffendingToken(e,t){e===this._recognizer&&(this.offendingToken=t)}get recognizer(){return this._recognizer}}Ye=Xr.RecognitionException=ON;var Wl={},Bo={},Ar={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Gv=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},mN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Transition=void 0;const Xv=J;let Ol=class{constructor(e){if(e==null)throw new Error("target cannot be null.");this.target=e}get isEpsilon(){return!1}get label(){}};Ol.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"];Gv([Xv.NotNull],Ol.prototype,"target",void 0);Ol=Gv([mN(0,Xv.NotNull)],Ol);Ar.Transition=Ol;/*! + */var tb=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},NN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Transition=void 0;const rb=X;let Pl=class{constructor(e){if(e==null)throw new Error("target cannot be null.");this.target=e}get isEpsilon(){return!1}get label(){}};Pl.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"];tb([rb.NotNull],Pl.prototype,"target",void 0);Pl=tb([NN(0,rb.NotNull)],Pl);Ar.Transition=Pl;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Io,"__esModule",{value:!0});Io.AbstractPredicateTransition=void 0;const gN=Ar;class xN extends gN.Transition{constructor(e){super(e)}}Io.AbstractPredicateTransition=xN;var ki={},_r={},gc={},Je={};(function(n){/*! + */Object.defineProperty(Bo,"__esModule",{value:!0});Bo.AbstractPredicateTransition=void 0;const DN=Ar;class PN extends DN.Transition{constructor(e){super(e)}}Bo.AbstractPredicateTransition=PN;var Bi={},_r={},bc={},Je={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. */Object.defineProperty(n,"__esModule",{value:!0}),n.MurmurHash=void 0,function(e){function r(a=0){return a}e.initialize=r;function i(a,u){u==null?u=0:typeof u=="string"?u=l(u):typeof u=="object"&&(u=u.hashCode());let m=u;return m=Math.imul(m,3432918353),m=m<<15|m>>>17,m=Math.imul(m,461845907),a=a^m,a=a<<13|a>>>19,a=Math.imul(a,5)+3864292196,a&4294967295}e.update=i;function o(a,u){return a=a^u*4,a=a^a>>>16,a=Math.imul(a,2246822507),a=a^a>>>13,a=Math.imul(a,3266489909),a=a^a>>>16,a}e.finish=o;function s(a,u=0){let c=r(u),h=0;for(let f of a)c=i(c,f),h++;return c=o(c,h),c}e.hashCode=s;function l(a){let u=a.length;if(u===0)return 0;let c=0;for(let h=0;h>>0)-c+f,c|=0}return c}}(n.MurmurHash||(n.MurmurHash={}))})(Je);var nr={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Yv=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(nr,"__esModule",{value:!0});nr.ObjectEqualityComparator=void 0;const Jv=J;class Nl{hashCode(e){return e==null?0:e.hashCode()}equals(e,t){return e==null?t==null:e.equals(t)}}Nl.INSTANCE=new Nl;Yv([Jv.Override],Nl.prototype,"hashCode",null);Yv([Jv.Override],Nl.prototype,"equals",null);nr.ObjectEqualityComparator=Nl;/*! + */var nb=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(nr,"__esModule",{value:!0});nr.ObjectEqualityComparator=void 0;const ib=X;class Rl{hashCode(e){return e==null?0:e.hashCode()}equals(e,t){return e==null?t==null:e.equals(t)}}Rl.INSTANCE=new Rl;nb([ib.Override],Rl.prototype,"hashCode",null);nb([ib.Override],Rl.prototype,"equals",null);nr.ObjectEqualityComparator=Rl;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Qv=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(gc,"__esModule",{value:!0});gc.DefaultEqualityComparator=void 0;const Zv=J,yN=Je,ig=nr;class Dl{hashCode(e){return e==null?0:typeof e=="string"||typeof e=="number"?yN.MurmurHash.hashCode([e]):ig.ObjectEqualityComparator.INSTANCE.hashCode(e)}equals(e,t){return e==null?t==null:typeof e=="string"||typeof e=="number"?e===t:ig.ObjectEqualityComparator.INSTANCE.equals(e,t)}}Dl.INSTANCE=new Dl;Qv([Zv.Override],Dl.prototype,"hashCode",null);Qv([Zv.Override],Dl.prototype,"equals",null);gc.DefaultEqualityComparator=Dl;/*! + */var ob=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(bc,"__esModule",{value:!0});bc.DefaultEqualityComparator=void 0;const sb=X,RN=Je,hg=nr;class Ll{hashCode(e){return e==null?0:typeof e=="string"||typeof e=="number"?RN.MurmurHash.hashCode([e]):hg.ObjectEqualityComparator.INSTANCE.hashCode(e)}equals(e,t){return e==null?t==null:typeof e=="string"||typeof e=="number"?e===t:hg.ObjectEqualityComparator.INSTANCE.equals(e,t)}}Ll.INSTANCE=new Ll;ob([sb.Override],Ll.prototype,"hashCode",null);ob([sb.Override],Ll.prototype,"equals",null);bc.DefaultEqualityComparator=Ll;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Lt=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},vN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(_r,"__esModule",{value:!0});_r.Array2DHashSet=void 0;const SN=jt(),bN=gc,kt=J,Qh=Je,Ua=16,Zh=.75;class rt{constructor(e,t=Ua){if(this.n=0,this.threshold=Math.floor(Ua*Zh),e instanceof rt){this.comparator=e.comparator,this.buckets=e.buckets.slice(0);for(let r=0;rthis.threshold&&this.expand(),this.getOrAddImpl(e)}getOrAddImpl(e){let t=this.getBucket(e),r=this.buckets[t];if(!r)return r=[e],this.buckets[t]=r,this.n++,e;for(let i of r)if(this.comparator.equals(i,e))return i;return r.push(e),this.n++,e}get(e){if(e==null)return e;let t=this.getBucket(e),r=this.buckets[t];if(r){for(let i of r)if(this.comparator.equals(i,e))return i}}getBucket(e){return this.comparator.hashCode(e)&this.buckets.length-1}hashCode(){let e=Qh.MurmurHash.initialize();for(let t of this.buckets)if(t!=null)for(let r of t){if(r==null)break;e=Qh.MurmurHash.update(e,this.comparator.hashCode(r))}return e=Qh.MurmurHash.finish(e,this.size),e}equals(e){return e===this?!0:!(e instanceof rt)||e.size!==this.size?!1:this.containsAll(e)}expand(){let e=this.buckets,t=this.buckets.length*2,r=this.createBuckets(t);this.buckets=r,this.threshold=Math.floor(t*Zh);let i=this.size;for(let o of e)if(o)for(let s of o){let l=this.getBucket(s),a=this.buckets[l];a||(a=[],this.buckets[l]=a),a.push(s)}SN(this.n===i)}add(e){return this.getOrAdd(e)===e}get size(){return this.n}get isEmpty(){return this.n===0}contains(e){return this.containsFast(this.asElementType(e))}containsFast(e){return e==null?!1:this.get(e)!=null}*[Symbol.iterator](){yield*this.toArray()}toArray(){const e=new Array(this.size);let t=0;for(let r of this.buckets)if(r!=null)for(let i of r){if(i==null)break;e[t++]=i}return e}containsAll(e){if(e instanceof rt){let t=e;for(let r of t.buckets)if(r!=null)for(let i of r){if(i==null)break;if(!this.containsFast(this.asElementType(i)))return!1}}else for(let t of e)if(!this.containsFast(this.asElementType(t)))return!1;return!0}addAll(e){let t=!1;for(let r of e)this.getOrAdd(r)!==r&&(t=!0);return t}clear(){this.buckets=this.createBuckets(Ua),this.n=0,this.threshold=Math.floor(Ua*Zh)}toString(){if(this.size===0)return"{}";let e="{",t=!0;for(let r of this.buckets)if(r!=null)for(let i of r){if(i==null)break;t?t=!1:e+=", ",e+=i.toString()}return e+="}",e}toTableString(){let e="";for(let t of this.buckets){if(t==null){e+=`null + */var Rt=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},LN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(_r,"__esModule",{value:!0});_r.Array2DHashSet=void 0;const kN=Bt(),IN=bc,Lt=X,sf=Je,Xa=16,lf=.75;class rt{constructor(e,t=Xa){if(this.n=0,this.threshold=Math.floor(Xa*lf),e instanceof rt){this.comparator=e.comparator,this.buckets=e.buckets.slice(0);for(let r=0;rthis.threshold&&this.expand(),this.getOrAddImpl(e)}getOrAddImpl(e){let t=this.getBucket(e),r=this.buckets[t];if(!r)return r=[e],this.buckets[t]=r,this.n++,e;for(let i of r)if(this.comparator.equals(i,e))return i;return r.push(e),this.n++,e}get(e){if(e==null)return e;let t=this.getBucket(e),r=this.buckets[t];if(r){for(let i of r)if(this.comparator.equals(i,e))return i}}getBucket(e){return this.comparator.hashCode(e)&this.buckets.length-1}hashCode(){let e=sf.MurmurHash.initialize();for(let t of this.buckets)if(t!=null)for(let r of t){if(r==null)break;e=sf.MurmurHash.update(e,this.comparator.hashCode(r))}return e=sf.MurmurHash.finish(e,this.size),e}equals(e){return e===this?!0:!(e instanceof rt)||e.size!==this.size?!1:this.containsAll(e)}expand(){let e=this.buckets,t=this.buckets.length*2,r=this.createBuckets(t);this.buckets=r,this.threshold=Math.floor(t*lf);let i=this.size;for(let o of e)if(o)for(let s of o){let l=this.getBucket(s),a=this.buckets[l];a||(a=[],this.buckets[l]=a),a.push(s)}kN(this.n===i)}add(e){return this.getOrAdd(e)===e}get size(){return this.n}get isEmpty(){return this.n===0}contains(e){return this.containsFast(this.asElementType(e))}containsFast(e){return e==null?!1:this.get(e)!=null}*[Symbol.iterator](){yield*this.toArray()}toArray(){const e=new Array(this.size);let t=0;for(let r of this.buckets)if(r!=null)for(let i of r){if(i==null)break;e[t++]=i}return e}containsAll(e){if(e instanceof rt){let t=e;for(let r of t.buckets)if(r!=null)for(let i of r){if(i==null)break;if(!this.containsFast(this.asElementType(i)))return!1}}else for(let t of e)if(!this.containsFast(this.asElementType(t)))return!1;return!0}addAll(e){let t=!1;for(let r of e)this.getOrAdd(r)!==r&&(t=!0);return t}clear(){this.buckets=this.createBuckets(Xa),this.n=0,this.threshold=Math.floor(Xa*lf)}toString(){if(this.size===0)return"{}";let e="{",t=!0;for(let r of this.buckets)if(r!=null)for(let i of r){if(i==null)break;t?t=!1:e+=", ",e+=i.toString()}return e+="}",e}toTableString(){let e="";for(let t of this.buckets){if(t==null){e+=`null `;continue}e+="[";let r=!0;for(let i of t)r?r=!1:e+=" ",i==null?e+="_":e+=i.toString();e+=`] -`}return e}asElementType(e){return e}createBuckets(e){return new Array(e)}}Lt([kt.NotNull],rt.prototype,"comparator",void 0);Lt([kt.Override],rt.prototype,"hashCode",null);Lt([kt.Override],rt.prototype,"equals",null);Lt([kt.Override],rt.prototype,"add",null);Lt([kt.Override],rt.prototype,"size",null);Lt([kt.Override],rt.prototype,"isEmpty",null);Lt([kt.Override],rt.prototype,"contains",null);Lt([vN(0,kt.Nullable)],rt.prototype,"containsFast",null);Lt([kt.Override],rt.prototype,Symbol.iterator,null);Lt([kt.Override],rt.prototype,"toArray",null);Lt([kt.Override],rt.prototype,"containsAll",null);Lt([kt.Override],rt.prototype,"addAll",null);Lt([kt.Override],rt.prototype,"clear",null);Lt([kt.Override],rt.prototype,"toString",null);Lt([kt.SuppressWarnings("unchecked")],rt.prototype,"asElementType",null);Lt([kt.SuppressWarnings("unchecked")],rt.prototype,"createBuckets",null);_r.Array2DHashSet=rt;var Ii={};/*! +`}return e}asElementType(e){return e}createBuckets(e){return new Array(e)}}Rt([Lt.NotNull],rt.prototype,"comparator",void 0);Rt([Lt.Override],rt.prototype,"hashCode",null);Rt([Lt.Override],rt.prototype,"equals",null);Rt([Lt.Override],rt.prototype,"add",null);Rt([Lt.Override],rt.prototype,"size",null);Rt([Lt.Override],rt.prototype,"isEmpty",null);Rt([Lt.Override],rt.prototype,"contains",null);Rt([LN(0,Lt.Nullable)],rt.prototype,"containsFast",null);Rt([Lt.Override],rt.prototype,Symbol.iterator,null);Rt([Lt.Override],rt.prototype,"toArray",null);Rt([Lt.Override],rt.prototype,"containsAll",null);Rt([Lt.Override],rt.prototype,"addAll",null);Rt([Lt.Override],rt.prototype,"clear",null);Rt([Lt.Override],rt.prototype,"toString",null);Rt([Lt.SuppressWarnings("unchecked")],rt.prototype,"asElementType",null);Rt([Lt.SuppressWarnings("unchecked")],rt.prototype,"createBuckets",null);_r.Array2DHashSet=rt;var ji={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var eS=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.ArrayEqualityComparator=void 0;const tS=J,AN=Je,_N=nr;class Pl{hashCode(e){return e==null?0:AN.MurmurHash.hashCode(e,0)}equals(e,t){if(e==null)return t==null;if(t==null||e.length!==t.length)return!1;for(let r=0;r=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(ji,"__esModule",{value:!0});ji.ArrayEqualityComparator=void 0;const ab=X,MN=Je,FN=nr;class kl{hashCode(e){return e==null?0:MN.MurmurHash.hashCode(e,0)}equals(e,t){if(e==null)return t==null;if(t==null||e.length!==t.length)return!1;for(let r=0;r=0;x--)(g=f[x])&&(y=(m<3?g(y):m>3?g(d,p,y):g(d,p))||y);return m>3&&y&&Object.defineProperty(d,p,y),y},t=w&&w.__param||function(f,d){return function(p,v){d(p,v,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SemanticContext=void 0;const r=_r,i=Ii,o=Je,s=J,l=nr,a=ut;function u(f){let d;for(let p of f){if(d===void 0){d=p;continue}d.compareTo(p)<0&&(d=p)}return d}function c(f){let d;for(let p of f){if(d===void 0){d=p;continue}d.compareTo(p)>0&&(d=p)}return d}class h{static get NONE(){return h._NONE===void 0&&(h._NONE=new h.Predicate),h._NONE}evalPrecedence(d,p){return this}static and(d,p){if(!d||d===h.NONE)return p;if(p===h.NONE)return d;let v=new h.AND(d,p);return v.opnds.length===1?v.opnds[0]:v}static or(d,p){if(!d)return p;if(d===h.NONE||p===h.NONE)return h.NONE;let v=new h.OR(d,p);return v.opnds.length===1?v.opnds[0]:v}}n.SemanticContext=h,function(f){function v(_){let b=[];for(let C=0;C<_.length;C++){let O=_[C];O instanceof f.PrecedencePredicate&&(b.push(O),_.splice(C,1),C--)}return b}class m extends f{constructor(b=-1,C=-1,O=!1){super(),this.ruleIndex=b,this.predIndex=C,this.isCtxDependent=O}eval(b,C){let O=this.isCtxDependent?C:void 0;return b.sempred(O,this.ruleIndex,this.predIndex)}hashCode(){let b=o.MurmurHash.initialize();return b=o.MurmurHash.update(b,this.ruleIndex),b=o.MurmurHash.update(b,this.predIndex),b=o.MurmurHash.update(b,this.isCtxDependent?1:0),b=o.MurmurHash.finish(b,3),b}equals(b){return b instanceof m?this===b?!0:this.ruleIndex===b.ruleIndex&&this.predIndex===b.predIndex&&this.isCtxDependent===b.isCtxDependent:!1}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}e([s.Override],m.prototype,"eval",null),e([s.Override],m.prototype,"hashCode",null),e([s.Override],m.prototype,"equals",null),e([s.Override],m.prototype,"toString",null),f.Predicate=m;class y extends f{constructor(b){super(),this.precedence=b}eval(b,C){return b.precpred(C,this.precedence)}evalPrecedence(b,C){if(b.precpred(C,this.precedence))return f.NONE}compareTo(b){return this.precedence-b.precedence}hashCode(){let b=1;return b=31*b+this.precedence,b}equals(b){return b instanceof y?this===b?!0:this.precedence===b.precedence:!1}toString(){return"{"+this.precedence+">=prec}?"}}e([s.Override],y.prototype,"eval",null),e([s.Override],y.prototype,"evalPrecedence",null),e([s.Override],y.prototype,"compareTo",null),e([s.Override],y.prototype,"hashCode",null),e([s.Override],y.prototype,"equals",null),e([s.Override],y.prototype,"toString",null),f.PrecedencePredicate=y;class g extends f{}f.Operator=g;let x=class pu extends g{constructor(b,C){super();let O=new r.Array2DHashSet(l.ObjectEqualityComparator.INSTANCE);b instanceof pu?O.addAll(b.opnds):O.add(b),C instanceof pu?O.addAll(C.opnds):O.add(C),this.opnds=O.toArray();let D=v(this.opnds),M=c(D);M&&this.opnds.push(M)}get operands(){return this.opnds}equals(b){return this===b?!0:b instanceof pu?i.ArrayEqualityComparator.INSTANCE.equals(this.opnds,b.opnds):!1}hashCode(){return o.MurmurHash.hashCode(this.opnds,40363613)}eval(b,C){for(let O of this.opnds)if(!O.eval(b,C))return!1;return!0}evalPrecedence(b,C){let O=!1,D=[];for(let j of this.opnds){let k=j.evalPrecedence(b,C);if(O=O||k!==j,k==null)return;k!==f.NONE&&D.push(k)}if(!O)return this;if(D.length===0)return f.NONE;let M=D[0];for(let j=1;j=0;x--)(g=f[x])&&(y=(m<3?g(y):m>3?g(d,p,y):g(d,p))||y);return m>3&&y&&Object.defineProperty(d,p,y),y},t=w&&w.__param||function(f,d){return function(p,v){d(p,v,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SemanticContext=void 0;const r=_r,i=ji,o=Je,s=X,l=nr,a=ut;function u(f){let d;for(let p of f){if(d===void 0){d=p;continue}d.compareTo(p)<0&&(d=p)}return d}function c(f){let d;for(let p of f){if(d===void 0){d=p;continue}d.compareTo(p)>0&&(d=p)}return d}class h{static get NONE(){return h._NONE===void 0&&(h._NONE=new h.Predicate),h._NONE}evalPrecedence(d,p){return this}static and(d,p){if(!d||d===h.NONE)return p;if(p===h.NONE)return d;let v=new h.AND(d,p);return v.opnds.length===1?v.opnds[0]:v}static or(d,p){if(!d)return p;if(d===h.NONE||p===h.NONE)return h.NONE;let v=new h.OR(d,p);return v.opnds.length===1?v.opnds[0]:v}}n.SemanticContext=h,function(f){function v(_){let S=[];for(let C=0;C<_.length;C++){let O=_[C];O instanceof f.PrecedencePredicate&&(S.push(O),_.splice(C,1),C--)}return S}class m extends f{constructor(S=-1,C=-1,O=!1){super(),this.ruleIndex=S,this.predIndex=C,this.isCtxDependent=O}eval(S,C){let O=this.isCtxDependent?C:void 0;return S.sempred(O,this.ruleIndex,this.predIndex)}hashCode(){let S=o.MurmurHash.initialize();return S=o.MurmurHash.update(S,this.ruleIndex),S=o.MurmurHash.update(S,this.predIndex),S=o.MurmurHash.update(S,this.isCtxDependent?1:0),S=o.MurmurHash.finish(S,3),S}equals(S){return S instanceof m?this===S?!0:this.ruleIndex===S.ruleIndex&&this.predIndex===S.predIndex&&this.isCtxDependent===S.isCtxDependent:!1}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}e([s.Override],m.prototype,"eval",null),e([s.Override],m.prototype,"hashCode",null),e([s.Override],m.prototype,"equals",null),e([s.Override],m.prototype,"toString",null),f.Predicate=m;class y extends f{constructor(S){super(),this.precedence=S}eval(S,C){return S.precpred(C,this.precedence)}evalPrecedence(S,C){if(S.precpred(C,this.precedence))return f.NONE}compareTo(S){return this.precedence-S.precedence}hashCode(){let S=1;return S=31*S+this.precedence,S}equals(S){return S instanceof y?this===S?!0:this.precedence===S.precedence:!1}toString(){return"{"+this.precedence+">=prec}?"}}e([s.Override],y.prototype,"eval",null),e([s.Override],y.prototype,"evalPrecedence",null),e([s.Override],y.prototype,"compareTo",null),e([s.Override],y.prototype,"hashCode",null),e([s.Override],y.prototype,"equals",null),e([s.Override],y.prototype,"toString",null),f.PrecedencePredicate=y;class g extends f{}f.Operator=g;let x=class yu extends g{constructor(S,C){super();let O=new r.Array2DHashSet(l.ObjectEqualityComparator.INSTANCE);S instanceof yu?O.addAll(S.opnds):O.add(S),C instanceof yu?O.addAll(C.opnds):O.add(C),this.opnds=O.toArray();let D=v(this.opnds),B=c(D);B&&this.opnds.push(B)}get operands(){return this.opnds}equals(S){return this===S?!0:S instanceof yu?i.ArrayEqualityComparator.INSTANCE.equals(this.opnds,S.opnds):!1}hashCode(){return o.MurmurHash.hashCode(this.opnds,40363613)}eval(S,C){for(let O of this.opnds)if(!O.eval(S,C))return!1;return!0}evalPrecedence(S,C){let O=!1,D=[];for(let $ of this.opnds){let I=$.evalPrecedence(S,C);if(O=O||I!==$,I==null)return;I!==f.NONE&&D.push(I)}if(!O)return this;if(D.length===0)return f.NONE;let B=D[0];for(let $=1;$=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},NN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ql,"__esModule",{value:!0});ql.PredicateTransition=void 0;const DN=Io,Ao=J,PN=ki;let yi=class extends DN.AbstractPredicateTransition{constructor(e,t,r,i){super(e),this.ruleIndex=t,this.predIndex=r,this.isCtxDependent=i}get serializationType(){return 4}get isEpsilon(){return!0}matches(e,t,r){return!1}get predicate(){return new PN.SemanticContext.Predicate(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}};Ul([Ao.Override],yi.prototype,"serializationType",null);Ul([Ao.Override],yi.prototype,"isEpsilon",null);Ul([Ao.Override],yi.prototype,"matches",null);Ul([Ao.Override,Ao.NotNull],yi.prototype,"toString",null);yi=Ul([NN(0,Ao.NotNull)],yi);ql.PredicateTransition=yi;/*! + */var Kl=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},qN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Wl,"__esModule",{value:!0});Wl.PredicateTransition=void 0;const UN=Bo,Eo=X,VN=Bi;let Ai=class extends UN.AbstractPredicateTransition{constructor(e,t,r,i){super(e),this.ruleIndex=t,this.predIndex=r,this.isCtxDependent=i}get serializationType(){return 4}get isEpsilon(){return!0}matches(e,t,r){return!1}get predicate(){return new VN.SemanticContext.Predicate(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}};Kl([Eo.Override],Ai.prototype,"serializationType",null);Kl([Eo.Override],Ai.prototype,"isEpsilon",null);Kl([Eo.Override],Ai.prototype,"matches",null);Kl([Eo.Override,Eo.NotNull],Ai.prototype,"toString",null);Ai=Kl([qN(0,Eo.NotNull)],Ai);Wl.PredicateTransition=Ai;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var rS=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},RN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ko,"__esModule",{value:!0});var nS=ko.FailedPredicateException=void 0;const LN=Gr,iS=J,kN=ql;let Vu=class oS extends LN.RecognitionException{constructor(e,t,r){super(e,e.inputStream,e.context,oS.formatMessage(t,r));let o=e.interpreter.atn.states[e.state].transition(0);o instanceof kN.PredicateTransition?(this._ruleIndex=o.ruleIndex,this._predicateIndex=o.predIndex):(this._ruleIndex=0,this._predicateIndex=0),this._predicate=t,super.setOffendingToken(e,e.currentToken)}get ruleIndex(){return this._ruleIndex}get predicateIndex(){return this._predicateIndex}get predicate(){return this._predicate}static formatMessage(e,t){return t||`failed predicate: {${e}}?`}};rS([iS.NotNull],Vu,"formatMessage",null);Vu=rS([RN(0,iS.NotNull)],Vu);nS=ko.FailedPredicateException=Vu;var Fi={};/*! + */var ub=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},WN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Fo,"__esModule",{value:!0});var cb=Fo.FailedPredicateException=void 0;const KN=Xr,hb=X,GN=Wl;let Xu=class fb extends KN.RecognitionException{constructor(e,t,r){super(e,e.inputStream,e.context,fb.formatMessage(t,r));let o=e.interpreter.atn.states[e.state].transition(0);o instanceof GN.PredicateTransition?(this._ruleIndex=o.ruleIndex,this._predicateIndex=o.predIndex):(this._ruleIndex=0,this._predicateIndex=0),this._predicate=t,super.setOffendingToken(e,e.currentToken)}get ruleIndex(){return this._ruleIndex}get predicateIndex(){return this._predicateIndex}get predicate(){return this._predicate}static formatMessage(e,t){return t||`failed predicate: {${e}}?`}};ub([hb.NotNull],Xu,"formatMessage",null);Xu=ub([WN(0,hb.NotNull)],Xu);cb=Fo.FailedPredicateException=Xu;var $i={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var IN=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},FN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.InputMismatchException=void 0;const MN=Gr,BN=J;let Td=class extends MN.RecognitionException{constructor(e,t,r){r===void 0&&(r=e.context),super(e,e.inputStream,r),t!==void 0&&this.setOffendingState(t),this.setOffendingToken(e,e.currentToken)}};Td=IN([FN(0,BN.NotNull)],Td);Fi.InputMismatchException=Td;var is={},Fo={},xc={};(function(n){/*! + */var XN=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},YN=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty($i,"__esModule",{value:!0});$i.InputMismatchException=void 0;const JN=Xr,QN=X;let Rd=class extends JN.RecognitionException{constructor(e,t,r){r===void 0&&(r=e.context),super(e,e.inputStream,r),t!==void 0&&this.setOffendingState(t),this.setOffendingToken(e,e.currentToken)}};Rd=XN([YN(0,QN.NotNull)],Rd);$i.InputMismatchException=Rd;var ss={},jo={},Sc={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(n,"__esModule",{value:!0}),n.Arrays=void 0,function(e){function t(o,s,l,a){return r(o,l!==void 0?l:0,a!==void 0?a:o.length,s)}e.binarySearch=t;function r(o,s,l,a){let u=s,c=l-1;for(;u<=c;){let h=u+c>>>1,f=o[h];if(fa)c=h-1;else return h}return-(u+1)}function i(o){let s="[",l=!0;for(let a of o)l?l=!1:s+=", ",a===null?s+="null":a===void 0?s+="undefined":s+=a;return s+="]",s}e.toString=i}(n.Arrays||(n.Arrays={}))})(xc);/*! + */Object.defineProperty(n,"__esModule",{value:!0}),n.Arrays=void 0,function(e){function t(o,s,l,a){return r(o,l!==void 0?l:0,a!==void 0?a:o.length,s)}e.binarySearch=t;function r(o,s,l,a){let u=s,c=l-1;for(;u<=c;){let h=u+c>>>1,f=o[h];if(fa)c=h-1;else return h}return-(u+1)}function i(o){let s="[",l=!0;for(let a of o)l?l=!1:s+=", ",a===null?s+="null":a===void 0?s+="undefined":s+=a;return s+="]",s}e.toString=i}(n.Arrays||(n.Arrays={}))})(Sc);/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var yc=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.IntegerList=void 0;const jN=xc,vc=J,ef=new Int32Array(0),$N=4,tf=(1<<31>>>0)-1-8;class on{constructor(e){if(!e)this._data=ef,this._size=0;else if(e instanceof on)this._data=e._data.slice(0),this._size=e._size;else if(typeof e=="number")e===0?(this._data=ef,this._size=0):(this._data=new Int32Array(e),this._size=0);else{this._data=ef,this._size=0;for(let t of e)this.add(t)}}add(e){this._data.length===this._size&&this.ensureCapacity(this._size+1),this._data[this._size]=e,this._size++}addAll(e){if(Array.isArray(e))this.ensureCapacity(this._size+e.length),this._data.subarray(this._size,this._size+e.length).set(e),this._size+=e.length;else if(e instanceof on)this.ensureCapacity(this._size+e._size),this._data.subarray(this._size,this._size+e.size).set(e._data),this._size+=e._size;else{this.ensureCapacity(this._size+e.size);let t=0;for(let r of e)this._data[this._size+t]=r,t++;this._size+=e.size}}get(e){if(e<0||e>=this._size)throw RangeError();return this._data[e]}contains(e){for(let t=0;t=this._size)throw RangeError();let r=this._data[e];return this._data[e]=t,r}removeAt(e){let t=this.get(e);return this._data.copyWithin(e,e+1,this._size),this._data[this._size-1]=0,this._size--,t}removeRange(e,t){if(e<0||t<0||e>this._size||t>this._size||e>t)throw RangeError();this._data.copyWithin(t,e,this._size),this._data.fill(0,this._size-(t-e),this._size),this._size-=t-e}get isEmpty(){return this._size===0}get size(){return this._size}trimToSize(){this._data.length!==this._size&&(this._data=this._data.slice(0,this._size))}clear(){this._data.fill(0,0,this._size),this._size=0}toArray(){return this._size===0?[]:Array.from(this._data.subarray(0,this._size))}sort(){this._data.subarray(0,this._size).sort()}equals(e){if(e===this)return!0;if(!(e instanceof on)||this._size!==e._size)return!1;for(let t=0;tthis._size||r>this._size)throw new RangeError;if(t>r)throw new RangeError;return jN.Arrays.binarySearch(this._data,e,t,r)}ensureCapacity(e){if(e<0||e>tf)throw new RangeError;let t;for(this._data.length===0?t=$N:t=this._data.length;ttf)&&(t=tf);let r=new Int32Array(t);r.set(this._data),this._data=r}toCharArray(){let e=new Uint16Array(this._size),t=0,r=!1;for(let i=0;i=0&&o<65536){e[t]=o,t++;continue}if(!r){let l=new Uint16Array(this.charArraySize());l.set(e,0),e=l,r=!0}let s=String.fromCodePoint(o);e[t]=s.charCodeAt(0),e[t+1]=s.charCodeAt(1),t+=2}return e}charArraySize(){let e=0;for(let t=0;t=65536?2:1;return e}}yc([vc.NotNull],on.prototype,"_data",void 0);yc([vc.Override],on.prototype,"equals",null);yc([vc.Override],on.prototype,"hashCode",null);yc([vc.Override],on.prototype,"toString",null);Fo.IntegerList=on;var Ct={};/*! + */var Ac=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(jo,"__esModule",{value:!0});jo.IntegerList=void 0;const ZN=Sc,_c=X,af=new Int32Array(0),e3=4,uf=(1<<31>>>0)-1-8;class sn{constructor(e){if(!e)this._data=af,this._size=0;else if(e instanceof sn)this._data=e._data.slice(0),this._size=e._size;else if(typeof e=="number")e===0?(this._data=af,this._size=0):(this._data=new Int32Array(e),this._size=0);else{this._data=af,this._size=0;for(let t of e)this.add(t)}}add(e){this._data.length===this._size&&this.ensureCapacity(this._size+1),this._data[this._size]=e,this._size++}addAll(e){if(Array.isArray(e))this.ensureCapacity(this._size+e.length),this._data.subarray(this._size,this._size+e.length).set(e),this._size+=e.length;else if(e instanceof sn)this.ensureCapacity(this._size+e._size),this._data.subarray(this._size,this._size+e.size).set(e._data),this._size+=e._size;else{this.ensureCapacity(this._size+e.size);let t=0;for(let r of e)this._data[this._size+t]=r,t++;this._size+=e.size}}get(e){if(e<0||e>=this._size)throw RangeError();return this._data[e]}contains(e){for(let t=0;t=this._size)throw RangeError();let r=this._data[e];return this._data[e]=t,r}removeAt(e){let t=this.get(e);return this._data.copyWithin(e,e+1,this._size),this._data[this._size-1]=0,this._size--,t}removeRange(e,t){if(e<0||t<0||e>this._size||t>this._size||e>t)throw RangeError();this._data.copyWithin(t,e,this._size),this._data.fill(0,this._size-(t-e),this._size),this._size-=t-e}get isEmpty(){return this._size===0}get size(){return this._size}trimToSize(){this._data.length!==this._size&&(this._data=this._data.slice(0,this._size))}clear(){this._data.fill(0,0,this._size),this._size=0}toArray(){return this._size===0?[]:Array.from(this._data.subarray(0,this._size))}sort(){this._data.subarray(0,this._size).sort()}equals(e){if(e===this)return!0;if(!(e instanceof sn)||this._size!==e._size)return!1;for(let t=0;tthis._size||r>this._size)throw new RangeError;if(t>r)throw new RangeError;return ZN.Arrays.binarySearch(this._data,e,t,r)}ensureCapacity(e){if(e<0||e>uf)throw new RangeError;let t;for(this._data.length===0?t=e3:t=this._data.length;tuf)&&(t=uf);let r=new Int32Array(t);r.set(this._data),this._data=r}toCharArray(){let e=new Uint16Array(this._size),t=0,r=!1;for(let i=0;i=0&&o<65536){e[t]=o,t++;continue}if(!r){let l=new Uint16Array(this.charArraySize());l.set(e,0),e=l,r=!0}let s=String.fromCodePoint(o);e[t]=s.charCodeAt(0),e[t+1]=s.charCodeAt(1),t+=2}return e}charArraySize(){let e=0;for(let t=0;t=65536?2:1;return e}}Ac([_c.NotNull],sn.prototype,"_data",void 0);Ac([_c.Override],sn.prototype,"equals",null);Ac([_c.Override],sn.prototype,"hashCode",null);Ac([_c.Override],sn.prototype,"toString",null);jo.IntegerList=sn;var Ct={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Tp=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.Interval=void 0;const Ep=J,sS=1e3;class lt{constructor(e,t){this.a=e,this.b=t}static get INVALID(){return lt._INVALID}static of(e,t){return e!==t||e<0||e>sS?new lt(e,t):(lt.cache[e]==null&&(lt.cache[e]=new lt(e,e)),lt.cache[e])}get length(){return this.b=e.a}startsAfter(e){return this.a>e.a}startsAfterDisjoint(e){return this.a>e.b}startsAfterNonDisjoint(e){return this.a>e.a&&this.a<=e.b}disjoint(e){return this.startsBeforeDisjoint(e)||this.startsAfterDisjoint(e)}adjacent(e){return this.a===e.b+1||this.b===e.a-1}properlyContains(e){return e.a>=this.a&&e.b<=this.b}union(e){return lt.of(Math.min(this.a,e.a),Math.max(this.b,e.b))}intersection(e){return lt.of(Math.max(this.a,e.a),Math.min(this.b,e.b))}differenceNotProperlyContained(e){let t;return e.startsBeforeNonDisjoint(this)?t=lt.of(Math.max(this.a,e.b+1),this.b):e.startsAfterNonDisjoint(this)&&(t=lt.of(this.a,e.a-1)),t}toString(){return this.a+".."+this.b}}lt._INVALID=new lt(-1,-2);lt.cache=new Array(sS+1);Tp([Ep.Override],lt.prototype,"equals",null);Tp([Ep.Override],lt.prototype,"hashCode",null);Tp([Ep.Override],lt.prototype,"toString",null);Ct.Interval=lt;var os={},Sc={},Wn={},ze={};(function(n){/*! + */var Rp=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.Interval=void 0;const Lp=X,db=1e3;class lt{constructor(e,t){this.a=e,this.b=t}static get INVALID(){return lt._INVALID}static of(e,t){return e!==t||e<0||e>db?new lt(e,t):(lt.cache[e]==null&&(lt.cache[e]=new lt(e,e)),lt.cache[e])}get length(){return this.b=e.a}startsAfter(e){return this.a>e.a}startsAfterDisjoint(e){return this.a>e.b}startsAfterNonDisjoint(e){return this.a>e.a&&this.a<=e.b}disjoint(e){return this.startsBeforeDisjoint(e)||this.startsAfterDisjoint(e)}adjacent(e){return this.a===e.b+1||this.b===e.a-1}properlyContains(e){return e.a>=this.a&&e.b<=this.b}union(e){return lt.of(Math.min(this.a,e.a),Math.max(this.b,e.b))}intersection(e){return lt.of(Math.max(this.a,e.a),Math.min(this.b,e.b))}differenceNotProperlyContained(e){let t;return e.startsBeforeNonDisjoint(this)?t=lt.of(Math.max(this.a,e.b+1),this.b):e.startsAfterNonDisjoint(this)&&(t=lt.of(this.a,e.a-1)),t}toString(){return this.a+".."+this.b}}lt._INVALID=new lt(-1,-2);lt.cache=new Array(db+1);Rp([Lp.Override],lt.prototype,"equals",null);Rp([Lp.Override],lt.prototype,"hashCode",null);Rp([Lp.Override],lt.prototype,"toString",null);Ct.Interval=lt;var ls={},Tc={},Kn={},ze={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(n,"__esModule",{value:!0}),n.Token=void 0;const e=pn;(function(t){t.INVALID_TYPE=0,t.EPSILON=-2,t.MIN_USER_TOKEN_TYPE=1,t.EOF=e.IntStream.EOF,t.DEFAULT_CHANNEL=0,t.HIDDEN_CHANNEL=1,t.MIN_USER_CHANNEL_VALUE=2})(n.Token||(n.Token={}))})(ze);/*! + */Object.defineProperty(n,"__esModule",{value:!0}),n.Token=void 0;const e=gn;(function(t){t.INVALID_TYPE=0,t.EPSILON=-2,t.MIN_USER_TOKEN_TYPE=1,t.EOF=e.IntStream.EOF,t.DEFAULT_CHANNEL=0,t.HIDDEN_CHANNEL=1,t.MIN_USER_CHANNEL_VALUE=2})(n.Token||(n.Token={}))})(ze);/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Wt=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},lS=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.CommonToken=void 0;const HN=Ct,Kt=J,og=ze;let Tt=class il{constructor(e,t,r=il.EMPTY_SOURCE,i=og.Token.DEFAULT_CHANNEL,o=0,s=0){this._line=0,this._charPositionInLine=-1,this._channel=og.Token.DEFAULT_CHANNEL,this.index=-1,this._text=t,this._type=e,this.source=r,this._channel=i,this.start=o,this.stop=s,r.source!=null&&(this._line=r.source.line,this._charPositionInLine=r.source.charPositionInLine)}static fromToken(e){let t=new il(e.type,void 0,il.EMPTY_SOURCE,e.channel,e.startIndex,e.stopIndex);return t._line=e.line,t.index=e.tokenIndex,t._charPositionInLine=e.charPositionInLine,e instanceof il?(t._text=e._text,t.source=e.source):(t._text=e.text,t.source={source:e.tokenSource,stream:e.inputStream}),t}get type(){return this._type}set type(e){this._type=e}get line(){return this._line}set line(e){this._line=e}get text(){if(this._text!=null)return this._text;let e=this.inputStream;if(e==null)return;let t=e.size;return this.start"}set text(e){this._text=e}get charPositionInLine(){return this._charPositionInLine}set charPositionInLine(e){this._charPositionInLine=e}get channel(){return this._channel}set channel(e){this._channel=e}get startIndex(){return this.start}set startIndex(e){this.start=e}get stopIndex(){return this.stop}set stopIndex(e){this.stop=e}get tokenIndex(){return this.index}set tokenIndex(e){this.index=e}get tokenSource(){return this.source.source}get inputStream(){return this.source.stream}toString(e){let t="";this._channel>0&&(t=",channel="+this._channel);let r=this.text;r!=null?(r=r.replace(/\n/g,"\\n"),r=r.replace(/\r/g,"\\r"),r=r.replace(/\t/g,"\\t")):r="";let i=String(this._type);return e&&(i=e.vocabulary.getDisplayName(this._type)),"[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+r+"',<"+i+">"+t+","+this._line+":"+this.charPositionInLine+"]"}};Tt.EMPTY_SOURCE={source:void 0,stream:void 0};Wt([Kt.NotNull],Tt.prototype,"source",void 0);Wt([Kt.Override],Tt.prototype,"type",null);Wt([Kt.Override],Tt.prototype,"line",null);Wt([Kt.Override],Tt.prototype,"text",null);Wt([Kt.Override],Tt.prototype,"charPositionInLine",null);Wt([Kt.Override],Tt.prototype,"channel",null);Wt([Kt.Override],Tt.prototype,"startIndex",null);Wt([Kt.Override],Tt.prototype,"stopIndex",null);Wt([Kt.Override],Tt.prototype,"tokenIndex",null);Wt([Kt.Override],Tt.prototype,"tokenSource",null);Wt([Kt.Override],Tt.prototype,"inputStream",null);Wt([Kt.Override],Tt.prototype,"toString",null);Wt([lS(0,Kt.NotNull)],Tt,"fromToken",null);Tt=Wt([lS(2,Kt.NotNull)],Tt);Wn.CommonToken=Tt;(function(n){/*! + */var Vt=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},pb=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.CommonToken=void 0;const t3=Ct,Wt=X,fg=ze;let Tt=class ll{constructor(e,t,r=ll.EMPTY_SOURCE,i=fg.Token.DEFAULT_CHANNEL,o=0,s=0){this._line=0,this._charPositionInLine=-1,this._channel=fg.Token.DEFAULT_CHANNEL,this.index=-1,this._text=t,this._type=e,this.source=r,this._channel=i,this.start=o,this.stop=s,r.source!=null&&(this._line=r.source.line,this._charPositionInLine=r.source.charPositionInLine)}static fromToken(e){let t=new ll(e.type,void 0,ll.EMPTY_SOURCE,e.channel,e.startIndex,e.stopIndex);return t._line=e.line,t.index=e.tokenIndex,t._charPositionInLine=e.charPositionInLine,e instanceof ll?(t._text=e._text,t.source=e.source):(t._text=e.text,t.source={source:e.tokenSource,stream:e.inputStream}),t}get type(){return this._type}set type(e){this._type=e}get line(){return this._line}set line(e){this._line=e}get text(){if(this._text!=null)return this._text;let e=this.inputStream;if(e==null)return;let t=e.size;return this.start"}set text(e){this._text=e}get charPositionInLine(){return this._charPositionInLine}set charPositionInLine(e){this._charPositionInLine=e}get channel(){return this._channel}set channel(e){this._channel=e}get startIndex(){return this.start}set startIndex(e){this.start=e}get stopIndex(){return this.stop}set stopIndex(e){this.stop=e}get tokenIndex(){return this.index}set tokenIndex(e){this.index=e}get tokenSource(){return this.source.source}get inputStream(){return this.source.stream}toString(e){let t="";this._channel>0&&(t=",channel="+this._channel);let r=this.text;r!=null?(r=r.replace(/\n/g,"\\n"),r=r.replace(/\r/g,"\\r"),r=r.replace(/\t/g,"\\t")):r="";let i=String(this._type);return e&&(i=e.vocabulary.getDisplayName(this._type)),"[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+r+"',<"+i+">"+t+","+this._line+":"+this.charPositionInLine+"]"}};Tt.EMPTY_SOURCE={source:void 0,stream:void 0};Vt([Wt.NotNull],Tt.prototype,"source",void 0);Vt([Wt.Override],Tt.prototype,"type",null);Vt([Wt.Override],Tt.prototype,"line",null);Vt([Wt.Override],Tt.prototype,"text",null);Vt([Wt.Override],Tt.prototype,"charPositionInLine",null);Vt([Wt.Override],Tt.prototype,"channel",null);Vt([Wt.Override],Tt.prototype,"startIndex",null);Vt([Wt.Override],Tt.prototype,"stopIndex",null);Vt([Wt.Override],Tt.prototype,"tokenIndex",null);Vt([Wt.Override],Tt.prototype,"tokenSource",null);Vt([Wt.Override],Tt.prototype,"inputStream",null);Vt([Wt.Override],Tt.prototype,"toString",null);Vt([pb(0,Wt.NotNull)],Tt,"fromToken",null);Tt=Vt([pb(2,Wt.NotNull)],Tt);Kn.CommonToken=Tt;(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(n,"__esModule",{value:!0}),n.CommonTokenFactory=void 0;const t=Wn,r=Ct,i=J;class o{constructor(l=!1){this.copyText=l}create(l,a,u,c,h,f,d,p){let v=new t.CommonToken(a,u,l,c,h,f);return v.line=d,v.charPositionInLine=p,u==null&&this.copyText&&l.stream!=null&&(v.text=l.stream.getText(r.Interval.of(h,f))),v}createSimple(l,a){return new t.CommonToken(l,a)}}e([i.Override],o.prototype,"create",null),e([i.Override],o.prototype,"createSimple",null),n.CommonTokenFactory=o,function(s){s.DEFAULT=new s}(o=n.CommonTokenFactory||(n.CommonTokenFactory={}))})(Sc);var Vl={};/*! + */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(n,"__esModule",{value:!0}),n.CommonTokenFactory=void 0;const t=Kn,r=Ct,i=X;class o{constructor(l=!1){this.copyText=l}create(l,a,u,c,h,f,d,p){let v=new t.CommonToken(a,u,l,c,h,f);return v.line=d,v.charPositionInLine=p,u==null&&this.copyText&&l.stream!=null&&(v.text=l.stream.getText(r.Interval.of(h,f))),v}createSimple(l,a){return new t.CommonToken(l,a)}}e([i.Override],o.prototype,"create",null),e([i.Override],o.prototype,"createSimple",null),n.CommonTokenFactory=o,function(s){s.DEFAULT=new s}(o=n.CommonTokenFactory||(n.CommonTokenFactory={}))})(Tc);var Gl={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Vl,"__esModule",{value:!0});Vl.IntegerStack=void 0;const zN=Fo;class qN extends zN.IntegerList{constructor(e){super(e)}push(e){this.add(e)}pop(){return this.removeAt(this.size-1)}peek(){return this.get(this.size-1)}}Vl.IntegerStack=qN;var rf={},Wl={};/*! + */Object.defineProperty(Gl,"__esModule",{value:!0});Gl.IntegerStack=void 0;const r3=jo;class n3 extends r3.IntegerList{constructor(e){super(e)}push(e){this.add(e)}pop(){return this.removeAt(this.size-1)}peek(){return this.get(this.size-1)}}Gl.IntegerStack=n3;var cf={},Xl={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Wl,"__esModule",{value:!0});Wl.AcceptStateInfo=void 0;class UN{constructor(e,t){this._prediction=e,this._lexerActionExecutor=t}get prediction(){return this._prediction}get lexerActionExecutor(){return this._lexerActionExecutor}}Wl.AcceptStateInfo=UN;var nf={},mn={};/*! + */Object.defineProperty(Xl,"__esModule",{value:!0});Xl.AcceptStateInfo=void 0;class i3{constructor(e,t){this._prediction=e,this._lexerActionExecutor=t}get prediction(){return this._prediction}get lexerActionExecutor(){return this._lexerActionExecutor}}Xl.AcceptStateInfo=i3;var hf={},xn={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(mn,"__esModule",{value:!0});mn.Array2DHashMap=void 0;const sg=_r;class VN{constructor(e){this.keyComparator=e}hashCode(e){return this.keyComparator.hashCode(e.key)}equals(e,t){return this.keyComparator.equals(e.key,t.key)}}class Wu{constructor(e){e instanceof Wu?this.backingStore=new sg.Array2DHashSet(e.backingStore):this.backingStore=new sg.Array2DHashSet(new VN(e))}clear(){this.backingStore.clear()}containsKey(e){return this.backingStore.contains({key:e})}get(e){let t=this.backingStore.get({key:e});if(t)return t.value}get isEmpty(){return this.backingStore.isEmpty}put(e,t){let r=this.backingStore.get({key:e,value:t}),i;return r?(i=r.value,r.value=t):this.backingStore.add({key:e,value:t}),i}putIfAbsent(e,t){let r=this.backingStore.get({key:e,value:t}),i;return r?i=r.value:this.backingStore.add({key:e,value:t}),i}get size(){return this.backingStore.size}hashCode(){return this.backingStore.hashCode()}equals(e){return e instanceof Wu?this.backingStore.equals(e.backingStore):!1}}mn.Array2DHashMap=Wu;var ss={},ls={},Mi={},Xr={};/*! + */Object.defineProperty(xn,"__esModule",{value:!0});xn.Array2DHashMap=void 0;const dg=_r;class o3{constructor(e){this.keyComparator=e}hashCode(e){return this.keyComparator.hashCode(e.key)}equals(e,t){return this.keyComparator.equals(e.key,t.key)}}class Yu{constructor(e){e instanceof Yu?this.backingStore=new dg.Array2DHashSet(e.backingStore):this.backingStore=new dg.Array2DHashSet(new o3(e))}clear(){this.backingStore.clear()}containsKey(e){return this.backingStore.contains({key:e})}get(e){let t=this.backingStore.get({key:e});if(t)return t.value}get isEmpty(){return this.backingStore.isEmpty}put(e,t){let r=this.backingStore.get({key:e,value:t}),i;return r?(i=r.value,r.value=t):this.backingStore.add({key:e,value:t}),i}putIfAbsent(e,t){let r=this.backingStore.get({key:e,value:t}),i;return r?i=r.value:this.backingStore.add({key:e,value:t}),i}get size(){return this.backingStore.size}hashCode(){return this.backingStore.hashCode()}equals(e){return e instanceof Yu?this.backingStore.equals(e.backingStore):!1}}xn.Array2DHashMap=Yu;var as={},us={},Hi={},Yr={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Xr,"__esModule",{value:!0});Xr.DecisionState=void 0;const WN=Kr;class KN extends WN.ATNState{constructor(){super(...arguments),this.decision=-1,this.nonGreedy=!1,this.sll=!1}}Xr.DecisionState=KN;var of={},sf={},lg;function Cp(){return lg||(lg=1,function(n){/*! + */Object.defineProperty(Yr,"__esModule",{value:!0});Yr.DecisionState=void 0;const s3=Gr;class l3 extends s3.ATNState{constructor(){super(...arguments),this.decision=-1,this.nonGreedy=!1,this.sll=!1}}Yr.DecisionState=l3;var ff={},df={},pg;function kp(){return pg||(pg=1,function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(a,u,c,h){var f=arguments.length,d=f<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(a,u,c,h);else for(var v=a.length-1;v>=0;v--)(p=a[v])&&(d=(f<3?p(d):f>3?p(u,c,d):p(u,c))||d);return f>3&&d&&Object.defineProperty(u,c,d),d};Object.defineProperty(n,"__esModule",{value:!0}),n.PredictionContextCache=void 0;const t=mn,r=J,i=nr,o=Tr(),s=jt();class l{constructor(u=!0){this.contexts=new t.Array2DHashMap(i.ObjectEqualityComparator.INSTANCE),this.childContexts=new t.Array2DHashMap(i.ObjectEqualityComparator.INSTANCE),this.joinContexts=new t.Array2DHashMap(i.ObjectEqualityComparator.INSTANCE),this.enableCache=u}getAsCached(u){if(!this.enableCache)return u;let c=this.contexts.get(u);return c||(c=u,this.contexts.put(u,u)),c}getChild(u,c){if(!this.enableCache)return u.getChild(c);let h=new l.PredictionContextAndInt(u,c),f=this.childContexts.get(h);return f||(f=u.getChild(c),f=this.getAsCached(f),this.childContexts.put(h,f)),f}join(u,c){if(!this.enableCache)return o.PredictionContext.join(u,c,this);let h=new l.IdentityCommutativePredictionContextOperands(u,c),f=this.joinContexts.get(h);return f||(f=o.PredictionContext.join(u,c,this),f=this.getAsCached(f),this.joinContexts.put(h,f),f)}}n.PredictionContextCache=l,l.UNCACHED=new l(!1),function(a){class u{constructor(f,d){this.obj=f,this.value=d}equals(f){if(f instanceof u){if(f===this)return!0}else return!1;let d=f;return this.value===d.value&&(this.obj===d.obj||this.obj!=null&&this.obj.equals(d.obj))}hashCode(){let f=5;return f=7*f+(this.obj!=null?this.obj.hashCode():0),f=7*f+this.value,f}}e([r.Override],u.prototype,"equals",null),e([r.Override],u.prototype,"hashCode",null),a.PredictionContextAndInt=u;class c{constructor(f,d){s(f!=null),s(d!=null),this._x=f,this._y=d}get x(){return this._x}get y(){return this._y}equals(f){if(f instanceof c){if(this===f)return!0}else return!1;let d=f;return this._x===d._x&&this._y===d._y||this._x===d._y&&this._y===d._x}hashCode(){return this._x.hashCode()^this._y.hashCode()}}e([r.Override],c.prototype,"equals",null),e([r.Override],c.prototype,"hashCode",null),a.IdentityCommutativePredictionContextOperands=c}(l=n.PredictionContextCache||(n.PredictionContextCache={}))}(sf)),sf}var ag;function Tr(){return ag||(ag=1,function(n){/*! + */var e=w&&w.__decorate||function(a,u,c,h){var f=arguments.length,d=f<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(a,u,c,h);else for(var v=a.length-1;v>=0;v--)(p=a[v])&&(d=(f<3?p(d):f>3?p(u,c,d):p(u,c))||d);return f>3&&d&&Object.defineProperty(u,c,d),d};Object.defineProperty(n,"__esModule",{value:!0}),n.PredictionContextCache=void 0;const t=xn,r=X,i=nr,o=Tr(),s=Bt();class l{constructor(u=!0){this.contexts=new t.Array2DHashMap(i.ObjectEqualityComparator.INSTANCE),this.childContexts=new t.Array2DHashMap(i.ObjectEqualityComparator.INSTANCE),this.joinContexts=new t.Array2DHashMap(i.ObjectEqualityComparator.INSTANCE),this.enableCache=u}getAsCached(u){if(!this.enableCache)return u;let c=this.contexts.get(u);return c||(c=u,this.contexts.put(u,u)),c}getChild(u,c){if(!this.enableCache)return u.getChild(c);let h=new l.PredictionContextAndInt(u,c),f=this.childContexts.get(h);return f||(f=u.getChild(c),f=this.getAsCached(f),this.childContexts.put(h,f)),f}join(u,c){if(!this.enableCache)return o.PredictionContext.join(u,c,this);let h=new l.IdentityCommutativePredictionContextOperands(u,c),f=this.joinContexts.get(h);return f||(f=o.PredictionContext.join(u,c,this),f=this.getAsCached(f),this.joinContexts.put(h,f),f)}}n.PredictionContextCache=l,l.UNCACHED=new l(!1),function(a){class u{constructor(f,d){this.obj=f,this.value=d}equals(f){if(f instanceof u){if(f===this)return!0}else return!1;let d=f;return this.value===d.value&&(this.obj===d.obj||this.obj!=null&&this.obj.equals(d.obj))}hashCode(){let f=5;return f=7*f+(this.obj!=null?this.obj.hashCode():0),f=7*f+this.value,f}}e([r.Override],u.prototype,"equals",null),e([r.Override],u.prototype,"hashCode",null),a.PredictionContextAndInt=u;class c{constructor(f,d){s(f!=null),s(d!=null),this._x=f,this._y=d}get x(){return this._x}get y(){return this._y}equals(f){if(f instanceof c){if(this===f)return!0}else return!1;let d=f;return this._x===d._x&&this._y===d._y||this._x===d._y&&this._y===d._x}hashCode(){return this._x.hashCode()^this._y.hashCode()}}e([r.Override],c.prototype,"equals",null),e([r.Override],c.prototype,"hashCode",null),a.IdentityCommutativePredictionContextOperands=c}(l=n.PredictionContextCache||(n.PredictionContextCache={}))}(df)),df}var mg;function Tr(){return mg||(mg=1,function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(v,m,y,g){var x=arguments.length,S=x<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,y):g,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,m,y,g);else for(var b=v.length-1;b>=0;b--)(_=v[b])&&(S=(x<3?_(S):x>3?_(m,y,S):_(m,y))||S);return x>3&&S&&Object.defineProperty(m,y,S),S},t=w&&w.__param||function(v,m){return function(y,g){m(y,g,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SingletonPredictionContext=n.PredictionContext=void 0;const r=mn,i=_r,o=xc,s=Je,l=J,a=Cp(),u=jt(),c=1;class h{constructor(m){this.cachedHashCode=m}static calculateEmptyHashCode(){let m=s.MurmurHash.initialize(c);return m=s.MurmurHash.finish(m,0),m}static calculateSingleHashCode(m,y){let g=s.MurmurHash.initialize(c);return g=s.MurmurHash.update(g,m),g=s.MurmurHash.update(g,y),g=s.MurmurHash.finish(g,2),g}static calculateHashCode(m,y){let g=s.MurmurHash.initialize(c);for(let x of m)g=s.MurmurHash.update(g,x);for(let x of y)g=s.MurmurHash.update(g,x);return g=s.MurmurHash.finish(g,2*m.length),g}static fromRuleContext(m,y,g=!0){if(y.isEmpty)return g?h.EMPTY_FULL:h.EMPTY_LOCAL;let x;y._parent?x=h.fromRuleContext(m,y._parent,g):x=g?h.EMPTY_FULL:h.EMPTY_LOCAL;let _=m.states[y.invokingState].transition(0);return x.getChild(_.followState.stateNumber)}static addEmptyContext(m){return m.addEmptyContext()}static removeEmptyContext(m){return m.removeEmptyContext()}static join(m,y,g=a.PredictionContextCache.UNCACHED){if(m===y)return m;if(m.isEmpty)return h.isEmptyLocal(m)?m:h.addEmptyContext(y);if(y.isEmpty)return h.isEmptyLocal(y)?y:h.addEmptyContext(m);let x=m.size,S=y.size;if(x===1&&S===1&&m.getReturnState(0)===y.getReturnState(0)){let k=g.join(m.getParent(0),y.getParent(0));return k===m.getParent(0)?m:k===y.getParent(0)?y:k.getChild(m.getReturnState(0))}let _=0,b=new Array(x+S),C=new Array(b.length),O=0,D=0,M=!0,j=!0;for(;O0){let j=1;for(;1<>>0>>0)-1;if(M=S>>_&k,b=b&&M>=C.size-1,M>=C.size)continue e;_+=j}if(m){D.length>1&&(D+=" ");let k=m.atn.states[O],V=m.ruleNames[k.ruleIndex];D+=V}else C.getReturnState(M)!==h.EMPTY_FULL_STATE_KEY&&(C.isEmpty||(D.length>1&&(D+=" "),D+=C.getReturnState(M)));O=C.getReturnState(M),C=C.getParent(M)}if(D+="]",x.push(D),b)break}return x}}e([l.Override],h.prototype,"hashCode",null),e([t(0,l.NotNull),t(1,l.NotNull),t(2,l.NotNull)],h,"join",null),e([t(0,l.NotNull),t(1,l.NotNull),t(2,l.NotNull)],h,"getCachedContext",null),n.PredictionContext=h;class f extends h{constructor(m){super(h.calculateEmptyHashCode()),this.fullContext=m}get isFullContext(){return this.fullContext}addEmptyContext(){return this}removeEmptyContext(){throw new Error("Cannot remove the empty context from itself.")}getParent(m){throw new Error("index out of bounds")}getReturnState(m){throw new Error("index out of bounds")}findReturnState(m){return-1}get size(){return 0}appendSingleContext(m,y){return y.getChild(this,m)}appendContext(m,y){return m}get isEmpty(){return!0}get hasEmpty(){return!0}equals(m){return this===m}toStrings(m,y,g){return["[]"]}}e([l.Override],f.prototype,"addEmptyContext",null),e([l.Override],f.prototype,"removeEmptyContext",null),e([l.Override],f.prototype,"getParent",null),e([l.Override],f.prototype,"getReturnState",null),e([l.Override],f.prototype,"findReturnState",null),e([l.Override],f.prototype,"size",null),e([l.Override],f.prototype,"appendSingleContext",null),e([l.Override],f.prototype,"appendContext",null),e([l.Override],f.prototype,"isEmpty",null),e([l.Override],f.prototype,"hasEmpty",null),e([l.Override],f.prototype,"equals",null),e([l.Override],f.prototype,"toStrings",null);let d=class ti extends h{constructor(m,y,g){super(g||h.calculateHashCode(m,y)),u(m.length===y.length),u(y.length>1||y[0]!==h.EMPTY_FULL_STATE_KEY,"Should be using PredictionContext.EMPTY instead."),this.parents=m,this.returnStates=y}getParent(m){return this.parents[m]}getReturnState(m){return this.returnStates[m]}findReturnState(m){return o.Arrays.binarySearch(this.returnStates,m)}get size(){return this.returnStates.length}get isEmpty(){return!1}get hasEmpty(){return this.returnStates[this.returnStates.length-1]===h.EMPTY_FULL_STATE_KEY}addEmptyContext(){if(this.hasEmpty)return this;let m=this.parents.slice(0),y=this.returnStates.slice(0);return m.push(h.EMPTY_FULL),y.push(h.EMPTY_FULL_STATE_KEY),new ti(m,y)}removeEmptyContext(){if(!this.hasEmpty)return this;if(this.returnStates.length===2)return new p(this.parents[0],this.returnStates[0]);{let m=this.parents.slice(0,this.parents.length-1),y=this.returnStates.slice(0,this.returnStates.length-1);return new ti(m,y)}}appendContext(m,y){return ti.appendContextImpl(this,m,new h.IdentityHashMap)}static appendContextImpl(m,y,g){if(y.isEmpty){if(h.isEmptyLocal(y)){if(m.hasEmpty)return h.EMPTY_LOCAL;throw new Error("what to do here?")}return m}if(y.size!==1)throw new Error("Appending a tree suffix is not yet supported.");let x=g.get(m);if(!x){if(m.isEmpty)x=y;else{let S=m.size;m.hasEmpty&&S--;let _=new Array(S),b=new Array(S);for(let C=0;C1),x=new ti(_,b)),m.hasEmpty&&(x=h.join(x,y))}g.put(m,x)}return x}equals(m){if(this===m)return!0;if(!(m instanceof ti)||this.hashCode()!==m.hashCode())return!1;let y=m;return this.equalsImpl(y,new i.Array2DHashSet)}equalsImpl(m,y){let g=[],x=[];for(g.push(this),x.push(m);;){let S=g.pop(),_=x.pop();if(!S||!_)break;let b=new a.PredictionContextCache.IdentityCommutativePredictionContextOperands(S,_);if(!y.add(b))continue;let C=b.x.size;if(C===0){if(!b.x.equals(b.y))return!1;continue}let O=b.y.size;if(C!==O)return!1;for(let D=0;D>>0),v.EMPTY_FULL_STATE_KEY=(1<<31>>>0)-1;class m extends r.Array2DHashMap{constructor(){super(y.INSTANCE)}}v.IdentityHashMap=m;class y{IdentityEqualityComparator(){}hashCode(x){return x.hashCode()}equals(x,S){return x===S}}y.INSTANCE=new y,e([l.Override],y.prototype,"hashCode",null),e([l.Override],y.prototype,"equals",null),v.IdentityEqualityComparator=y}(h=n.PredictionContext||(n.PredictionContext={}))}(of)),of}/*! + */var e=w&&w.__decorate||function(v,m,y,g){var x=arguments.length,b=x<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,y):g,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,m,y,g);else for(var S=v.length-1;S>=0;S--)(_=v[S])&&(b=(x<3?_(b):x>3?_(m,y,b):_(m,y))||b);return x>3&&b&&Object.defineProperty(m,y,b),b},t=w&&w.__param||function(v,m){return function(y,g){m(y,g,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SingletonPredictionContext=n.PredictionContext=void 0;const r=xn,i=_r,o=Sc,s=Je,l=X,a=kp(),u=Bt(),c=1;class h{constructor(m){this.cachedHashCode=m}static calculateEmptyHashCode(){let m=s.MurmurHash.initialize(c);return m=s.MurmurHash.finish(m,0),m}static calculateSingleHashCode(m,y){let g=s.MurmurHash.initialize(c);return g=s.MurmurHash.update(g,m),g=s.MurmurHash.update(g,y),g=s.MurmurHash.finish(g,2),g}static calculateHashCode(m,y){let g=s.MurmurHash.initialize(c);for(let x of m)g=s.MurmurHash.update(g,x);for(let x of y)g=s.MurmurHash.update(g,x);return g=s.MurmurHash.finish(g,2*m.length),g}static fromRuleContext(m,y,g=!0){if(y.isEmpty)return g?h.EMPTY_FULL:h.EMPTY_LOCAL;let x;y._parent?x=h.fromRuleContext(m,y._parent,g):x=g?h.EMPTY_FULL:h.EMPTY_LOCAL;let _=m.states[y.invokingState].transition(0);return x.getChild(_.followState.stateNumber)}static addEmptyContext(m){return m.addEmptyContext()}static removeEmptyContext(m){return m.removeEmptyContext()}static join(m,y,g=a.PredictionContextCache.UNCACHED){if(m===y)return m;if(m.isEmpty)return h.isEmptyLocal(m)?m:h.addEmptyContext(y);if(y.isEmpty)return h.isEmptyLocal(y)?y:h.addEmptyContext(m);let x=m.size,b=y.size;if(x===1&&b===1&&m.getReturnState(0)===y.getReturnState(0)){let I=g.join(m.getParent(0),y.getParent(0));return I===m.getParent(0)?m:I===y.getParent(0)?y:I.getChild(m.getReturnState(0))}let _=0,S=new Array(x+b),C=new Array(S.length),O=0,D=0,B=!0,$=!0;for(;O0){let $=1;for(;1<<$>>>0>>0)-1;if(B=b>>_&I,S=S&&B>=C.size-1,B>=C.size)continue e;_+=$}if(m){D.length>1&&(D+=" ");let I=m.atn.states[O],V=m.ruleNames[I.ruleIndex];D+=V}else C.getReturnState(B)!==h.EMPTY_FULL_STATE_KEY&&(C.isEmpty||(D.length>1&&(D+=" "),D+=C.getReturnState(B)));O=C.getReturnState(B),C=C.getParent(B)}if(D+="]",x.push(D),S)break}return x}}e([l.Override],h.prototype,"hashCode",null),e([t(0,l.NotNull),t(1,l.NotNull),t(2,l.NotNull)],h,"join",null),e([t(0,l.NotNull),t(1,l.NotNull),t(2,l.NotNull)],h,"getCachedContext",null),n.PredictionContext=h;class f extends h{constructor(m){super(h.calculateEmptyHashCode()),this.fullContext=m}get isFullContext(){return this.fullContext}addEmptyContext(){return this}removeEmptyContext(){throw new Error("Cannot remove the empty context from itself.")}getParent(m){throw new Error("index out of bounds")}getReturnState(m){throw new Error("index out of bounds")}findReturnState(m){return-1}get size(){return 0}appendSingleContext(m,y){return y.getChild(this,m)}appendContext(m,y){return m}get isEmpty(){return!0}get hasEmpty(){return!0}equals(m){return this===m}toStrings(m,y,g){return["[]"]}}e([l.Override],f.prototype,"addEmptyContext",null),e([l.Override],f.prototype,"removeEmptyContext",null),e([l.Override],f.prototype,"getParent",null),e([l.Override],f.prototype,"getReturnState",null),e([l.Override],f.prototype,"findReturnState",null),e([l.Override],f.prototype,"size",null),e([l.Override],f.prototype,"appendSingleContext",null),e([l.Override],f.prototype,"appendContext",null),e([l.Override],f.prototype,"isEmpty",null),e([l.Override],f.prototype,"hasEmpty",null),e([l.Override],f.prototype,"equals",null),e([l.Override],f.prototype,"toStrings",null);let d=class oi extends h{constructor(m,y,g){super(g||h.calculateHashCode(m,y)),u(m.length===y.length),u(y.length>1||y[0]!==h.EMPTY_FULL_STATE_KEY,"Should be using PredictionContext.EMPTY instead."),this.parents=m,this.returnStates=y}getParent(m){return this.parents[m]}getReturnState(m){return this.returnStates[m]}findReturnState(m){return o.Arrays.binarySearch(this.returnStates,m)}get size(){return this.returnStates.length}get isEmpty(){return!1}get hasEmpty(){return this.returnStates[this.returnStates.length-1]===h.EMPTY_FULL_STATE_KEY}addEmptyContext(){if(this.hasEmpty)return this;let m=this.parents.slice(0),y=this.returnStates.slice(0);return m.push(h.EMPTY_FULL),y.push(h.EMPTY_FULL_STATE_KEY),new oi(m,y)}removeEmptyContext(){if(!this.hasEmpty)return this;if(this.returnStates.length===2)return new p(this.parents[0],this.returnStates[0]);{let m=this.parents.slice(0,this.parents.length-1),y=this.returnStates.slice(0,this.returnStates.length-1);return new oi(m,y)}}appendContext(m,y){return oi.appendContextImpl(this,m,new h.IdentityHashMap)}static appendContextImpl(m,y,g){if(y.isEmpty){if(h.isEmptyLocal(y)){if(m.hasEmpty)return h.EMPTY_LOCAL;throw new Error("what to do here?")}return m}if(y.size!==1)throw new Error("Appending a tree suffix is not yet supported.");let x=g.get(m);if(!x){if(m.isEmpty)x=y;else{let b=m.size;m.hasEmpty&&b--;let _=new Array(b),S=new Array(b);for(let C=0;C1),x=new oi(_,S)),m.hasEmpty&&(x=h.join(x,y))}g.put(m,x)}return x}equals(m){if(this===m)return!0;if(!(m instanceof oi)||this.hashCode()!==m.hashCode())return!1;let y=m;return this.equalsImpl(y,new i.Array2DHashSet)}equalsImpl(m,y){let g=[],x=[];for(g.push(this),x.push(m);;){let b=g.pop(),_=x.pop();if(!b||!_)break;let S=new a.PredictionContextCache.IdentityCommutativePredictionContextOperands(b,_);if(!y.add(S))continue;let C=S.x.size;if(C===0){if(!S.x.equals(S.y))return!1;continue}let O=S.y.size;if(C!==O)return!1;for(let D=0;D>>0),v.EMPTY_FULL_STATE_KEY=(1<<31>>>0)-1;class m extends r.Array2DHashMap{constructor(){super(y.INSTANCE)}}v.IdentityHashMap=m;class y{IdentityEqualityComparator(){}hashCode(x){return x.hashCode()}equals(x,b){return x===b}}y.INSTANCE=new y,e([l.Override],y.prototype,"hashCode",null),e([l.Override],y.prototype,"equals",null),v.IdentityEqualityComparator=y}(h=n.PredictionContext||(n.PredictionContext={}))}(ff)),ff}/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var st=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},tr=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.ATNConfig=void 0;const GN=mn,XN=Xr,tn=Je,Ve=J,YN=nr,ug=Tr(),ri=ki,cg=jt(),lf=2147483648;let $t=class ol{constructor(e,t,r){typeof t=="number"?(cg((t&16777215)===t),this._state=e,this.altAndOuterContextDepth=t,this._context=r):(this._state=e,this.altAndOuterContextDepth=t.altAndOuterContextDepth,this._context=r)}static create(e,t,r,i=ri.SemanticContext.NONE,o){return i!==ri.SemanticContext.NONE?o!=null?new To(o,i,e,t,r,!1):new vi(i,e,t,r):o!=null?new _o(o,e,t,r,!1):new ol(e,t,r)}get state(){return this._state}get alt(){return this.altAndOuterContextDepth&16777215}get context(){return this._context}set context(e){this._context=e}get reachesIntoOuterContext(){return this.outerContextDepth!==0}get outerContextDepth(){return this.altAndOuterContextDepth>>>24&127}set outerContextDepth(e){cg(e>=0),e=Math.min(e,127),this.altAndOuterContextDepth=e<<24|(this.altAndOuterContextDepth&-2130706433)>>>0}get lexerActionExecutor(){}get semanticContext(){return ri.SemanticContext.NONE}get hasPassedThroughNonGreedyDecision(){return!1}clone(){return this.transform(this.state,!1)}transform(e,t,r){return r==null?this.transformImpl(e,this._context,this.semanticContext,t,this.lexerActionExecutor):r instanceof ug.PredictionContext?this.transformImpl(e,r,this.semanticContext,t,this.lexerActionExecutor):r instanceof ri.SemanticContext?this.transformImpl(e,this._context,r,t,this.lexerActionExecutor):this.transformImpl(e,this._context,this.semanticContext,t,r)}transformImpl(e,t,r,i,o){let s=i&&ol.checkNonGreedyDecision(this,e);return r!==ri.SemanticContext.NONE?o!=null||s?new To(o,r,e,this,t,s):new vi(r,e,this,t):o!=null||s?new _o(o,e,this,t,s):new ol(e,this,t)}static checkNonGreedyDecision(e,t){return e.hasPassedThroughNonGreedyDecision||t instanceof XN.DecisionState&&t.nonGreedy}appendContext(e,t){if(typeof e=="number"){let r=this.context.appendSingleContext(e,t);return this.transform(this.state,!1,r)}else{let r=this.context.appendContext(e,t);return this.transform(this.state,!1,r)}}contains(e){if(this.state.stateNumber!==e.state.stateNumber||this.alt!==e.alt||!this.semanticContext.equals(e.semanticContext))return!1;let t=[],r=[];for(t.push(this.context),r.push(e.context);;){let i=t.pop(),o=r.pop();if(!i||!o)break;if(i===o)return!0;if(i.size=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},tr=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ATNConfig=void 0;const a3=xn,u3=Yr,rn=Je,Ve=X,c3=nr,gg=Tr(),si=Bi,xg=Bt(),pf=2147483648;let jt=class al{constructor(e,t,r){typeof t=="number"?(xg((t&16777215)===t),this._state=e,this.altAndOuterContextDepth=t,this._context=r):(this._state=e,this.altAndOuterContextDepth=t.altAndOuterContextDepth,this._context=r)}static create(e,t,r,i=si.SemanticContext.NONE,o){return i!==si.SemanticContext.NONE?o!=null?new wo(o,i,e,t,r,!1):new _i(i,e,t,r):o!=null?new Co(o,e,t,r,!1):new al(e,t,r)}get state(){return this._state}get alt(){return this.altAndOuterContextDepth&16777215}get context(){return this._context}set context(e){this._context=e}get reachesIntoOuterContext(){return this.outerContextDepth!==0}get outerContextDepth(){return this.altAndOuterContextDepth>>>24&127}set outerContextDepth(e){xg(e>=0),e=Math.min(e,127),this.altAndOuterContextDepth=e<<24|(this.altAndOuterContextDepth&-2130706433)>>>0}get lexerActionExecutor(){}get semanticContext(){return si.SemanticContext.NONE}get hasPassedThroughNonGreedyDecision(){return!1}clone(){return this.transform(this.state,!1)}transform(e,t,r){return r==null?this.transformImpl(e,this._context,this.semanticContext,t,this.lexerActionExecutor):r instanceof gg.PredictionContext?this.transformImpl(e,r,this.semanticContext,t,this.lexerActionExecutor):r instanceof si.SemanticContext?this.transformImpl(e,this._context,r,t,this.lexerActionExecutor):this.transformImpl(e,this._context,this.semanticContext,t,r)}transformImpl(e,t,r,i,o){let s=i&&al.checkNonGreedyDecision(this,e);return r!==si.SemanticContext.NONE?o!=null||s?new wo(o,r,e,this,t,s):new _i(r,e,this,t):o!=null||s?new Co(o,e,this,t,s):new al(e,this,t)}static checkNonGreedyDecision(e,t){return e.hasPassedThroughNonGreedyDecision||t instanceof u3.DecisionState&&t.nonGreedy}appendContext(e,t){if(typeof e=="number"){let r=this.context.appendSingleContext(e,t);return this.transform(this.state,!1,r)}else{let r=this.context.appendContext(e,t);return this.transform(this.state,!1,r)}}contains(e){if(this.state.stateNumber!==e.state.stateNumber||this.alt!==e.alt||!this.semanticContext.equals(e.semanticContext))return!1;let t=[],r=[];for(t.push(this.context),r.push(e.context);;){let i=t.pop(),o=r.pop();if(!i||!o)break;if(i===o)return!0;if(i.size>>4}function Zi(n){return n*16}function Ed(n){let e=1;for(let t=0;t<16;t++){if(n&e)return t;e=e<<1>>>0}throw new RangeError("No specified bit found")}function hg(n){let e=32768;for(let t=15;t>=0;t--){if(n&e)return t;e=e>>>1}throw new RangeError("No specified bit found")}function sr(n,e){return n&=15,e&=15,n===e?1<>>0:65535>>>15-e^65535>>>16-n}const Cd=new Uint8Array(65536);for(let n=0;n<16;n++){const e=1<>>0;let t=0;for(;tr)return-1;let o=65535^sr(e,15);if((t[i]|o)===65535){for(i++,o=0;ir)return-1;let o=sr(e,15);if(!(t[i]&o)){for(i++,o=65535;i=r)return-1}return Zi(i)+Ed(t[i]&o)}or(e){const t=this.data,r=e.data,i=Math.min(t.length,r.length),o=Math.max(t.length,r.length),s=t.length===o?t:new Uint16Array(o);let l=-1;for(let u=0;ur.length?t:r;for(let u=i;u=r&&(i=r-1);let o=65535^sr(0,e);if((t[i]|o)===65535){for(o=0,i--;i>=0&&t[i]===65535;i--);if(i<0)return-1}return Zi(i)+hg((t[i]|o)^65535)}previousSetBit(e){if(e<0)throw new RangeError("fromIndex cannot be negative");const t=this.data,r=t.length;let i=Xt(e);i>=r&&(i=r-1);let o=sr(0,e);if(!(t[i]&o)){for(i--,o=65535;i>=0&&t[i]===0;i--);if(i<0)return-1}return Zi(i)+hg(t[i]&o)}set(e,t,r){if(t===void 0?(t=e,r=!0):typeof t=="boolean"&&(r=t,t=e),r===void 0&&(r=!0),e<0||e>t)throw new RangeError;let i=Xt(e),o=Xt(t);if(r&&o>=this.data.length){let s=new Uint16Array(o+1);this.data.forEach((l,a)=>s[a]=l),this.data=s}else if(!r){if(i>=this.data.length)return;o>=this.data.length&&(o=this.data.length-1,t=this.data.length*16-1)}if(i===o)this._setBits(i,r,sr(e,t));else{for(this._setBits(i++,r,sr(e,15));i=0;r=this.nextSetBit(r+1))t?t=!1:e+=", ",e+=r;return e+="}",e}xor(e){const t=this.data,r=e.data,i=Math.min(t.length,r.length),o=Math.max(t.length,r.length),s=t.length===o?t:new Uint16Array(o);let l=-1;for(let u=0;ur.length?t:r;for(let u=i;u>>4}function ro(n){return n*16}function Ld(n){let e=1;for(let t=0;t<16;t++){if(n&e)return t;e=e<<1>>>0}throw new RangeError("No specified bit found")}function yg(n){let e=32768;for(let t=15;t>=0;t--){if(n&e)return t;e=e>>>1}throw new RangeError("No specified bit found")}function sr(n,e){return n&=15,e&=15,n===e?1<>>0:65535>>>15-e^65535>>>16-n}const kd=new Uint8Array(65536);for(let n=0;n<16;n++){const e=1<>>0;let t=0;for(;tr)return-1;let o=65535^sr(e,15);if((t[i]|o)===65535){for(i++,o=0;ir)return-1;let o=sr(e,15);if(!(t[i]&o)){for(i++,o=65535;i=r)return-1}return ro(i)+Ld(t[i]&o)}or(e){const t=this.data,r=e.data,i=Math.min(t.length,r.length),o=Math.max(t.length,r.length),s=t.length===o?t:new Uint16Array(o);let l=-1;for(let u=0;ur.length?t:r;for(let u=i;u=r&&(i=r-1);let o=65535^sr(0,e);if((t[i]|o)===65535){for(o=0,i--;i>=0&&t[i]===65535;i--);if(i<0)return-1}return ro(i)+yg((t[i]|o)^65535)}previousSetBit(e){if(e<0)throw new RangeError("fromIndex cannot be negative");const t=this.data,r=t.length;let i=Gt(e);i>=r&&(i=r-1);let o=sr(0,e);if(!(t[i]&o)){for(i--,o=65535;i>=0&&t[i]===0;i--);if(i<0)return-1}return ro(i)+yg(t[i]&o)}set(e,t,r){if(t===void 0?(t=e,r=!0):typeof t=="boolean"&&(r=t,t=e),r===void 0&&(r=!0),e<0||e>t)throw new RangeError;let i=Gt(e),o=Gt(t);if(r&&o>=this.data.length){let s=new Uint16Array(o+1);this.data.forEach((l,a)=>s[a]=l),this.data=s}else if(!r){if(i>=this.data.length)return;o>=this.data.length&&(o=this.data.length-1,t=this.data.length*16-1)}if(i===o)this._setBits(i,r,sr(e,t));else{for(this._setBits(i++,r,sr(e,15));i=0;r=this.nextSetBit(r+1))t?t=!1:e+=", ",e+=r;return e+="}",e}xor(e){const t=this.data,r=e.data,i=Math.min(t.length,r.length),o=Math.max(t.length,r.length),s=t.length===o?t:new Uint16Array(o);let l=-1;for(let u=0;ur.length?t:r;for(let u=i;u=0;O--)(C=y[O])&&(b=(_<3?C(b):_>3?C(g,x,b):C(g,x))||b);return _>3&&b&&Object.defineProperty(g,x,b),b};Object.defineProperty(ls,"__esModule",{value:!0}),ls.ATNConfigSet=void 0;const e=mn,t=_r,r=Ii,i=xn(),o=Mi,s=Er,l=J,a=nr,u=Tr(),c=Cp(),h=ki,f=jt(),d=ut;class p{hashCode(g){return g.state^g.alt}equals(g,x){return g.state===x.state&&g.alt===x.alt}}p.INSTANCE=new p;function v(y){return y?new e.Array2DHashMap(y):new e.Array2DHashMap(p.INSTANCE)}let m=class wd{constructor(g,x){this._uniqueAlt=0,this._hasSemanticContext=!1,this._dipsIntoOuterContext=!1,this.outermostConfigSet=!1,this.cachedHashCode=-1,g?(x?(this.mergedConfigs=void 0,this.unmerged=void 0):g.isReadOnly?(this.mergedConfigs=v(),this.unmerged=[]):(this.mergedConfigs=v(g.mergedConfigs),this.unmerged=g.unmerged.slice(0)),this.configs=g.configs.slice(0),this._dipsIntoOuterContext=g._dipsIntoOuterContext,this._hasSemanticContext=g._hasSemanticContext,this.outermostConfigSet=g.outermostConfigSet,(x||!g.isReadOnly)&&(this._uniqueAlt=g._uniqueAlt,this._conflictInfo=g._conflictInfo)):(this.mergedConfigs=v(),this.unmerged=[],this.configs=[],this._uniqueAlt=i.ATN.INVALID_ALT_NUMBER)}getRepresentedAlternatives(){if(this._conflictInfo!=null)return this._conflictInfo.conflictedAlts.clone();let g=new s.BitSet;for(let x of this)g.set(x.alt);return g}get isReadOnly(){return this.mergedConfigs==null}get isOutermostConfigSet(){return this.outermostConfigSet}set isOutermostConfigSet(g){if(this.outermostConfigSet&&!g)throw new Error("IllegalStateException");f(!g||!this._dipsIntoOuterContext),this.outermostConfigSet=g}getStates(){let g=new t.Array2DHashSet(a.ObjectEqualityComparator.INSTANCE);for(let x of this.configs)g.add(x.state);return g}optimizeConfigs(g){if(this.configs.length!==0)for(let x of this.configs)x.context=g.atn.getCachedContext(x.context)}clone(g){let x=new wd(this,g);return!g&&this.isReadOnly&&x.addAll(this.configs),x}get size(){return this.configs.length}get isEmpty(){return this.configs.length===0}contains(g){if(!(g instanceof o.ATNConfig))return!1;if(this.mergedConfigs&&this.unmerged){let x=g,S=this.getKey(x),_=this.mergedConfigs.get(S);if(_!=null&&this.canMerge(x,S,_))return _.contains(x);for(let b of this.unmerged)if(b.contains(g))return!0}else for(let x of this.configs)if(x.contains(g))return!0;return!1}*[Symbol.iterator](){yield*this.configs}toArray(){return this.configs}add(g,x){if(this.ensureWritable(),!this.mergedConfigs||!this.unmerged)throw new Error("Covered by ensureWritable but duplicated here for strict null check limitation");f(!this.outermostConfigSet||!g.reachesIntoOuterContext),x==null&&(x=c.PredictionContextCache.UNCACHED);let S,_=this.getKey(g),b=this.mergedConfigs.get(_);if(S=b==null,b!=null&&this.canMerge(g,_,b)){b.outerContextDepth=Math.max(b.outerContextDepth,g.outerContextDepth),g.isPrecedenceFilterSuppressed&&(b.isPrecedenceFilterSuppressed=!0);let C=u.PredictionContext.join(b.context,g.context,x);return this.updatePropertiesForMergedConfig(g),b.context===C?!1:(b.context=C,!0)}for(let C=0;C_.alt!==b.alt?_.alt-b.alt:_.state.stateNumber!==b.state.stateNumber?_.state.stateNumber-b.state.stateNumber:_.semanticContext.toString().localeCompare(b.semanticContext.toString())),x+="[";for(let _=0;_0&&(x+=", "),x+=S[_].toString(void 0,!0,g);return x+="]",this._hasSemanticContext&&(x+=",hasSemanticContext="+this._hasSemanticContext),this._uniqueAlt!==i.ATN.INVALID_ALT_NUMBER&&(x+=",uniqueAlt="+this._uniqueAlt),this._conflictInfo!=null&&(x+=",conflictingAlts="+this._conflictInfo.conflictedAlts,this._conflictInfo.isExact||(x+="*")),this._dipsIntoOuterContext&&(x+=",dipsIntoOuterContext"),x.toString()}get uniqueAlt(){return this._uniqueAlt}get hasSemanticContext(){return this._hasSemanticContext}set hasSemanticContext(g){this.ensureWritable(),this._hasSemanticContext=g}get conflictInfo(){return this._conflictInfo}set conflictInfo(g){this.ensureWritable(),this._conflictInfo=g}get conflictingAlts(){if(this._conflictInfo!=null)return this._conflictInfo.conflictedAlts}get isExactConflict(){return this._conflictInfo==null?!1:this._conflictInfo.isExact}get dipsIntoOuterContext(){return this._dipsIntoOuterContext}get(g){return this.configs[g]}ensureWritable(){if(this.isReadOnly)throw new Error("This ATNConfigSet is read only.")}};return n([l.NotNull],m.prototype,"getRepresentedAlternatives",null),n([l.Override],m.prototype,"size",null),n([l.Override],m.prototype,"isEmpty",null),n([l.Override],m.prototype,"contains",null),n([l.Override],m.prototype,Symbol.iterator,null),n([l.Override],m.prototype,"toArray",null),n([l.Override],m.prototype,"containsAll",null),n([l.Override],m.prototype,"clear",null),n([l.Override],m.prototype,"equals",null),n([l.Override],m.prototype,"hashCode",null),ls.ATNConfigSet=m,ls}var us={},af={},uf={},dg;function bc(){return dg||(dg=1,function(n){/*! + */var n=w&&w.__decorate||function(y,g,x,b){var _=arguments.length,S=_<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,x):b,C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,g,x,b);else for(var O=y.length-1;O>=0;O--)(C=y[O])&&(S=(_<3?C(S):_>3?C(g,x,S):C(g,x))||S);return _>3&&S&&Object.defineProperty(g,x,S),S};Object.defineProperty(us,"__esModule",{value:!0}),us.ATNConfigSet=void 0;const e=xn,t=_r,r=ji,i=vn(),o=Hi,s=Er,l=X,a=nr,u=Tr(),c=kp(),h=Bi,f=Bt(),d=ut;class p{hashCode(g){return g.state^g.alt}equals(g,x){return g.state===x.state&&g.alt===x.alt}}p.INSTANCE=new p;function v(y){return y?new e.Array2DHashMap(y):new e.Array2DHashMap(p.INSTANCE)}let m=class Id{constructor(g,x){this._uniqueAlt=0,this._hasSemanticContext=!1,this._dipsIntoOuterContext=!1,this.outermostConfigSet=!1,this.cachedHashCode=-1,g?(x?(this.mergedConfigs=void 0,this.unmerged=void 0):g.isReadOnly?(this.mergedConfigs=v(),this.unmerged=[]):(this.mergedConfigs=v(g.mergedConfigs),this.unmerged=g.unmerged.slice(0)),this.configs=g.configs.slice(0),this._dipsIntoOuterContext=g._dipsIntoOuterContext,this._hasSemanticContext=g._hasSemanticContext,this.outermostConfigSet=g.outermostConfigSet,(x||!g.isReadOnly)&&(this._uniqueAlt=g._uniqueAlt,this._conflictInfo=g._conflictInfo)):(this.mergedConfigs=v(),this.unmerged=[],this.configs=[],this._uniqueAlt=i.ATN.INVALID_ALT_NUMBER)}getRepresentedAlternatives(){if(this._conflictInfo!=null)return this._conflictInfo.conflictedAlts.clone();let g=new s.BitSet;for(let x of this)g.set(x.alt);return g}get isReadOnly(){return this.mergedConfigs==null}get isOutermostConfigSet(){return this.outermostConfigSet}set isOutermostConfigSet(g){if(this.outermostConfigSet&&!g)throw new Error("IllegalStateException");f(!g||!this._dipsIntoOuterContext),this.outermostConfigSet=g}getStates(){let g=new t.Array2DHashSet(a.ObjectEqualityComparator.INSTANCE);for(let x of this.configs)g.add(x.state);return g}optimizeConfigs(g){if(this.configs.length!==0)for(let x of this.configs)x.context=g.atn.getCachedContext(x.context)}clone(g){let x=new Id(this,g);return!g&&this.isReadOnly&&x.addAll(this.configs),x}get size(){return this.configs.length}get isEmpty(){return this.configs.length===0}contains(g){if(!(g instanceof o.ATNConfig))return!1;if(this.mergedConfigs&&this.unmerged){let x=g,b=this.getKey(x),_=this.mergedConfigs.get(b);if(_!=null&&this.canMerge(x,b,_))return _.contains(x);for(let S of this.unmerged)if(S.contains(g))return!0}else for(let x of this.configs)if(x.contains(g))return!0;return!1}*[Symbol.iterator](){yield*this.configs}toArray(){return this.configs}add(g,x){if(this.ensureWritable(),!this.mergedConfigs||!this.unmerged)throw new Error("Covered by ensureWritable but duplicated here for strict null check limitation");f(!this.outermostConfigSet||!g.reachesIntoOuterContext),x==null&&(x=c.PredictionContextCache.UNCACHED);let b,_=this.getKey(g),S=this.mergedConfigs.get(_);if(b=S==null,S!=null&&this.canMerge(g,_,S)){S.outerContextDepth=Math.max(S.outerContextDepth,g.outerContextDepth),g.isPrecedenceFilterSuppressed&&(S.isPrecedenceFilterSuppressed=!0);let C=u.PredictionContext.join(S.context,g.context,x);return this.updatePropertiesForMergedConfig(g),S.context===C?!1:(S.context=C,!0)}for(let C=0;C_.alt!==S.alt?_.alt-S.alt:_.state.stateNumber!==S.state.stateNumber?_.state.stateNumber-S.state.stateNumber:_.semanticContext.toString().localeCompare(S.semanticContext.toString())),x+="[";for(let _=0;_0&&(x+=", "),x+=b[_].toString(void 0,!0,g);return x+="]",this._hasSemanticContext&&(x+=",hasSemanticContext="+this._hasSemanticContext),this._uniqueAlt!==i.ATN.INVALID_ALT_NUMBER&&(x+=",uniqueAlt="+this._uniqueAlt),this._conflictInfo!=null&&(x+=",conflictingAlts="+this._conflictInfo.conflictedAlts,this._conflictInfo.isExact||(x+="*")),this._dipsIntoOuterContext&&(x+=",dipsIntoOuterContext"),x.toString()}get uniqueAlt(){return this._uniqueAlt}get hasSemanticContext(){return this._hasSemanticContext}set hasSemanticContext(g){this.ensureWritable(),this._hasSemanticContext=g}get conflictInfo(){return this._conflictInfo}set conflictInfo(g){this.ensureWritable(),this._conflictInfo=g}get conflictingAlts(){if(this._conflictInfo!=null)return this._conflictInfo.conflictedAlts}get isExactConflict(){return this._conflictInfo==null?!1:this._conflictInfo.isExact}get dipsIntoOuterContext(){return this._dipsIntoOuterContext}get(g){return this.configs[g]}ensureWritable(){if(this.isReadOnly)throw new Error("This ATNConfigSet is read only.")}};return n([l.NotNull],m.prototype,"getRepresentedAlternatives",null),n([l.Override],m.prototype,"size",null),n([l.Override],m.prototype,"isEmpty",null),n([l.Override],m.prototype,"contains",null),n([l.Override],m.prototype,Symbol.iterator,null),n([l.Override],m.prototype,"toArray",null),n([l.Override],m.prototype,"containsAll",null),n([l.Override],m.prototype,"clear",null),n([l.Override],m.prototype,"equals",null),n([l.Override],m.prototype,"hashCode",null),us.ATNConfigSet=m,us}var hs={},mf={},gf={},bg;function Ec(){return bg||(bg=1,function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(c,h,f,d){var p=arguments.length,v=p<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(c,h,f,d);else for(var y=c.length-1;y>=0;y--)(m=c[y])&&(v=(p<3?m(v):p>3?m(h,f,v):m(h,f))||v);return p>3&&v&&Object.defineProperty(h,f,v),v},t=w&&w.__param||function(c,h){return function(f,d){h(f,d,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DFAState=void 0;const r=xn(),i=Er,o=Je,s=J,l=Tr(),a=jt();class u{constructor(h){this.stateNumber=-1,this.configs=h,this.edges=new Map,this.contextEdges=new Map}get isContextSensitive(){return!!this.contextSymbols}isContextSymbol(h){return this.isContextSensitive?this.contextSymbols.get(h):!1}setContextSymbol(h){a(this.isContextSensitive),this.contextSymbols.set(h)}setContextSensitive(h){a(!this.configs.isOutermostConfigSet),!this.isContextSensitive&&(this.contextSymbols||(this.contextSymbols=new i.BitSet))}get acceptStateInfo(){return this._acceptStateInfo}set acceptStateInfo(h){this._acceptStateInfo=h}get isAcceptState(){return!!this._acceptStateInfo}get prediction(){return this._acceptStateInfo?this._acceptStateInfo.prediction:r.ATN.INVALID_ALT_NUMBER}get lexerActionExecutor(){if(this._acceptStateInfo)return this._acceptStateInfo.lexerActionExecutor}getTarget(h){return this.edges.get(h)}setTarget(h,f){this.edges.set(h,f)}getEdgeMap(){return this.edges}getContextTarget(h){return h===l.PredictionContext.EMPTY_FULL_STATE_KEY&&(h=-1),this.contextEdges.get(h)}setContextTarget(h,f){if(!this.isContextSensitive)throw new Error("The state is not context sensitive.");h===l.PredictionContext.EMPTY_FULL_STATE_KEY&&(h=-1),this.contextEdges.set(h,f)}getContextEdgeMap(){let h=new Map(this.contextEdges),f=h.get(-1);if(f!==void 0)if(h.size===1){let d=new Map;return d.set(l.PredictionContext.EMPTY_FULL_STATE_KEY,f),d}else h.delete(-1),h.set(l.PredictionContext.EMPTY_FULL_STATE_KEY,f);return h}hashCode(){let h=o.MurmurHash.initialize(7);return h=o.MurmurHash.update(h,this.configs.hashCode()),h=o.MurmurHash.finish(h,1),h}equals(h){if(this===h)return!0;if(!(h instanceof u))return!1;let f=h;return this.configs.equals(f.configs)}toString(){let h="";return h+=this.stateNumber+":"+this.configs,this.isAcceptState&&(h+="=>",this.predicates?h+=this.predicates:h+=this.prediction),h.toString()}}e([s.NotNull],u.prototype,"configs",void 0),e([s.NotNull],u.prototype,"edges",void 0),e([s.NotNull],u.prototype,"contextEdges",void 0),e([s.Override],u.prototype,"hashCode",null),e([s.Override],u.prototype,"equals",null),e([s.Override],u.prototype,"toString",null),n.DFAState=u,function(c){let h=class{constructor(d,p){this.alt=p,this.pred=d}toString(){return"("+this.pred+", "+this.alt+")"}};e([s.NotNull],h.prototype,"pred",void 0),e([s.Override],h.prototype,"toString",null),h=e([t(0,s.NotNull)],h),c.PredPrediction=h}(u=n.DFAState||(n.DFAState={}))}(uf)),uf}var pg;function Ac(){return pg||(pg=1,function(n){/*! + */var e=w&&w.__decorate||function(c,h,f,d){var p=arguments.length,v=p<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(c,h,f,d);else for(var y=c.length-1;y>=0;y--)(m=c[y])&&(v=(p<3?m(v):p>3?m(h,f,v):m(h,f))||v);return p>3&&v&&Object.defineProperty(h,f,v),v},t=w&&w.__param||function(c,h){return function(f,d){h(f,d,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DFAState=void 0;const r=vn(),i=Er,o=Je,s=X,l=Tr(),a=Bt();class u{constructor(h){this.stateNumber=-1,this.configs=h,this.edges=new Map,this.contextEdges=new Map}get isContextSensitive(){return!!this.contextSymbols}isContextSymbol(h){return this.isContextSensitive?this.contextSymbols.get(h):!1}setContextSymbol(h){a(this.isContextSensitive),this.contextSymbols.set(h)}setContextSensitive(h){a(!this.configs.isOutermostConfigSet),!this.isContextSensitive&&(this.contextSymbols||(this.contextSymbols=new i.BitSet))}get acceptStateInfo(){return this._acceptStateInfo}set acceptStateInfo(h){this._acceptStateInfo=h}get isAcceptState(){return!!this._acceptStateInfo}get prediction(){return this._acceptStateInfo?this._acceptStateInfo.prediction:r.ATN.INVALID_ALT_NUMBER}get lexerActionExecutor(){if(this._acceptStateInfo)return this._acceptStateInfo.lexerActionExecutor}getTarget(h){return this.edges.get(h)}setTarget(h,f){this.edges.set(h,f)}getEdgeMap(){return this.edges}getContextTarget(h){return h===l.PredictionContext.EMPTY_FULL_STATE_KEY&&(h=-1),this.contextEdges.get(h)}setContextTarget(h,f){if(!this.isContextSensitive)throw new Error("The state is not context sensitive.");h===l.PredictionContext.EMPTY_FULL_STATE_KEY&&(h=-1),this.contextEdges.set(h,f)}getContextEdgeMap(){let h=new Map(this.contextEdges),f=h.get(-1);if(f!==void 0)if(h.size===1){let d=new Map;return d.set(l.PredictionContext.EMPTY_FULL_STATE_KEY,f),d}else h.delete(-1),h.set(l.PredictionContext.EMPTY_FULL_STATE_KEY,f);return h}hashCode(){let h=o.MurmurHash.initialize(7);return h=o.MurmurHash.update(h,this.configs.hashCode()),h=o.MurmurHash.finish(h,1),h}equals(h){if(this===h)return!0;if(!(h instanceof u))return!1;let f=h;return this.configs.equals(f.configs)}toString(){let h="";return h+=this.stateNumber+":"+this.configs,this.isAcceptState&&(h+="=>",this.predicates?h+=this.predicates:h+=this.prediction),h.toString()}}e([s.NotNull],u.prototype,"configs",void 0),e([s.NotNull],u.prototype,"edges",void 0),e([s.NotNull],u.prototype,"contextEdges",void 0),e([s.Override],u.prototype,"hashCode",null),e([s.Override],u.prototype,"equals",null),e([s.Override],u.prototype,"toString",null),n.DFAState=u,function(c){let h=class{constructor(d,p){this.alt=p,this.pred=d}toString(){return"("+this.pred+", "+this.alt+")"}};e([s.NotNull],h.prototype,"pred",void 0),e([s.Override],h.prototype,"toString",null),h=e([t(0,s.NotNull)],h),c.PredPrediction=h}(u=n.DFAState||(n.DFAState={}))}(gf)),gf}var Sg;function Cc(){return Sg||(Sg=1,function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(a,u,c,h){var f=arguments.length,d=f<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(a,u,c,h);else for(var v=a.length-1;v>=0;v--)(p=a[v])&&(d=(f<3?p(d):f>3?p(u,c,d):p(u,c))||d);return f>3&&d&&Object.defineProperty(u,c,d),d},t=w&&w.__param||function(a,u){return function(c,h){u(c,h,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ATNSimulator=void 0;const r=Kl(),i=bc(),o=J,s=Tr();let l=class sl{constructor(u){this.atn=u}static get ERROR(){return sl._ERROR||(sl._ERROR=new i.DFAState(new r.ATNConfigSet),sl._ERROR.stateNumber=s.PredictionContext.EMPTY_FULL_STATE_KEY),sl._ERROR}clearDFA(){this.atn.clearDFA()}};e([o.NotNull],l.prototype,"atn",void 0),e([o.NotNull],l,"ERROR",null),l=e([t(0,o.NotNull)],l),n.ATNSimulator=l,l=n.ATNSimulator||(n.ATNSimulator={}),n.ATNSimulator=l}(af)),af}var Kn={},Gl={};/*! + */var e=w&&w.__decorate||function(a,u,c,h){var f=arguments.length,d=f<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,c):h,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(a,u,c,h);else for(var v=a.length-1;v>=0;v--)(p=a[v])&&(d=(f<3?p(d):f>3?p(u,c,d):p(u,c))||d);return f>3&&d&&Object.defineProperty(u,c,d),d},t=w&&w.__param||function(a,u){return function(c,h){u(c,h,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ATNSimulator=void 0;const r=Yl(),i=Ec(),o=X,s=Tr();let l=class ul{constructor(u){this.atn=u}static get ERROR(){return ul._ERROR||(ul._ERROR=new i.DFAState(new r.ATNConfigSet),ul._ERROR.stateNumber=s.PredictionContext.EMPTY_FULL_STATE_KEY),ul._ERROR}clearDFA(){this.atn.clearDFA()}};e([o.NotNull],l.prototype,"atn",void 0),e([o.NotNull],l,"ERROR",null),l=e([t(0,o.NotNull)],l),n.ATNSimulator=l,l=n.ATNSimulator||(n.ATNSimulator={}),n.ATNSimulator=l}(mf)),mf}var Gn={},Jl={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Gl,"__esModule",{value:!0});Gl.ConsoleErrorListener=void 0;class Od{syntaxError(e,t,r,i,o,s){console.error(`line ${r}:${i} ${o}`)}}Gl.ConsoleErrorListener=Od;Od.INSTANCE=new Od;var Mo={};/*! + */Object.defineProperty(Jl,"__esModule",{value:!0});Jl.ConsoleErrorListener=void 0;class Md{syntaxError(e,t,r,i,o,s){console.error(`line ${r}:${i} ${o}`)}}Jl.ConsoleErrorListener=Md;Md.INSTANCE=new Md;var $o={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},mg=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.ProxyErrorListener=void 0;const cf=J;class uS{constructor(e){if(this.delegates=e,!e)throw new Error("Invalid delegates")}getDelegates(){return this.delegates}syntaxError(e,t,r,i,o,s){this.delegates.forEach(l=>{l.syntaxError&&l.syntaxError(e,t,r,i,o,s)})}}e3([cf.Override,mg(0,cf.NotNull),mg(4,cf.NotNull)],uS.prototype,"syntaxError",null);Mo.ProxyErrorListener=uS;/*! + */var p3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Ag=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty($o,"__esModule",{value:!0});$o.ProxyErrorListener=void 0;const xf=X;class gb{constructor(e){if(this.delegates=e,!e)throw new Error("Invalid delegates")}getDelegates(){return this.delegates}syntaxError(e,t,r,i,o,s){this.delegates.forEach(l=>{l.syntaxError&&l.syntaxError(e,t,r,i,o,s)})}}p3([xf.Override,Ag(0,xf.NotNull),Ag(4,xf.NotNull)],gb.prototype,"syntaxError",null);$o.ProxyErrorListener=gb;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Yr=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},_c=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.Recognizer=void 0;const t3=Gl,r3=Mo,rr=J,gg=ze,n3=ut;class ht{constructor(){this._listeners=[t3.ConsoleErrorListener.INSTANCE],this._stateNumber=-1}getTokenTypeMap(){let e=this.vocabulary,t=ht.tokenTypeMapCache.get(e);if(t==null){let r=new Map;for(let i=0;i<=this.atn.maxTokenType;i++){let o=e.getLiteralName(i);o!=null&&r.set(o,i);let s=e.getSymbolicName(i);s!=null&&r.set(s,i)}r.set("EOF",gg.Token.EOF),t=r,ht.tokenTypeMapCache.set(e,t)}return t}getRuleIndexMap(){let e=this.ruleNames;if(e==null)throw new Error("The current recognizer does not provide a list of rule names.");let t=ht.ruleIndexMapCache.get(e);return t==null&&(t=n3.toMap(e),ht.ruleIndexMapCache.set(e,t)),t}getTokenType(e){let t=this.getTokenTypeMap().get(e);return t??gg.Token.INVALID_TYPE}get serializedATN(){throw new Error("there is no serialized ATN")}get atn(){return this._interp.atn}get interpreter(){return this._interp}set interpreter(e){this._interp=e}get parseInfo(){return Promise.resolve(void 0)}getErrorHeader(e){let t=e.getOffendingToken();if(!t)return"";let r=t.line,i=t.charPositionInLine;return"line "+r+":"+i}addErrorListener(e){if(!e)throw new TypeError("listener must not be null");this._listeners.push(e)}removeErrorListener(e){let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}removeErrorListeners(){this._listeners.length=0}getErrorListeners(){return this._listeners.slice(0)}getErrorListenerDispatch(){return new r3.ProxyErrorListener(this.getErrorListeners())}sempred(e,t,r){return!0}precpred(e,t){return!0}action(e,t,r){}get state(){return this._stateNumber}set state(e){this._stateNumber=e}}ht.EOF=-1;ht.tokenTypeMapCache=new WeakMap;ht.ruleIndexMapCache=new WeakMap;Yr([rr.SuppressWarnings("serial"),rr.NotNull],ht.prototype,"_listeners",void 0);Yr([rr.NotNull],ht.prototype,"getTokenTypeMap",null);Yr([rr.NotNull],ht.prototype,"getRuleIndexMap",null);Yr([rr.NotNull],ht.prototype,"serializedATN",null);Yr([rr.NotNull],ht.prototype,"atn",null);Yr([rr.NotNull,_c(0,rr.NotNull)],ht.prototype,"interpreter",null);Yr([rr.NotNull,_c(0,rr.NotNull)],ht.prototype,"getErrorHeader",null);Yr([_c(0,rr.NotNull)],ht.prototype,"addErrorListener",null);Yr([_c(0,rr.NotNull)],ht.prototype,"removeErrorListener",null);Yr([rr.NotNull],ht.prototype,"getErrorListeners",null);Kn.Recognizer=ht;var gn={};/*! + */var Jr=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},wc=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.Recognizer=void 0;const m3=Jl,g3=$o,rr=X,_g=ze,x3=ut;class ht{constructor(){this._listeners=[m3.ConsoleErrorListener.INSTANCE],this._stateNumber=-1}getTokenTypeMap(){let e=this.vocabulary,t=ht.tokenTypeMapCache.get(e);if(t==null){let r=new Map;for(let i=0;i<=this.atn.maxTokenType;i++){let o=e.getLiteralName(i);o!=null&&r.set(o,i);let s=e.getSymbolicName(i);s!=null&&r.set(s,i)}r.set("EOF",_g.Token.EOF),t=r,ht.tokenTypeMapCache.set(e,t)}return t}getRuleIndexMap(){let e=this.ruleNames;if(e==null)throw new Error("The current recognizer does not provide a list of rule names.");let t=ht.ruleIndexMapCache.get(e);return t==null&&(t=x3.toMap(e),ht.ruleIndexMapCache.set(e,t)),t}getTokenType(e){let t=this.getTokenTypeMap().get(e);return t??_g.Token.INVALID_TYPE}get serializedATN(){throw new Error("there is no serialized ATN")}get atn(){return this._interp.atn}get interpreter(){return this._interp}set interpreter(e){this._interp=e}get parseInfo(){return Promise.resolve(void 0)}getErrorHeader(e){let t=e.getOffendingToken();if(!t)return"";let r=t.line,i=t.charPositionInLine;return"line "+r+":"+i}addErrorListener(e){if(!e)throw new TypeError("listener must not be null");this._listeners.push(e)}removeErrorListener(e){let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}removeErrorListeners(){this._listeners.length=0}getErrorListeners(){return this._listeners.slice(0)}getErrorListenerDispatch(){return new g3.ProxyErrorListener(this.getErrorListeners())}sempred(e,t,r){return!0}precpred(e,t){return!0}action(e,t,r){}get state(){return this._stateNumber}set state(e){this._stateNumber=e}}ht.EOF=-1;ht.tokenTypeMapCache=new WeakMap;ht.ruleIndexMapCache=new WeakMap;Jr([rr.SuppressWarnings("serial"),rr.NotNull],ht.prototype,"_listeners",void 0);Jr([rr.NotNull],ht.prototype,"getTokenTypeMap",null);Jr([rr.NotNull],ht.prototype,"getRuleIndexMap",null);Jr([rr.NotNull],ht.prototype,"serializedATN",null);Jr([rr.NotNull],ht.prototype,"atn",null);Jr([rr.NotNull,wc(0,rr.NotNull)],ht.prototype,"interpreter",null);Jr([rr.NotNull,wc(0,rr.NotNull)],ht.prototype,"getErrorHeader",null);Jr([wc(0,rr.NotNull)],ht.prototype,"addErrorListener",null);Jr([wc(0,rr.NotNull)],ht.prototype,"removeErrorListener",null);Jr([rr.NotNull],ht.prototype,"getErrorListeners",null);Gn.Recognizer=ht;var yn={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Gn=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(gn,"__esModule",{value:!0});var wp=gn.VocabularyImpl=void 0;const an=J,i3=ze;class yr{constructor(e,t,r){this.literalNames=e,this.symbolicNames=t,this.displayNames=r,this._maxTokenType=Math.max(this.displayNames.length,Math.max(this.literalNames.length,this.symbolicNames.length))-1}get maxTokenType(){return this._maxTokenType}getLiteralName(e){if(e>=0&&e=0&&e=0&&e=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(yn,"__esModule",{value:!0});var Ip=yn.VocabularyImpl=void 0;const un=X,y3=ze;class yr{constructor(e,t,r){this.literalNames=e,this.symbolicNames=t,this.displayNames=r,this._maxTokenType=Math.max(this.displayNames.length,Math.max(this.literalNames.length,this.symbolicNames.length))-1}get maxTokenType(){return this._maxTokenType}getLiteralName(e){if(e>=0&&e=0&&e=0&&e=0;p--)(d=l[p])&&(f=(h<3?d(f):h>3?d(a,u,f):d(a,u))||f);return h>3&&f&&Object.defineProperty(a,u,f),f};Object.defineProperty(us,"__esModule",{value:!0}),us.DFASerializer=void 0;const e=Ac(),t=J,r=Tr(),i=Kn,o=gn;let s=class{constructor(a,u,c,h){u instanceof i.Recognizer?(c=u.ruleNames,h=u.atn,u=u.vocabulary):u||(u=o.VocabularyImpl.EMPTY_VOCABULARY),this.dfa=a,this.vocabulary=u,this.ruleNames=c,this.atn=h}toString(){if(!this.dfa.s0)return"";let a="";if(this.dfa.states){let c=new Array(...this.dfa.states.toArray());c.sort((h,f)=>h.stateNumber-f.stateNumber);for(let h of c){let f=h.getEdgeMap(),d=[...f.keys()].sort((m,y)=>m-y),p=h.getContextEdgeMap(),v=[...p.keys()].sort((m,y)=>m-y);for(let m of d){let y=f.get(m);if((y==null||y===e.ATNSimulator.ERROR)&&!h.isContextSymbol(m))continue;let g=!1;a+=this.getStateString(h)+"-"+this.getEdgeLabel(m)+"->",h.isContextSymbol(m)&&(a+="!",g=!0);let x=y;x&&x.stateNumber!==e.ATNSimulator.ERROR.stateNumber?a+=this.getStateString(x)+` + */var n=w&&w.__decorate||function(l,a,u,c){var h=arguments.length,f=h<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,u):c,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(l,a,u,c);else for(var p=l.length-1;p>=0;p--)(d=l[p])&&(f=(h<3?d(f):h>3?d(a,u,f):d(a,u))||f);return h>3&&f&&Object.defineProperty(a,u,f),f};Object.defineProperty(hs,"__esModule",{value:!0}),hs.DFASerializer=void 0;const e=Cc(),t=X,r=Tr(),i=Gn,o=yn;let s=class{constructor(a,u,c,h){u instanceof i.Recognizer?(c=u.ruleNames,h=u.atn,u=u.vocabulary):u||(u=o.VocabularyImpl.EMPTY_VOCABULARY),this.dfa=a,this.vocabulary=u,this.ruleNames=c,this.atn=h}toString(){if(!this.dfa.s0)return"";let a="";if(this.dfa.states){let c=new Array(...this.dfa.states.toArray());c.sort((h,f)=>h.stateNumber-f.stateNumber);for(let h of c){let f=h.getEdgeMap(),d=[...f.keys()].sort((m,y)=>m-y),p=h.getContextEdgeMap(),v=[...p.keys()].sort((m,y)=>m-y);for(let m of d){let y=f.get(m);if((y==null||y===e.ATNSimulator.ERROR)&&!h.isContextSymbol(m))continue;let g=!1;a+=this.getStateString(h)+"-"+this.getEdgeLabel(m)+"->",h.isContextSymbol(m)&&(a+="!",g=!0);let x=y;x&&x.stateNumber!==e.ATNSimulator.ERROR.stateNumber?a+=this.getStateString(x)+` `:g&&(a+=`ctx `)}if(h.isContextSensitive)for(let m of v)a+=this.getStateString(h)+"-"+this.getContextLabel(m)+"->"+this.getStateString(p.get(m))+` -`}}let u=a;return u.length===0?"":u}getContextLabel(a){if(a===r.PredictionContext.EMPTY_FULL_STATE_KEY)return"ctx:EMPTY_FULL";if(a===r.PredictionContext.EMPTY_LOCAL_STATE_KEY)return"ctx:EMPTY_LOCAL";if(this.atn&&a>0&&a<=this.atn.states.length){let c=this.atn.states[a].ruleIndex;if(this.ruleNames&&c>=0&&c"+a.predicates:c=":s"+u+"=>"+a.prediction),a.isContextSensitive){c+="*";for(let h of a.configs)if(h.reachesIntoOuterContext){c+="*";break}}return c}};return n([t.NotNull],s.prototype,"dfa",void 0),n([t.NotNull],s.prototype,"vocabulary",void 0),n([t.Override],s.prototype,"toString",null),us.DFASerializer=s,us}var cs={},yg;function o3(){if(yg)return cs;yg=1;/*! +`}}let u=a;return u.length===0?"":u}getContextLabel(a){if(a===r.PredictionContext.EMPTY_FULL_STATE_KEY)return"ctx:EMPTY_FULL";if(a===r.PredictionContext.EMPTY_LOCAL_STATE_KEY)return"ctx:EMPTY_LOCAL";if(this.atn&&a>0&&a<=this.atn.states.length){let c=this.atn.states[a].ruleIndex;if(this.ruleNames&&c>=0&&c"+a.predicates:c=":s"+u+"=>"+a.prediction),a.isContextSensitive){c+="*";for(let h of a.configs)if(h.reachesIntoOuterContext){c+="*";break}}return c}};return n([t.NotNull],s.prototype,"dfa",void 0),n([t.NotNull],s.prototype,"vocabulary",void 0),n([t.Override],s.prototype,"toString",null),hs.DFASerializer=s,hs}var fs={},Eg;function v3(){if(Eg)return fs;Eg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h},e=w&&w.__param||function(s,l){return function(a,u){l(a,u,s)}};Object.defineProperty(cs,"__esModule",{value:!0}),cs.LexerDFASerializer=void 0;const t=cS(),r=J,i=gn;let o=class extends t.DFASerializer{constructor(l){super(l,i.VocabularyImpl.EMPTY_VOCABULARY)}getEdgeLabel(l){return"'"+String.fromCodePoint(l)+"'"}};return n([r.Override,r.NotNull],o.prototype,"getEdgeLabel",null),o=n([e(0,r.NotNull)],o),cs.LexerDFASerializer=o,cs}var Bo={};/*! + */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h},e=w&&w.__param||function(s,l){return function(a,u){l(a,u,s)}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.LexerDFASerializer=void 0;const t=xb(),r=X,i=yn;let o=class extends t.DFASerializer{constructor(l){super(l,i.VocabularyImpl.EMPTY_VOCABULARY)}getEdgeLabel(l){return"'"+String.fromCodePoint(l)+"'"}};return n([r.Override,r.NotNull],o.prototype,"getEdgeLabel",null),o=n([e(0,r.NotNull)],o),fs.LexerDFASerializer=o,fs}var Ho={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var s3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.StarLoopEntryState=void 0;const l3=mt,a3=Er,u3=Xr,c3=J;class hS extends u3.DecisionState{constructor(){super(...arguments),this.precedenceRuleDecision=!1,this.precedenceLoopbackStates=new a3.BitSet}get stateType(){return l3.ATNStateType.STAR_LOOP_ENTRY}}s3([c3.Override],hS.prototype,"stateType",null);Bo.StarLoopEntryState=hS;var vg;function fS(){if(vg)return ss;vg=1;/*! + */var b3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.StarLoopEntryState=void 0;const S3=mt,A3=Er,_3=Yr,T3=X;class yb extends _3.DecisionState{constructor(){super(...arguments),this.precedenceRuleDecision=!1,this.precedenceLoopbackStates=new A3.BitSet}get stateType(){return S3.ATNStateType.STAR_LOOP_ENTRY}}b3([T3.Override],yb.prototype,"stateType",null);Ho.StarLoopEntryState=yb;var Cg;function vb(){if(Cg)return as;Cg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(f,d,p,v){var m=arguments.length,y=m<3?d:v===null?v=Object.getOwnPropertyDescriptor(d,p):v,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,d,p,v);else for(var x=f.length-1;x>=0;x--)(g=f[x])&&(y=(m<3?g(y):m>3?g(d,p,y):g(d,p))||y);return m>3&&y&&Object.defineProperty(d,p,y),y},e=w&&w.__param||function(f,d){return function(p,v){d(p,v,f)}};Object.defineProperty(ss,"__esModule",{value:!0}),ss.DFA=void 0;const t=_r,r=Kl(),i=cS(),o=bc(),s=o3(),l=J,a=nr,u=Bo,c=gn;let h=class{constructor(d,p=0){if(this.states=new t.Array2DHashSet(a.ObjectEqualityComparator.INSTANCE),this.nextStateNumber=0,!d.atn)throw new Error("The ATNState must be associated with an ATN");this.atnStartState=d,this.atn=d.atn,this.decision=p;let v=!1;d instanceof u.StarLoopEntryState&&d.precedenceRuleDecision&&(v=!0,this.s0=new o.DFAState(new r.ATNConfigSet),this.s0full=new o.DFAState(new r.ATNConfigSet)),this.precedenceDfa=v}get isPrecedenceDfa(){return this.precedenceDfa}getPrecedenceStartState(d,p){if(!this.isPrecedenceDfa)throw new Error("Only precedence DFAs may contain a precedence start state.");return p?this.s0full.getTarget(d):this.s0.getTarget(d)}setPrecedenceStartState(d,p,v){if(!this.isPrecedenceDfa)throw new Error("Only precedence DFAs may contain a precedence start state.");d<0||(p?this.s0full.setTarget(d,v):this.s0.setTarget(d,v))}get isEmpty(){return this.isPrecedenceDfa?this.s0.getEdgeMap().size===0&&this.s0full.getEdgeMap().size===0:this.s0==null&&this.s0full==null}get isContextSensitive(){return this.isPrecedenceDfa?this.s0full.getEdgeMap().size>0:this.s0full!=null}addState(d){return d.stateNumber=this.nextStateNumber++,this.states.getOrAdd(d)}toString(d,p){if(d||(d=c.VocabularyImpl.EMPTY_VOCABULARY),!this.s0)return"";let v;return p?v=new i.DFASerializer(this,d,p,this.atnStartState.atn):v=new i.DFASerializer(this,d),v.toString()}toLexerString(){return this.s0?new s.LexerDFASerializer(this).toString():""}};return n([l.NotNull],h.prototype,"states",void 0),n([l.NotNull],h.prototype,"atnStartState",void 0),n([l.NotNull],h.prototype,"atn",void 0),h=n([e(0,l.NotNull)],h),ss.DFA=h,ss}var Xl={},Yl={};/*! + */var n=w&&w.__decorate||function(f,d,p,v){var m=arguments.length,y=m<3?d:v===null?v=Object.getOwnPropertyDescriptor(d,p):v,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,d,p,v);else for(var x=f.length-1;x>=0;x--)(g=f[x])&&(y=(m<3?g(y):m>3?g(d,p,y):g(d,p))||y);return m>3&&y&&Object.defineProperty(d,p,y),y},e=w&&w.__param||function(f,d){return function(p,v){d(p,v,f)}};Object.defineProperty(as,"__esModule",{value:!0}),as.DFA=void 0;const t=_r,r=Yl(),i=xb(),o=Ec(),s=v3(),l=X,a=nr,u=Ho,c=yn;let h=class{constructor(d,p=0){if(this.states=new t.Array2DHashSet(a.ObjectEqualityComparator.INSTANCE),this.nextStateNumber=0,!d.atn)throw new Error("The ATNState must be associated with an ATN");this.atnStartState=d,this.atn=d.atn,this.decision=p;let v=!1;d instanceof u.StarLoopEntryState&&d.precedenceRuleDecision&&(v=!0,this.s0=new o.DFAState(new r.ATNConfigSet),this.s0full=new o.DFAState(new r.ATNConfigSet)),this.precedenceDfa=v}get isPrecedenceDfa(){return this.precedenceDfa}getPrecedenceStartState(d,p){if(!this.isPrecedenceDfa)throw new Error("Only precedence DFAs may contain a precedence start state.");return p?this.s0full.getTarget(d):this.s0.getTarget(d)}setPrecedenceStartState(d,p,v){if(!this.isPrecedenceDfa)throw new Error("Only precedence DFAs may contain a precedence start state.");d<0||(p?this.s0full.setTarget(d,v):this.s0.setTarget(d,v))}get isEmpty(){return this.isPrecedenceDfa?this.s0.getEdgeMap().size===0&&this.s0full.getEdgeMap().size===0:this.s0==null&&this.s0full==null}get isContextSensitive(){return this.isPrecedenceDfa?this.s0full.getEdgeMap().size>0:this.s0full!=null}addState(d){return d.stateNumber=this.nextStateNumber++,this.states.getOrAdd(d)}toString(d,p){if(d||(d=c.VocabularyImpl.EMPTY_VOCABULARY),!this.s0)return"";let v;return p?v=new i.DFASerializer(this,d,p,this.atnStartState.atn):v=new i.DFASerializer(this,d),v.toString()}toLexerString(){return this.s0?new s.LexerDFASerializer(this).toString():""}};return n([l.NotNull],h.prototype,"states",void 0),n([l.NotNull],h.prototype,"atnStartState",void 0),n([l.NotNull],h.prototype,"atn",void 0),h=n([e(0,l.NotNull)],h),as.DFA=h,as}var Ql={},Zl={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var h3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Yl,"__esModule",{value:!0});Yl.BasicState=void 0;const f3=Kr,d3=mt,p3=J;class dS extends f3.ATNState{get stateType(){return d3.ATNStateType.BASIC}}h3([p3.Override],dS.prototype,"stateType",null);Yl.BasicState=dS;/*! + */var E3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Zl,"__esModule",{value:!0});Zl.BasicState=void 0;const C3=Gr,w3=mt,O3=X;class bb extends C3.ATNState{get stateType(){return w3.ATNStateType.BASIC}}E3([O3.Override],bb.prototype,"stateType",null);Zl.BasicState=bb;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var m3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Xl,"__esModule",{value:!0});Xl.InvalidState=void 0;const g3=mt,x3=Yl,y3=J;class pS extends x3.BasicState{get stateType(){return g3.ATNStateType.INVALID_TYPE}}m3([y3.Override],pS.prototype,"stateType",null);Xl.InvalidState=pS;var hs={},fs={},ds={},Sg;function Op(){if(Sg)return ds;Sg=1;/*! + */var N3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Ql,"__esModule",{value:!0});Ql.InvalidState=void 0;const D3=mt,P3=Zl,R3=X;class Sb extends P3.BasicState{get stateType(){return D3.ATNStateType.INVALID_TYPE}}N3([R3.Override],Sb.prototype,"stateType",null);Ql.InvalidState=Sb;var ds={},ps={},ms={},wg;function Mp(){if(wg)return ms;wg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(l,a,u,c){var h=arguments.length,f=h<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,u):c,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(l,a,u,c);else for(var p=l.length-1;p>=0;p--)(d=l[p])&&(f=(h<3?d(f):h>3?d(a,u,f):d(a,u))||f);return h>3&&f&&Object.defineProperty(a,u,f),f},e=w&&w.__param||function(l,a){return function(u,c){a(u,c,l)}};Object.defineProperty(ds,"__esModule",{value:!0}),ds.SetTransition=void 0;const t=zi(),r=J,i=ze,o=Ar;let s=class extends o.Transition{constructor(a,u){super(a),u==null&&(u=t.IntervalSet.of(i.Token.INVALID_TYPE)),this.set=u}get serializationType(){return 7}get label(){return this.set}matches(a,u,c){return this.set.contains(a)}toString(){return this.set.toString()}};return n([r.NotNull],s.prototype,"set",void 0),n([r.Override],s.prototype,"serializationType",null),n([r.Override,r.NotNull],s.prototype,"label",null),n([r.Override],s.prototype,"matches",null),n([r.Override,r.NotNull],s.prototype,"toString",null),s=n([e(0,r.NotNull),e(1,r.Nullable)],s),ds.SetTransition=s,ds}var bg;function Np(){if(bg)return fs;bg=1;/*! + */var n=w&&w.__decorate||function(l,a,u,c){var h=arguments.length,f=h<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,u):c,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(l,a,u,c);else for(var p=l.length-1;p>=0;p--)(d=l[p])&&(f=(h<3?d(f):h>3?d(a,u,f):d(a,u))||f);return h>3&&f&&Object.defineProperty(a,u,f),f},e=w&&w.__param||function(l,a){return function(u,c){a(u,c,l)}};Object.defineProperty(ms,"__esModule",{value:!0}),ms.SetTransition=void 0;const t=Wi(),r=X,i=ze,o=Ar;let s=class extends o.Transition{constructor(a,u){super(a),u==null&&(u=t.IntervalSet.of(i.Token.INVALID_TYPE)),this.set=u}get serializationType(){return 7}get label(){return this.set}matches(a,u,c){return this.set.contains(a)}toString(){return this.set.toString()}};return n([r.NotNull],s.prototype,"set",void 0),n([r.Override],s.prototype,"serializationType",null),n([r.Override,r.NotNull],s.prototype,"label",null),n([r.Override],s.prototype,"matches",null),n([r.Override,r.NotNull],s.prototype,"toString",null),s=n([e(0,r.NotNull),e(1,r.Nullable)],s),ms.SetTransition=s,ms}var Og;function Fp(){if(Og)return ps;Og=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.NotSetTransition=void 0;const t=J,r=Op();let i=class extends r.SetTransition{constructor(s,l){super(s,l)}get serializationType(){return 8}matches(s,l,a){return s>=l&&s<=a&&!super.matches(s,l,a)}toString(){return"~"+super.toString()}};return n([t.Override],i.prototype,"serializationType",null),n([t.Override],i.prototype,"matches",null),n([t.Override],i.prototype,"toString",null),i=n([e(0,t.NotNull),e(1,t.Nullable)],i),fs.NotSetTransition=i,fs}var Xn={};/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(ps,"__esModule",{value:!0}),ps.NotSetTransition=void 0;const t=X,r=Mp();let i=class extends r.SetTransition{constructor(s,l){super(s,l)}get serializationType(){return 8}matches(s,l,a){return s>=l&&s<=a&&!super.matches(s,l,a)}toString(){return"~"+super.toString()}};return n([t.Override],i.prototype,"serializationType",null),n([t.Override],i.prototype,"matches",null),n([t.Override],i.prototype,"toString",null),i=n([e(0,t.NotNull),e(1,t.Nullable)],i),ps.NotSetTransition=i,ps}var Yn={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var mS=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.RuleStopState=void 0;const v3=Kr,S3=mt,gS=J;class Dp extends v3.ATNState{get nonStopStateNumber(){return-1}get stateType(){return S3.ATNStateType.RULE_STOP}}mS([gS.Override],Dp.prototype,"nonStopStateNumber",null);mS([gS.Override],Dp.prototype,"stateType",null);Xn.RuleStopState=Dp;var jo={};/*! + */var Ab=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.RuleStopState=void 0;const L3=Gr,k3=mt,_b=X;class Bp extends L3.ATNState{get nonStopStateNumber(){return-1}get stateType(){return k3.ATNStateType.RULE_STOP}}Ab([_b.Override],Bp.prototype,"nonStopStateNumber",null);Ab([_b.Override],Bp.prototype,"stateType",null);Yn.RuleStopState=Bp;var zo={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Jl=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Ag=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(jo,"__esModule",{value:!0});jo.RuleTransition=void 0;const Eo=J,b3=Ar;let Si=class extends b3.Transition{constructor(e,t,r,i){super(e),this.tailCall=!1,this.optimizedTailCall=!1,this.ruleIndex=t,this.precedence=r,this.followState=i}get serializationType(){return 3}get isEpsilon(){return!0}matches(e,t,r){return!1}};Jl([Eo.NotNull],Si.prototype,"followState",void 0);Jl([Eo.Override],Si.prototype,"serializationType",null);Jl([Eo.Override],Si.prototype,"isEpsilon",null);Jl([Eo.Override],Si.prototype,"matches",null);Si=Jl([Ag(0,Eo.NotNull),Ag(3,Eo.NotNull)],Si);jo.RuleTransition=Si;var Ql={};/*! + */var ea=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Ng=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(zo,"__esModule",{value:!0});zo.RuleTransition=void 0;const Oo=X,I3=Ar;let Ti=class extends I3.Transition{constructor(e,t,r,i){super(e),this.tailCall=!1,this.optimizedTailCall=!1,this.ruleIndex=t,this.precedence=r,this.followState=i}get serializationType(){return 3}get isEpsilon(){return!0}matches(e,t,r){return!1}};ea([Oo.NotNull],Ti.prototype,"followState",void 0);ea([Oo.Override],Ti.prototype,"serializationType",null);ea([Oo.Override],Ti.prototype,"isEpsilon",null);ea([Oo.Override],Ti.prototype,"matches",null);Ti=ea([Ng(0,Oo.NotNull),Ng(3,Oo.NotNull)],Ti);zo.RuleTransition=Ti;var ta={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Tc=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},A3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ql,"__esModule",{value:!0});Ql.WildcardTransition=void 0;const Rl=J,_3=Ar;let Co=class extends _3.Transition{constructor(e){super(e)}get serializationType(){return 9}matches(e,t,r){return e>=t&&e<=r}toString(){return"."}};Tc([Rl.Override],Co.prototype,"serializationType",null);Tc([Rl.Override],Co.prototype,"matches",null);Tc([Rl.Override,Rl.NotNull],Co.prototype,"toString",null);Co=Tc([A3(0,Rl.NotNull)],Co);Ql.WildcardTransition=Co;var _g;function T3(){if(_g)return hs;_g=1;/*! + */var Oc=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},M3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ta,"__esModule",{value:!0});ta.WildcardTransition=void 0;const Il=X,F3=Ar;let No=class extends F3.Transition{constructor(e){super(e)}get serializationType(){return 9}matches(e,t,r){return e>=t&&e<=r}toString(){return"."}};Oc([Il.Override],No.prototype,"serializationType",null);Oc([Il.Override],No.prototype,"matches",null);Oc([Il.Override,Il.NotNull],No.prototype,"toString",null);No=Oc([M3(0,Il.NotNull)],No);ta.WildcardTransition=No;var Dg;function B3(){if(Dg)return ds;Dg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(m,y,g,x){var S=arguments.length,_=S<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,g):x,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,y,g,x);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(_=(S<3?b(_):S>3?b(y,g,_):b(y,g))||_);return S>3&&_&&Object.defineProperty(y,g,_),_},e=w&&w.__param||function(m,y){return function(g,x){y(g,x,m)}};Object.defineProperty(hs,"__esModule",{value:!0}),hs.LL1Analyzer=void 0;const t=Io,r=_r,i=Mi,o=Er,s=zi(),l=J,a=Np(),u=nr,c=Tr(),h=Xn,f=jo,d=ze,p=Ql;let v=class Nd{constructor(y){this.atn=y}getDecisionLookahead(y){if(y==null)return;let g=new Array(y.numberOfTransitions);for(let x=0;x=0;C--)(S=m[C])&&(_=(b<3?S(_):b>3?S(y,g,_):S(y,g))||_);return b>3&&_&&Object.defineProperty(y,g,_),_},e=w&&w.__param||function(m,y){return function(g,x){y(g,x,m)}};Object.defineProperty(ds,"__esModule",{value:!0}),ds.LL1Analyzer=void 0;const t=Bo,r=_r,i=Hi,o=Er,s=Wi(),l=X,a=Fp(),u=nr,c=Tr(),h=Yn,f=zo,d=ze,p=ta;let v=class Fd{constructor(y){this.atn=y}getDecisionLookahead(y){if(y==null)return;let g=new Array(y.numberOfTransitions);for(let x=0;x=0;_--)(S=p[_])&&(x=(g<3?S(x):g>3?S(v,m,x):S(v,m))||x);return g>3&&x&&Object.defineProperty(v,m,x),x},t=w&&w.__param||function(p,v){return function(m,y){v(m,y,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ATN=void 0;const r=mn,i=fS(),o=zi(),s=Xl,l=T3(),a=J,u=nr,c=Tr(),h=ze,f=jt();let d=class{constructor(v,m){this.states=[],this.decisionToState=[],this.modeNameToStartState=new Map,this.modeToStartState=[],this.contextCache=new r.Array2DHashMap(u.ObjectEqualityComparator.INSTANCE),this.decisionToDFA=[],this.modeToDFA=[],this.LL1Table=new Map,this.grammarType=v,this.maxTokenType=m}clearDFA(){this.decisionToDFA=new Array(this.decisionToState.length);for(let v=0;v0)return this.decisionToState[v]}get numberOfDecisions(){return this.decisionToState.length}getExpectedTokens(v,m){if(v<0||v>=this.states.length)throw new RangeError("Invalid state number.");let y=m,g=this.states[v],x=this.nextTokens(g);if(!x.contains(h.Token.EPSILON))return x;let S=new o.IntervalSet;for(S.addAll(x),S.remove(h.Token.EPSILON);y!=null&&y.invokingState>=0&&x.contains(h.Token.EPSILON);){let b=this.states[y.invokingState].transition(0);x=this.nextTokens(b.followState),S.addAll(x),S.remove(h.Token.EPSILON),y=y._parent}return x.contains(h.Token.EPSILON)&&S.add(h.Token.EOF),S}};e([a.NotNull],d.prototype,"states",void 0),e([a.NotNull],d.prototype,"decisionToState",void 0),e([a.NotNull],d.prototype,"modeNameToStartState",void 0),e([a.NotNull],d.prototype,"modeToStartState",void 0),e([a.NotNull],d.prototype,"decisionToDFA",void 0),e([a.NotNull],d.prototype,"modeToDFA",void 0),e([a.NotNull],d.prototype,"nextTokens",null),e([t(0,a.NotNull)],d.prototype,"removeState",null),e([t(0,a.NotNull),t(1,a.NotNull)],d.prototype,"defineMode",null),e([t(0,a.NotNull)],d.prototype,"defineDecisionState",null),e([a.NotNull],d.prototype,"getExpectedTokens",null),d=e([t(0,a.NotNull)],d),n.ATN=d,function(p){p.INVALID_ALT_NUMBER=0}(d=n.ATN||(n.ATN={})),n.ATN=d}(nf)),nf}var Ec={},Cc={};/*! + */var e=w&&w.__decorate||function(p,v,m,y){var g=arguments.length,x=g<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,m):y,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(p,v,m,y);else for(var _=p.length-1;_>=0;_--)(b=p[_])&&(x=(g<3?b(x):g>3?b(v,m,x):b(v,m))||x);return g>3&&x&&Object.defineProperty(v,m,x),x},t=w&&w.__param||function(p,v){return function(m,y){v(m,y,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ATN=void 0;const r=xn,i=vb(),o=Wi(),s=Ql,l=B3(),a=X,u=nr,c=Tr(),h=ze,f=Bt();let d=class{constructor(v,m){this.states=[],this.decisionToState=[],this.modeNameToStartState=new Map,this.modeToStartState=[],this.contextCache=new r.Array2DHashMap(u.ObjectEqualityComparator.INSTANCE),this.decisionToDFA=[],this.modeToDFA=[],this.LL1Table=new Map,this.grammarType=v,this.maxTokenType=m}clearDFA(){this.decisionToDFA=new Array(this.decisionToState.length);for(let v=0;v0)return this.decisionToState[v]}get numberOfDecisions(){return this.decisionToState.length}getExpectedTokens(v,m){if(v<0||v>=this.states.length)throw new RangeError("Invalid state number.");let y=m,g=this.states[v],x=this.nextTokens(g);if(!x.contains(h.Token.EPSILON))return x;let b=new o.IntervalSet;for(b.addAll(x),b.remove(h.Token.EPSILON);y!=null&&y.invokingState>=0&&x.contains(h.Token.EPSILON);){let S=this.states[y.invokingState].transition(0);x=this.nextTokens(S.followState),b.addAll(x),b.remove(h.Token.EPSILON),y=y._parent}return x.contains(h.Token.EPSILON)&&b.add(h.Token.EOF),b}};e([a.NotNull],d.prototype,"states",void 0),e([a.NotNull],d.prototype,"decisionToState",void 0),e([a.NotNull],d.prototype,"modeNameToStartState",void 0),e([a.NotNull],d.prototype,"modeToStartState",void 0),e([a.NotNull],d.prototype,"decisionToDFA",void 0),e([a.NotNull],d.prototype,"modeToDFA",void 0),e([a.NotNull],d.prototype,"nextTokens",null),e([t(0,a.NotNull)],d.prototype,"removeState",null),e([t(0,a.NotNull),t(1,a.NotNull)],d.prototype,"defineMode",null),e([t(0,a.NotNull)],d.prototype,"defineDecisionState",null),e([a.NotNull],d.prototype,"getExpectedTokens",null),d=e([t(0,a.NotNull)],d),n.ATN=d,function(p){p.INVALID_ALT_NUMBER=0}(d=n.ATN||(n.ATN={})),n.ATN=d}(hf)),hf}var Nc={},Dc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Bi=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},E3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Cc,"__esModule",{value:!0});Cc.LexerIndexedCustomAction=void 0;const Va=Je,ji=J;let un=class xS{constructor(e,t){this._offset=e,this._action=t}get offset(){return this._offset}get action(){return this._action}get actionType(){return this._action.actionType}get isPositionDependent(){return!0}execute(e){this._action.execute(e)}hashCode(){let e=Va.MurmurHash.initialize();return e=Va.MurmurHash.update(e,this._offset),e=Va.MurmurHash.update(e,this._action),Va.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof xS?this._offset===e._offset&&this._action.equals(e._action):!1}};Bi([ji.NotNull],un.prototype,"action",null);Bi([ji.Override],un.prototype,"actionType",null);Bi([ji.Override],un.prototype,"isPositionDependent",null);Bi([ji.Override],un.prototype,"execute",null);Bi([ji.Override],un.prototype,"hashCode",null);Bi([ji.Override],un.prototype,"equals",null);un=Bi([E3(1,ji.NotNull)],un);Cc.LexerIndexedCustomAction=un;/*! + */var zi=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},j3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.LexerIndexedCustomAction=void 0;const Ya=Je,qi=X;let cn=class Tb{constructor(e,t){this._offset=e,this._action=t}get offset(){return this._offset}get action(){return this._action}get actionType(){return this._action.actionType}get isPositionDependent(){return!0}execute(e){this._action.execute(e)}hashCode(){let e=Ya.MurmurHash.initialize();return e=Ya.MurmurHash.update(e,this._offset),e=Ya.MurmurHash.update(e,this._action),Ya.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof Tb?this._offset===e._offset&&this._action.equals(e._action):!1}};zi([qi.NotNull],cn.prototype,"action",null);zi([qi.Override],cn.prototype,"actionType",null);zi([qi.Override],cn.prototype,"isPositionDependent",null);zi([qi.Override],cn.prototype,"execute",null);zi([qi.Override],cn.prototype,"hashCode",null);zi([qi.Override],cn.prototype,"equals",null);cn=zi([j3(1,qi.NotNull)],cn);Dc.LexerIndexedCustomAction=cn;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var $i=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Pp=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ec,"__esModule",{value:!0});Ec.LexerActionExecutor=void 0;const C3=Ii,hf=Cc,ff=Je,qn=J;let cn=class ll{constructor(e){this._lexerActions=e;let t=ff.MurmurHash.initialize();for(let r of e)t=ff.MurmurHash.update(t,r);this.cachedHashCode=ff.MurmurHash.finish(t,e.length)}static append(e,t){if(!e)return new ll([t]);let r=e._lexerActions.slice(0);return r.push(t),new ll(r)}fixOffsetBeforeMatch(e){let t;for(let r=0;r=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},jp=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Nc,"__esModule",{value:!0});Nc.LexerActionExecutor=void 0;const $3=ji,yf=Dc,vf=Je,Un=X;let hn=class cl{constructor(e){this._lexerActions=e;let t=vf.MurmurHash.initialize();for(let r of e)t=vf.MurmurHash.update(t,r);this.cachedHashCode=vf.MurmurHash.finish(t,e.length)}static append(e,t){if(!e)return new cl([t]);let r=e._lexerActions.slice(0);return r.push(t),new cl(r)}fixOffsetBeforeMatch(e){let t;for(let r=0;r=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},w3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.LexerNoViableAltException=void 0;const O3=Gr,Lp=J,N3=Ct,D3=ut;let Ll=class extends O3.RecognitionException{constructor(e,t,r,i){super(e,t),this._startIndex=r,this._deadEndConfigs=i}get startIndex(){return this._startIndex}get deadEndConfigs(){return this._deadEndConfigs}get inputStream(){return super.inputStream}toString(){let e="";return this._startIndex>=0&&this._startIndex=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},H3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.LexerNoViableAltException=void 0;const z3=Xr,Hp=X,q3=Ct,U3=ut;let Ml=class extends z3.RecognitionException{constructor(e,t,r,i){super(e,t),this._startIndex=r,this._deadEndConfigs=i}get startIndex(){return this._startIndex}get deadEndConfigs(){return this._deadEndConfigs}get inputStream(){return super.inputStream}toString(){let e="";return this._startIndex>=0&&this._startIndex=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u};Object.defineProperty(ps,"__esModule",{value:!0}),ps.OrderedATNConfigSet=void 0;const e=Kl(),t=J;let r=class yS extends e.ATNConfigSet{constructor(o,s){o!=null&&s!=null?super(o,s):super()}clone(o){let s=new yS(this,o);return!o&&this.isReadOnly&&s.addAll(this),s}getKey(o){return{state:0,alt:o.hashCode()}}canMerge(o,s,l){return o.equals(l)}};return n([t.Override],r.prototype,"clone",null),n([t.Override],r.prototype,"getKey",null),n([t.Override],r.prototype,"canMerge",null),ps.OrderedATNConfigSet=r,ps}var Cg;function wc(){return Cg||(Cg=1,function(n){/*! + */var n=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u};Object.defineProperty(gs,"__esModule",{value:!0}),gs.OrderedATNConfigSet=void 0;const e=Yl(),t=X;let r=class Eb extends e.ATNConfigSet{constructor(o,s){o!=null&&s!=null?super(o,s):super()}clone(o){let s=new Eb(this,o);return!o&&this.isReadOnly&&s.addAll(this),s}getKey(o){return{state:0,alt:o.hashCode()}}canMerge(o,s,l){return o.equals(l)}};return n([t.Override],r.prototype,"clone",null),n([t.Override],r.prototype,"getKey",null),n([t.Override],r.prototype,"canMerge",null),gs.OrderedATNConfigSet=r,gs}var Lg;function Pc(){return Lg||(Lg=1,function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(_,b,C,O){var D=arguments.length,M=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O,j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,b,C,O);else for(var k=_.length-1;k>=0;k--)(j=_[k])&&(M=(D<3?j(M):D>3?j(b,C,M):j(b,C))||M);return D>3&&M&&Object.defineProperty(b,C,M),M},t=w&&w.__param||function(_,b){return function(C,O){b(C,O,_)}};Object.defineProperty(n,"__esModule",{value:!0}),n.LexerATNSimulator=void 0;const r=Wl,i=xn(),o=Mi,s=Kl(),l=Ac(),a=bc(),u=Ct,c=pn,h=Yn(),f=Ec,d=Hi,p=J,v=P3(),m=Tr(),y=Xn,g=ze,x=jt();let S=class Yt extends l.ATNSimulator{constructor(b,C){super(b),this.optimize_tail_calls=!0,this.startIndex=-1,this._line=1,this._charPositionInLine=0,this.mode=h.Lexer.DEFAULT_MODE,this.prevAccept=new Yt.SimState,this.recog=C}copyState(b){this._charPositionInLine=b.charPositionInLine,this._line=b._line,this.mode=b.mode,this.startIndex=b.startIndex}match(b,C){this.mode=C;let O=b.mark();try{this.startIndex=b.index,this.prevAccept.reset();let D=this.atn.modeToDFA[C].s0;return D==null?this.matchATN(b):this.execATN(b,D)}finally{b.release(O)}}reset(){this.prevAccept.reset(),this.startIndex=-1,this._line=1,this._charPositionInLine=0,this.mode=h.Lexer.DEFAULT_MODE}matchATN(b){let C=this.atn.modeToStartState[this.mode];Yt.debug&&console.log(`matchATN mode ${this.mode} start: ${C}`);let O=this.mode,D=this.computeStartState(b,C),M=D.hasSemanticContext;M&&(D.hasSemanticContext=!1);let j=this.addDFAState(D);if(!M){let V=this.atn.modeToDFA[this.mode];V.s0?j=V.s0:V.s0=j}let k=this.execATN(b,j);return Yt.debug&&console.log(`DFA after matchATN: ${this.atn.modeToDFA[O].toLexerString()}`),k}execATN(b,C){Yt.debug&&console.log(`start state closure=${C.configs}`),C.isAcceptState&&this.captureSimState(this.prevAccept,b,C);let O=b.LA(1),D=C;for(;;){Yt.debug&&console.log(`execATN loop starting closure: ${D.configs}`);let M=this.getExistingTargetState(D,O);if(M==null&&(M=this.computeTargetState(b,D,O)),M===l.ATNSimulator.ERROR||(O!==c.IntStream.EOF&&this.consume(b),M.isAcceptState&&(this.captureSimState(this.prevAccept,b,M),O===c.IntStream.EOF)))break;O=b.LA(1),D=M}return this.failOrAccept(this.prevAccept,b,D.configs,O)}getExistingTargetState(b,C){let O=b.getTarget(C);return Yt.debug&&O!=null&&console.log("reuse state "+b.stateNumber+" edge to "+O.stateNumber),O}computeTargetState(b,C,O){let D=new v.OrderedATNConfigSet;return this.getReachableConfigSet(b,C.configs,D,O),D.isEmpty?(D.hasSemanticContext||this.addDFAEdge(C,O,l.ATNSimulator.ERROR),l.ATNSimulator.ERROR):this.addDFAEdge(C,O,D)}failOrAccept(b,C,O,D){if(b.dfaState!=null){let M=b.dfaState.lexerActionExecutor;return this.accept(C,M,this.startIndex,b.index,b.line,b.charPos),b.dfaState.prediction}else{if(D===c.IntStream.EOF&&C.index===this.startIndex)return g.Token.EOF;throw new d.LexerNoViableAltException(this.recog,C,this.startIndex,O)}}getReachableConfigSet(b,C,O,D){let M=i.ATN.INVALID_ALT_NUMBER;for(let j of C){let k=j.alt===M;if(k&&j.hasPassedThroughNonGreedyDecision)continue;Yt.debug&&console.log(`testing ${this.getTokenName(D)} at ${j.toString(this.recog,!0)}`);let V=j.state.numberOfOptimizedTransitions;for(let se=0;se "+O+" upon "+String.fromCharCode(C)),b!=null&&b.setTarget(C,O)}addDFAState(b){x(!b.hasSemanticContext);let C=new a.DFAState(b),O=this.atn.modeToDFA[this.mode].states.get(C);if(O!=null)return O;b.optimizeConfigs(this);let D=new a.DFAState(b.clone(!0)),M;for(let j of b)if(j.state instanceof y.RuleStopState){M=j;break}if(M!=null){let j=this.atn.ruleToTokenType[M.state.ruleIndex],k=M.lexerActionExecutor;D.acceptStateInfo=new r.AcceptStateInfo(j,k)}return this.atn.modeToDFA[this.mode].addState(D)}getDFA(b){return this.atn.modeToDFA[b]}getText(b){return b.getText(u.Interval.of(this.startIndex,b.index-1))}get line(){return this._line}set line(b){this._line=b}get charPositionInLine(){return this._charPositionInLine}set charPositionInLine(b){this._charPositionInLine=b}consume(b){b.LA(1)===10?(this._line++,this._charPositionInLine=0):this._charPositionInLine++,b.consume()}getTokenName(b){return b===-1?"EOF":"'"+String.fromCharCode(b)+"'"}};e([p.NotNull],S.prototype,"prevAccept",void 0),e([t(0,p.NotNull)],S.prototype,"copyState",null),e([t(0,p.NotNull)],S.prototype,"match",null),e([p.Override],S.prototype,"reset",null),e([t(0,p.NotNull)],S.prototype,"matchATN",null),e([t(0,p.NotNull),t(1,p.NotNull)],S.prototype,"execATN",null),e([t(0,p.NotNull)],S.prototype,"getExistingTargetState",null),e([p.NotNull,t(0,p.NotNull),t(1,p.NotNull)],S.prototype,"computeTargetState",null),e([t(0,p.NotNull),t(1,p.NotNull),t(2,p.NotNull)],S.prototype,"getReachableConfigSet",null),e([t(0,p.NotNull)],S.prototype,"accept",null),e([p.NotNull,t(0,p.NotNull),t(1,p.NotNull)],S.prototype,"computeStartState",null),e([t(0,p.NotNull),t(1,p.NotNull),t(2,p.NotNull)],S.prototype,"closure",null),e([t(0,p.NotNull),t(1,p.NotNull),t(2,p.NotNull),t(3,p.NotNull)],S.prototype,"getEpsilonTarget",null),e([t(0,p.NotNull)],S.prototype,"evaluatePredicate",null),e([t(0,p.NotNull),t(1,p.NotNull),t(2,p.NotNull)],S.prototype,"captureSimState",null),e([p.NotNull,t(0,p.NotNull)],S.prototype,"addDFAState",null),e([p.NotNull],S.prototype,"getDFA",null),e([p.NotNull,t(0,p.NotNull)],S.prototype,"getText",null),e([t(0,p.NotNull)],S.prototype,"consume",null),e([p.NotNull],S.prototype,"getTokenName",null),S=e([t(0,p.NotNull)],S),n.LexerATNSimulator=S,function(_){_.debug=!1,_.dfa_debug=!1;class b{constructor(){this.index=-1,this.line=0,this.charPos=-1}reset(){this.index=-1,this.line=0,this.charPos=-1,this.dfaState=void 0}}_.SimState=b}(S=n.LexerATNSimulator||(n.LexerATNSimulator={})),n.LexerATNSimulator=S}(rf)),rf}var wg;function Yn(){if(wg)return os;wg=1;/*! + */var e=w&&w.__decorate||function(_,S,C,O){var D=arguments.length,B=D<3?S:O===null?O=Object.getOwnPropertyDescriptor(S,C):O,$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(_,S,C,O);else for(var I=_.length-1;I>=0;I--)($=_[I])&&(B=(D<3?$(B):D>3?$(S,C,B):$(S,C))||B);return D>3&&B&&Object.defineProperty(S,C,B),B},t=w&&w.__param||function(_,S){return function(C,O){S(C,O,_)}};Object.defineProperty(n,"__esModule",{value:!0}),n.LexerATNSimulator=void 0;const r=Xl,i=vn(),o=Hi,s=Yl(),l=Cc(),a=Ec(),u=Ct,c=gn,h=Jn(),f=Nc,d=Vi,p=X,v=V3(),m=Tr(),y=Yn,g=ze,x=Bt();let b=class Xt extends l.ATNSimulator{constructor(S,C){super(S),this.optimize_tail_calls=!0,this.startIndex=-1,this._line=1,this._charPositionInLine=0,this.mode=h.Lexer.DEFAULT_MODE,this.prevAccept=new Xt.SimState,this.recog=C}copyState(S){this._charPositionInLine=S.charPositionInLine,this._line=S._line,this.mode=S.mode,this.startIndex=S.startIndex}match(S,C){this.mode=C;let O=S.mark();try{this.startIndex=S.index,this.prevAccept.reset();let D=this.atn.modeToDFA[C].s0;return D==null?this.matchATN(S):this.execATN(S,D)}finally{S.release(O)}}reset(){this.prevAccept.reset(),this.startIndex=-1,this._line=1,this._charPositionInLine=0,this.mode=h.Lexer.DEFAULT_MODE}matchATN(S){let C=this.atn.modeToStartState[this.mode];Xt.debug&&console.log(`matchATN mode ${this.mode} start: ${C}`);let O=this.mode,D=this.computeStartState(S,C),B=D.hasSemanticContext;B&&(D.hasSemanticContext=!1);let $=this.addDFAState(D);if(!B){let V=this.atn.modeToDFA[this.mode];V.s0?$=V.s0:V.s0=$}let I=this.execATN(S,$);return Xt.debug&&console.log(`DFA after matchATN: ${this.atn.modeToDFA[O].toLexerString()}`),I}execATN(S,C){Xt.debug&&console.log(`start state closure=${C.configs}`),C.isAcceptState&&this.captureSimState(this.prevAccept,S,C);let O=S.LA(1),D=C;for(;;){Xt.debug&&console.log(`execATN loop starting closure: ${D.configs}`);let B=this.getExistingTargetState(D,O);if(B==null&&(B=this.computeTargetState(S,D,O)),B===l.ATNSimulator.ERROR||(O!==c.IntStream.EOF&&this.consume(S),B.isAcceptState&&(this.captureSimState(this.prevAccept,S,B),O===c.IntStream.EOF)))break;O=S.LA(1),D=B}return this.failOrAccept(this.prevAccept,S,D.configs,O)}getExistingTargetState(S,C){let O=S.getTarget(C);return Xt.debug&&O!=null&&console.log("reuse state "+S.stateNumber+" edge to "+O.stateNumber),O}computeTargetState(S,C,O){let D=new v.OrderedATNConfigSet;return this.getReachableConfigSet(S,C.configs,D,O),D.isEmpty?(D.hasSemanticContext||this.addDFAEdge(C,O,l.ATNSimulator.ERROR),l.ATNSimulator.ERROR):this.addDFAEdge(C,O,D)}failOrAccept(S,C,O,D){if(S.dfaState!=null){let B=S.dfaState.lexerActionExecutor;return this.accept(C,B,this.startIndex,S.index,S.line,S.charPos),S.dfaState.prediction}else{if(D===c.IntStream.EOF&&C.index===this.startIndex)return g.Token.EOF;throw new d.LexerNoViableAltException(this.recog,C,this.startIndex,O)}}getReachableConfigSet(S,C,O,D){let B=i.ATN.INVALID_ALT_NUMBER;for(let $ of C){let I=$.alt===B;if(I&&$.hasPassedThroughNonGreedyDecision)continue;Xt.debug&&console.log(`testing ${this.getTokenName(D)} at ${$.toString(this.recog,!0)}`);let V=$.state.numberOfOptimizedTransitions;for(let se=0;se "+O+" upon "+String.fromCharCode(C)),S!=null&&S.setTarget(C,O)}addDFAState(S){x(!S.hasSemanticContext);let C=new a.DFAState(S),O=this.atn.modeToDFA[this.mode].states.get(C);if(O!=null)return O;S.optimizeConfigs(this);let D=new a.DFAState(S.clone(!0)),B;for(let $ of S)if($.state instanceof y.RuleStopState){B=$;break}if(B!=null){let $=this.atn.ruleToTokenType[B.state.ruleIndex],I=B.lexerActionExecutor;D.acceptStateInfo=new r.AcceptStateInfo($,I)}return this.atn.modeToDFA[this.mode].addState(D)}getDFA(S){return this.atn.modeToDFA[S]}getText(S){return S.getText(u.Interval.of(this.startIndex,S.index-1))}get line(){return this._line}set line(S){this._line=S}get charPositionInLine(){return this._charPositionInLine}set charPositionInLine(S){this._charPositionInLine=S}consume(S){S.LA(1)===10?(this._line++,this._charPositionInLine=0):this._charPositionInLine++,S.consume()}getTokenName(S){return S===-1?"EOF":"'"+String.fromCharCode(S)+"'"}};e([p.NotNull],b.prototype,"prevAccept",void 0),e([t(0,p.NotNull)],b.prototype,"copyState",null),e([t(0,p.NotNull)],b.prototype,"match",null),e([p.Override],b.prototype,"reset",null),e([t(0,p.NotNull)],b.prototype,"matchATN",null),e([t(0,p.NotNull),t(1,p.NotNull)],b.prototype,"execATN",null),e([t(0,p.NotNull)],b.prototype,"getExistingTargetState",null),e([p.NotNull,t(0,p.NotNull),t(1,p.NotNull)],b.prototype,"computeTargetState",null),e([t(0,p.NotNull),t(1,p.NotNull),t(2,p.NotNull)],b.prototype,"getReachableConfigSet",null),e([t(0,p.NotNull)],b.prototype,"accept",null),e([p.NotNull,t(0,p.NotNull),t(1,p.NotNull)],b.prototype,"computeStartState",null),e([t(0,p.NotNull),t(1,p.NotNull),t(2,p.NotNull)],b.prototype,"closure",null),e([t(0,p.NotNull),t(1,p.NotNull),t(2,p.NotNull),t(3,p.NotNull)],b.prototype,"getEpsilonTarget",null),e([t(0,p.NotNull)],b.prototype,"evaluatePredicate",null),e([t(0,p.NotNull),t(1,p.NotNull),t(2,p.NotNull)],b.prototype,"captureSimState",null),e([p.NotNull,t(0,p.NotNull)],b.prototype,"addDFAState",null),e([p.NotNull],b.prototype,"getDFA",null),e([p.NotNull,t(0,p.NotNull)],b.prototype,"getText",null),e([t(0,p.NotNull)],b.prototype,"consume",null),e([p.NotNull],b.prototype,"getTokenName",null),b=e([t(0,p.NotNull)],b),n.LexerATNSimulator=b,function(_){_.debug=!1,_.dfa_debug=!1;class S{constructor(){this.index=-1,this.line=0,this.charPos=-1}reset(){this.index=-1,this.line=0,this.charPos=-1,this.dfaState=void 0}}_.SimState=S}(b=n.LexerATNSimulator||(n.LexerATNSimulator={})),n.LexerATNSimulator=b}(cf)),cf}var kg;function Jn(){if(kg)return ls;kg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(h,f,d,p){var v=arguments.length,m=v<3?f:p===null?p=Object.getOwnPropertyDescriptor(f,d):p,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(h,f,d,p);else for(var g=h.length-1;g>=0;g--)(y=h[g])&&(m=(v<3?y(m):v>3?y(f,d,m):y(f,d))||m);return v>3&&m&&Object.defineProperty(f,d,m),m};Object.defineProperty(os,"__esModule",{value:!0}),os.Lexer=void 0;const e=Sc,t=Vl,r=Ct,i=pn,o=wc(),s=Hi,l=J,a=Kn,u=ze;let c=class _n extends a.Recognizer{constructor(f){super(),this._factory=e.CommonTokenFactory.DEFAULT,this._tokenStartCharIndex=-1,this._tokenStartLine=0,this._tokenStartCharPositionInLine=0,this._hitEOF=!1,this._channel=0,this._type=0,this._modeStack=new t.IntegerStack,this._mode=_n.DEFAULT_MODE,this._input=f,this._tokenFactorySourcePair={source:this,stream:f}}static get DEFAULT_TOKEN_CHANNEL(){return u.Token.DEFAULT_CHANNEL}static get HIDDEN(){return u.Token.HIDDEN_CHANNEL}reset(f){(f===void 0||f)&&this._input.seek(0),this._token=void 0,this._type=u.Token.INVALID_TYPE,this._channel=u.Token.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartCharPositionInLine=-1,this._tokenStartLine=-1,this._text=void 0,this._hitEOF=!1,this._mode=_n.DEFAULT_MODE,this._modeStack.clear(),this.interpreter.reset()}nextToken(){if(this._input==null)throw new Error("nextToken requires a non-null input stream.");let f=this._input.mark();try{e:for(;;){if(this._hitEOF)return this.emitEOF();this._token=void 0,this._channel=u.Token.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartCharPositionInLine=this.interpreter.charPositionInLine,this._tokenStartLine=this.interpreter.line,this._text=void 0;do{this._type=u.Token.INVALID_TYPE;let d;try{d=this.interpreter.match(this._input,this._mode)}catch(p){if(p instanceof s.LexerNoViableAltException)this.notifyListeners(p),this.recover(p),d=_n.SKIP;else throw p}if(this._input.LA(1)===i.IntStream.EOF&&(this._hitEOF=!0),this._type===u.Token.INVALID_TYPE&&(this._type=d),this._type===_n.SKIP)continue e}while(this._type===_n.MORE);return this._token==null?this.emit():this._token}}finally{this._input.release(f)}}skip(){this._type=_n.SKIP}more(){this._type=_n.MORE}mode(f){this._mode=f}pushMode(f){o.LexerATNSimulator.debug&&console.log("pushMode "+f),this._modeStack.push(this._mode),this.mode(f)}popMode(){if(this._modeStack.isEmpty)throw new Error("EmptyStackException");return o.LexerATNSimulator.debug&&console.log("popMode back to "+this._modeStack.peek()),this.mode(this._modeStack.pop()),this._mode}get tokenFactory(){return this._factory}set tokenFactory(f){this._factory=f}get inputStream(){return this._input}set inputStream(f){this.reset(!1),this._input=f,this._tokenFactorySourcePair={source:this,stream:this._input}}get sourceName(){return this._input.sourceName}emit(f){return f||(f=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.charIndex-1,this._tokenStartLine,this._tokenStartCharPositionInLine)),this._token=f,f}emitEOF(){let f=this.charPositionInLine,d=this.line,p=this._factory.create(this._tokenFactorySourcePair,u.Token.EOF,void 0,u.Token.DEFAULT_CHANNEL,this._input.index,this._input.index-1,d,f);return this.emit(p),p}get line(){return this.interpreter.line}set line(f){this.interpreter.line=f}get charPositionInLine(){return this.interpreter.charPositionInLine}set charPositionInLine(f){this.interpreter.charPositionInLine=f}get charIndex(){return this._input.index}get text(){return this._text!=null?this._text:this.interpreter.getText(this._input)}set text(f){this._text=f}get token(){return this._token}set token(f){this._token=f}set type(f){this._type=f}get type(){return this._type}set channel(f){this._channel=f}get channel(){return this._channel}getAllTokens(){let f=[],d=this.nextToken();for(;d.type!==u.Token.EOF;)f.push(d),d=this.nextToken();return f}notifyListeners(f){let d=this._input.getText(r.Interval.of(this._tokenStartCharIndex,this._input.index)),p="token recognition error at: '"+this.getErrorDisplay(d)+"'",v=this.getErrorListenerDispatch();v.syntaxError&&v.syntaxError(this,void 0,this._tokenStartLine,this._tokenStartCharPositionInLine,p,f)}getErrorDisplay(f){if(typeof f=="number"){switch(f){case u.Token.EOF:return"";case 10:return"\\n";case 9:return"\\t";case 13:return"\\r"}return String.fromCharCode(f)}return f.replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}getCharErrorDisplay(f){return"'"+this.getErrorDisplay(f)+"'"}recover(f){f instanceof s.LexerNoViableAltException?this._input.LA(1)!==i.IntStream.EOF&&this.interpreter.consume(this._input):this._input.consume()}};return c.DEFAULT_MODE=0,c.MORE=-2,c.SKIP=-3,c.MIN_CHAR_VALUE=0,c.MAX_CHAR_VALUE=1114111,n([l.Override],c.prototype,"nextToken",null),n([l.Override],c.prototype,"tokenFactory",null),n([l.Override],c.prototype,"inputStream",null),n([l.Override],c.prototype,"sourceName",null),n([l.Override],c.prototype,"line",null),n([l.Override],c.prototype,"charPositionInLine",null),os.Lexer=c,os}var Og;function zi(){if(Og)return is;Og=1;/*! + */var n=w&&w.__decorate||function(h,f,d,p){var v=arguments.length,m=v<3?f:p===null?p=Object.getOwnPropertyDescriptor(f,d):p,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(h,f,d,p);else for(var g=h.length-1;g>=0;g--)(y=h[g])&&(m=(v<3?y(m):v>3?y(f,d,m):y(f,d))||m);return v>3&&m&&Object.defineProperty(f,d,m),m};Object.defineProperty(ls,"__esModule",{value:!0}),ls.Lexer=void 0;const e=Tc,t=Gl,r=Ct,i=gn,o=Pc(),s=Vi,l=X,a=Gn,u=ze;let c=class Tn extends a.Recognizer{constructor(f){super(),this._factory=e.CommonTokenFactory.DEFAULT,this._tokenStartCharIndex=-1,this._tokenStartLine=0,this._tokenStartCharPositionInLine=0,this._hitEOF=!1,this._channel=0,this._type=0,this._modeStack=new t.IntegerStack,this._mode=Tn.DEFAULT_MODE,this._input=f,this._tokenFactorySourcePair={source:this,stream:f}}static get DEFAULT_TOKEN_CHANNEL(){return u.Token.DEFAULT_CHANNEL}static get HIDDEN(){return u.Token.HIDDEN_CHANNEL}reset(f){(f===void 0||f)&&this._input.seek(0),this._token=void 0,this._type=u.Token.INVALID_TYPE,this._channel=u.Token.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartCharPositionInLine=-1,this._tokenStartLine=-1,this._text=void 0,this._hitEOF=!1,this._mode=Tn.DEFAULT_MODE,this._modeStack.clear(),this.interpreter.reset()}nextToken(){if(this._input==null)throw new Error("nextToken requires a non-null input stream.");let f=this._input.mark();try{e:for(;;){if(this._hitEOF)return this.emitEOF();this._token=void 0,this._channel=u.Token.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartCharPositionInLine=this.interpreter.charPositionInLine,this._tokenStartLine=this.interpreter.line,this._text=void 0;do{this._type=u.Token.INVALID_TYPE;let d;try{d=this.interpreter.match(this._input,this._mode)}catch(p){if(p instanceof s.LexerNoViableAltException)this.notifyListeners(p),this.recover(p),d=Tn.SKIP;else throw p}if(this._input.LA(1)===i.IntStream.EOF&&(this._hitEOF=!0),this._type===u.Token.INVALID_TYPE&&(this._type=d),this._type===Tn.SKIP)continue e}while(this._type===Tn.MORE);return this._token==null?this.emit():this._token}}finally{this._input.release(f)}}skip(){this._type=Tn.SKIP}more(){this._type=Tn.MORE}mode(f){this._mode=f}pushMode(f){o.LexerATNSimulator.debug&&console.log("pushMode "+f),this._modeStack.push(this._mode),this.mode(f)}popMode(){if(this._modeStack.isEmpty)throw new Error("EmptyStackException");return o.LexerATNSimulator.debug&&console.log("popMode back to "+this._modeStack.peek()),this.mode(this._modeStack.pop()),this._mode}get tokenFactory(){return this._factory}set tokenFactory(f){this._factory=f}get inputStream(){return this._input}set inputStream(f){this.reset(!1),this._input=f,this._tokenFactorySourcePair={source:this,stream:this._input}}get sourceName(){return this._input.sourceName}emit(f){return f||(f=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.charIndex-1,this._tokenStartLine,this._tokenStartCharPositionInLine)),this._token=f,f}emitEOF(){let f=this.charPositionInLine,d=this.line,p=this._factory.create(this._tokenFactorySourcePair,u.Token.EOF,void 0,u.Token.DEFAULT_CHANNEL,this._input.index,this._input.index-1,d,f);return this.emit(p),p}get line(){return this.interpreter.line}set line(f){this.interpreter.line=f}get charPositionInLine(){return this.interpreter.charPositionInLine}set charPositionInLine(f){this.interpreter.charPositionInLine=f}get charIndex(){return this._input.index}get text(){return this._text!=null?this._text:this.interpreter.getText(this._input)}set text(f){this._text=f}get token(){return this._token}set token(f){this._token=f}set type(f){this._type=f}get type(){return this._type}set channel(f){this._channel=f}get channel(){return this._channel}getAllTokens(){let f=[],d=this.nextToken();for(;d.type!==u.Token.EOF;)f.push(d),d=this.nextToken();return f}notifyListeners(f){let d=this._input.getText(r.Interval.of(this._tokenStartCharIndex,this._input.index)),p="token recognition error at: '"+this.getErrorDisplay(d)+"'",v=this.getErrorListenerDispatch();v.syntaxError&&v.syntaxError(this,void 0,this._tokenStartLine,this._tokenStartCharPositionInLine,p,f)}getErrorDisplay(f){if(typeof f=="number"){switch(f){case u.Token.EOF:return"";case 10:return"\\n";case 9:return"\\t";case 13:return"\\r"}return String.fromCharCode(f)}return f.replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}getCharErrorDisplay(f){return"'"+this.getErrorDisplay(f)+"'"}recover(f){f instanceof s.LexerNoViableAltException?this._input.LA(1)!==i.IntStream.EOF&&this.interpreter.consume(this._input):this._input.consume()}};return c.DEFAULT_MODE=0,c.MORE=-2,c.SKIP=-3,c.MIN_CHAR_VALUE=0,c.MAX_CHAR_VALUE=1114111,n([l.Override],c.prototype,"nextToken",null),n([l.Override],c.prototype,"tokenFactory",null),n([l.Override],c.prototype,"inputStream",null),n([l.Override],c.prototype,"sourceName",null),n([l.Override],c.prototype,"line",null),n([l.Override],c.prototype,"charPositionInLine",null),ls.Lexer=c,ls}var Ig;function Wi(){if(Ig)return ss;Ig=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(c,h,f,d){var p=arguments.length,v=p<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(c,h,f,d);else for(var y=c.length-1;y>=0;y--)(m=c[y])&&(v=(p<3?m(v):p>3?m(h,f,v):m(h,f))||v);return p>3&&v&&Object.defineProperty(h,f,v),v},e=w&&w.__param||function(c,h){return function(f,d){h(f,d,c)}};Object.defineProperty(is,"__esModule",{value:!0}),is.IntervalSet=void 0;const t=Ii,r=Fo,i=Ct,o=Yn(),s=Je,l=J,a=ze;let u=class Be{constructor(h){this.readonly=!1,h!=null?this._intervals=h.slice(0):this._intervals=[]}static get COMPLETE_CHAR_SET(){return Be._COMPLETE_CHAR_SET===void 0&&(Be._COMPLETE_CHAR_SET=Be.of(o.Lexer.MIN_CHAR_VALUE,o.Lexer.MAX_CHAR_VALUE),Be._COMPLETE_CHAR_SET.setReadonly(!0)),Be._COMPLETE_CHAR_SET}static get EMPTY_SET(){return Be._EMPTY_SET==null&&(Be._EMPTY_SET=new Be,Be._EMPTY_SET.setReadonly(!0)),Be._EMPTY_SET}static of(h,f=h){let d=new Be;return d.add(h,f),d}clear(){if(this.readonly)throw new Error("can't alter readonly IntervalSet");this._intervals.length=0}add(h,f=h){this.addRange(i.Interval.of(h,f))}addRange(h){if(this.readonly)throw new Error("can't alter readonly IntervalSet");if(!(h.bm.b){p++;continue}let g,x;if(y.a>m.a&&(g=new i.Interval(m.a,y.a-1)),y.b>1,m=this._intervals[v],y=m.a;if(m.bh)p=v-1;else return!0}return!1}get isNil(){return this._intervals==null||this._intervals.length===0}get maxElement(){if(this.isNil)throw new RangeError("set is empty");return this._intervals[this._intervals.length-1].b}get minElement(){if(this.isNil)throw new RangeError("set is empty");return this._intervals[0].a}get intervals(){return this._intervals}hashCode(){let h=s.MurmurHash.initialize();for(let f of this._intervals)h=s.MurmurHash.update(h,f.a),h=s.MurmurHash.update(h,f.b);return h=s.MurmurHash.finish(h,this._intervals.length*2),h}equals(h){return h==null||!(h instanceof Be)?!1:t.ArrayEqualityComparator.INSTANCE.equals(this._intervals,h._intervals)}toString(h=!1){let f="";if(this._intervals==null||this._intervals.length===0)return"{}";this.size>1&&(f+="{");let d=!0;for(let p of this._intervals){d?d=!1:f+=", ";let v=p.a,m=p.b;v===m?v===a.Token.EOF?f+="":h?f+="'"+String.fromCodePoint(v)+"'":f+=v:h?f+="'"+String.fromCodePoint(v)+"'..'"+String.fromCodePoint(m)+"'":f+=v+".."+m}return this.size>1&&(f+="}"),f}toStringVocabulary(h){if(this._intervals==null||this._intervals.length===0)return"{}";let f="";this.size>1&&(f+="{");let d=!0;for(let p of this._intervals){d?d=!1:f+=", ";let v=p.a,m=p.b;if(v===m)f+=this.elementName(h,v);else for(let y=v;y<=m;y++)y>v&&(f+=", "),f+=this.elementName(h,y)}return this.size>1&&(f+="}"),f}elementName(h,f){return f===a.Token.EOF?"":f===a.Token.EPSILON?"":h.getDisplayName(f)}get size(){let h=0,f=this._intervals.length;if(f===1){let d=this._intervals[0];return d.b-d.a+1}for(let d=0;dv&&h=0;y--)(m=c[y])&&(v=(p<3?m(v):p>3?m(h,f,v):m(h,f))||v);return p>3&&v&&Object.defineProperty(h,f,v),v},e=w&&w.__param||function(c,h){return function(f,d){h(f,d,c)}};Object.defineProperty(ss,"__esModule",{value:!0}),ss.IntervalSet=void 0;const t=ji,r=jo,i=Ct,o=Jn(),s=Je,l=X,a=ze;let u=class Be{constructor(h){this.readonly=!1,h!=null?this._intervals=h.slice(0):this._intervals=[]}static get COMPLETE_CHAR_SET(){return Be._COMPLETE_CHAR_SET===void 0&&(Be._COMPLETE_CHAR_SET=Be.of(o.Lexer.MIN_CHAR_VALUE,o.Lexer.MAX_CHAR_VALUE),Be._COMPLETE_CHAR_SET.setReadonly(!0)),Be._COMPLETE_CHAR_SET}static get EMPTY_SET(){return Be._EMPTY_SET==null&&(Be._EMPTY_SET=new Be,Be._EMPTY_SET.setReadonly(!0)),Be._EMPTY_SET}static of(h,f=h){let d=new Be;return d.add(h,f),d}clear(){if(this.readonly)throw new Error("can't alter readonly IntervalSet");this._intervals.length=0}add(h,f=h){this.addRange(i.Interval.of(h,f))}addRange(h){if(this.readonly)throw new Error("can't alter readonly IntervalSet");if(!(h.bm.b){p++;continue}let g,x;if(y.a>m.a&&(g=new i.Interval(m.a,y.a-1)),y.b>1,m=this._intervals[v],y=m.a;if(m.bh)p=v-1;else return!0}return!1}get isNil(){return this._intervals==null||this._intervals.length===0}get maxElement(){if(this.isNil)throw new RangeError("set is empty");return this._intervals[this._intervals.length-1].b}get minElement(){if(this.isNil)throw new RangeError("set is empty");return this._intervals[0].a}get intervals(){return this._intervals}hashCode(){let h=s.MurmurHash.initialize();for(let f of this._intervals)h=s.MurmurHash.update(h,f.a),h=s.MurmurHash.update(h,f.b);return h=s.MurmurHash.finish(h,this._intervals.length*2),h}equals(h){return h==null||!(h instanceof Be)?!1:t.ArrayEqualityComparator.INSTANCE.equals(this._intervals,h._intervals)}toString(h=!1){let f="";if(this._intervals==null||this._intervals.length===0)return"{}";this.size>1&&(f+="{");let d=!0;for(let p of this._intervals){d?d=!1:f+=", ";let v=p.a,m=p.b;v===m?v===a.Token.EOF?f+="":h?f+="'"+String.fromCodePoint(v)+"'":f+=v:h?f+="'"+String.fromCodePoint(v)+"'..'"+String.fromCodePoint(m)+"'":f+=v+".."+m}return this.size>1&&(f+="}"),f}toStringVocabulary(h){if(this._intervals==null||this._intervals.length===0)return"{}";let f="";this.size>1&&(f+="{");let d=!0;for(let p of this._intervals){d?d=!1:f+=", ";let v=p.a,m=p.b;if(v===m)f+=this.elementName(h,v);else for(let y=v;y<=m;y++)y>v&&(f+=", "),f+=this.elementName(h,y)}return this.size>1&&(f+="}"),f}elementName(h,f){return f===a.Token.EOF?"":f===a.Token.EPSILON?"":h.getDisplayName(f)}get size(){let h=0,f=this._intervals.length;if(f===1){let d=this._intervals[0];return d.b-d.a+1}for(let d=0;dv&&h=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Zl,"__esModule",{value:!0});Zl.ATNDeserializationOptions=void 0;const L3=J;class Nn{constructor(e){this.readOnly=!1,e?(this.verifyATN=e.verifyATN,this.generateRuleBypassTransitions=e.generateRuleBypassTransitions,this.optimize=e.optimize):(this.verifyATN=!0,this.generateRuleBypassTransitions=!1,this.optimize=!0)}static get defaultOptions(){return Nn._defaultOptions==null&&(Nn._defaultOptions=new Nn,Nn._defaultOptions.makeReadOnly()),Nn._defaultOptions}get isReadOnly(){return this.readOnly}makeReadOnly(){this.readOnly=!0}get isVerifyATN(){return this.verifyATN}set isVerifyATN(e){this.throwIfReadOnly(),this.verifyATN=e}get isGenerateRuleBypassTransitions(){return this.generateRuleBypassTransitions}set isGenerateRuleBypassTransitions(e){this.throwIfReadOnly(),this.generateRuleBypassTransitions=e}get isOptimize(){return this.optimize}set isOptimize(e){this.throwIfReadOnly(),this.optimize=e}throwIfReadOnly(){if(this.isReadOnly)throw new Error("The object is read only.")}}R3([L3.NotNull],Nn,"defaultOptions",null);Zl.ATNDeserializationOptions=Nn;var xs={},ea={};/*! + */var W3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(ra,"__esModule",{value:!0});ra.ATNDeserializationOptions=void 0;const K3=X;class Dn{constructor(e){this.readOnly=!1,e?(this.verifyATN=e.verifyATN,this.generateRuleBypassTransitions=e.generateRuleBypassTransitions,this.optimize=e.optimize):(this.verifyATN=!0,this.generateRuleBypassTransitions=!1,this.optimize=!0)}static get defaultOptions(){return Dn._defaultOptions==null&&(Dn._defaultOptions=new Dn,Dn._defaultOptions.makeReadOnly()),Dn._defaultOptions}get isReadOnly(){return this.readOnly}makeReadOnly(){this.readOnly=!0}get isVerifyATN(){return this.verifyATN}set isVerifyATN(e){this.throwIfReadOnly(),this.verifyATN=e}get isGenerateRuleBypassTransitions(){return this.generateRuleBypassTransitions}set isGenerateRuleBypassTransitions(e){this.throwIfReadOnly(),this.generateRuleBypassTransitions=e}get isOptimize(){return this.optimize}set isOptimize(e){this.throwIfReadOnly(),this.optimize=e}throwIfReadOnly(){if(this.isReadOnly)throw new Error("The object is read only.")}}W3([K3.NotNull],Dn,"defaultOptions",null);ra.ATNDeserializationOptions=Dn;var vs={},na={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var ta=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},k3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ea,"__esModule",{value:!0});ea.ActionTransition=void 0;const ra=J,I3=Ar;let bi=class extends I3.Transition{constructor(e,t,r=-1,i=!1){super(e),this.ruleIndex=t,this.actionIndex=r,this.isCtxDependent=i}get serializationType(){return 6}get isEpsilon(){return!0}matches(e,t,r){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}};ta([ra.Override],bi.prototype,"serializationType",null);ta([ra.Override],bi.prototype,"isEpsilon",null);ta([ra.Override],bi.prototype,"matches",null);ta([ra.Override],bi.prototype,"toString",null);bi=ta([k3(0,ra.NotNull)],bi);ea.ActionTransition=bi;var na={};/*! + */var ia=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},G3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(na,"__esModule",{value:!0});na.ActionTransition=void 0;const oa=X,X3=Ar;let Ei=class extends X3.Transition{constructor(e,t,r=-1,i=!1){super(e),this.ruleIndex=t,this.actionIndex=r,this.isCtxDependent=i}get serializationType(){return 6}get isEpsilon(){return!0}matches(e,t,r){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}};ia([oa.Override],Ei.prototype,"serializationType",null);ia([oa.Override],Ei.prototype,"isEpsilon",null);ia([oa.Override],Ei.prototype,"matches",null);ia([oa.Override],Ei.prototype,"toString",null);Ei=ia([G3(0,oa.NotNull)],Ei);na.ActionTransition=Ei;var sa={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var ia=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},F3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(na,"__esModule",{value:!0});na.AtomTransition=void 0;const M3=zi(),Ai=J,B3=Ar;let _i=class extends B3.Transition{constructor(e,t){super(e),this._label=t}get serializationType(){return 5}get label(){return M3.IntervalSet.of(this._label)}matches(e,t,r){return this._label===e}toString(){return String(this.label)}};ia([Ai.Override],_i.prototype,"serializationType",null);ia([Ai.Override,Ai.NotNull],_i.prototype,"label",null);ia([Ai.Override],_i.prototype,"matches",null);ia([Ai.Override,Ai.NotNull],_i.prototype,"toString",null);_i=ia([F3(0,Ai.NotNull)],_i);na.AtomTransition=_i;var Oc={},qi={};/*! + */var la=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Y3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(sa,"__esModule",{value:!0});sa.AtomTransition=void 0;const J3=Wi(),Ci=X,Q3=Ar;let wi=class extends Q3.Transition{constructor(e,t){super(e),this._label=t}get serializationType(){return 5}get label(){return J3.IntervalSet.of(this._label)}matches(e,t,r){return this._label===e}toString(){return String(this.label)}};la([Ci.Override],wi.prototype,"serializationType",null);la([Ci.Override,Ci.NotNull],wi.prototype,"label",null);la([Ci.Override],wi.prototype,"matches",null);la([Ci.Override,Ci.NotNull],wi.prototype,"toString",null);wi=la([Y3(0,Ci.NotNull)],wi);sa.AtomTransition=wi;var Rc={},Ki={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(qi,"__esModule",{value:!0});qi.BlockStartState=void 0;const j3=Xr;class $3 extends j3.DecisionState{}qi.BlockStartState=$3;/*! + */Object.defineProperty(Ki,"__esModule",{value:!0});Ki.BlockStartState=void 0;const Z3=Yr;class eD extends Z3.DecisionState{}Ki.BlockStartState=eD;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var H3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Oc,"__esModule",{value:!0});Oc.BasicBlockStartState=void 0;const z3=mt,q3=qi,U3=J;class vS extends q3.BlockStartState{get stateType(){return z3.ATNStateType.BLOCK_START}}H3([U3.Override],vS.prototype,"stateType",null);Oc.BasicBlockStartState=vS;var Nc={};/*! + */var tD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Rc,"__esModule",{value:!0});Rc.BasicBlockStartState=void 0;const rD=mt,nD=Ki,iD=X;class Cb extends nD.BlockStartState{get stateType(){return rD.ATNStateType.BLOCK_START}}tD([iD.Override],Cb.prototype,"stateType",null);Rc.BasicBlockStartState=Cb;var Lc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var V3=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Nc,"__esModule",{value:!0});Nc.BlockEndState=void 0;const W3=Kr,K3=mt,G3=J;class SS extends W3.ATNState{get stateType(){return K3.ATNStateType.BLOCK_END}}V3([G3.Override],SS.prototype,"stateType",null);Nc.BlockEndState=SS;var Dc={};/*! + */var oD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.BlockEndState=void 0;const sD=Gr,lD=mt,aD=X;class wb extends sD.ATNState{get stateType(){return lD.ATNStateType.BLOCK_END}}oD([aD.Override],wb.prototype,"stateType",null);Lc.BlockEndState=wb;var kc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var oa=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},X3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.EpsilonTransition=void 0;const wo=J,Y3=Ar;let Ti=class extends Y3.Transition{constructor(e,t=-1){super(e),this._outermostPrecedenceReturn=t}get outermostPrecedenceReturn(){return this._outermostPrecedenceReturn}get serializationType(){return 1}get isEpsilon(){return!0}matches(e,t,r){return!1}toString(){return"epsilon"}};oa([wo.Override],Ti.prototype,"serializationType",null);oa([wo.Override],Ti.prototype,"isEpsilon",null);oa([wo.Override],Ti.prototype,"matches",null);oa([wo.Override,wo.NotNull],Ti.prototype,"toString",null);Ti=oa([X3(0,wo.NotNull)],Ti);Dc.EpsilonTransition=Ti;var Pc={};/*! + */var aa=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},uD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(kc,"__esModule",{value:!0});kc.EpsilonTransition=void 0;const Do=X,cD=Ar;let Oi=class extends cD.Transition{constructor(e,t=-1){super(e),this._outermostPrecedenceReturn=t}get outermostPrecedenceReturn(){return this._outermostPrecedenceReturn}get serializationType(){return 1}get isEpsilon(){return!0}matches(e,t,r){return!1}toString(){return"epsilon"}};aa([Do.Override],Oi.prototype,"serializationType",null);aa([Do.Override],Oi.prototype,"isEpsilon",null);aa([Do.Override],Oi.prototype,"matches",null);aa([Do.Override,Do.NotNull],Oi.prototype,"toString",null);Oi=aa([uD(0,Do.NotNull)],Oi);kc.EpsilonTransition=Oi;var Ic={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var $o=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},J3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Pc,"__esModule",{value:!0});Pc.LexerChannelAction=void 0;const Wa=Je,Ei=J;class yn{constructor(e){this._channel=e}get channel(){return this._channel}get actionType(){return 0}get isPositionDependent(){return!1}execute(e){e.channel=this._channel}hashCode(){let e=Wa.MurmurHash.initialize();return e=Wa.MurmurHash.update(e,this.actionType),e=Wa.MurmurHash.update(e,this._channel),Wa.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof yn?this._channel===e._channel:!1}toString(){return`channel(${this._channel})`}}$o([Ei.Override],yn.prototype,"actionType",null);$o([Ei.Override],yn.prototype,"isPositionDependent",null);$o([Ei.Override,J3(0,Ei.NotNull)],yn.prototype,"execute",null);$o([Ei.Override],yn.prototype,"hashCode",null);$o([Ei.Override],yn.prototype,"equals",null);$o([Ei.Override],yn.prototype,"toString",null);Pc.LexerChannelAction=yn;var Rc={};/*! + */var qo=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},hD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ic,"__esModule",{value:!0});Ic.LexerChannelAction=void 0;const Ja=Je,Ni=X;class bn{constructor(e){this._channel=e}get channel(){return this._channel}get actionType(){return 0}get isPositionDependent(){return!1}execute(e){e.channel=this._channel}hashCode(){let e=Ja.MurmurHash.initialize();return e=Ja.MurmurHash.update(e,this.actionType),e=Ja.MurmurHash.update(e,this._channel),Ja.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof bn?this._channel===e._channel:!1}toString(){return`channel(${this._channel})`}}qo([Ni.Override],bn.prototype,"actionType",null);qo([Ni.Override],bn.prototype,"isPositionDependent",null);qo([Ni.Override,hD(0,Ni.NotNull)],bn.prototype,"execute",null);qo([Ni.Override],bn.prototype,"hashCode",null);qo([Ni.Override],bn.prototype,"equals",null);qo([Ni.Override],bn.prototype,"toString",null);Ic.LexerChannelAction=bn;var Mc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var sa=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Q3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Rc,"__esModule",{value:!0});Rc.LexerCustomAction=void 0;const ys=Je,Oo=J;class Jn{constructor(e,t){this._ruleIndex=e,this._actionIndex=t}get ruleIndex(){return this._ruleIndex}get actionIndex(){return this._actionIndex}get actionType(){return 1}get isPositionDependent(){return!0}execute(e){e.action(void 0,this._ruleIndex,this._actionIndex)}hashCode(){let e=ys.MurmurHash.initialize();return e=ys.MurmurHash.update(e,this.actionType),e=ys.MurmurHash.update(e,this._ruleIndex),e=ys.MurmurHash.update(e,this._actionIndex),ys.MurmurHash.finish(e,3)}equals(e){return e===this?!0:e instanceof Jn?this._ruleIndex===e._ruleIndex&&this._actionIndex===e._actionIndex:!1}}sa([Oo.Override],Jn.prototype,"actionType",null);sa([Oo.Override],Jn.prototype,"isPositionDependent",null);sa([Oo.Override,Q3(0,Oo.NotNull)],Jn.prototype,"execute",null);sa([Oo.Override],Jn.prototype,"hashCode",null);sa([Oo.Override],Jn.prototype,"equals",null);Rc.LexerCustomAction=Jn;var Lc={};/*! + */var ua=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},fD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Mc,"__esModule",{value:!0});Mc.LexerCustomAction=void 0;const bs=Je,Po=X;class Qn{constructor(e,t){this._ruleIndex=e,this._actionIndex=t}get ruleIndex(){return this._ruleIndex}get actionIndex(){return this._actionIndex}get actionType(){return 1}get isPositionDependent(){return!0}execute(e){e.action(void 0,this._ruleIndex,this._actionIndex)}hashCode(){let e=bs.MurmurHash.initialize();return e=bs.MurmurHash.update(e,this.actionType),e=bs.MurmurHash.update(e,this._ruleIndex),e=bs.MurmurHash.update(e,this._actionIndex),bs.MurmurHash.finish(e,3)}equals(e){return e===this?!0:e instanceof Qn?this._ruleIndex===e._ruleIndex&&this._actionIndex===e._actionIndex:!1}}ua([Po.Override],Qn.prototype,"actionType",null);ua([Po.Override],Qn.prototype,"isPositionDependent",null);ua([Po.Override,fD(0,Po.NotNull)],Qn.prototype,"execute",null);ua([Po.Override],Qn.prototype,"hashCode",null);ua([Po.Override],Qn.prototype,"equals",null);Mc.LexerCustomAction=Qn;var Fc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Ho=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Z3=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.LexerModeAction=void 0;const Ka=Je,Ci=J;class vn{constructor(e){this._mode=e}get mode(){return this._mode}get actionType(){return 2}get isPositionDependent(){return!1}execute(e){e.mode(this._mode)}hashCode(){let e=Ka.MurmurHash.initialize();return e=Ka.MurmurHash.update(e,this.actionType),e=Ka.MurmurHash.update(e,this._mode),Ka.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof vn?this._mode===e._mode:!1}toString(){return`mode(${this._mode})`}}Ho([Ci.Override],vn.prototype,"actionType",null);Ho([Ci.Override],vn.prototype,"isPositionDependent",null);Ho([Ci.Override,Z3(0,Ci.NotNull)],vn.prototype,"execute",null);Ho([Ci.Override],vn.prototype,"hashCode",null);Ho([Ci.Override],vn.prototype,"equals",null);Ho([Ci.Override],vn.prototype,"toString",null);Lc.LexerModeAction=vn;var bS={};(function(n){/*! + */var Uo=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},dD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Fc,"__esModule",{value:!0});Fc.LexerModeAction=void 0;const Qa=Je,Di=X;class Sn{constructor(e){this._mode=e}get mode(){return this._mode}get actionType(){return 2}get isPositionDependent(){return!1}execute(e){e.mode(this._mode)}hashCode(){let e=Qa.MurmurHash.initialize();return e=Qa.MurmurHash.update(e,this.actionType),e=Qa.MurmurHash.update(e,this._mode),Qa.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof Sn?this._mode===e._mode:!1}toString(){return`mode(${this._mode})`}}Uo([Di.Override],Sn.prototype,"actionType",null);Uo([Di.Override],Sn.prototype,"isPositionDependent",null);Uo([Di.Override,dD(0,Di.NotNull)],Sn.prototype,"execute",null);Uo([Di.Override],Sn.prototype,"hashCode",null);Uo([Di.Override],Sn.prototype,"equals",null);Uo([Di.Override],Sn.prototype,"toString",null);Fc.LexerModeAction=Sn;var Ob={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h},t=w&&w.__param||function(s,l){return function(a,u){l(a,u,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.LexerMoreAction=void 0;const r=Je,i=J;class o{constructor(){}get actionType(){return 3}get isPositionDependent(){return!1}execute(l){l.more()}hashCode(){let l=r.MurmurHash.initialize();return l=r.MurmurHash.update(l,this.actionType),r.MurmurHash.finish(l,1)}equals(l){return l===this}toString(){return"more"}}e([i.Override],o.prototype,"actionType",null),e([i.Override],o.prototype,"isPositionDependent",null),e([i.Override,t(0,i.NotNull)],o.prototype,"execute",null),e([i.Override],o.prototype,"hashCode",null),e([i.Override],o.prototype,"equals",null),e([i.Override],o.prototype,"toString",null),n.LexerMoreAction=o,function(s){s.INSTANCE=new s}(o=n.LexerMoreAction||(n.LexerMoreAction={}))})(bS);var AS={};(function(n){/*! + */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h},t=w&&w.__param||function(s,l){return function(a,u){l(a,u,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.LexerMoreAction=void 0;const r=Je,i=X;class o{constructor(){}get actionType(){return 3}get isPositionDependent(){return!1}execute(l){l.more()}hashCode(){let l=r.MurmurHash.initialize();return l=r.MurmurHash.update(l,this.actionType),r.MurmurHash.finish(l,1)}equals(l){return l===this}toString(){return"more"}}e([i.Override],o.prototype,"actionType",null),e([i.Override],o.prototype,"isPositionDependent",null),e([i.Override,t(0,i.NotNull)],o.prototype,"execute",null),e([i.Override],o.prototype,"hashCode",null),e([i.Override],o.prototype,"equals",null),e([i.Override],o.prototype,"toString",null),n.LexerMoreAction=o,function(s){s.INSTANCE=new s}(o=n.LexerMoreAction||(n.LexerMoreAction={}))})(Ob);var Nb={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h},t=w&&w.__param||function(s,l){return function(a,u){l(a,u,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.LexerPopModeAction=void 0;const r=Je,i=J;class o{constructor(){}get actionType(){return 4}get isPositionDependent(){return!1}execute(l){l.popMode()}hashCode(){let l=r.MurmurHash.initialize();return l=r.MurmurHash.update(l,this.actionType),r.MurmurHash.finish(l,1)}equals(l){return l===this}toString(){return"popMode"}}e([i.Override],o.prototype,"actionType",null),e([i.Override],o.prototype,"isPositionDependent",null),e([i.Override,t(0,i.NotNull)],o.prototype,"execute",null),e([i.Override],o.prototype,"hashCode",null),e([i.Override],o.prototype,"equals",null),e([i.Override],o.prototype,"toString",null),n.LexerPopModeAction=o,function(s){s.INSTANCE=new s}(o=n.LexerPopModeAction||(n.LexerPopModeAction={}))})(AS);var kc={};/*! + */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h},t=w&&w.__param||function(s,l){return function(a,u){l(a,u,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.LexerPopModeAction=void 0;const r=Je,i=X;class o{constructor(){}get actionType(){return 4}get isPositionDependent(){return!1}execute(l){l.popMode()}hashCode(){let l=r.MurmurHash.initialize();return l=r.MurmurHash.update(l,this.actionType),r.MurmurHash.finish(l,1)}equals(l){return l===this}toString(){return"popMode"}}e([i.Override],o.prototype,"actionType",null),e([i.Override],o.prototype,"isPositionDependent",null),e([i.Override,t(0,i.NotNull)],o.prototype,"execute",null),e([i.Override],o.prototype,"hashCode",null),e([i.Override],o.prototype,"equals",null),e([i.Override],o.prototype,"toString",null),n.LexerPopModeAction=o,function(s){s.INSTANCE=new s}(o=n.LexerPopModeAction||(n.LexerPopModeAction={}))})(Nb);var Bc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var zo=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},eD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(kc,"__esModule",{value:!0});kc.LexerPushModeAction=void 0;const Ga=Je,wi=J;class Sn{constructor(e){this._mode=e}get mode(){return this._mode}get actionType(){return 5}get isPositionDependent(){return!1}execute(e){e.pushMode(this._mode)}hashCode(){let e=Ga.MurmurHash.initialize();return e=Ga.MurmurHash.update(e,this.actionType),e=Ga.MurmurHash.update(e,this._mode),Ga.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof Sn?this._mode===e._mode:!1}toString(){return`pushMode(${this._mode})`}}zo([wi.Override],Sn.prototype,"actionType",null);zo([wi.Override],Sn.prototype,"isPositionDependent",null);zo([wi.Override,eD(0,wi.NotNull)],Sn.prototype,"execute",null);zo([wi.Override],Sn.prototype,"hashCode",null);zo([wi.Override],Sn.prototype,"equals",null);zo([wi.Override],Sn.prototype,"toString",null);kc.LexerPushModeAction=Sn;var _S={};(function(n){/*! + */var Vo=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},pD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Bc,"__esModule",{value:!0});Bc.LexerPushModeAction=void 0;const Za=Je,Pi=X;class An{constructor(e){this._mode=e}get mode(){return this._mode}get actionType(){return 5}get isPositionDependent(){return!1}execute(e){e.pushMode(this._mode)}hashCode(){let e=Za.MurmurHash.initialize();return e=Za.MurmurHash.update(e,this.actionType),e=Za.MurmurHash.update(e,this._mode),Za.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof An?this._mode===e._mode:!1}toString(){return`pushMode(${this._mode})`}}Vo([Pi.Override],An.prototype,"actionType",null);Vo([Pi.Override],An.prototype,"isPositionDependent",null);Vo([Pi.Override,pD(0,Pi.NotNull)],An.prototype,"execute",null);Vo([Pi.Override],An.prototype,"hashCode",null);Vo([Pi.Override],An.prototype,"equals",null);Vo([Pi.Override],An.prototype,"toString",null);Bc.LexerPushModeAction=An;var Db={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h},t=w&&w.__param||function(s,l){return function(a,u){l(a,u,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.LexerSkipAction=void 0;const r=Je,i=J;class o{constructor(){}get actionType(){return 6}get isPositionDependent(){return!1}execute(l){l.skip()}hashCode(){let l=r.MurmurHash.initialize();return l=r.MurmurHash.update(l,this.actionType),r.MurmurHash.finish(l,1)}equals(l){return l===this}toString(){return"skip"}}e([i.Override],o.prototype,"actionType",null),e([i.Override],o.prototype,"isPositionDependent",null),e([i.Override,t(0,i.NotNull)],o.prototype,"execute",null),e([i.Override],o.prototype,"hashCode",null),e([i.Override],o.prototype,"equals",null),e([i.Override],o.prototype,"toString",null),n.LexerSkipAction=o,function(s){s.INSTANCE=new s}(o=n.LexerSkipAction||(n.LexerSkipAction={}))})(_S);var Ic={};/*! + */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h},t=w&&w.__param||function(s,l){return function(a,u){l(a,u,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.LexerSkipAction=void 0;const r=Je,i=X;class o{constructor(){}get actionType(){return 6}get isPositionDependent(){return!1}execute(l){l.skip()}hashCode(){let l=r.MurmurHash.initialize();return l=r.MurmurHash.update(l,this.actionType),r.MurmurHash.finish(l,1)}equals(l){return l===this}toString(){return"skip"}}e([i.Override],o.prototype,"actionType",null),e([i.Override],o.prototype,"isPositionDependent",null),e([i.Override,t(0,i.NotNull)],o.prototype,"execute",null),e([i.Override],o.prototype,"hashCode",null),e([i.Override],o.prototype,"equals",null),e([i.Override],o.prototype,"toString",null),n.LexerSkipAction=o,function(s){s.INSTANCE=new s}(o=n.LexerSkipAction||(n.LexerSkipAction={}))})(Db);var jc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var qo=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},tD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ic,"__esModule",{value:!0});Ic.LexerTypeAction=void 0;const Xa=Je,Oi=J;class bn{constructor(e){this._type=e}get type(){return this._type}get actionType(){return 7}get isPositionDependent(){return!1}execute(e){e.type=this._type}hashCode(){let e=Xa.MurmurHash.initialize();return e=Xa.MurmurHash.update(e,this.actionType),e=Xa.MurmurHash.update(e,this._type),Xa.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof bn?this._type===e._type:!1}toString(){return`type(${this._type})`}}qo([Oi.Override],bn.prototype,"actionType",null);qo([Oi.Override],bn.prototype,"isPositionDependent",null);qo([Oi.Override,tD(0,Oi.NotNull)],bn.prototype,"execute",null);qo([Oi.Override],bn.prototype,"hashCode",null);qo([Oi.Override],bn.prototype,"equals",null);qo([Oi.Override],bn.prototype,"toString",null);Ic.LexerTypeAction=bn;var la={};/*! + */var Wo=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},mD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(jc,"__esModule",{value:!0});jc.LexerTypeAction=void 0;const eu=Je,Ri=X;class _n{constructor(e){this._type=e}get type(){return this._type}get actionType(){return 7}get isPositionDependent(){return!1}execute(e){e.type=this._type}hashCode(){let e=eu.MurmurHash.initialize();return e=eu.MurmurHash.update(e,this.actionType),e=eu.MurmurHash.update(e,this._type),eu.MurmurHash.finish(e,2)}equals(e){return e===this?!0:e instanceof _n?this._type===e._type:!1}toString(){return`type(${this._type})`}}Wo([Ri.Override],_n.prototype,"actionType",null);Wo([Ri.Override],_n.prototype,"isPositionDependent",null);Wo([Ri.Override,mD(0,Ri.NotNull)],_n.prototype,"execute",null);Wo([Ri.Override],_n.prototype,"hashCode",null);Wo([Ri.Override],_n.prototype,"equals",null);Wo([Ri.Override],_n.prototype,"toString",null);jc.LexerTypeAction=_n;var ca={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var rD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(la,"__esModule",{value:!0});la.LoopEndState=void 0;const nD=Kr,iD=mt,oD=J;class TS extends nD.ATNState{get stateType(){return iD.ATNStateType.LOOP_END}}rD([oD.Override],TS.prototype,"stateType",null);la.LoopEndState=TS;var vs={},Fc={};/*! + */var gD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(ca,"__esModule",{value:!0});ca.LoopEndState=void 0;const xD=Gr,yD=mt,vD=X;class Pb extends xD.ATNState{get stateType(){return yD.ATNStateType.LOOP_END}}gD([vD.Override],Pb.prototype,"stateType",null);ca.LoopEndState=Pb;var Ss={},$c={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var ES=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Fc,"__esModule",{value:!0});Fc.ConflictInfo=void 0;const CS=J,sD=ut;class aa{constructor(e,t){this._conflictedAlts=e,this.exact=t}get conflictedAlts(){return this._conflictedAlts}get isExact(){return this.exact}equals(e){return e===this?!0:e instanceof aa?this.isExact===e.isExact&&sD.equals(this.conflictedAlts,e.conflictedAlts):!1}hashCode(){return this.conflictedAlts.hashCode()}}ES([CS.Override],aa.prototype,"equals",null);ES([CS.Override],aa.prototype,"hashCode",null);Fc.ConflictInfo=aa;var Ss={},Uo={},An={};/*! + */var Rb=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty($c,"__esModule",{value:!0});$c.ConflictInfo=void 0;const Lb=X,bD=ut;class ha{constructor(e,t){this._conflictedAlts=e,this.exact=t}get conflictedAlts(){return this._conflictedAlts}get isExact(){return this.exact}equals(e){return e===this?!0:e instanceof ha?this.isExact===e.isExact&&bD.equals(this.conflictedAlts,e.conflictedAlts):!1}hashCode(){return this.conflictedAlts.hashCode()}}Rb([Lb.Override],ha.prototype,"equals",null);Rb([Lb.Override],ha.prototype,"hashCode",null);$c.ConflictInfo=ha;var As={},Zn={},Cr={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Jr=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(An,"__esModule",{value:!0});An.TerminalNode=void 0;const lD=Ct,Qr=J,aD=ze;class Cr{constructor(e){this._symbol=e}getChild(e){throw new RangeError("Terminal Node has no children.")}get symbol(){return this._symbol}get parent(){return this._parent}setParent(e){this._parent=e}get payload(){return this._symbol}get sourceInterval(){let e=this._symbol.tokenIndex;return new lD.Interval(e,e)}get childCount(){return 0}accept(e){return e.visitTerminal(this)}get text(){return this._symbol.text||""}toStringTree(e){return this.toString()}toString(){return this._symbol.type===aD.Token.EOF?"":this._symbol.text||""}}Jr([Qr.Override],Cr.prototype,"getChild",null);Jr([Qr.Override],Cr.prototype,"parent",null);Jr([Qr.Override],Cr.prototype,"setParent",null);Jr([Qr.Override],Cr.prototype,"payload",null);Jr([Qr.Override],Cr.prototype,"sourceInterval",null);Jr([Qr.Override],Cr.prototype,"childCount",null);Jr([Qr.Override],Cr.prototype,"accept",null);Jr([Qr.Override],Cr.prototype,"text",null);Jr([Qr.Override],Cr.prototype,"toStringTree",null);Jr([Qr.Override],Cr.prototype,"toString",null);An.TerminalNode=Cr;/*! + */var Qr=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.TerminalNode=void 0;const SD=Ct,Zr=X,AD=ze;class wr{constructor(e){this._symbol=e}getChild(e){throw new RangeError("Terminal Node has no children.")}get symbol(){return this._symbol}get parent(){return this._parent}setParent(e){this._parent=e}get payload(){return this._symbol}get sourceInterval(){let e=this._symbol.tokenIndex;return new SD.Interval(e,e)}get childCount(){return 0}accept(e){return e.visitTerminal(this)}get text(){return this._symbol.text||""}toStringTree(e){return this.toString()}toString(){return this._symbol.type===AD.Token.EOF?"":this._symbol.text||""}}Qr([Zr.Override],wr.prototype,"getChild",null);Qr([Zr.Override],wr.prototype,"parent",null);Qr([Zr.Override],wr.prototype,"setParent",null);Qr([Zr.Override],wr.prototype,"payload",null);Qr([Zr.Override],wr.prototype,"sourceInterval",null);Qr([Zr.Override],wr.prototype,"childCount",null);Qr([Zr.Override],wr.prototype,"accept",null);Qr([Zr.Override],wr.prototype,"text",null);Qr([Zr.Override],wr.prototype,"toStringTree",null);Qr([Zr.Override],wr.prototype,"toString",null);Cr.TerminalNode=wr;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var uD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.ErrorNode=void 0;const cD=J,hD=An;class wS extends hD.TerminalNode{constructor(e){super(e)}accept(e){return e.visitErrorNode(this)}}uD([cD.Override],wS.prototype,"accept",null);Uo.ErrorNode=wS;var bs={},Vo={};/*! + */var _D=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ErrorNode=void 0;const TD=X,ED=Cr;class kb extends ED.TerminalNode{constructor(e){super(e)}accept(e){return e.visitErrorNode(this)}}_D([TD.Override],kb.prototype,"accept",null);Zn.ErrorNode=kb;var _s={},ei={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Vo,"__esModule",{value:!0});Vo.RuleNode=void 0;class fD{}Vo.RuleNode=fD;var As={},Ng;function Ui(){if(Ng)return As;Ng=1;/*! + */Object.defineProperty(ei,"__esModule",{value:!0});ei.RuleNode=void 0;class CD{}ei.RuleNode=CD;var Ts={},Mg;function ti(){if(Mg)return Ts;Mg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(d,p,v,m){var y=arguments.length,g=y<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,v):m,x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(d,p,v,m);else for(var S=d.length-1;S>=0;S--)(x=d[S])&&(g=(y<3?x(g):y>3?x(p,v,g):x(p,v))||g);return y>3&&g&&Object.defineProperty(p,v,g),g},e=w&&w.__param||function(d,p){return function(v,m){p(v,m,d)}};Object.defineProperty(As,"__esModule",{value:!0}),As.Trees=void 0;const t=xn(),r=Wn,i=Uo,o=J,s=va(),l=wr(),a=Vo,u=An,c=ze,h=ut;let f=class Tn{static toStringTree(p,v){let m;v instanceof s.Parser?m=v.ruleNames:m=v;let y=h.escapeWhitespace(this.getNodeText(p,m),!1);if(p.childCount===0)return y;let g="";g+="(",y=h.escapeWhitespace(this.getNodeText(p,m),!1),g+=y,g+=" ";for(let x=0;x0&&(g+=" "),g+=this.toStringTree(p.getChild(x),m);return g+=")",g}static getNodeText(p,v){let m;if(v instanceof s.Parser)m=v.ruleNames;else if(v)m=v;else{let y=p.payload;return typeof y.text=="string"?y.text:p.payload.toString()}if(p instanceof a.RuleNode){let y=p.ruleContext,g=y.ruleIndex,x=m[g],S=y.altNumber;return S!==t.ATN.INVALID_ALT_NUMBER?x+":"+S:x}else{if(p instanceof i.ErrorNode)return p.toString();if(p instanceof u.TerminalNode)return p.symbol.text||""}throw new TypeError("Unexpected node type")}static getChildren(p){let v=[];for(let m=0;m=p.start.tokenIndex&&(g==null||m<=g.tokenIndex))return p}}static stripChildrenOutOfRange(p,v,m,y){if(!p)return;let g=p.childCount;for(let x=0;xy)&&Tn.isAncestorOf(S,v)){let b=new r.CommonToken(c.Token.INVALID_TYPE,"...");p.children[x]=new u.TerminalNode(b)}}}static findNodeSuchThat(p,v){if(v(p))return p;let m=p.childCount;for(let y=0;y=0;b--)(x=d[b])&&(g=(y<3?x(g):y>3?x(p,v,g):x(p,v))||g);return y>3&&g&&Object.defineProperty(p,v,g),g},e=w&&w.__param||function(d,p){return function(v,m){p(v,m,d)}};Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.Trees=void 0;const t=vn(),r=Kn,i=Zn,o=X,s=Aa(),l=Or(),a=ei,u=Cr,c=ze,h=ut;let f=class En{static toStringTree(p,v){let m;v instanceof s.Parser?m=v.ruleNames:m=v;let y=h.escapeWhitespace(this.getNodeText(p,m),!1);if(p.childCount===0)return y;let g="";g+="(",y=h.escapeWhitespace(this.getNodeText(p,m),!1),g+=y,g+=" ";for(let x=0;x0&&(g+=" "),g+=this.toStringTree(p.getChild(x),m);return g+=")",g}static getNodeText(p,v){let m;if(v instanceof s.Parser)m=v.ruleNames;else if(v)m=v;else{let y=p.payload;return typeof y.text=="string"?y.text:p.payload.toString()}if(p instanceof a.RuleNode){let y=p.ruleContext,g=y.ruleIndex,x=m[g],b=y.altNumber;return b!==t.ATN.INVALID_ALT_NUMBER?x+":"+b:x}else{if(p instanceof i.ErrorNode)return p.toString();if(p instanceof u.TerminalNode)return p.symbol.text||""}throw new TypeError("Unexpected node type")}static getChildren(p){let v=[];for(let m=0;m=p.start.tokenIndex&&(g==null||m<=g.tokenIndex))return p}}static stripChildrenOutOfRange(p,v,m,y){if(!p)return;let g=p.childCount;for(let x=0;xy)&&En.isAncestorOf(b,v)){let S=new r.CommonToken(c.Token.INVALID_TYPE,"...");p.children[x]=new u.TerminalNode(S)}}}static findNodeSuchThat(p,v){if(v(p))return p;let m=p.childCount;for(let y=0;y=0;m--)(v=u[m])&&(p=(d<3?v(p):d>3?v(c,h,p):v(c,h))||p);return d>3&&p&&Object.defineProperty(c,h,p),p};Object.defineProperty(bs,"__esModule",{value:!0}),bs.RuleContext=void 0;const e=xn(),t=Kn,r=Vo,i=Ct,o=J,s=Ui(),l=wr();let a=class OS extends r.RuleNode{constructor(c,h){super(),this._parent=c,this.invokingState=h??-1}static getChildContext(c,h){return new OS(c,h)}depth(){let c=0,h=this;for(;h;)h=h._parent,c++;return c}get isEmpty(){return this.invokingState===-1}get sourceInterval(){return i.Interval.INVALID}get ruleContext(){return this}get parent(){return this._parent}setParent(c){this._parent=c}get payload(){return this}get text(){if(this.childCount===0)return"";let c="";for(let h=0;h=0&&v=0;m--)(v=u[m])&&(p=(d<3?v(p):d>3?v(c,h,p):v(c,h))||p);return d>3&&p&&Object.defineProperty(c,h,p),p};Object.defineProperty(_s,"__esModule",{value:!0}),_s.RuleContext=void 0;const e=vn(),t=Gn,r=ei,i=Ct,o=X,s=ti(),l=Or();let a=class Ib extends r.RuleNode{constructor(c,h){super(),this._parent=c,this.invokingState=h??-1}static getChildContext(c,h){return new Ib(c,h)}depth(){let c=0,h=this;for(;h;)h=h._parent,c++;return c}get isEmpty(){return this.invokingState===-1}get sourceInterval(){return i.Interval.INVALID}get ruleContext(){return this}get parent(){return this._parent}setParent(c){this._parent=c}get payload(){return this}get text(){if(this.childCount===0)return"";let c="";for(let h=0;h=0&&v=0;p--)(d=l[p])&&(f=(h<3?d(f):h>3?d(a,u,f):d(a,u))||f);return h>3&&f&&Object.defineProperty(a,u,f),f};Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.ParserRuleContext=void 0;const e=Uo,t=Ct,r=J,i=NS(),o=An;let s=class Dd extends i.RuleContext{constructor(a,u){u==null?super():super(a,u)}static emptyContext(){return Dd.EMPTY}copyFrom(a){if(this._parent=a._parent,this.invokingState=a.invokingState,this._start=a._start,this._stop=a._stop,a.children){this.children=[];for(let u of a.children)u instanceof e.ErrorNode&&this.addChild(u)}}enterRule(a){}exitRule(a){}addAnyChild(a){return this.children?this.children.push(a):this.children=[a],a}addChild(a){if(a instanceof o.TerminalNode){a.setParent(this),this.addAnyChild(a);return}else if(a instanceof i.RuleContext){this.addAnyChild(a);return}else return a=new o.TerminalNode(a),this.addAnyChild(a),a.setParent(this),a}addErrorNode(a){if(a instanceof e.ErrorNode){const u=a;return u.setParent(this),this.addAnyChild(u)}else{const u=a;let c=new e.ErrorNode(u);return this.addAnyChild(c),c.setParent(this),c}}removeLastChild(){this.children&&this.children.pop()}get parent(){let a=super.parent;if(a===void 0||a instanceof Dd)return a;throw new TypeError("Invalid parent type for ParserRuleContext")}getChild(a,u){if(!this.children||a<0||a>=this.children.length)throw new RangeError("index parameter must be between >= 0 and <= number of children.");if(u==null)return this.children[a];let c=this.tryGetChild(a,u);if(c===void 0)throw new Error("The specified node does not exist");return c}tryGetChild(a,u){if(!this.children||a<0||a>=this.children.length)return;let c=-1;for(let h of this.children)if(h instanceof u&&(c++,c===a))return h}getToken(a,u){let c=this.tryGetToken(a,u);if(c===void 0)throw new Error("The specified token does not exist");return c}tryGetToken(a,u){if(!this.children||u<0||u>=this.children.length)return;let c=-1;for(let h of this.children)if(h instanceof o.TerminalNode&&h.symbol.type===a&&(c++,c===u))return h}getTokens(a){let u=[];if(!this.children)return u;for(let c of this.children)c instanceof o.TerminalNode&&c.symbol.type===a&&u.push(c);return u}get ruleContext(){return this}getRuleContext(a,u){return this.getChild(a,u)}tryGetRuleContext(a,u){return this.tryGetChild(a,u)}getRuleContexts(a){let u=[];if(!this.children)return u;for(let c of this.children)c instanceof a&&u.push(c);return u}get childCount(){return this.children?this.children.length:0}get sourceInterval(){return this._start?!this._stop||this._stop.tokenIndex=0;p--)(d=l[p])&&(f=(h<3?d(f):h>3?d(a,u,f):d(a,u))||f);return h>3&&f&&Object.defineProperty(a,u,f),f};Object.defineProperty(As,"__esModule",{value:!0}),As.ParserRuleContext=void 0;const e=Zn,t=Ct,r=X,i=Mb(),o=Cr;let s=class Bd extends i.RuleContext{constructor(a,u){u==null?super():super(a,u)}static emptyContext(){return Bd.EMPTY}copyFrom(a){if(this._parent=a._parent,this.invokingState=a.invokingState,this._start=a._start,this._stop=a._stop,a.children){this.children=[];for(let u of a.children)u instanceof e.ErrorNode&&this.addChild(u)}}enterRule(a){}exitRule(a){}addAnyChild(a){return this.children?this.children.push(a):this.children=[a],a}addChild(a){if(a instanceof o.TerminalNode){a.setParent(this),this.addAnyChild(a);return}else if(a instanceof i.RuleContext){this.addAnyChild(a);return}else return a=new o.TerminalNode(a),this.addAnyChild(a),a.setParent(this),a}addErrorNode(a){if(a instanceof e.ErrorNode){const u=a;return u.setParent(this),this.addAnyChild(u)}else{const u=a;let c=new e.ErrorNode(u);return this.addAnyChild(c),c.setParent(this),c}}removeLastChild(){this.children&&this.children.pop()}get parent(){let a=super.parent;if(a===void 0||a instanceof Bd)return a;throw new TypeError("Invalid parent type for ParserRuleContext")}getChild(a,u){if(!this.children||a<0||a>=this.children.length)throw new RangeError("index parameter must be between >= 0 and <= number of children.");if(u==null)return this.children[a];let c=this.tryGetChild(a,u);if(c===void 0)throw new Error("The specified node does not exist");return c}tryGetChild(a,u){if(!this.children||a<0||a>=this.children.length)return;let c=-1;for(let h of this.children)if(h instanceof u&&(c++,c===a))return h}getToken(a,u){let c=this.tryGetToken(a,u);if(c===void 0)throw new Error("The specified token does not exist");return c}tryGetToken(a,u){if(!this.children||u<0||u>=this.children.length)return;let c=-1;for(let h of this.children)if(h instanceof o.TerminalNode&&h.symbol.type===a&&(c++,c===u))return h}getTokens(a){let u=[];if(!this.children)return u;for(let c of this.children)c instanceof o.TerminalNode&&c.symbol.type===a&&u.push(c);return u}get ruleContext(){return this}getRuleContext(a,u){return this.getChild(a,u)}tryGetRuleContext(a,u){return this.tryGetChild(a,u)}getRuleContexts(a){let u=[];if(!this.children)return u;for(let c of this.children)c instanceof a&&u.push(c);return u}get childCount(){return this.children?this.children.length:0}get sourceInterval(){return this._start?!this._stop||this._stop.tokenIndex=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(n,"__esModule",{value:!0}),n.PredictionMode=void 0;const t=mn,r=Je,i=J,o=Xn;(function(s){s[s.SLL=0]="SLL",s[s.LL=1]="LL",s[s.LL_EXACT_AMBIG_DETECTION=2]="LL_EXACT_AMBIG_DETECTION"})(n.PredictionMode||(n.PredictionMode={})),function(s){class l extends t.Array2DHashMap{constructor(){super(a.INSTANCE)}}class a{AltAndContextConfigEqualityComparator(){}hashCode(f){let d=r.MurmurHash.initialize(7);return d=r.MurmurHash.update(d,f.state.stateNumber),d=r.MurmurHash.update(d,f.context),d=r.MurmurHash.finish(d,2),d}equals(f,d){return f===d?!0:f==null||d==null?!1:f.state.stateNumber===d.state.stateNumber&&f.context.equals(d.context)}}a.INSTANCE=new a,e([i.Override],a.prototype,"hashCode",null),e([i.Override],a.prototype,"equals",null);function u(h){for(let f of h)if(f.state instanceof o.RuleStopState)return!0;return!1}s.hasConfigInRuleStopState=u;function c(h){for(let f of h)if(!(f.state instanceof o.RuleStopState))return!1;return!0}s.allConfigsInRuleStopStates=c}(n.PredictionMode||(n.PredictionMode={}))})(DS);var _s={},Rg;function PS(){if(Rg)return _s;Rg=1;/*! + */var e=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(n,"__esModule",{value:!0}),n.PredictionMode=void 0;const t=xn,r=Je,i=X,o=Yn;(function(s){s[s.SLL=0]="SLL",s[s.LL=1]="LL",s[s.LL_EXACT_AMBIG_DETECTION=2]="LL_EXACT_AMBIG_DETECTION"})(n.PredictionMode||(n.PredictionMode={})),function(s){class l extends t.Array2DHashMap{constructor(){super(a.INSTANCE)}}class a{AltAndContextConfigEqualityComparator(){}hashCode(f){let d=r.MurmurHash.initialize(7);return d=r.MurmurHash.update(d,f.state.stateNumber),d=r.MurmurHash.update(d,f.context),d=r.MurmurHash.finish(d,2),d}equals(f,d){return f===d?!0:f==null||d==null?!1:f.state.stateNumber===d.state.stateNumber&&f.context.equals(d.context)}}a.INSTANCE=new a,e([i.Override],a.prototype,"hashCode",null),e([i.Override],a.prototype,"equals",null);function u(h){for(let f of h)if(f.state instanceof o.RuleStopState)return!0;return!1}s.hasConfigInRuleStopState=u;function c(h){for(let f of h)if(!(f.state instanceof o.RuleStopState))return!1;return!0}s.allConfigsInRuleStopStates=c}(n.PredictionMode||(n.PredictionMode={}))})(Fb);var Es={},jg;function Bb(){if(jg)return Es;jg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(_s,"__esModule",{value:!0}),_s.SimulatorState=void 0;const t=J,r=wr();let i=class{constructor(s,l,a,u){this.outerContext=s??r.ParserRuleContext.emptyContext(),this.s0=l,this.useContext=a,this.remainingOuterContext=u}};return i=n([e(1,t.NotNull)],i),_s.SimulatorState=i,_s}var Lg;function ua(){if(Lg)return vs;Lg=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Es,"__esModule",{value:!0}),Es.SimulatorState=void 0;const t=X,r=Or();let i=class{constructor(s,l,a,u){this.outerContext=s??r.ParserRuleContext.emptyContext(),this.s0=l,this.useContext=a,this.remainingOuterContext=u}};return i=n([e(1,t.NotNull)],i),Es.SimulatorState=i,Es}var $g;function fa(){if($g)return Ss;$g=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(le,E,A,T){var N=arguments.length,R=N<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,A):T,P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(le,E,A,T);else for(var L=le.length-1;L>=0;L--)(P=le[L])&&(R=(N<3?P(R):N>3?P(E,A,R):P(E,A))||R);return N>3&&R&&Object.defineProperty(E,A,R),R},e=w&&w.__param||function(le,E){return function(A,T){E(A,T,le)}};Object.defineProperty(vs,"__esModule",{value:!0}),vs.ParserATNSimulator=void 0;const t=Wl,r=ea,i=_r,o=xc,s=xn(),l=Mi,a=Kl(),u=Ac(),c=mt,h=na,f=Er,d=Fc,p=Xr,v=bc(),m=Fo,y=Ct,g=pn,x=J,S=Np(),_=Jc(),b=nr,C=wr(),O=Tr(),D=Cp(),M=DS,j=Xn,k=jo,V=ki,se=Op(),ie=PS(),fe=ze,Ee=gn,me=jt(),ee=65535,X=-(1<<31>>>0);let Z=class we extends u.ATNSimulator{constructor(E,A){super(E),this.predictionMode=M.PredictionMode.LL,this.force_global_context=!1,this.always_try_local_context=!0,this.enable_global_context_dfa=!1,this.optimize_unique_closure=!0,this.optimize_ll1=!0,this.optimize_tail_calls=!0,this.tail_call_preserves_sll=!0,this.treat_sllk1_conflict_as_ambiguity=!1,this.reportAmbiguities=!1,this.userWantsCtxSensitive=!0,this._parser=A}getPredictionMode(){return this.predictionMode}setPredictionMode(E){this.predictionMode=E}reset(){}adaptivePredict(E,A,T,N){N===void 0&&(N=!1);let R=this.atn.decisionToDFA[A];if(me(R!=null),this.optimize_ll1&&!R.isPrecedenceDfa&&!R.isEmpty){let W=E.LA(1);if(W>=0&&W<=65535){let Y=(A<<16>>>0)+W,I=this.atn.LL1Table.get(Y);if(I!=null)return I}}this.dfa=R,this.force_global_context?N=!0:this.always_try_local_context||(N=N||R.isContextSensitive),this.userWantsCtxSensitive=N||this.predictionMode!==M.PredictionMode.SLL&&T!=null&&!this.atn.decisionToState[A].sll,T==null&&(T=C.ParserRuleContext.emptyContext());let P;R.isEmpty||(P=this.getStartState(R,E,T,N)),P==null&&(T==null&&(T=C.ParserRuleContext.emptyContext()),we.debug&&console.log("ATN decision "+R.decision+" exec LA(1)=="+this.getLookaheadName(E)+", outerContext="+T.toString(this._parser)),P=this.computeStartState(R,T,N));let L=E.mark(),z=E.index;try{let W=this.execDFA(R,E,z,P);return we.debug&&console.log("DFA after predictATN: "+R.toString(this._parser.vocabulary,this._parser.ruleNames)),W}finally{this.dfa=void 0,E.seek(z),E.release(L)}}getStartState(E,A,T,N){if(!N)if(E.isPrecedenceDfa){let L=E.getPrecedenceStartState(this._parser.precedence,!1);return L==null?void 0:new ie.SimulatorState(T,L,!1,T)}else return E.s0==null?void 0:new ie.SimulatorState(T,E.s0,!1,T);if(!this.enable_global_context_dfa)return;let R=T;me(T!=null);let P;for(E.isPrecedenceDfa?P=E.getPrecedenceStartState(this._parser.precedence,!0):P=E.s0full;R!=null&&P!=null&&P.isContextSensitive;)R=this.skipTailCalls(R),P=P.getContextTarget(this.getReturnState(R)),R.isEmpty?me(P==null||!P.isContextSensitive):R=R.parent;if(P!=null)return new ie.SimulatorState(T,P,N,R)}execDFA(E,A,T,N){let R=N.outerContext;we.dfa_debug&&console.log("DFA decision "+E.decision+" exec LA(1)=="+this.getLookaheadName(A)+", outerContext="+R.toString(this._parser)),we.dfa_debug&&console.log(E.toString(this._parser.vocabulary,this._parser.ruleNames));let P=N.s0,L=A.LA(1),z=N.remainingOuterContext;for(;;){if(we.dfa_debug&&console.log("DFA state "+P.stateNumber+" LA(1)=="+this.getLookaheadName(A)),N.useContext)for(;P.isContextSymbol(L);){let I;if(z!=null&&(z=this.skipTailCalls(z),I=P.getContextTarget(this.getReturnState(z))),I==null){let F=new ie.SimulatorState(N.outerContext,P,N.useContext,z);return this.execATN(E,A,T,F)}me(z!=null),z=z.parent,P=I}if(this.isAcceptState(P,N.useContext)){P.predicates!=null?we.dfa_debug&&console.log("accept "+P):we.dfa_debug&&console.log("accept; predict "+P.prediction+" in state "+P.stateNumber);break}me(!this.isAcceptState(P,N.useContext));let Y=this.getExistingTargetState(P,L);if(Y==null){we.dfa_debug&&L>=0&&console.log("no edge for "+this._parser.vocabulary.getDisplayName(L));let I;if(we.dfa_debug){let U=y.Interval.of(T,this._parser.inputStream.index);console.log("ATN exec upon "+this._parser.inputStream.getText(U)+" at DFA state "+P.stateNumber)}let F=new ie.SimulatorState(R,P,N.useContext,z);return I=this.execATN(E,A,T,F),we.dfa_debug&&console.log("back from DFA update, alt="+I+`, dfa= -`+E.toString(this._parser.vocabulary,this._parser.ruleNames)),we.dfa_debug&&console.log("DFA decision "+E.decision+" predicts "+I),I}else if(Y===u.ATNSimulator.ERROR){let I=new ie.SimulatorState(R,P,N.useContext,z);return this.handleNoViableAlt(A,T,I)}P=Y,!this.isAcceptState(P,N.useContext)&&L!==g.IntStream.EOF&&(A.consume(),L=A.LA(1))}if(!N.useContext&&P.configs.conflictInfo!=null&&E.atnStartState instanceof p.DecisionState&&!(!this.userWantsCtxSensitive||!P.configs.dipsIntoOuterContext&&P.configs.isExactConflict||this.treat_sllk1_conflict_as_ambiguity&&A.index===T)){me(!N.useContext);let Y,I=P.predicates;if(I!=null){let F=A.index;if(F!==T&&A.seek(T),Y=this.evalSemanticContext(I,R,!0),Y.cardinality()===1)return Y.nextSetBit(0);F!==T&&A.seek(F)}if(this.reportAmbiguities){let F=new ie.SimulatorState(R,P,N.useContext,z);this.reportAttemptingFullContext(E,Y,F,T,A.index)}return A.seek(T),this.adaptivePredict(A,E.decision,R,!0)}let W=P.predicates;if(W!=null){let Y=A.index;T!==Y&&A.seek(T);let I=this.evalSemanticContext(W,R,this.reportAmbiguities&&this.predictionMode===M.PredictionMode.LL_EXACT_AMBIG_DETECTION);switch(I.cardinality()){case 0:throw this.noViableAlt(A,R,P.configs,T);case 1:return I.nextSetBit(0);default:return T!==Y&&A.seek(Y),this.reportAmbiguity(E,P,T,Y,P.configs.isExactConflict,I,P.configs),I.nextSetBit(0)}}return we.dfa_debug&&console.log("DFA decision "+E.decision+" predicts "+P.prediction),P.prediction}isAcceptState(E,A){return E.isAcceptState?E.configs.conflictingAlts==null?!0:A&&this.predictionMode===M.PredictionMode.LL_EXACT_AMBIG_DETECTION?E.configs.isExactConflict:!0:!1}execATN(E,A,T,N){we.debug&&console.log("execATN decision "+E.decision+" exec LA(1)=="+this.getLookaheadName(A));let R=N.outerContext,P=N.useContext,L=A.LA(1),z=N,W=new D.PredictionContextCache;for(;;){let Y=this.computeReachSet(E,z,L,W);if(Y==null)return this.setDFAEdge(z.s0,A.LA(1),u.ATNSimulator.ERROR),this.handleNoViableAlt(A,T,z);let I=Y.s0;if(me(I.isAcceptState||I.prediction===s.ATN.INVALID_ALT_NUMBER),me(I.isAcceptState||I.configs.conflictInfo==null),this.isAcceptState(I,P)){let F=I.configs.conflictingAlts,U=F==null?I.prediction:s.ATN.INVALID_ALT_NUMBER;if(U!==s.ATN.INVALID_ALT_NUMBER){if(this.optimize_ll1&&A.index===T&&!E.isPrecedenceDfa&&Y.outerContext===Y.remainingOuterContext&&E.decision>=0&&!I.configs.hasSemanticContext&&L>=0&&L<=ee){let ne=(E.decision<<16>>>0)+L;this.atn.LL1Table.set(ne,U)}P&&this.always_try_local_context&&this.reportContextSensitivity(E,U,Y,T,A.index)}U=I.prediction;let Q=F!=null&&this.userWantsCtxSensitive;if(Q&&(Q=!P&&(I.configs.dipsIntoOuterContext||!I.configs.isExactConflict)&&(!this.treat_sllk1_conflict_as_ambiguity||A.index!==T)),I.configs.hasSemanticContext){let ne=I.predicates;if(ne!=null){let oe=A.index;switch(oe!==T&&A.seek(T),F=this.evalSemanticContext(ne,R,Q||this.reportAmbiguities),F.cardinality()){case 0:throw this.noViableAlt(A,R,I.configs,T);case 1:return F.nextSetBit(0)}oe!==T&&A.seek(oe)}}if(Q){me(!P),me(this.isAcceptState(I,!1)),we.debug&&console.log("RETRY with outerContext="+R);let ne=this.computeStartState(E,R,!0);return this.reportAmbiguities&&this.reportAttemptingFullContext(E,F,Y,T,A.index),A.seek(T),this.execATN(E,A,T,ne)}else return F!=null&&(this.reportAmbiguities&&F.cardinality()>1&&this.reportAmbiguity(E,I,T,A.index,I.configs.isExactConflict,F,I.configs),U=F.nextSetBit(0)),U}z=Y,L!==g.IntStream.EOF&&(A.consume(),L=A.LA(1))}}handleNoViableAlt(E,A,T){if(T.s0!=null){let N=new f.BitSet,R=0;for(let P of T.s0.configs)(P.reachesIntoOuterContext||P.state instanceof j.RuleStopState)&&(N.set(P.alt),R=Math.max(R,P.alt));switch(N.cardinality()){case 0:break;case 1:return N.nextSetBit(0);default:if(!T.s0.configs.hasSemanticContext)return N.nextSetBit(0);let P=new a.ATNConfigSet;for(let z of T.s0.configs)(z.reachesIntoOuterContext||z.state instanceof j.RuleStopState)&&P.add(z);let L=this.getPredsForAmbigAlts(N,P,R);if(L!=null){let z=this.getPredicatePredictions(N,L);if(z!=null){let W=E.index;try{E.seek(A);let Y=this.evalSemanticContext(z,T.outerContext,!1);if(!Y.isEmpty)return Y.nextSetBit(0)}finally{E.seek(W)}}}return N.nextSetBit(0)}}throw this.noViableAlt(E,T.outerContext,T.s0.configs,A)}computeReachSet(E,A,T,N){let R=A.useContext,P=A.remainingOuterContext,L=A.s0;if(R)for(;L.isContextSymbol(T);){let Y;if(P!=null&&(P=this.skipTailCalls(P),Y=L.getContextTarget(this.getReturnState(P))),Y==null)break;me(P!=null),P=P.parent,L=Y}if(me(!this.isAcceptState(L,R)),this.isAcceptState(L,R))return new ie.SimulatorState(A.outerContext,L,R,P);let z=L,W=this.getExistingTargetState(z,T);if(W==null){let Y=this.computeTargetState(E,z,P,T,R,N);W=Y[0],P=Y[1]}if(W!==u.ATNSimulator.ERROR)return me(!R||!W.configs.dipsIntoOuterContext),new ie.SimulatorState(A.outerContext,W,R,P)}getExistingTargetState(E,A){return E.getTarget(A)}computeTargetState(E,A,T,N,R,P){let L=A.configs.toArray(),z,W=new a.ATNConfigSet,Y;do{let F=!R||T!=null;F||(W.isOutermostConfigSet=!0);let U=new a.ATNConfigSet,Q;for(let H of L){if(we.debug&&console.log("testing "+this.getTokenName(N)+" at "+H.toString()),H.state instanceof j.RuleStopState){me(H.context.isEmpty),(R&&!H.reachesIntoOuterContext||N===g.IntStream.EOF)&&(Q==null&&(Q=[]),Q.push(H));continue}let G=H.state.numberOfOptimizedTransitions;for(let ge=0;ge0);for(let H of Q)W.add(H,P)}if(R&&Y){W.clear(),T=T,T=this.skipTailCalls(T);let H=this.getReturnState(T);if(z==null&&(z=new m.IntegerList),T.isEmpty?T=void 0:T=T.parent,z.add(H),H!==O.PredictionContext.EMPTY_FULL_STATE_KEY)for(let G=0;G0;){let W=new a.ATNConfigSet;for(let Y of L)this.closureImpl(Y,A,W,z,T,N,R,0,P);L=W}}closureImpl(E,A,T,N,R,P,L,z,W){if(we.debug&&console.log("closure("+E.toString(this._parser,!0)+")"),E.state instanceof j.RuleStopState)if(E.context.isEmpty)if(P)we.debug&&console.log("FALLING off rule "+this.getRuleName(E.state.ruleIndex)),E.context===O.PredictionContext.EMPTY_FULL?E=E.transform(E.state,!1,O.PredictionContext.EMPTY_LOCAL):!E.reachesIntoOuterContext&&O.PredictionContext.isEmptyLocal(E.context)&&A.add(E,L);else{A.add(E,L);return}else{let I=E.context.hasEmpty,F=E.context.size-(I?1:0);for(let U=0;UX),this.closureImpl(oe,A,T,N,R,P,L,z-1,W)}if(!I||!P)return;E=E.transform(E.state,!1,O.PredictionContext.EMPTY_LOCAL)}let Y=E.state;Y.onlyHasEpsilonTransitions||(A.add(E,L),we.debug&&console.log("added config "+A));for(let I=0;IX),ne--,we.debug&&console.log("dips into outer ctx: "+Q)}else if(F instanceof k.RuleTransition)this.optimize_tail_calls&&F.optimizedTailCall&&(!this.tail_call_preserves_sll||!O.PredictionContext.isEmptyLocal(E.context))?(me(Q.context===E.context),ne===0&&(ne--,!this.tail_call_preserves_sll&&O.PredictionContext.isEmptyLocal(E.context)&&(Q.outerContextDepth=Q.outerContextDepth+1))):ne>=0&&ne++;else if(!F.isEpsilon&&!N.add(Q))continue;this.closureImpl(Q,A,T,N,U,P,L,ne,W)}}}getRuleName(E){return this._parser!=null&&E>=0?this._parser.ruleNames[E]:""}getEpsilonTarget(E,A,T,N,R,P){switch(A.serializationType){case 3:return this.ruleTransition(E,A,R);case 10:return this.precedenceTransition(E,A,T,N);case 4:return this.predTransition(E,A,T,N);case 6:return this.actionTransition(E,A);case 1:return E.transform(A.target,!1);case 5:case 2:case 7:return P&&A.matches(fe.Token.EOF,0,1)?E.transform(A.target,!1):void 0;default:return}}actionTransition(E,A){return we.debug&&console.log("ACTION edge "+A.ruleIndex+":"+A.actionIndex),E.transform(A.target,!1)}precedenceTransition(E,A,T,N){we.debug&&(console.log("PRED (collectPredicates="+T+") "+A.precedence+">=_p, ctx dependent=true"),this._parser!=null&&console.log("context surrounding pred is "+this._parser.getRuleInvocationStack()));let R;if(T&&N){let P=V.SemanticContext.and(E.semanticContext,A.predicate);R=E.transform(A.target,!1,P)}else R=E.transform(A.target,!1);return we.debug&&console.log("config from pred transition="+R),R}predTransition(E,A,T,N){we.debug&&(console.log("PRED (collectPredicates="+T+") "+A.ruleIndex+":"+A.predIndex+", ctx dependent="+A.isCtxDependent),this._parser!=null&&console.log("context surrounding pred is "+this._parser.getRuleInvocationStack()));let R;if(T&&(!A.isCtxDependent||A.isCtxDependent&&N)){let P=V.SemanticContext.and(E.semanticContext,A.predicate);R=E.transform(A.target,!1,P)}else R=E.transform(A.target,!1);return we.debug&&console.log("config from pred transition="+R),R}ruleTransition(E,A,T){we.debug&&console.log("CALL rule "+this.getRuleName(A.target.ruleIndex)+", ctx="+E.context);let N=A.followState,R;return this.optimize_tail_calls&&A.optimizedTailCall&&(!this.tail_call_preserves_sll||!O.PredictionContext.isEmptyLocal(E.context))?R=E.context:T!=null?R=T.getChild(E.context,N.stateNumber):R=E.context.getChild(N.stateNumber),E.transform(A.target,!1,R)}isConflicted(E,A){if(E.uniqueAlt!==s.ATN.INVALID_ALT_NUMBER||E.size<=1)return;let T=E.toArray();T.sort(we.STATE_ALT_SORT_COMPARATOR);let N=!E.dipsIntoOuterContext,R=new f.BitSet,P=T[0].alt;R.set(P);let L=T[0].state.nonStopStateNumber;for(let F of T){let U=F.state.nonStopStateNumber;if(U!==L){if(F.alt!==P)return;L=U}}let z;if(N){L=T[0].state.nonStopStateNumber,z=new f.BitSet;let F=P;for(let Q of T){if(Q.state.nonStopStateNumber!==L)break;let ne=Q.alt;z.set(ne),F=ne}L=T[0].state.nonStopStateNumber;let U=P;for(let Q of T){let ne=Q.state.nonStopStateNumber,oe=Q.alt;if(ne!==L){if(U!==F){N=!1;break}L=ne,U=P}else if(oe!==U){if(oe!==z.nextSetBit(U+1)){N=!1;break}U=oe}}}L=T[0].state.nonStopStateNumber;let W=0,Y=0,I=T[0].context;for(let F=1;F"}getLookaheadName(E){return this.getTokenName(E.LA(1))}dumpDeadEndConfigs(E){console.log("dead end configs: ");let A=E.deadEndConfigs;if(A)for(let T of A){let N="no edges";if(T.state.numberOfOptimizedTransitions>0){let R=T.state.getOptimizedTransition(0);R instanceof h.AtomTransition?N="Atom "+this.getTokenName(R._label):R instanceof se.SetTransition&&(N=(R instanceof S.NotSetTransition?"~":"")+"Set "+R.set.toString())}console.log(T.toString(this._parser,!0)+":"+N)}}noViableAlt(E,A,T,N){return new _.NoViableAltException(this._parser,E,E.get(N),E.LT(1),T,A)}getUniqueAlt(E){let A=s.ATN.INVALID_ALT_NUMBER;for(let T of E)if(A===s.ATN.INVALID_ALT_NUMBER)A=T.alt;else if(T.alt!==A)return s.ATN.INVALID_ALT_NUMBER;return A}configWithAltAtStopState(E,A){for(let T of E)if(T.alt===A&&T.state instanceof j.RuleStopState)return!0;return!1}addDFAEdge(E,A,T,N,R,P){me(N==null||N.isEmpty||E.isContextSensitive);let L=A,z=this.addDFAState(E,R,P);if(N!=null)for(let W of N.toArray()){if(W===O.PredictionContext.EMPTY_FULL_STATE_KEY&&L.configs.isOutermostConfigSet)continue;L.setContextSensitive(this.atn),L.setContextSymbol(T);let Y=L.getContextTarget(W);if(Y!=null){L=Y;continue}Y=this.addDFAContextState(E,L.configs,W,P),me(W!==O.PredictionContext.EMPTY_FULL_STATE_KEY||Y.configs.isOutermostConfigSet),L.setContextTarget(W,Y),L=Y}return we.debug&&console.log("EDGE "+L+" -> "+z+" upon "+this.getTokenName(T)),this.setDFAEdge(L,T,z),we.debug&&console.log(`DFA= -`+E.toString(this._parser!=null?this._parser.vocabulary:Ee.VocabularyImpl.EMPTY_VOCABULARY,this._parser!=null?this._parser.ruleNames:void 0)),z}setDFAEdge(E,A,T){E!=null&&E.setTarget(A,T)}addDFAContextState(E,A,T,N){if(T!==O.PredictionContext.EMPTY_FULL_STATE_KEY){let R=new a.ATNConfigSet;for(let P of A)R.add(P.appendContext(T,N));return this.addDFAState(E,R,N)}else return me(!A.isOutermostConfigSet,"Shouldn't be adding a duplicate edge."),A=A.clone(!0),A.isOutermostConfigSet=!0,this.addDFAState(E,A,N)}addDFAState(E,A,T){let N=this.enable_global_context_dfa||!A.isOutermostConfigSet;if(N){A.isReadOnly||A.optimizeConfigs(this);let W=this.createDFAState(E,A),Y=E.states.get(W);if(Y!=null)return Y}A.isReadOnly||A.conflictInfo==null&&(A.conflictInfo=this.isConflicted(A,T));let R=this.createDFAState(E,A.clone(!0)),P=this.atn.getDecisionState(E.decision),L=this.getUniqueAlt(A);if(L!==s.ATN.INVALID_ALT_NUMBER)R.acceptStateInfo=new t.AcceptStateInfo(L);else if(A.conflictingAlts!=null){let W=A.conflictingAlts;W&&(R.acceptStateInfo=new t.AcceptStateInfo(W.nextSetBit(0)))}if(R.isAcceptState&&A.hasSemanticContext&&this.predicateDFAState(R,A,P.numberOfTransitions),!N)return R;let z=E.addState(R);return we.debug&&z===R&&console.log("adding new DFA state: "+R),z}createDFAState(E,A){return new v.DFAState(A)}reportAttemptingFullContext(E,A,T,N,R){if(we.debug||we.retry_debug){let P=y.Interval.of(N,R);console.log("reportAttemptingFullContext decision="+E.decision+":"+T.s0.configs+", input="+this._parser.inputStream.getText(P))}if(this._parser!=null){let P=this._parser.getErrorListenerDispatch();P.reportAttemptingFullContext&&P.reportAttemptingFullContext(this._parser,E,N,R,A,T)}}reportContextSensitivity(E,A,T,N,R){if(we.debug||we.retry_debug){let P=y.Interval.of(N,R);console.log("reportContextSensitivity decision="+E.decision+":"+T.s0.configs+", input="+this._parser.inputStream.getText(P))}if(this._parser!=null){let P=this._parser.getErrorListenerDispatch();P.reportContextSensitivity&&P.reportContextSensitivity(this._parser,E,N,R,A,T)}}reportAmbiguity(E,A,T,N,R,P,L){if(we.debug||we.retry_debug){let z=y.Interval.of(T,N);console.log("reportAmbiguity "+P+":"+L+", input="+this._parser.inputStream.getText(z))}if(this._parser!=null){let z=this._parser.getErrorListenerDispatch();z.reportAmbiguity&&z.reportAmbiguity(this._parser,E,T,N,R,P,L)}}getReturnState(E){return E.isEmpty?O.PredictionContext.EMPTY_FULL_STATE_KEY:this.atn.states[E.invokingState].transition(0).followState.stateNumber}skipTailCalls(E){if(!this.optimize_tail_calls)return E;for(;!E.isEmpty;){let A=this.atn.states[E.invokingState];if(me(A.numberOfTransitions===1&&A.transition(0).serializationType===3),!A.transition(0).tailCall)break;E=E.parent}return E}get parser(){return this._parser}};return Z.debug=!1,Z.dfa_debug=!1,Z.retry_debug=!1,Z.STATE_ALT_SORT_COMPARATOR=(le,E)=>{let A=le.state.nonStopStateNumber-E.state.nonStopStateNumber;return A!==0||(A=le.alt-E.alt,A!==0)?A:0},n([x.NotNull],Z.prototype,"predictionMode",void 0),n([x.NotNull],Z.prototype,"getPredictionMode",null),n([e(0,x.NotNull)],Z.prototype,"setPredictionMode",null),n([x.Override],Z.prototype,"reset",null),n([e(0,x.NotNull)],Z.prototype,"adaptivePredict",null),n([e(0,x.NotNull),e(1,x.NotNull),e(2,x.NotNull)],Z.prototype,"getStartState",null),n([e(0,x.NotNull),e(1,x.NotNull),e(3,x.NotNull)],Z.prototype,"execDFA",null),n([e(0,x.NotNull),e(1,x.NotNull),e(3,x.NotNull)],Z.prototype,"execATN",null),n([e(0,x.NotNull),e(2,x.NotNull)],Z.prototype,"handleNoViableAlt",null),n([e(0,x.NotNull)],Z.prototype,"getExistingTargetState",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"computeTargetState",null),n([x.NotNull,e(0,x.NotNull)],Z.prototype,"removeAllConfigsNotInRuleStopState",null),n([x.NotNull],Z.prototype,"computeStartState",null),n([x.NotNull,e(0,x.NotNull)],Z.prototype,"applyPrecedenceFilter",null),n([e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"getReachableTarget",null),n([e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"getPredsForAmbigAlts",null),n([e(0,x.NotNull)],Z.prototype,"evalSemanticContext",null),n([e(0,x.NotNull)],Z.prototype,"evalSemanticContextImpl",null),n([e(1,x.NotNull),e(4,x.Nullable)],Z.prototype,"closure",null),n([e(0,x.NotNull),e(1,x.NotNull),e(2,x.Nullable),e(3,x.NotNull),e(6,x.NotNull)],Z.prototype,"closureImpl",null),n([x.NotNull],Z.prototype,"getRuleName",null),n([e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"getEpsilonTarget",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"actionTransition",null),n([x.Nullable,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"precedenceTransition",null),n([x.Nullable,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"predTransition",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull),e(2,x.Nullable)],Z.prototype,"ruleTransition",null),n([e(0,x.NotNull)],Z.prototype,"isConflicted",null),n([x.NotNull],Z.prototype,"getTokenName",null),n([e(0,x.NotNull)],Z.prototype,"dumpDeadEndConfigs",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull),e(2,x.NotNull)],Z.prototype,"noViableAlt",null),n([e(0,x.NotNull)],Z.prototype,"getUniqueAlt",null),n([e(0,x.NotNull)],Z.prototype,"configWithAltAtStopState",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull),e(4,x.NotNull)],Z.prototype,"addDFAEdge",null),n([e(0,x.Nullable),e(2,x.Nullable)],Z.prototype,"setDFAEdge",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"addDFAContextState",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"addDFAState",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"createDFAState",null),n([e(0,x.NotNull),e(2,x.NotNull)],Z.prototype,"reportAttemptingFullContext",null),n([e(0,x.NotNull),e(2,x.NotNull)],Z.prototype,"reportContextSensitivity",null),n([e(0,x.NotNull),e(5,x.NotNull),e(6,x.NotNull)],Z.prototype,"reportAmbiguity",null),Z=n([e(0,x.NotNull)],Z),vs.ParserATNSimulator=Z,vs}var Mc={};/*! + */var n=w&&w.__decorate||function(le,E,A,T){var N=arguments.length,R=N<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,A):T,P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(le,E,A,T);else for(var L=le.length-1;L>=0;L--)(P=le[L])&&(R=(N<3?P(R):N>3?P(E,A,R):P(E,A))||R);return N>3&&R&&Object.defineProperty(E,A,R),R},e=w&&w.__param||function(le,E){return function(A,T){E(A,T,le)}};Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.ParserATNSimulator=void 0;const t=Xl,r=na,i=_r,o=Sc,s=vn(),l=Hi,a=Yl(),u=Cc(),c=mt,h=sa,f=Er,d=$c,p=Yr,v=Ec(),m=jo,y=Ct,g=gn,x=X,b=Fp(),_=th(),S=nr,C=Or(),O=Tr(),D=kp(),B=Fb,$=Yn,I=zo,V=Bi,se=Mp(),ie=Bb(),fe=ze,Ee=yn,me=Bt(),ee=65535,Y=-(1<<31>>>0);let Z=class we extends u.ATNSimulator{constructor(E,A){super(E),this.predictionMode=B.PredictionMode.LL,this.force_global_context=!1,this.always_try_local_context=!0,this.enable_global_context_dfa=!1,this.optimize_unique_closure=!0,this.optimize_ll1=!0,this.optimize_tail_calls=!0,this.tail_call_preserves_sll=!0,this.treat_sllk1_conflict_as_ambiguity=!1,this.reportAmbiguities=!1,this.userWantsCtxSensitive=!0,this._parser=A}getPredictionMode(){return this.predictionMode}setPredictionMode(E){this.predictionMode=E}reset(){}adaptivePredict(E,A,T,N){N===void 0&&(N=!1);let R=this.atn.decisionToDFA[A];if(me(R!=null),this.optimize_ll1&&!R.isPrecedenceDfa&&!R.isEmpty){let W=E.LA(1);if(W>=0&&W<=65535){let J=(A<<16>>>0)+W,M=this.atn.LL1Table.get(J);if(M!=null)return M}}this.dfa=R,this.force_global_context?N=!0:this.always_try_local_context||(N=N||R.isContextSensitive),this.userWantsCtxSensitive=N||this.predictionMode!==B.PredictionMode.SLL&&T!=null&&!this.atn.decisionToState[A].sll,T==null&&(T=C.ParserRuleContext.emptyContext());let P;R.isEmpty||(P=this.getStartState(R,E,T,N)),P==null&&(T==null&&(T=C.ParserRuleContext.emptyContext()),we.debug&&console.log("ATN decision "+R.decision+" exec LA(1)=="+this.getLookaheadName(E)+", outerContext="+T.toString(this._parser)),P=this.computeStartState(R,T,N));let L=E.mark(),z=E.index;try{let W=this.execDFA(R,E,z,P);return we.debug&&console.log("DFA after predictATN: "+R.toString(this._parser.vocabulary,this._parser.ruleNames)),W}finally{this.dfa=void 0,E.seek(z),E.release(L)}}getStartState(E,A,T,N){if(!N)if(E.isPrecedenceDfa){let L=E.getPrecedenceStartState(this._parser.precedence,!1);return L==null?void 0:new ie.SimulatorState(T,L,!1,T)}else return E.s0==null?void 0:new ie.SimulatorState(T,E.s0,!1,T);if(!this.enable_global_context_dfa)return;let R=T;me(T!=null);let P;for(E.isPrecedenceDfa?P=E.getPrecedenceStartState(this._parser.precedence,!0):P=E.s0full;R!=null&&P!=null&&P.isContextSensitive;)R=this.skipTailCalls(R),P=P.getContextTarget(this.getReturnState(R)),R.isEmpty?me(P==null||!P.isContextSensitive):R=R.parent;if(P!=null)return new ie.SimulatorState(T,P,N,R)}execDFA(E,A,T,N){let R=N.outerContext;we.dfa_debug&&console.log("DFA decision "+E.decision+" exec LA(1)=="+this.getLookaheadName(A)+", outerContext="+R.toString(this._parser)),we.dfa_debug&&console.log(E.toString(this._parser.vocabulary,this._parser.ruleNames));let P=N.s0,L=A.LA(1),z=N.remainingOuterContext;for(;;){if(we.dfa_debug&&console.log("DFA state "+P.stateNumber+" LA(1)=="+this.getLookaheadName(A)),N.useContext)for(;P.isContextSymbol(L);){let M;if(z!=null&&(z=this.skipTailCalls(z),M=P.getContextTarget(this.getReturnState(z))),M==null){let F=new ie.SimulatorState(N.outerContext,P,N.useContext,z);return this.execATN(E,A,T,F)}me(z!=null),z=z.parent,P=M}if(this.isAcceptState(P,N.useContext)){P.predicates!=null?we.dfa_debug&&console.log("accept "+P):we.dfa_debug&&console.log("accept; predict "+P.prediction+" in state "+P.stateNumber);break}me(!this.isAcceptState(P,N.useContext));let J=this.getExistingTargetState(P,L);if(J==null){we.dfa_debug&&L>=0&&console.log("no edge for "+this._parser.vocabulary.getDisplayName(L));let M;if(we.dfa_debug){let U=y.Interval.of(T,this._parser.inputStream.index);console.log("ATN exec upon "+this._parser.inputStream.getText(U)+" at DFA state "+P.stateNumber)}let F=new ie.SimulatorState(R,P,N.useContext,z);return M=this.execATN(E,A,T,F),we.dfa_debug&&console.log("back from DFA update, alt="+M+`, dfa= +`+E.toString(this._parser.vocabulary,this._parser.ruleNames)),we.dfa_debug&&console.log("DFA decision "+E.decision+" predicts "+M),M}else if(J===u.ATNSimulator.ERROR){let M=new ie.SimulatorState(R,P,N.useContext,z);return this.handleNoViableAlt(A,T,M)}P=J,!this.isAcceptState(P,N.useContext)&&L!==g.IntStream.EOF&&(A.consume(),L=A.LA(1))}if(!N.useContext&&P.configs.conflictInfo!=null&&E.atnStartState instanceof p.DecisionState&&!(!this.userWantsCtxSensitive||!P.configs.dipsIntoOuterContext&&P.configs.isExactConflict||this.treat_sllk1_conflict_as_ambiguity&&A.index===T)){me(!N.useContext);let J,M=P.predicates;if(M!=null){let F=A.index;if(F!==T&&A.seek(T),J=this.evalSemanticContext(M,R,!0),J.cardinality()===1)return J.nextSetBit(0);F!==T&&A.seek(F)}if(this.reportAmbiguities){let F=new ie.SimulatorState(R,P,N.useContext,z);this.reportAttemptingFullContext(E,J,F,T,A.index)}return A.seek(T),this.adaptivePredict(A,E.decision,R,!0)}let W=P.predicates;if(W!=null){let J=A.index;T!==J&&A.seek(T);let M=this.evalSemanticContext(W,R,this.reportAmbiguities&&this.predictionMode===B.PredictionMode.LL_EXACT_AMBIG_DETECTION);switch(M.cardinality()){case 0:throw this.noViableAlt(A,R,P.configs,T);case 1:return M.nextSetBit(0);default:return T!==J&&A.seek(J),this.reportAmbiguity(E,P,T,J,P.configs.isExactConflict,M,P.configs),M.nextSetBit(0)}}return we.dfa_debug&&console.log("DFA decision "+E.decision+" predicts "+P.prediction),P.prediction}isAcceptState(E,A){return E.isAcceptState?E.configs.conflictingAlts==null?!0:A&&this.predictionMode===B.PredictionMode.LL_EXACT_AMBIG_DETECTION?E.configs.isExactConflict:!0:!1}execATN(E,A,T,N){we.debug&&console.log("execATN decision "+E.decision+" exec LA(1)=="+this.getLookaheadName(A));let R=N.outerContext,P=N.useContext,L=A.LA(1),z=N,W=new D.PredictionContextCache;for(;;){let J=this.computeReachSet(E,z,L,W);if(J==null)return this.setDFAEdge(z.s0,A.LA(1),u.ATNSimulator.ERROR),this.handleNoViableAlt(A,T,z);let M=J.s0;if(me(M.isAcceptState||M.prediction===s.ATN.INVALID_ALT_NUMBER),me(M.isAcceptState||M.configs.conflictInfo==null),this.isAcceptState(M,P)){let F=M.configs.conflictingAlts,U=F==null?M.prediction:s.ATN.INVALID_ALT_NUMBER;if(U!==s.ATN.INVALID_ALT_NUMBER){if(this.optimize_ll1&&A.index===T&&!E.isPrecedenceDfa&&J.outerContext===J.remainingOuterContext&&E.decision>=0&&!M.configs.hasSemanticContext&&L>=0&&L<=ee){let ne=(E.decision<<16>>>0)+L;this.atn.LL1Table.set(ne,U)}P&&this.always_try_local_context&&this.reportContextSensitivity(E,U,J,T,A.index)}U=M.prediction;let Q=F!=null&&this.userWantsCtxSensitive;if(Q&&(Q=!P&&(M.configs.dipsIntoOuterContext||!M.configs.isExactConflict)&&(!this.treat_sllk1_conflict_as_ambiguity||A.index!==T)),M.configs.hasSemanticContext){let ne=M.predicates;if(ne!=null){let oe=A.index;switch(oe!==T&&A.seek(T),F=this.evalSemanticContext(ne,R,Q||this.reportAmbiguities),F.cardinality()){case 0:throw this.noViableAlt(A,R,M.configs,T);case 1:return F.nextSetBit(0)}oe!==T&&A.seek(oe)}}if(Q){me(!P),me(this.isAcceptState(M,!1)),we.debug&&console.log("RETRY with outerContext="+R);let ne=this.computeStartState(E,R,!0);return this.reportAmbiguities&&this.reportAttemptingFullContext(E,F,J,T,A.index),A.seek(T),this.execATN(E,A,T,ne)}else return F!=null&&(this.reportAmbiguities&&F.cardinality()>1&&this.reportAmbiguity(E,M,T,A.index,M.configs.isExactConflict,F,M.configs),U=F.nextSetBit(0)),U}z=J,L!==g.IntStream.EOF&&(A.consume(),L=A.LA(1))}}handleNoViableAlt(E,A,T){if(T.s0!=null){let N=new f.BitSet,R=0;for(let P of T.s0.configs)(P.reachesIntoOuterContext||P.state instanceof $.RuleStopState)&&(N.set(P.alt),R=Math.max(R,P.alt));switch(N.cardinality()){case 0:break;case 1:return N.nextSetBit(0);default:if(!T.s0.configs.hasSemanticContext)return N.nextSetBit(0);let P=new a.ATNConfigSet;for(let z of T.s0.configs)(z.reachesIntoOuterContext||z.state instanceof $.RuleStopState)&&P.add(z);let L=this.getPredsForAmbigAlts(N,P,R);if(L!=null){let z=this.getPredicatePredictions(N,L);if(z!=null){let W=E.index;try{E.seek(A);let J=this.evalSemanticContext(z,T.outerContext,!1);if(!J.isEmpty)return J.nextSetBit(0)}finally{E.seek(W)}}}return N.nextSetBit(0)}}throw this.noViableAlt(E,T.outerContext,T.s0.configs,A)}computeReachSet(E,A,T,N){let R=A.useContext,P=A.remainingOuterContext,L=A.s0;if(R)for(;L.isContextSymbol(T);){let J;if(P!=null&&(P=this.skipTailCalls(P),J=L.getContextTarget(this.getReturnState(P))),J==null)break;me(P!=null),P=P.parent,L=J}if(me(!this.isAcceptState(L,R)),this.isAcceptState(L,R))return new ie.SimulatorState(A.outerContext,L,R,P);let z=L,W=this.getExistingTargetState(z,T);if(W==null){let J=this.computeTargetState(E,z,P,T,R,N);W=J[0],P=J[1]}if(W!==u.ATNSimulator.ERROR)return me(!R||!W.configs.dipsIntoOuterContext),new ie.SimulatorState(A.outerContext,W,R,P)}getExistingTargetState(E,A){return E.getTarget(A)}computeTargetState(E,A,T,N,R,P){let L=A.configs.toArray(),z,W=new a.ATNConfigSet,J;do{let F=!R||T!=null;F||(W.isOutermostConfigSet=!0);let U=new a.ATNConfigSet,Q;for(let H of L){if(we.debug&&console.log("testing "+this.getTokenName(N)+" at "+H.toString()),H.state instanceof $.RuleStopState){me(H.context.isEmpty),(R&&!H.reachesIntoOuterContext||N===g.IntStream.EOF)&&(Q==null&&(Q=[]),Q.push(H));continue}let G=H.state.numberOfOptimizedTransitions;for(let ge=0;ge0);for(let H of Q)W.add(H,P)}if(R&&J){W.clear(),T=T,T=this.skipTailCalls(T);let H=this.getReturnState(T);if(z==null&&(z=new m.IntegerList),T.isEmpty?T=void 0:T=T.parent,z.add(H),H!==O.PredictionContext.EMPTY_FULL_STATE_KEY)for(let G=0;G0;){let W=new a.ATNConfigSet;for(let J of L)this.closureImpl(J,A,W,z,T,N,R,0,P);L=W}}closureImpl(E,A,T,N,R,P,L,z,W){if(we.debug&&console.log("closure("+E.toString(this._parser,!0)+")"),E.state instanceof $.RuleStopState)if(E.context.isEmpty)if(P)we.debug&&console.log("FALLING off rule "+this.getRuleName(E.state.ruleIndex)),E.context===O.PredictionContext.EMPTY_FULL?E=E.transform(E.state,!1,O.PredictionContext.EMPTY_LOCAL):!E.reachesIntoOuterContext&&O.PredictionContext.isEmptyLocal(E.context)&&A.add(E,L);else{A.add(E,L);return}else{let M=E.context.hasEmpty,F=E.context.size-(M?1:0);for(let U=0;UY),this.closureImpl(oe,A,T,N,R,P,L,z-1,W)}if(!M||!P)return;E=E.transform(E.state,!1,O.PredictionContext.EMPTY_LOCAL)}let J=E.state;J.onlyHasEpsilonTransitions||(A.add(E,L),we.debug&&console.log("added config "+A));for(let M=0;MY),ne--,we.debug&&console.log("dips into outer ctx: "+Q)}else if(F instanceof I.RuleTransition)this.optimize_tail_calls&&F.optimizedTailCall&&(!this.tail_call_preserves_sll||!O.PredictionContext.isEmptyLocal(E.context))?(me(Q.context===E.context),ne===0&&(ne--,!this.tail_call_preserves_sll&&O.PredictionContext.isEmptyLocal(E.context)&&(Q.outerContextDepth=Q.outerContextDepth+1))):ne>=0&&ne++;else if(!F.isEpsilon&&!N.add(Q))continue;this.closureImpl(Q,A,T,N,U,P,L,ne,W)}}}getRuleName(E){return this._parser!=null&&E>=0?this._parser.ruleNames[E]:""}getEpsilonTarget(E,A,T,N,R,P){switch(A.serializationType){case 3:return this.ruleTransition(E,A,R);case 10:return this.precedenceTransition(E,A,T,N);case 4:return this.predTransition(E,A,T,N);case 6:return this.actionTransition(E,A);case 1:return E.transform(A.target,!1);case 5:case 2:case 7:return P&&A.matches(fe.Token.EOF,0,1)?E.transform(A.target,!1):void 0;default:return}}actionTransition(E,A){return we.debug&&console.log("ACTION edge "+A.ruleIndex+":"+A.actionIndex),E.transform(A.target,!1)}precedenceTransition(E,A,T,N){we.debug&&(console.log("PRED (collectPredicates="+T+") "+A.precedence+">=_p, ctx dependent=true"),this._parser!=null&&console.log("context surrounding pred is "+this._parser.getRuleInvocationStack()));let R;if(T&&N){let P=V.SemanticContext.and(E.semanticContext,A.predicate);R=E.transform(A.target,!1,P)}else R=E.transform(A.target,!1);return we.debug&&console.log("config from pred transition="+R),R}predTransition(E,A,T,N){we.debug&&(console.log("PRED (collectPredicates="+T+") "+A.ruleIndex+":"+A.predIndex+", ctx dependent="+A.isCtxDependent),this._parser!=null&&console.log("context surrounding pred is "+this._parser.getRuleInvocationStack()));let R;if(T&&(!A.isCtxDependent||A.isCtxDependent&&N)){let P=V.SemanticContext.and(E.semanticContext,A.predicate);R=E.transform(A.target,!1,P)}else R=E.transform(A.target,!1);return we.debug&&console.log("config from pred transition="+R),R}ruleTransition(E,A,T){we.debug&&console.log("CALL rule "+this.getRuleName(A.target.ruleIndex)+", ctx="+E.context);let N=A.followState,R;return this.optimize_tail_calls&&A.optimizedTailCall&&(!this.tail_call_preserves_sll||!O.PredictionContext.isEmptyLocal(E.context))?R=E.context:T!=null?R=T.getChild(E.context,N.stateNumber):R=E.context.getChild(N.stateNumber),E.transform(A.target,!1,R)}isConflicted(E,A){if(E.uniqueAlt!==s.ATN.INVALID_ALT_NUMBER||E.size<=1)return;let T=E.toArray();T.sort(we.STATE_ALT_SORT_COMPARATOR);let N=!E.dipsIntoOuterContext,R=new f.BitSet,P=T[0].alt;R.set(P);let L=T[0].state.nonStopStateNumber;for(let F of T){let U=F.state.nonStopStateNumber;if(U!==L){if(F.alt!==P)return;L=U}}let z;if(N){L=T[0].state.nonStopStateNumber,z=new f.BitSet;let F=P;for(let Q of T){if(Q.state.nonStopStateNumber!==L)break;let ne=Q.alt;z.set(ne),F=ne}L=T[0].state.nonStopStateNumber;let U=P;for(let Q of T){let ne=Q.state.nonStopStateNumber,oe=Q.alt;if(ne!==L){if(U!==F){N=!1;break}L=ne,U=P}else if(oe!==U){if(oe!==z.nextSetBit(U+1)){N=!1;break}U=oe}}}L=T[0].state.nonStopStateNumber;let W=0,J=0,M=T[0].context;for(let F=1;F"}getLookaheadName(E){return this.getTokenName(E.LA(1))}dumpDeadEndConfigs(E){console.log("dead end configs: ");let A=E.deadEndConfigs;if(A)for(let T of A){let N="no edges";if(T.state.numberOfOptimizedTransitions>0){let R=T.state.getOptimizedTransition(0);R instanceof h.AtomTransition?N="Atom "+this.getTokenName(R._label):R instanceof se.SetTransition&&(N=(R instanceof b.NotSetTransition?"~":"")+"Set "+R.set.toString())}console.log(T.toString(this._parser,!0)+":"+N)}}noViableAlt(E,A,T,N){return new _.NoViableAltException(this._parser,E,E.get(N),E.LT(1),T,A)}getUniqueAlt(E){let A=s.ATN.INVALID_ALT_NUMBER;for(let T of E)if(A===s.ATN.INVALID_ALT_NUMBER)A=T.alt;else if(T.alt!==A)return s.ATN.INVALID_ALT_NUMBER;return A}configWithAltAtStopState(E,A){for(let T of E)if(T.alt===A&&T.state instanceof $.RuleStopState)return!0;return!1}addDFAEdge(E,A,T,N,R,P){me(N==null||N.isEmpty||E.isContextSensitive);let L=A,z=this.addDFAState(E,R,P);if(N!=null)for(let W of N.toArray()){if(W===O.PredictionContext.EMPTY_FULL_STATE_KEY&&L.configs.isOutermostConfigSet)continue;L.setContextSensitive(this.atn),L.setContextSymbol(T);let J=L.getContextTarget(W);if(J!=null){L=J;continue}J=this.addDFAContextState(E,L.configs,W,P),me(W!==O.PredictionContext.EMPTY_FULL_STATE_KEY||J.configs.isOutermostConfigSet),L.setContextTarget(W,J),L=J}return we.debug&&console.log("EDGE "+L+" -> "+z+" upon "+this.getTokenName(T)),this.setDFAEdge(L,T,z),we.debug&&console.log(`DFA= +`+E.toString(this._parser!=null?this._parser.vocabulary:Ee.VocabularyImpl.EMPTY_VOCABULARY,this._parser!=null?this._parser.ruleNames:void 0)),z}setDFAEdge(E,A,T){E!=null&&E.setTarget(A,T)}addDFAContextState(E,A,T,N){if(T!==O.PredictionContext.EMPTY_FULL_STATE_KEY){let R=new a.ATNConfigSet;for(let P of A)R.add(P.appendContext(T,N));return this.addDFAState(E,R,N)}else return me(!A.isOutermostConfigSet,"Shouldn't be adding a duplicate edge."),A=A.clone(!0),A.isOutermostConfigSet=!0,this.addDFAState(E,A,N)}addDFAState(E,A,T){let N=this.enable_global_context_dfa||!A.isOutermostConfigSet;if(N){A.isReadOnly||A.optimizeConfigs(this);let W=this.createDFAState(E,A),J=E.states.get(W);if(J!=null)return J}A.isReadOnly||A.conflictInfo==null&&(A.conflictInfo=this.isConflicted(A,T));let R=this.createDFAState(E,A.clone(!0)),P=this.atn.getDecisionState(E.decision),L=this.getUniqueAlt(A);if(L!==s.ATN.INVALID_ALT_NUMBER)R.acceptStateInfo=new t.AcceptStateInfo(L);else if(A.conflictingAlts!=null){let W=A.conflictingAlts;W&&(R.acceptStateInfo=new t.AcceptStateInfo(W.nextSetBit(0)))}if(R.isAcceptState&&A.hasSemanticContext&&this.predicateDFAState(R,A,P.numberOfTransitions),!N)return R;let z=E.addState(R);return we.debug&&z===R&&console.log("adding new DFA state: "+R),z}createDFAState(E,A){return new v.DFAState(A)}reportAttemptingFullContext(E,A,T,N,R){if(we.debug||we.retry_debug){let P=y.Interval.of(N,R);console.log("reportAttemptingFullContext decision="+E.decision+":"+T.s0.configs+", input="+this._parser.inputStream.getText(P))}if(this._parser!=null){let P=this._parser.getErrorListenerDispatch();P.reportAttemptingFullContext&&P.reportAttemptingFullContext(this._parser,E,N,R,A,T)}}reportContextSensitivity(E,A,T,N,R){if(we.debug||we.retry_debug){let P=y.Interval.of(N,R);console.log("reportContextSensitivity decision="+E.decision+":"+T.s0.configs+", input="+this._parser.inputStream.getText(P))}if(this._parser!=null){let P=this._parser.getErrorListenerDispatch();P.reportContextSensitivity&&P.reportContextSensitivity(this._parser,E,N,R,A,T)}}reportAmbiguity(E,A,T,N,R,P,L){if(we.debug||we.retry_debug){let z=y.Interval.of(T,N);console.log("reportAmbiguity "+P+":"+L+", input="+this._parser.inputStream.getText(z))}if(this._parser!=null){let z=this._parser.getErrorListenerDispatch();z.reportAmbiguity&&z.reportAmbiguity(this._parser,E,T,N,R,P,L)}}getReturnState(E){return E.isEmpty?O.PredictionContext.EMPTY_FULL_STATE_KEY:this.atn.states[E.invokingState].transition(0).followState.stateNumber}skipTailCalls(E){if(!this.optimize_tail_calls)return E;for(;!E.isEmpty;){let A=this.atn.states[E.invokingState];if(me(A.numberOfTransitions===1&&A.transition(0).serializationType===3),!A.transition(0).tailCall)break;E=E.parent}return E}get parser(){return this._parser}};return Z.debug=!1,Z.dfa_debug=!1,Z.retry_debug=!1,Z.STATE_ALT_SORT_COMPARATOR=(le,E)=>{let A=le.state.nonStopStateNumber-E.state.nonStopStateNumber;return A!==0||(A=le.alt-E.alt,A!==0)?A:0},n([x.NotNull],Z.prototype,"predictionMode",void 0),n([x.NotNull],Z.prototype,"getPredictionMode",null),n([e(0,x.NotNull)],Z.prototype,"setPredictionMode",null),n([x.Override],Z.prototype,"reset",null),n([e(0,x.NotNull)],Z.prototype,"adaptivePredict",null),n([e(0,x.NotNull),e(1,x.NotNull),e(2,x.NotNull)],Z.prototype,"getStartState",null),n([e(0,x.NotNull),e(1,x.NotNull),e(3,x.NotNull)],Z.prototype,"execDFA",null),n([e(0,x.NotNull),e(1,x.NotNull),e(3,x.NotNull)],Z.prototype,"execATN",null),n([e(0,x.NotNull),e(2,x.NotNull)],Z.prototype,"handleNoViableAlt",null),n([e(0,x.NotNull)],Z.prototype,"getExistingTargetState",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"computeTargetState",null),n([x.NotNull,e(0,x.NotNull)],Z.prototype,"removeAllConfigsNotInRuleStopState",null),n([x.NotNull],Z.prototype,"computeStartState",null),n([x.NotNull,e(0,x.NotNull)],Z.prototype,"applyPrecedenceFilter",null),n([e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"getReachableTarget",null),n([e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"getPredsForAmbigAlts",null),n([e(0,x.NotNull)],Z.prototype,"evalSemanticContext",null),n([e(0,x.NotNull)],Z.prototype,"evalSemanticContextImpl",null),n([e(1,x.NotNull),e(4,x.Nullable)],Z.prototype,"closure",null),n([e(0,x.NotNull),e(1,x.NotNull),e(2,x.Nullable),e(3,x.NotNull),e(6,x.NotNull)],Z.prototype,"closureImpl",null),n([x.NotNull],Z.prototype,"getRuleName",null),n([e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"getEpsilonTarget",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"actionTransition",null),n([x.Nullable,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"precedenceTransition",null),n([x.Nullable,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"predTransition",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull),e(2,x.Nullable)],Z.prototype,"ruleTransition",null),n([e(0,x.NotNull)],Z.prototype,"isConflicted",null),n([x.NotNull],Z.prototype,"getTokenName",null),n([e(0,x.NotNull)],Z.prototype,"dumpDeadEndConfigs",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull),e(2,x.NotNull)],Z.prototype,"noViableAlt",null),n([e(0,x.NotNull)],Z.prototype,"getUniqueAlt",null),n([e(0,x.NotNull)],Z.prototype,"configWithAltAtStopState",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull),e(4,x.NotNull)],Z.prototype,"addDFAEdge",null),n([e(0,x.Nullable),e(2,x.Nullable)],Z.prototype,"setDFAEdge",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"addDFAContextState",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"addDFAState",null),n([x.NotNull,e(0,x.NotNull),e(1,x.NotNull)],Z.prototype,"createDFAState",null),n([e(0,x.NotNull),e(2,x.NotNull)],Z.prototype,"reportAttemptingFullContext",null),n([e(0,x.NotNull),e(2,x.NotNull)],Z.prototype,"reportContextSensitivity",null),n([e(0,x.NotNull),e(5,x.NotNull),e(6,x.NotNull)],Z.prototype,"reportAmbiguity",null),Z=n([e(0,x.NotNull)],Z),Ss.ParserATNSimulator=Z,Ss}var Hc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var dD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Mc,"__esModule",{value:!0});Mc.PlusBlockStartState=void 0;const pD=mt,mD=qi,gD=J;class RS extends mD.BlockStartState{get stateType(){return pD.ATNStateType.PLUS_BLOCK_START}}dD([gD.Override],RS.prototype,"stateType",null);Mc.PlusBlockStartState=RS;var Bc={};/*! + */var wD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.PlusBlockStartState=void 0;const OD=mt,ND=Ki,DD=X;class jb extends ND.BlockStartState{get stateType(){return OD.ATNStateType.PLUS_BLOCK_START}}wD([DD.Override],jb.prototype,"stateType",null);Hc.PlusBlockStartState=jb;var zc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var xD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Bc,"__esModule",{value:!0});Bc.PlusLoopbackState=void 0;const yD=mt,vD=Xr,SD=J;class LS extends vD.DecisionState{get stateType(){return yD.ATNStateType.PLUS_LOOP_BACK}}xD([SD.Override],LS.prototype,"stateType",null);Bc.PlusLoopbackState=LS;var jc={};/*! + */var PD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(zc,"__esModule",{value:!0});zc.PlusLoopbackState=void 0;const RD=mt,LD=Yr,kD=X;class $b extends LD.DecisionState{get stateType(){return RD.ATNStateType.PLUS_LOOP_BACK}}PD([kD.Override],$b.prototype,"stateType",null);zc.PlusLoopbackState=$b;var qc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var ca=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},bD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(jc,"__esModule",{value:!0});jc.PrecedencePredicateTransition=void 0;const AD=Io,ha=J,_D=ki;let Ni=class extends AD.AbstractPredicateTransition{constructor(e,t){super(e),this.precedence=t}get serializationType(){return 10}get isEpsilon(){return!0}matches(e,t,r){return!1}get predicate(){return new _D.SemanticContext.PrecedencePredicate(this.precedence)}toString(){return this.precedence+" >= _p"}};ca([ha.Override],Ni.prototype,"serializationType",null);ca([ha.Override],Ni.prototype,"isEpsilon",null);ca([ha.Override],Ni.prototype,"matches",null);ca([ha.Override],Ni.prototype,"toString",null);Ni=ca([bD(0,ha.NotNull)],Ni);jc.PrecedencePredicateTransition=Ni;var $c={};/*! + */var da=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},ID=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(qc,"__esModule",{value:!0});qc.PrecedencePredicateTransition=void 0;const MD=Bo,pa=X,FD=Bi;let Li=class extends MD.AbstractPredicateTransition{constructor(e,t){super(e),this.precedence=t}get serializationType(){return 10}get isEpsilon(){return!0}matches(e,t,r){return!1}get predicate(){return new FD.SemanticContext.PrecedencePredicate(this.precedence)}toString(){return this.precedence+" >= _p"}};da([pa.Override],Li.prototype,"serializationType",null);da([pa.Override],Li.prototype,"isEpsilon",null);da([pa.Override],Li.prototype,"matches",null);da([pa.Override],Li.prototype,"toString",null);Li=da([ID(0,pa.NotNull)],Li);qc.PrecedencePredicateTransition=Li;var Uc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var fa=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},TD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty($c,"__esModule",{value:!0});$c.RangeTransition=void 0;const ED=zi(),Di=J,CD=Ar;let Pi=class extends CD.Transition{constructor(e,t,r){super(e),this.from=t,this.to=r}get serializationType(){return 2}get label(){return ED.IntervalSet.of(this.from,this.to)}matches(e,t,r){return e>=this.from&&e<=this.to}toString(){return"'"+String.fromCodePoint(this.from)+"'..'"+String.fromCodePoint(this.to)+"'"}};fa([Di.Override],Pi.prototype,"serializationType",null);fa([Di.Override,Di.NotNull],Pi.prototype,"label",null);fa([Di.Override],Pi.prototype,"matches",null);fa([Di.Override,Di.NotNull],Pi.prototype,"toString",null);Pi=fa([TD(0,Di.NotNull)],Pi);$c.RangeTransition=Pi;var Hc={};/*! + */var ma=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},BD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Uc,"__esModule",{value:!0});Uc.RangeTransition=void 0;const jD=Wi(),ki=X,$D=Ar;let Ii=class extends $D.Transition{constructor(e,t,r){super(e),this.from=t,this.to=r}get serializationType(){return 2}get label(){return jD.IntervalSet.of(this.from,this.to)}matches(e,t,r){return e>=this.from&&e<=this.to}toString(){return"'"+String.fromCodePoint(this.from)+"'..'"+String.fromCodePoint(this.to)+"'"}};ma([ki.Override],Ii.prototype,"serializationType",null);ma([ki.Override,ki.NotNull],Ii.prototype,"label",null);ma([ki.Override],Ii.prototype,"matches",null);ma([ki.Override,ki.NotNull],Ii.prototype,"toString",null);Ii=ma([BD(0,ki.NotNull)],Ii);Uc.RangeTransition=Ii;var Vc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var wD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.RuleStartState=void 0;const OD=Kr,ND=mt,DD=J;class kS extends OD.ATNState{constructor(){super(...arguments),this.isPrecedenceRule=!1,this.leftFactored=!1}get stateType(){return ND.ATNStateType.RULE_START}}wD([DD.Override],kS.prototype,"stateType",null);Hc.RuleStartState=kS;var zc={};/*! + */var HD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.RuleStartState=void 0;const zD=Gr,qD=mt,UD=X;class Hb extends zD.ATNState{constructor(){super(...arguments),this.isPrecedenceRule=!1,this.leftFactored=!1}get stateType(){return qD.ATNStateType.RULE_START}}HD([UD.Override],Hb.prototype,"stateType",null);Vc.RuleStartState=Hb;var Wc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var PD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(zc,"__esModule",{value:!0});zc.StarBlockStartState=void 0;const RD=mt,LD=qi,kD=J;class IS extends LD.BlockStartState{get stateType(){return RD.ATNStateType.STAR_BLOCK_START}}PD([kD.Override],IS.prototype,"stateType",null);zc.StarBlockStartState=IS;var qc={};/*! + */var VD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Wc,"__esModule",{value:!0});Wc.StarBlockStartState=void 0;const WD=mt,KD=Ki,GD=X;class zb extends KD.BlockStartState{get stateType(){return WD.ATNStateType.STAR_BLOCK_START}}VD([GD.Override],zb.prototype,"stateType",null);Wc.StarBlockStartState=zb;var Kc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var ID=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(qc,"__esModule",{value:!0});qc.StarLoopbackState=void 0;const FD=Kr,MD=mt,BD=J;class FS extends FD.ATNState{get loopEntryState(){return this.transition(0).target}get stateType(){return MD.ATNStateType.STAR_LOOP_BACK}}ID([BD.Override],FS.prototype,"stateType",null);qc.StarLoopbackState=FS;var Uc={};/*! + */var XD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Kc,"__esModule",{value:!0});Kc.StarLoopbackState=void 0;const YD=Gr,JD=mt,QD=X;class qb extends YD.ATNState{get loopEntryState(){return this.transition(0).target}get stateType(){return JD.ATNStateType.STAR_LOOP_BACK}}XD([QD.Override],qb.prototype,"stateType",null);Kc.StarLoopbackState=qb;var Gc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var jD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Uc,"__esModule",{value:!0});Uc.TokensStartState=void 0;const $D=mt,HD=Xr,zD=J;class MS extends HD.DecisionState{get stateType(){return $D.ATNStateType.TOKEN_START}}jD([zD.Override],MS.prototype,"stateType",null);Uc.TokensStartState=MS;var Vc={};/*! + */var ZD=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.TokensStartState=void 0;const eP=mt,tP=Yr,rP=X;class Ub extends tP.DecisionState{get stateType(){return eP.ATNStateType.TOKEN_START}}ZD([rP.Override],Ub.prototype,"stateType",null);Gc.TokensStartState=Ub;var Xc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Vc,"__esModule",{value:!0});Vc.UUID=void 0;const qD=Je;class Ku{constructor(e,t,r,i){this.data=new Uint32Array(4),this.data[0]=e,this.data[1]=t,this.data[2]=r,this.data[3]=i}static fromString(e){if(!/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/.test(e))throw new Error("Incorrectly formatted UUID");let t=e.split("-"),r=parseInt(t[0],16),i=(parseInt(t[1],16)<<16>>>0)+parseInt(t[2],16),o=(parseInt(t[3],16)<<16>>>0)+parseInt(t[4].substr(0,4),16),s=parseInt(t[4].substr(-8),16);return new Ku(r,i,o,s)}hashCode(){return qD.MurmurHash.hashCode([this.data[0],this.data[1],this.data[2],this.data[3]])}equals(e){return e===this?!0:e instanceof Ku?this.data[0]===e.data[0]&&this.data[1]===e.data[1]&&this.data[2]===e.data[2]&&this.data[3]===e.data[3]:!1}toString(){return("00000000"+this.data[0].toString(16)).substr(-8)+"-"+("0000"+(this.data[1]>>>16).toString(16)).substr(-4)+"-"+("0000"+this.data[1].toString(16)).substr(-4)+"-"+("0000"+(this.data[2]>>>16).toString(16)).substr(-4)+"-"+("0000"+this.data[2].toString(16)).substr(-4)+("00000000"+this.data[3].toString(16)).substr(-8)}}Vc.UUID=Ku;var kg;function kp(){if(kg)return xs;kg=1;/*! + */Object.defineProperty(Xc,"__esModule",{value:!0});Xc.UUID=void 0;const nP=Je;class Ju{constructor(e,t,r,i){this.data=new Uint32Array(4),this.data[0]=e,this.data[1]=t,this.data[2]=r,this.data[3]=i}static fromString(e){if(!/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/.test(e))throw new Error("Incorrectly formatted UUID");let t=e.split("-"),r=parseInt(t[0],16),i=(parseInt(t[1],16)<<16>>>0)+parseInt(t[2],16),o=(parseInt(t[3],16)<<16>>>0)+parseInt(t[4].substr(0,4),16),s=parseInt(t[4].substr(-8),16);return new Ju(r,i,o,s)}hashCode(){return nP.MurmurHash.hashCode([this.data[0],this.data[1],this.data[2],this.data[3]])}equals(e){return e===this?!0:e instanceof Ju?this.data[0]===e.data[0]&&this.data[1]===e.data[1]&&this.data[2]===e.data[2]&&this.data[3]===e.data[3]:!1}toString(){return("00000000"+this.data[0].toString(16)).substr(-8)+"-"+("0000"+(this.data[1]>>>16).toString(16)).substr(-4)+"-"+("0000"+this.data[1].toString(16)).substr(-4)+"-"+("0000"+(this.data[2]>>>16).toString(16)).substr(-4)+"-"+("0000"+this.data[2].toString(16)).substr(-4)+("00000000"+this.data[3].toString(16)).substr(-8)}}Xc.UUID=Ju;var Hg;function zp(){if(Hg)return vs;Hg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(Y,I,F,U){var Q=arguments.length,ne=Q<3?I:U===null?U=Object.getOwnPropertyDescriptor(I,F):U,oe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(Y,I,F,U);else for(var H=Y.length-1;H>=0;H--)(oe=Y[H])&&(ne=(Q<3?oe(ne):Q>3?oe(I,F,ne):oe(I,F))||ne);return Q>3&&ne&&Object.defineProperty(I,F,ne),ne},e=w&&w.__param||function(Y,I){return function(F,U){I(F,U,Y)}};Object.defineProperty(xs,"__esModule",{value:!0}),xs.ATNDeserializer=void 0;const t=ea,r=_r,i=xn(),o=Zl,s=mt,l=na,a=Oc,u=Yl,c=Er,h=Nc,f=qi,d=Xr,p=fS(),v=Dc,m=zi(),y=Xl,g=Pc,x=Rc,S=Lc,_=bS,b=AS,C=kc,O=_S,D=Ic,M=la,j=J,k=Np(),V=ua(),se=Mc,ie=Bc,fe=jc,Ee=ql,me=$c,ee=Hc,X=Xn,Z=jo,le=Op(),E=zc,A=qc,T=Bo,N=ze,R=Uc,P=Vc,L=Ql;var z;(function(Y){Y[Y.UNICODE_BMP=0]="UNICODE_BMP",Y[Y.UNICODE_SMP=1]="UNICODE_SMP"})(z||(z={}));let W=class xe{constructor(I){I===void 0&&(I=o.ATNDeserializationOptions.defaultOptions),this.deserializationOptions=I}static get SERIALIZED_VERSION(){return 3}static isFeatureSupported(I,F){let U=xe.SUPPORTED_UUIDS.findIndex(Q=>Q.equals(I));return U<0?!1:xe.SUPPORTED_UUIDS.findIndex(Q=>Q.equals(F))>=U}static getUnicodeDeserializer(I){return I===0?{readUnicode:(F,U)=>xe.toInt(F[U]),size:1}:{readUnicode:(F,U)=>xe.toInt32(F,U),size:2}}deserialize(I){I=I.slice(0);for(let K=1;KK.equals(Q))<0){let K=`Could not deserialize ATN with UUID ${Q} (expected ${xe.SERIALIZED_UUID} or a legacy UUID).`;throw new Error(K)}let ne=xe.isFeatureSupported(xe.ADDED_LEXER_ACTIONS,Q),oe=xe.toInt(I[F++]),H=xe.toInt(I[F++]),G=new i.ATN(oe,H),ge=[],ke=[],He=xe.toInt(I[F++]);for(let K=0;KK.stopState^K.returnState^K.outermostPrecedenceReturn,equals:(K,be)=>K.stopState===be.stopState&&K.returnState===be.returnState&&K.outermostPrecedenceReturn===be.outermostPrecedenceReturn}),Fe=[];for(let K of G.states){let be=K.ruleIndex>=0&&G.ruleToStartState[K.ruleIndex].leftFactored;for(let _e=0;_e0;){let gt=G.ruleToStartState[K].removeTransition(G.ruleToStartState[K].numberOfTransitions-1);be.addTransition(gt)}G.ruleToStartState[K].addTransition(new v.EpsilonTransition(be)),_e.addTransition(new v.EpsilonTransition(Ce));let zt=new u.BasicState;G.addState(zt),zt.addTransition(new l.AtomTransition(_e,G.ruleToTokenType[K])),be.addTransition(new v.EpsilonTransition(zt))}this.deserializationOptions.isVerifyATN&&this.verifyATN(G)}if(this.deserializationOptions.isOptimize){for(;;){let K=0;K+=xe.inlineSetRules(G),K+=xe.combineChainedEpsilons(G);let be=G.grammarType===0;if(K+=xe.optimizeSets(G,be),K===0)break}this.deserializationOptions.isVerifyATN&&this.verifyATN(G)}return xe.identifyTailCalls(G),G}deserializeSets(I,F,U,Q){let ne=xe.toInt(I[F++]);for(let oe=0;oe=0)}else this.checkCondition(F.numberOfTransitions<=1||F instanceof X.RuleStopState)}}checkCondition(I,F){if(!I)throw new Error("IllegalStateException: "+F)}static inlineSetRules(I){let F=0,U=new Array(I.ruleToStartState.length);for(let Q=0;Q0;)Q.removeOptimizedTransition(Q.numberOfOptimizedTransitions-1);for(let oe of ne)Q.addOptimizedTransition(oe)}}return V.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+F+" rule invocations by inlining sets."),F}static combineChainedEpsilons(I){let F=0;for(let U of I.states){if(!U.onlyHasEpsilonTransitions||U instanceof X.RuleStopState)continue;let Q;e:for(let ne=0;ne0;)U.removeOptimizedTransition(U.numberOfOptimizedTransitions-1);for(let ne of Q)U.addOptimizedTransition(ne)}}return V.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+F+" transitions by combining chained epsilon transitions."),F}static optimizeSets(I,F){if(F)return 0;let U=0,Q=I.decisionToState;for(let ne of Q){let oe=new m.IntervalSet;for(let B=0;B0;)ne.removeOptimizedTransition(ne.numberOfOptimizedTransitions-1);for(let B of H)ne.addOptimizedTransition(B)}return V.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+U+" paths by collapsing sets."),U}static identifyTailCalls(I){for(let F of I.states){for(let U=0;U>>0}static toUUID(I,F){let U=xe.toInt32(I,F),Q=xe.toInt32(I,F+2),ne=xe.toInt32(I,F+4),oe=xe.toInt32(I,F+6);return new P.UUID(oe,ne,Q,U)}edgeFactory(I,F,U,Q,ne,oe,H,G){let ge=I.states[Q];switch(F){case 1:return new v.EpsilonTransition(ge);case 2:return H!==0?new me.RangeTransition(ge,N.Token.EOF,oe):new me.RangeTransition(ge,ne,oe);case 3:return new Z.RuleTransition(I.states[ne],oe,H,ge);case 4:return new Ee.PredicateTransition(ge,ne,oe,H!==0);case 10:return new fe.PrecedencePredicateTransition(ge,ne);case 5:return H!==0?new l.AtomTransition(ge,N.Token.EOF):new l.AtomTransition(ge,ne);case 6:return new t.ActionTransition(ge,ne,oe,H!==0);case 7:return new le.SetTransition(ge,G[ne]);case 8:return new k.NotSetTransition(ge,G[ne]);case 9:return new L.WildcardTransition(ge)}throw new Error("The specified transition type is not valid.")}stateFactory(I,F){let U;switch(I){case s.ATNStateType.INVALID_TYPE:return new y.InvalidState;case s.ATNStateType.BASIC:U=new u.BasicState;break;case s.ATNStateType.RULE_START:U=new ee.RuleStartState;break;case s.ATNStateType.BLOCK_START:U=new a.BasicBlockStartState;break;case s.ATNStateType.PLUS_BLOCK_START:U=new se.PlusBlockStartState;break;case s.ATNStateType.STAR_BLOCK_START:U=new E.StarBlockStartState;break;case s.ATNStateType.TOKEN_START:U=new R.TokensStartState;break;case s.ATNStateType.RULE_STOP:U=new X.RuleStopState;break;case s.ATNStateType.BLOCK_END:U=new h.BlockEndState;break;case s.ATNStateType.STAR_LOOP_BACK:U=new A.StarLoopbackState;break;case s.ATNStateType.STAR_LOOP_ENTRY:U=new T.StarLoopEntryState;break;case s.ATNStateType.PLUS_LOOP_BACK:U=new ie.PlusLoopbackState;break;case s.ATNStateType.LOOP_END:U=new M.LoopEndState;break;default:let Q=`The specified state type ${I} is not valid.`;throw new Error(Q)}return U.ruleIndex=F,U}lexerActionFactory(I,F,U){switch(I){case 0:return new g.LexerChannelAction(F);case 1:return new x.LexerCustomAction(F,U);case 2:return new S.LexerModeAction(F);case 3:return _.LexerMoreAction.INSTANCE;case 4:return b.LexerPopModeAction.INSTANCE;case 5:return new C.LexerPushModeAction(F);case 6:return O.LexerSkipAction.INSTANCE;case 7:return new D.LexerTypeAction(F);default:let Q=`The specified lexer action type ${I} is not valid.`;throw new Error(Q)}}};return W.BASE_SERIALIZED_UUID=P.UUID.fromString("E4178468-DF95-44D0-AD87-F22A5D5FB6D3"),W.ADDED_LEXER_ACTIONS=P.UUID.fromString("AB35191A-1603-487E-B75A-479B831EAF6D"),W.ADDED_UNICODE_SMP=P.UUID.fromString("C23FEA89-0605-4f51-AFB8-058BCAB8C91B"),W.SUPPORTED_UUIDS=[W.BASE_SERIALIZED_UUID,W.ADDED_LEXER_ACTIONS,W.ADDED_UNICODE_SMP],W.SERIALIZED_UUID=W.ADDED_UNICODE_SMP,n([j.NotNull],W.prototype,"deserializationOptions",void 0),n([e(0,j.NotNull)],W.prototype,"deserialize",null),n([e(0,j.NotNull)],W.prototype,"markPrecedenceDecisions",null),n([j.NotNull,e(0,j.NotNull)],W.prototype,"edgeFactory",null),xs.ATNDeserializer=W,xs}var Wc={};/*! + */var n=w&&w.__decorate||function(J,M,F,U){var Q=arguments.length,ne=Q<3?M:U===null?U=Object.getOwnPropertyDescriptor(M,F):U,oe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(J,M,F,U);else for(var H=J.length-1;H>=0;H--)(oe=J[H])&&(ne=(Q<3?oe(ne):Q>3?oe(M,F,ne):oe(M,F))||ne);return Q>3&&ne&&Object.defineProperty(M,F,ne),ne},e=w&&w.__param||function(J,M){return function(F,U){M(F,U,J)}};Object.defineProperty(vs,"__esModule",{value:!0}),vs.ATNDeserializer=void 0;const t=na,r=_r,i=vn(),o=ra,s=mt,l=sa,a=Rc,u=Zl,c=Er,h=Lc,f=Ki,d=Yr,p=vb(),v=kc,m=Wi(),y=Ql,g=Ic,x=Mc,b=Fc,_=Ob,S=Nb,C=Bc,O=Db,D=jc,B=ca,$=X,I=Fp(),V=fa(),se=Hc,ie=zc,fe=qc,Ee=Wl,me=Uc,ee=Vc,Y=Yn,Z=zo,le=Mp(),E=Wc,A=Kc,T=Ho,N=ze,R=Gc,P=Xc,L=ta;var z;(function(J){J[J.UNICODE_BMP=0]="UNICODE_BMP",J[J.UNICODE_SMP=1]="UNICODE_SMP"})(z||(z={}));let W=class xe{constructor(M){M===void 0&&(M=o.ATNDeserializationOptions.defaultOptions),this.deserializationOptions=M}static get SERIALIZED_VERSION(){return 3}static isFeatureSupported(M,F){let U=xe.SUPPORTED_UUIDS.findIndex(Q=>Q.equals(M));return U<0?!1:xe.SUPPORTED_UUIDS.findIndex(Q=>Q.equals(F))>=U}static getUnicodeDeserializer(M){return M===0?{readUnicode:(F,U)=>xe.toInt(F[U]),size:1}:{readUnicode:(F,U)=>xe.toInt32(F,U),size:2}}deserialize(M){M=M.slice(0);for(let K=1;KK.equals(Q))<0){let K=`Could not deserialize ATN with UUID ${Q} (expected ${xe.SERIALIZED_UUID} or a legacy UUID).`;throw new Error(K)}let ne=xe.isFeatureSupported(xe.ADDED_LEXER_ACTIONS,Q),oe=xe.toInt(M[F++]),H=xe.toInt(M[F++]),G=new i.ATN(oe,H),ge=[],ke=[],He=xe.toInt(M[F++]);for(let K=0;KK.stopState^K.returnState^K.outermostPrecedenceReturn,equals:(K,Se)=>K.stopState===Se.stopState&&K.returnState===Se.returnState&&K.outermostPrecedenceReturn===Se.outermostPrecedenceReturn}),Me=[];for(let K of G.states){let Se=K.ruleIndex>=0&&G.ruleToStartState[K.ruleIndex].leftFactored;for(let _e=0;_e0;){let gt=G.ruleToStartState[K].removeTransition(G.ruleToStartState[K].numberOfTransitions-1);Se.addTransition(gt)}G.ruleToStartState[K].addTransition(new v.EpsilonTransition(Se)),_e.addTransition(new v.EpsilonTransition(Ce));let Ht=new u.BasicState;G.addState(Ht),Ht.addTransition(new l.AtomTransition(_e,G.ruleToTokenType[K])),Se.addTransition(new v.EpsilonTransition(Ht))}this.deserializationOptions.isVerifyATN&&this.verifyATN(G)}if(this.deserializationOptions.isOptimize){for(;;){let K=0;K+=xe.inlineSetRules(G),K+=xe.combineChainedEpsilons(G);let Se=G.grammarType===0;if(K+=xe.optimizeSets(G,Se),K===0)break}this.deserializationOptions.isVerifyATN&&this.verifyATN(G)}return xe.identifyTailCalls(G),G}deserializeSets(M,F,U,Q){let ne=xe.toInt(M[F++]);for(let oe=0;oe=0)}else this.checkCondition(F.numberOfTransitions<=1||F instanceof Y.RuleStopState)}}checkCondition(M,F){if(!M)throw new Error("IllegalStateException: "+F)}static inlineSetRules(M){let F=0,U=new Array(M.ruleToStartState.length);for(let Q=0;Q0;)Q.removeOptimizedTransition(Q.numberOfOptimizedTransitions-1);for(let oe of ne)Q.addOptimizedTransition(oe)}}return V.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+F+" rule invocations by inlining sets."),F}static combineChainedEpsilons(M){let F=0;for(let U of M.states){if(!U.onlyHasEpsilonTransitions||U instanceof Y.RuleStopState)continue;let Q;e:for(let ne=0;ne0;)U.removeOptimizedTransition(U.numberOfOptimizedTransitions-1);for(let ne of Q)U.addOptimizedTransition(ne)}}return V.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+F+" transitions by combining chained epsilon transitions."),F}static optimizeSets(M,F){if(F)return 0;let U=0,Q=M.decisionToState;for(let ne of Q){let oe=new m.IntervalSet;for(let j=0;j0;)ne.removeOptimizedTransition(ne.numberOfOptimizedTransitions-1);for(let j of H)ne.addOptimizedTransition(j)}return V.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+U+" paths by collapsing sets."),U}static identifyTailCalls(M){for(let F of M.states){for(let U=0;U>>0}static toUUID(M,F){let U=xe.toInt32(M,F),Q=xe.toInt32(M,F+2),ne=xe.toInt32(M,F+4),oe=xe.toInt32(M,F+6);return new P.UUID(oe,ne,Q,U)}edgeFactory(M,F,U,Q,ne,oe,H,G){let ge=M.states[Q];switch(F){case 1:return new v.EpsilonTransition(ge);case 2:return H!==0?new me.RangeTransition(ge,N.Token.EOF,oe):new me.RangeTransition(ge,ne,oe);case 3:return new Z.RuleTransition(M.states[ne],oe,H,ge);case 4:return new Ee.PredicateTransition(ge,ne,oe,H!==0);case 10:return new fe.PrecedencePredicateTransition(ge,ne);case 5:return H!==0?new l.AtomTransition(ge,N.Token.EOF):new l.AtomTransition(ge,ne);case 6:return new t.ActionTransition(ge,ne,oe,H!==0);case 7:return new le.SetTransition(ge,G[ne]);case 8:return new I.NotSetTransition(ge,G[ne]);case 9:return new L.WildcardTransition(ge)}throw new Error("The specified transition type is not valid.")}stateFactory(M,F){let U;switch(M){case s.ATNStateType.INVALID_TYPE:return new y.InvalidState;case s.ATNStateType.BASIC:U=new u.BasicState;break;case s.ATNStateType.RULE_START:U=new ee.RuleStartState;break;case s.ATNStateType.BLOCK_START:U=new a.BasicBlockStartState;break;case s.ATNStateType.PLUS_BLOCK_START:U=new se.PlusBlockStartState;break;case s.ATNStateType.STAR_BLOCK_START:U=new E.StarBlockStartState;break;case s.ATNStateType.TOKEN_START:U=new R.TokensStartState;break;case s.ATNStateType.RULE_STOP:U=new Y.RuleStopState;break;case s.ATNStateType.BLOCK_END:U=new h.BlockEndState;break;case s.ATNStateType.STAR_LOOP_BACK:U=new A.StarLoopbackState;break;case s.ATNStateType.STAR_LOOP_ENTRY:U=new T.StarLoopEntryState;break;case s.ATNStateType.PLUS_LOOP_BACK:U=new ie.PlusLoopbackState;break;case s.ATNStateType.LOOP_END:U=new B.LoopEndState;break;default:let Q=`The specified state type ${M} is not valid.`;throw new Error(Q)}return U.ruleIndex=F,U}lexerActionFactory(M,F,U){switch(M){case 0:return new g.LexerChannelAction(F);case 1:return new x.LexerCustomAction(F,U);case 2:return new b.LexerModeAction(F);case 3:return _.LexerMoreAction.INSTANCE;case 4:return S.LexerPopModeAction.INSTANCE;case 5:return new C.LexerPushModeAction(F);case 6:return O.LexerSkipAction.INSTANCE;case 7:return new D.LexerTypeAction(F);default:let Q=`The specified lexer action type ${M} is not valid.`;throw new Error(Q)}}};return W.BASE_SERIALIZED_UUID=P.UUID.fromString("E4178468-DF95-44D0-AD87-F22A5D5FB6D3"),W.ADDED_LEXER_ACTIONS=P.UUID.fromString("AB35191A-1603-487E-B75A-479B831EAF6D"),W.ADDED_UNICODE_SMP=P.UUID.fromString("C23FEA89-0605-4f51-AFB8-058BCAB8C91B"),W.SUPPORTED_UUIDS=[W.BASE_SERIALIZED_UUID,W.ADDED_LEXER_ACTIONS,W.ADDED_UNICODE_SMP],W.SERIALIZED_UUID=W.ADDED_UNICODE_SMP,n([$.NotNull],W.prototype,"deserializationOptions",void 0),n([e(0,$.NotNull)],W.prototype,"deserialize",null),n([e(0,$.NotNull)],W.prototype,"markPrecedenceDecisions",null),n([$.NotNull,e(0,$.NotNull)],W.prototype,"edgeFactory",null),vs.ATNDeserializer=W,vs}var Yc={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Ip=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},UD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ParseInfo=void 0;const Fp=J;let kl=class{constructor(e){this.atnSimulator=e}getDecisionInfo(){return this.atnSimulator.getDecisionInfo()}getLLDecisions(){let e=this.atnSimulator.getDecisionInfo(),t=[];for(let r=0;r0&&t.push(r);return t}getTotalTimeInPrediction(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.timeInPrediction;return t}getTotalSLLLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.SLL_TotalLook;return t}getTotalLLLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.LL_TotalLook;return t}getTotalSLLATNLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.SLL_ATNTransitions;return t}getTotalLLATNLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.LL_ATNTransitions;return t}getTotalATNLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.SLL_ATNTransitions,t+=r.LL_ATNTransitions;return t}getDFASize(e){if(e)return this.atnSimulator.atn.decisionToDFA[e].states.size;{let t=0,r=this.atnSimulator.atn.decisionToDFA;for(let i=0;i=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},iP=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.ParseInfo=void 0;const Up=X;let Fl=class{constructor(e){this.atnSimulator=e}getDecisionInfo(){return this.atnSimulator.getDecisionInfo()}getLLDecisions(){let e=this.atnSimulator.getDecisionInfo(),t=[];for(let r=0;r0&&t.push(r);return t}getTotalTimeInPrediction(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.timeInPrediction;return t}getTotalSLLLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.SLL_TotalLook;return t}getTotalLLLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.LL_TotalLook;return t}getTotalSLLATNLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.SLL_ATNTransitions;return t}getTotalLLATNLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.LL_ATNTransitions;return t}getTotalATNLookaheadOps(){let e=this.atnSimulator.getDecisionInfo(),t=0;for(let r of e)t+=r.SLL_ATNTransitions,t+=r.LL_ATNTransitions;return t}getDFASize(e){if(e)return this.atnSimulator.atn.decisionToDFA[e].states.size;{let t=0,r=this.atnSimulator.atn.decisionToDFA;for(let i=0;i=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(da,"__esModule",{value:!0});da.ProxyParserErrorListener=void 0;const VD=Mo,Bp=J;class Kc extends VD.ProxyErrorListener{constructor(e){super(e)}reportAmbiguity(e,t,r,i,o,s,l){this.getDelegates().forEach(a=>{a.reportAmbiguity&&a.reportAmbiguity(e,t,r,i,o,s,l)})}reportAttemptingFullContext(e,t,r,i,o,s){this.getDelegates().forEach(l=>{l.reportAttemptingFullContext&&l.reportAttemptingFullContext(e,t,r,i,o,s)})}reportContextSensitivity(e,t,r,i,o,s){this.getDelegates().forEach(l=>{l.reportContextSensitivity&&l.reportContextSensitivity(e,t,r,i,o,s)})}}Mp([Bp.Override],Kc.prototype,"reportAmbiguity",null);Mp([Bp.Override],Kc.prototype,"reportAttemptingFullContext",null);Mp([Bp.Override],Kc.prototype,"reportContextSensitivity",null);da.ProxyParserErrorListener=Kc;var df={},Gc={},jp={},Fn={};/*! + */var Vp=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(ga,"__esModule",{value:!0});ga.ProxyParserErrorListener=void 0;const oP=$o,Wp=X;class Jc extends oP.ProxyErrorListener{constructor(e){super(e)}reportAmbiguity(e,t,r,i,o,s,l){this.getDelegates().forEach(a=>{a.reportAmbiguity&&a.reportAmbiguity(e,t,r,i,o,s,l)})}reportAttemptingFullContext(e,t,r,i,o,s){this.getDelegates().forEach(l=>{l.reportAttemptingFullContext&&l.reportAttemptingFullContext(e,t,r,i,o,s)})}reportContextSensitivity(e,t,r,i,o,s){this.getDelegates().forEach(l=>{l.reportContextSensitivity&&l.reportContextSensitivity(e,t,r,i,o,s)})}}Vp([Wp.Override],Jc.prototype,"reportAmbiguity",null);Vp([Wp.Override],Jc.prototype,"reportAttemptingFullContext",null);Vp([Wp.Override],Jc.prototype,"reportContextSensitivity",null);ga.ProxyParserErrorListener=Jc;var bf={},Qc={},Kp={},Fn={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Fn,"__esModule",{value:!0});Fn.isSupplementaryCodePoint=Fn.isLowSurrogate=Fn.isHighSurrogate=void 0;function WD(n){return n>=55296&&n<=56319}Fn.isHighSurrogate=WD;function KD(n){return n>=56320&&n<=57343}Fn.isLowSurrogate=KD;function GD(n){return n>=65536}Fn.isSupplementaryCodePoint=GD;(function(n){/*! + */Object.defineProperty(Fn,"__esModule",{value:!0});Fn.isSupplementaryCodePoint=Fn.isLowSurrogate=Fn.isHighSurrogate=void 0;function sP(n){return n>=55296&&n<=56319}Fn.isHighSurrogate=sP;function lP(n){return n>=56320&&n<=57343}Fn.isLowSurrogate=lP;function aP(n){return n>=65536}Fn.isSupplementaryCodePoint=aP;(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(n,"__esModule",{value:!0}),n.CodePointBuffer=void 0;const e=jt(),t=Fn;class r{constructor(o,s){this.buffer=o,this._position=0,this._size=s}static withArray(o){return new r(o,o.length)}get position(){return this._position}set position(o){if(o<0||o>this._size)throw new RangeError;this._position=o}get remaining(){return this._size-this.position}get(o){return this.buffer[o]}array(){return this.buffer.slice(0,this._size)}static builder(o){return new r.Builder(o)}}n.CodePointBuffer=r,function(i){let o;(function(l){l[l.BYTE=0]="BYTE",l[l.CHAR=1]="CHAR",l[l.INT=2]="INT"})(o||(o={}));class s{constructor(a){this.type=0,this.buffer=new Uint8Array(a),this.prevHighSurrogate=-1,this.position=0}build(){return new i(this.buffer,this.position)}static roundUpToNextPowerOfTwo(a){let u=32-Math.clz32(a-1);return Math.pow(2,u)}ensureRemaining(a){switch(this.type){case 0:if(this.buffer.length-this.position>1));u.set(this.buffer.subarray(0,this.position),0),this.type=1,this.buffer=u}byteToIntBuffer(a){let u=new Int32Array(Math.max(this.position+a,this.buffer.length>>2));u.set(this.buffer.subarray(0,this.position),0),this.type=2,this.buffer=u}charToIntBuffer(a){let u=new Int32Array(Math.max(this.position+a,this.buffer.length>>1));u.set(this.buffer.subarray(0,this.position),0),this.type=2,this.buffer=u}}i.Builder=s}(r=n.CodePointBuffer||(n.CodePointBuffer={}))})(jp);var pa={};/*! + */Object.defineProperty(n,"__esModule",{value:!0}),n.CodePointBuffer=void 0;const e=Bt(),t=Fn;class r{constructor(o,s){this.buffer=o,this._position=0,this._size=s}static withArray(o){return new r(o,o.length)}get position(){return this._position}set position(o){if(o<0||o>this._size)throw new RangeError;this._position=o}get remaining(){return this._size-this.position}get(o){return this.buffer[o]}array(){return this.buffer.slice(0,this._size)}static builder(o){return new r.Builder(o)}}n.CodePointBuffer=r,function(i){let o;(function(l){l[l.BYTE=0]="BYTE",l[l.CHAR=1]="CHAR",l[l.INT=2]="INT"})(o||(o={}));class s{constructor(a){this.type=0,this.buffer=new Uint8Array(a),this.prevHighSurrogate=-1,this.position=0}build(){return new i(this.buffer,this.position)}static roundUpToNextPowerOfTwo(a){let u=32-Math.clz32(a-1);return Math.pow(2,u)}ensureRemaining(a){switch(this.type){case 0:if(this.buffer.length-this.position>1));u.set(this.buffer.subarray(0,this.position),0),this.type=1,this.buffer=u}byteToIntBuffer(a){let u=new Int32Array(Math.max(this.position+a,this.buffer.length>>2));u.set(this.buffer.subarray(0,this.position),0),this.type=2,this.buffer=u}charToIntBuffer(a){let u=new Int32Array(Math.max(this.position+a,this.buffer.length>>1));u.set(this.buffer.subarray(0,this.position),0),this.type=2,this.buffer=u}}i.Builder=s}(r=n.CodePointBuffer||(n.CodePointBuffer={}))})(Kp);var xa={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Zr=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(pa,"__esModule",{value:!0});pa.CodePointCharStream=void 0;const Ig=jt(),Ya=pn,XD=Ct,en=J;class ir{constructor(e,t,r,i){Ig(t===0),this._array=e,this._size=r,this._name=i,this._position=0}get internalStorage(){return this._array}static fromBuffer(e,t){return(t===void 0||t.length===0)&&(t=Ya.IntStream.UNKNOWN_SOURCE_NAME),new ir(e.array(),e.position,e.remaining,t)}consume(){if(this._size-this._position===0)throw Ig(this.LA(1)===Ya.IntStream.EOF),new RangeError("cannot consume EOF");this._position++}get index(){return this._position}get size(){return this._size}mark(){return-1}release(e){}seek(e){this._position=e}get sourceName(){return this._name}toString(){return this.getText(XD.Interval.of(0,this.size-1))}LA(e){let t;switch(Math.sign(e)){case-1:return t=this.index+e,t<0?Ya.IntStream.EOF:this._array[t];case 0:return 0;case 1:return t=this.index+e-1,t>=this.size?Ya.IntStream.EOF:this._array[t]}throw new RangeError("Not reached")}getText(e){const t=Math.min(e.a,this.size),r=Math.min(e.b-e.a+1,this.size-t);return this._array instanceof Int32Array?String.fromCodePoint(...Array.from(this._array.subarray(t,t+r))):String.fromCharCode(...Array.from(this._array.subarray(t,t+r)))}}Zr([en.Override],ir.prototype,"consume",null);Zr([en.Override],ir.prototype,"index",null);Zr([en.Override],ir.prototype,"size",null);Zr([en.Override],ir.prototype,"mark",null);Zr([en.Override],ir.prototype,"release",null);Zr([en.Override],ir.prototype,"seek",null);Zr([en.Override],ir.prototype,"sourceName",null);Zr([en.Override],ir.prototype,"toString",null);Zr([en.Override],ir.prototype,"LA",null);Zr([en.Override],ir.prototype,"getText",null);pa.CodePointCharStream=ir;(function(n){/*! + */var en=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(xa,"__esModule",{value:!0});xa.CodePointCharStream=void 0;const zg=Bt(),tu=gn,uP=Ct,tn=X;class ir{constructor(e,t,r,i){zg(t===0),this._array=e,this._size=r,this._name=i,this._position=0}get internalStorage(){return this._array}static fromBuffer(e,t){return(t===void 0||t.length===0)&&(t=tu.IntStream.UNKNOWN_SOURCE_NAME),new ir(e.array(),e.position,e.remaining,t)}consume(){if(this._size-this._position===0)throw zg(this.LA(1)===tu.IntStream.EOF),new RangeError("cannot consume EOF");this._position++}get index(){return this._position}get size(){return this._size}mark(){return-1}release(e){}seek(e){this._position=e}get sourceName(){return this._name}toString(){return this.getText(uP.Interval.of(0,this.size-1))}LA(e){let t;switch(Math.sign(e)){case-1:return t=this.index+e,t<0?tu.IntStream.EOF:this._array[t];case 0:return 0;case 1:return t=this.index+e-1,t>=this.size?tu.IntStream.EOF:this._array[t]}throw new RangeError("Not reached")}getText(e){const t=Math.min(e.a,this.size),r=Math.min(e.b-e.a+1,this.size-t);return this._array instanceof Int32Array?String.fromCodePoint(...Array.from(this._array.subarray(t,t+r))):String.fromCharCode(...Array.from(this._array.subarray(t,t+r)))}}en([tn.Override],ir.prototype,"consume",null);en([tn.Override],ir.prototype,"index",null);en([tn.Override],ir.prototype,"size",null);en([tn.Override],ir.prototype,"mark",null);en([tn.Override],ir.prototype,"release",null);en([tn.Override],ir.prototype,"seek",null);en([tn.Override],ir.prototype,"sourceName",null);en([tn.Override],ir.prototype,"toString",null);en([tn.Override],ir.prototype,"LA",null);en([tn.Override],ir.prototype,"getText",null);xa.CodePointCharStream=ir;(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(n,"__esModule",{value:!0}),n.CharStreams=void 0;const e=jp,t=pa,r=pn;(function(i){function o(s,l){(l===void 0||l.length===0)&&(l=r.IntStream.UNKNOWN_SOURCE_NAME);let a=e.CodePointBuffer.builder(s.length),u=new Uint16Array(s.length);for(let c=0;c=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},YD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ma,"__esModule",{value:!0});ma.BufferedTokenStream=void 0;const Fg=jt(),Mg=Wn,pf=Ct,mf=Yn(),pt=J,ei=ze;let Et=class{constructor(e){if(this.tokens=[],this.p=-1,this.fetchedEOF=!1,e==null)throw new Error("tokenSource cannot be null");this._tokenSource=e}get tokenSource(){return this._tokenSource}set tokenSource(e){this._tokenSource=e,this.tokens.length=0,this.p=-1,this.fetchedEOF=!1}get index(){return this.p}mark(){return 0}release(e){}seek(e){this.lazyInit(),this.p=this.adjustSeekIndex(e)}get size(){return this.tokens.length}consume(){let e;if(this.p>=0?this.fetchedEOF?e=this.p=0);let t=e-this.tokens.length+1;return t>0?this.fetch(t)>=t:!0}fetch(e){if(this.fetchedEOF)return 0;for(let t=0;t=this.tokens.length)throw new RangeError("token index "+e+" out of range 0.."+(this.tokens.length-1));return this.tokens[e]}getRange(e,t){if(e<0||t<0)return[];this.lazyInit();let r=new Array;t>=this.tokens.length&&(t=this.tokens.length-1);for(let i=e;i<=t;i++){let o=this.tokens[i];if(o.type===ei.Token.EOF)break;r.push(o)}return r}LA(e){let t=this.LT(e);return t?t.type:ei.Token.INVALID_TYPE}tryLB(e){if(!(this.p-e<0))return this.tokens[this.p-e]}LT(e){let t=this.tryLT(e);if(t===void 0)throw new RangeError("requested lookback index out of range");return t}tryLT(e){if(this.lazyInit(),e===0)throw new RangeError("0 is not a valid lookahead index");if(e<0)return this.tryLB(-e);let t=this.p+e-1;return this.sync(t),t>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[t]}adjustSeekIndex(e){return e}lazyInit(){this.p===-1&&this.setup()}setup(){this.sync(0),this.p=this.adjustSeekIndex(0)}getTokens(e,t,r){if(this.lazyInit(),e===void 0)return Fg(t===void 0&&r===void 0),this.tokens;if(t===void 0&&(t=this.tokens.length-1),e<0||t>=this.tokens.length||t<0||e>=this.tokens.length)throw new RangeError("start "+e+" or stop "+t+" not in 0.."+(this.tokens.length-1));if(e>t)return[];if(r===void 0)return this.tokens.slice(e,t+1);typeof r=="number"&&(r=new Set().add(r));let i=r,o=this.tokens.slice(e,t+1);return o=o.filter(s=>i.has(s.type)),o}nextTokenOnChannel(e,t){if(this.sync(e),e>=this.size)return this.size-1;let r=this.tokens[e];for(;r.channel!==t;){if(r.type===ei.Token.EOF)return e;e++,this.sync(e),r=this.tokens[e]}return e}previousTokenOnChannel(e,t){if(this.sync(e),e>=this.size)return this.size-1;for(;e>=0;){let r=this.tokens[e];if(r.type===ei.Token.EOF||r.channel===t)return e;e--}return e}getHiddenTokensToRight(e,t=-1){if(this.lazyInit(),e<0||e>=this.tokens.length)throw new RangeError(e+" not in 0.."+(this.tokens.length-1));let r=this.nextTokenOnChannel(e+1,mf.Lexer.DEFAULT_TOKEN_CHANNEL),i,o=e+1;return r===-1?i=this.size-1:i=r,this.filterForChannel(o,i,t)}getHiddenTokensToLeft(e,t=-1){if(this.lazyInit(),e<0||e>=this.tokens.length)throw new RangeError(e+" not in 0.."+(this.tokens.length-1));if(e===0)return[];let r=this.previousTokenOnChannel(e-1,mf.Lexer.DEFAULT_TOKEN_CHANNEL);if(r===e-1)return[];let i=r+1,o=e-1;return this.filterForChannel(i,o,t)}filterForChannel(e,t,r){let i=new Array;for(let o=e;o<=t;o++){let s=this.tokens[o];r===-1?s.channel!==mf.Lexer.DEFAULT_TOKEN_CHANNEL&&i.push(s):s.channel===r&&i.push(s)}return i}get sourceName(){return this.tokenSource.sourceName}getText(e){e===void 0?e=pf.Interval.of(0,this.size-1):e instanceof pf.Interval||(e=e.sourceInterval);let t=e.a,r=e.b;if(t<0||r<0)return"";this.fill(),r>=this.tokens.length&&(r=this.tokens.length-1);let i="";for(let o=t;o<=r;o++){let s=this.tokens[o];if(s.type===ei.Token.EOF)break;i+=s.text}return i.toString()}getTextFromRange(e,t){return this.isToken(e)&&this.isToken(t)?this.getText(pf.Interval.of(e.tokenIndex,t.tokenIndex)):""}fill(){this.lazyInit();const e=1e3;for(;;)if(this.fetch(e)=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},cP=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ya,"__esModule",{value:!0});ya.BufferedTokenStream=void 0;const qg=Bt(),Ug=Kn,Sf=Ct,Af=Jn(),pt=X,ii=ze;let Et=class{constructor(e){if(this.tokens=[],this.p=-1,this.fetchedEOF=!1,e==null)throw new Error("tokenSource cannot be null");this._tokenSource=e}get tokenSource(){return this._tokenSource}set tokenSource(e){this._tokenSource=e,this.tokens.length=0,this.p=-1,this.fetchedEOF=!1}get index(){return this.p}mark(){return 0}release(e){}seek(e){this.lazyInit(),this.p=this.adjustSeekIndex(e)}get size(){return this.tokens.length}consume(){let e;if(this.p>=0?this.fetchedEOF?e=this.p=0);let t=e-this.tokens.length+1;return t>0?this.fetch(t)>=t:!0}fetch(e){if(this.fetchedEOF)return 0;for(let t=0;t=this.tokens.length)throw new RangeError("token index "+e+" out of range 0.."+(this.tokens.length-1));return this.tokens[e]}getRange(e,t){if(e<0||t<0)return[];this.lazyInit();let r=new Array;t>=this.tokens.length&&(t=this.tokens.length-1);for(let i=e;i<=t;i++){let o=this.tokens[i];if(o.type===ii.Token.EOF)break;r.push(o)}return r}LA(e){let t=this.LT(e);return t?t.type:ii.Token.INVALID_TYPE}tryLB(e){if(!(this.p-e<0))return this.tokens[this.p-e]}LT(e){let t=this.tryLT(e);if(t===void 0)throw new RangeError("requested lookback index out of range");return t}tryLT(e){if(this.lazyInit(),e===0)throw new RangeError("0 is not a valid lookahead index");if(e<0)return this.tryLB(-e);let t=this.p+e-1;return this.sync(t),t>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[t]}adjustSeekIndex(e){return e}lazyInit(){this.p===-1&&this.setup()}setup(){this.sync(0),this.p=this.adjustSeekIndex(0)}getTokens(e,t,r){if(this.lazyInit(),e===void 0)return qg(t===void 0&&r===void 0),this.tokens;if(t===void 0&&(t=this.tokens.length-1),e<0||t>=this.tokens.length||t<0||e>=this.tokens.length)throw new RangeError("start "+e+" or stop "+t+" not in 0.."+(this.tokens.length-1));if(e>t)return[];if(r===void 0)return this.tokens.slice(e,t+1);typeof r=="number"&&(r=new Set().add(r));let i=r,o=this.tokens.slice(e,t+1);return o=o.filter(s=>i.has(s.type)),o}nextTokenOnChannel(e,t){if(this.sync(e),e>=this.size)return this.size-1;let r=this.tokens[e];for(;r.channel!==t;){if(r.type===ii.Token.EOF)return e;e++,this.sync(e),r=this.tokens[e]}return e}previousTokenOnChannel(e,t){if(this.sync(e),e>=this.size)return this.size-1;for(;e>=0;){let r=this.tokens[e];if(r.type===ii.Token.EOF||r.channel===t)return e;e--}return e}getHiddenTokensToRight(e,t=-1){if(this.lazyInit(),e<0||e>=this.tokens.length)throw new RangeError(e+" not in 0.."+(this.tokens.length-1));let r=this.nextTokenOnChannel(e+1,Af.Lexer.DEFAULT_TOKEN_CHANNEL),i,o=e+1;return r===-1?i=this.size-1:i=r,this.filterForChannel(o,i,t)}getHiddenTokensToLeft(e,t=-1){if(this.lazyInit(),e<0||e>=this.tokens.length)throw new RangeError(e+" not in 0.."+(this.tokens.length-1));if(e===0)return[];let r=this.previousTokenOnChannel(e-1,Af.Lexer.DEFAULT_TOKEN_CHANNEL);if(r===e-1)return[];let i=r+1,o=e-1;return this.filterForChannel(i,o,t)}filterForChannel(e,t,r){let i=new Array;for(let o=e;o<=t;o++){let s=this.tokens[o];r===-1?s.channel!==Af.Lexer.DEFAULT_TOKEN_CHANNEL&&i.push(s):s.channel===r&&i.push(s)}return i}get sourceName(){return this.tokenSource.sourceName}getText(e){e===void 0?e=Sf.Interval.of(0,this.size-1):e instanceof Sf.Interval||(e=e.sourceInterval);let t=e.a,r=e.b;if(t<0||r<0)return"";this.fill(),r>=this.tokens.length&&(r=this.tokens.length-1);let i="";for(let o=t;o<=r;o++){let s=this.tokens[o];if(s.type===ii.Token.EOF)break;i+=s.text}return i.toString()}getTextFromRange(e,t){return this.isToken(e)&&this.isToken(t)?this.getText(Sf.Interval.of(e.tokenIndex,t.tokenIndex)):""}fill(){this.lazyInit();const e=1e3;for(;;)if(this.fetch(e)=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},JD=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.CommonTokenStream=void 0;const QD=ma,Yc=J,Bg=ze;let No=class extends QD.BufferedTokenStream{constructor(e,t=Bg.Token.DEFAULT_CHANNEL){super(e),this.channel=t}adjustSeekIndex(e){return this.nextTokenOnChannel(e,this.channel)}tryLB(e){if(this.p-e<0)return;let t=this.p,r=1;for(;r<=e&&t>0;)t=this.previousTokenOnChannel(t-1,this.channel),r++;if(!(t<0))return this.tokens[t]}tryLT(e){if(this.lazyInit(),e===0)throw new RangeError("0 is not a valid lookahead index");if(e<0)return this.tryLB(-e);let t=this.p,r=1;for(;r=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},hP=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.CommonTokenStream=void 0;const fP=ya,eh=X,Vg=ze;let Ro=class extends fP.BufferedTokenStream{constructor(e,t=Vg.Token.DEFAULT_CHANNEL){super(e),this.channel=t}adjustSeekIndex(e){return this.nextTokenOnChannel(e,this.channel)}tryLB(e){if(this.p-e<0)return;let t=this.p,r=1;for(;r<=e&&t>0;)t=this.previousTokenOnChannel(t-1,this.channel),r++;if(!(t<0))return this.tokens[t]}tryLT(e){if(this.lazyInit(),e===0)throw new RangeError("0 is not a valid lookahead index");if(e<0)return this.tryLB(-e);let t=this.p,r=1;for(;r=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},BS=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ga,"__esModule",{value:!0});ga.ListTokenSource=void 0;const ZD=Sc,sn=J,gf=ze;let hn=class{constructor(e,t){if(this.i=0,this._factory=ZD.CommonTokenFactory.DEFAULT,e==null)throw new Error("tokens cannot be null");this.tokens=e,this._sourceName=t}get charPositionInLine(){if(this.i0){let e=this.tokens[this.tokens.length-1],t=e.text;if(t!=null){let r=t.lastIndexOf(` -`);if(r>=0)return t.length-r-1}return e.charPositionInLine+e.stopIndex-e.startIndex+1}return 0}nextToken(){if(this.i>=this.tokens.length){if(this.eofToken==null){let t=-1;if(this.tokens.length>0){let i=this.tokens[this.tokens.length-1].stopIndex;i!==-1&&(t=i+1)}let r=Math.max(-1,t-1);this.eofToken=this._factory.create({source:this,stream:this.inputStream},gf.Token.EOF,"EOF",gf.Token.DEFAULT_CHANNEL,t,r,this.line,this.charPositionInLine)}return this.eofToken}let e=this.tokens[this.i];return this.i===this.tokens.length-1&&e.type===gf.Token.EOF&&(this.eofToken=e),this.i++,e}get line(){if(this.i0){let e=this.tokens[this.tokens.length-1],t=e.line,r=e.text;if(r!=null)for(let i=0;i0)return this.tokens[this.tokens.length-1].inputStream}get sourceName(){if(this._sourceName)return this._sourceName;let e=this.inputStream;return e!=null?e.sourceName:"List"}set tokenFactory(e){this._factory=e}get tokenFactory(){return this._factory}};Vi([sn.Override],hn.prototype,"charPositionInLine",null);Vi([sn.Override],hn.prototype,"nextToken",null);Vi([sn.Override],hn.prototype,"line",null);Vi([sn.Override],hn.prototype,"inputStream",null);Vi([sn.Override],hn.prototype,"sourceName",null);Vi([sn.Override,sn.NotNull,BS(0,sn.NotNull)],hn.prototype,"tokenFactory",null);hn=Vi([BS(0,sn.NotNull)],hn);ga.ListTokenSource=hn;var Ts={},jg;function eP(){if(jg)return Ts;jg=1;/*! + */var Gi=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Vb=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(va,"__esModule",{value:!0});va.ListTokenSource=void 0;const dP=Tc,ln=X,_f=ze;let fn=class{constructor(e,t){if(this.i=0,this._factory=dP.CommonTokenFactory.DEFAULT,e==null)throw new Error("tokens cannot be null");this.tokens=e,this._sourceName=t}get charPositionInLine(){if(this.i0){let e=this.tokens[this.tokens.length-1],t=e.text;if(t!=null){let r=t.lastIndexOf(` +`);if(r>=0)return t.length-r-1}return e.charPositionInLine+e.stopIndex-e.startIndex+1}return 0}nextToken(){if(this.i>=this.tokens.length){if(this.eofToken==null){let t=-1;if(this.tokens.length>0){let i=this.tokens[this.tokens.length-1].stopIndex;i!==-1&&(t=i+1)}let r=Math.max(-1,t-1);this.eofToken=this._factory.create({source:this,stream:this.inputStream},_f.Token.EOF,"EOF",_f.Token.DEFAULT_CHANNEL,t,r,this.line,this.charPositionInLine)}return this.eofToken}let e=this.tokens[this.i];return this.i===this.tokens.length-1&&e.type===_f.Token.EOF&&(this.eofToken=e),this.i++,e}get line(){if(this.i0){let e=this.tokens[this.tokens.length-1],t=e.line,r=e.text;if(r!=null)for(let i=0;i0)return this.tokens[this.tokens.length-1].inputStream}get sourceName(){if(this._sourceName)return this._sourceName;let e=this.inputStream;return e!=null?e.sourceName:"List"}set tokenFactory(e){this._factory=e}get tokenFactory(){return this._factory}};Gi([ln.Override],fn.prototype,"charPositionInLine",null);Gi([ln.Override],fn.prototype,"nextToken",null);Gi([ln.Override],fn.prototype,"line",null);Gi([ln.Override],fn.prototype,"inputStream",null);Gi([ln.Override],fn.prototype,"sourceName",null);Gi([ln.Override,ln.NotNull,Vb(0,ln.NotNull)],fn.prototype,"tokenFactory",null);fn=Gi([Vb(0,ln.NotNull)],fn);va.ListTokenSource=fn;var Cs={},Wg;function pP(){if(Wg)return Cs;Wg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.MultiMap=void 0;let n=class extends Map{constructor(){super()}map(t,r){let i=super.get(t);i||(i=[],super.set(t,i)),i.push(r)}getPairs(){let t=[];return this.forEach((r,i)=>{r.forEach(o=>{t.push([i,o])})}),t}};return Ts.MultiMap=n,Ts}var xa={};/*! + */Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.MultiMap=void 0;let n=class extends Map{constructor(){super()}map(t,r){let i=super.get(t);i||(i=[],super.set(t,i)),i.push(r)}getPairs(){let t=[];return this.forEach((r,i)=>{r.forEach(o=>{t.push([i,o])})}),t}};return Cs.MultiMap=n,Cs}var ba={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(xa,"__esModule",{value:!0});xa.ParseCancellationException=void 0;class tP extends Error{constructor(e){super(e.message),this.cause=e,this.stack=e.stack}getCause(){return this.cause}}xa.ParseCancellationException=tP;var Es={},Cs={},$g;function jS(){if($g)return Cs;$g=1;/*! + */Object.defineProperty(ba,"__esModule",{value:!0});ba.ParseCancellationException=void 0;class mP extends Error{constructor(e){super(e.message),this.cause=e,this.stack=e.stack}getCause(){return this.cause}}ba.ParseCancellationException=mP;var ws={},Os={},Kg;function Wb(){if(Kg)return Os;Kg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u};Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.InterpreterRuleContext=void 0;const e=J,t=wr();let r=class extends t.ParserRuleContext{constructor(o,s,l){l!==void 0?super(s,l):super(),this._ruleIndex=o}get ruleIndex(){return this._ruleIndex}};return n([e.Override],r.prototype,"ruleIndex",null),Cs.InterpreterRuleContext=r,Cs}var Hg;function $S(){if(Hg)return Es;Hg=1;/*! + */var n=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u};Object.defineProperty(Os,"__esModule",{value:!0}),Os.InterpreterRuleContext=void 0;const e=X,t=Or();let r=class extends t.ParserRuleContext{constructor(o,s,l){l!==void 0?super(s,l):super(),this._ruleIndex=o}get ruleIndex(){return this._ruleIndex}};return n([e.Override],r.prototype,"ruleIndex",null),Os.InterpreterRuleContext=r,Os}var Gg;function Kb(){if(Gg)return ws;Gg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(y,g,x,S){var _=arguments.length,b=_<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,x):S,C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(y,g,x,S);else for(var O=y.length-1;O>=0;O--)(C=y[O])&&(b=(_<3?C(b):_>3?C(g,x,b):C(g,x))||b);return _>3&&b&&Object.defineProperty(g,x,b),b},e=w&&w.__param||function(y,g){return function(x,S){g(x,S,y)}};Object.defineProperty(Es,"__esModule",{value:!0}),Es.ParserInterpreter=void 0;const t=Kr,r=mt,i=Er,o=ko,s=Fi,l=jS(),a=la,u=J,c=J,h=va(),f=ua(),d=Gr,p=Bo,v=ze;let m=class Pd extends h.Parser{constructor(g,x,S,_,b){if(super(g instanceof Pd?g.inputStream:b),this._parentContextStack=[],this.overrideDecision=-1,this.overrideDecisionInputIndex=-1,this.overrideDecisionAlt=-1,this.overrideDecisionReached=!1,this._overrideDecisionRoot=void 0,g instanceof Pd){let C=g;this._grammarFileName=C._grammarFileName,this._atn=C._atn,this.pushRecursionContextStates=C.pushRecursionContextStates,this._ruleNames=C._ruleNames,this._vocabulary=C._vocabulary,this.interpreter=new f.ParserATNSimulator(this._atn,this)}else{x=x,S=S,_=_,this._grammarFileName=g,this._atn=_,this._ruleNames=S.slice(0),this._vocabulary=x,this.pushRecursionContextStates=new i.BitSet(_.states.length);for(let C of _.states)C instanceof p.StarLoopEntryState&&C.precedenceRuleDecision&&this.pushRecursionContextStates.set(C.stateNumber);this.interpreter=new f.ParserATNSimulator(_,this)}}reset(g){g===void 0?super.reset():super.reset(g),this.overrideDecisionReached=!1,this._overrideDecisionRoot=void 0}get atn(){return this._atn}get vocabulary(){return this._vocabulary}get ruleNames(){return this._ruleNames}get grammarFileName(){return this._grammarFileName}parse(g){let x=this._atn.ruleToStartState[g];for(this._rootContext=this.createInterpreterRuleContext(void 0,t.ATNState.INVALID_STATE_NUMBER,g),x.isPrecedenceRule?this.enterRecursionRule(this._rootContext,x.stateNumber,g,0):this.enterRule(this._rootContext,x.stateNumber,g);;){let S=this.atnState;switch(S.stateType){case r.ATNStateType.RULE_STOP:if(this._ctx.isEmpty)if(x.isPrecedenceRule){let _=this._ctx,b=this._parentContextStack.pop();return this.unrollRecursionContexts(b[0]),_}else return this.exitRule(),this._rootContext;this.visitRuleStopState(S);break;default:try{this.visitState(S)}catch(_){if(_ instanceof d.RecognitionException)this.state=this._atn.ruleToStopState[S.ruleIndex].stateNumber,this.context.exception=_,this.errorHandler.reportError(this,_),this.recover(_);else throw _}break}}}enterRecursionRule(g,x,S,_){this._parentContextStack.push([this._ctx,g.invokingState]),super.enterRecursionRule(g,x,S,_)}get atnState(){return this._atn.states[this.state]}visitState(g){let x=1;g.numberOfTransitions>1&&(x=this.visitDecisionState(g));let S=g.transition(x-1);switch(S.serializationType){case 1:if(this.pushRecursionContextStates.get(g.stateNumber)&&!(S.target instanceof a.LoopEndState)){let M=this._parentContextStack[this._parentContextStack.length-1],j=this.createInterpreterRuleContext(M[0],M[1],this._ctx.ruleIndex);this.pushNewRecursionContext(j,this._atn.ruleToStartState[g.ruleIndex].stateNumber,this._ctx.ruleIndex)}break;case 5:this.match(S._label);break;case 2:case 7:case 8:S.matches(this._input.LA(1),v.Token.MIN_USER_TOKEN_TYPE,65535)||this.recoverInline(),this.matchWildcard();break;case 9:this.matchWildcard();break;case 3:let _=S.target,b=_.ruleIndex,C=this.createInterpreterRuleContext(this._ctx,g.stateNumber,b);_.isPrecedenceRule?this.enterRecursionRule(C,_.stateNumber,b,S.precedence):this.enterRule(C,S.target.stateNumber,b);break;case 4:let O=S;if(!this.sempred(this._ctx,O.ruleIndex,O.predIndex))throw new o.FailedPredicateException(this);break;case 6:let D=S;this.action(this._ctx,D.ruleIndex,D.actionIndex);break;case 10:if(!this.precpred(this._ctx,S.precedence)){let M=S.precedence;throw new o.FailedPredicateException(this,`precpred(_ctx, ${M})`)}break;default:throw new Error("UnsupportedOperationException: Unrecognized ATN transition type.")}this.state=S.target.stateNumber}visitDecisionState(g){let x;this.errorHandler.sync(this);let S=g.decision;return S===this.overrideDecision&&this._input.index===this.overrideDecisionInputIndex&&!this.overrideDecisionReached?(x=this.overrideDecisionAlt,this.overrideDecisionReached=!0):x=this.interpreter.adaptivePredict(this._input,S,this._ctx),x}createInterpreterRuleContext(g,x,S){return new l.InterpreterRuleContext(S,g,x)}visitRuleStopState(g){if(this._atn.ruleToStartState[g.ruleIndex].isPrecedenceRule){let _=this._parentContextStack.pop();this.unrollRecursionContexts(_[0]),this.state=_[1]}else this.exitRule();let S=this._atn.states[this.state].transition(0);this.state=S.followState.stateNumber}addDecisionOverride(g,x,S){this.overrideDecision=g,this.overrideDecisionInputIndex=x,this.overrideDecisionAlt=S}get overrideDecisionRoot(){return this._overrideDecisionRoot}recover(g){let x=this._input.index;if(this.errorHandler.recover(this,g),this._input.index===x){let S=g.getOffendingToken();if(!S)throw new Error("Expected exception to have an offending token");let _=S.tokenSource,b=_!==void 0?_.inputStream:void 0,C={source:_,stream:b};if(g instanceof s.InputMismatchException){let O=g.expectedTokens;if(O===void 0)throw new Error("Expected the exception to provide expected tokens");let D=v.Token.INVALID_TYPE;O.isNil||(D=O.minElement);let M=this.tokenFactory.create(C,D,S.text,v.Token.DEFAULT_CHANNEL,-1,-1,S.line,S.charPositionInLine);this._ctx.addErrorNode(this.createErrorNode(this._ctx,M))}else{S.tokenSource;let O=this.tokenFactory.create(C,v.Token.INVALID_TYPE,S.text,v.Token.DEFAULT_CHANNEL,-1,-1,S.line,S.charPositionInLine);this._ctx.addErrorNode(this.createErrorNode(this._ctx,O))}}}recoverInline(){return this._errHandler.recoverInline(this)}get rootContext(){return this._rootContext}};return n([u.NotNull],m.prototype,"_vocabulary",void 0),n([c.Override],m.prototype,"reset",null),n([c.Override],m.prototype,"atn",null),n([c.Override],m.prototype,"vocabulary",null),n([c.Override],m.prototype,"ruleNames",null),n([c.Override],m.prototype,"grammarFileName",null),n([c.Override],m.prototype,"enterRecursionRule",null),m=n([e(1,u.NotNull)],m),Es.ParserInterpreter=m,Es}var ws={},zg;function rP(){if(zg)return ws;zg=1;/*! + */var n=w&&w.__decorate||function(y,g,x,b){var _=arguments.length,S=_<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,x):b,C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,g,x,b);else for(var O=y.length-1;O>=0;O--)(C=y[O])&&(S=(_<3?C(S):_>3?C(g,x,S):C(g,x))||S);return _>3&&S&&Object.defineProperty(g,x,S),S},e=w&&w.__param||function(y,g){return function(x,b){g(x,b,y)}};Object.defineProperty(ws,"__esModule",{value:!0}),ws.ParserInterpreter=void 0;const t=Gr,r=mt,i=Er,o=Fo,s=$i,l=Wb(),a=ca,u=X,c=X,h=Aa(),f=fa(),d=Xr,p=Ho,v=ze;let m=class jd extends h.Parser{constructor(g,x,b,_,S){if(super(g instanceof jd?g.inputStream:S),this._parentContextStack=[],this.overrideDecision=-1,this.overrideDecisionInputIndex=-1,this.overrideDecisionAlt=-1,this.overrideDecisionReached=!1,this._overrideDecisionRoot=void 0,g instanceof jd){let C=g;this._grammarFileName=C._grammarFileName,this._atn=C._atn,this.pushRecursionContextStates=C.pushRecursionContextStates,this._ruleNames=C._ruleNames,this._vocabulary=C._vocabulary,this.interpreter=new f.ParserATNSimulator(this._atn,this)}else{x=x,b=b,_=_,this._grammarFileName=g,this._atn=_,this._ruleNames=b.slice(0),this._vocabulary=x,this.pushRecursionContextStates=new i.BitSet(_.states.length);for(let C of _.states)C instanceof p.StarLoopEntryState&&C.precedenceRuleDecision&&this.pushRecursionContextStates.set(C.stateNumber);this.interpreter=new f.ParserATNSimulator(_,this)}}reset(g){g===void 0?super.reset():super.reset(g),this.overrideDecisionReached=!1,this._overrideDecisionRoot=void 0}get atn(){return this._atn}get vocabulary(){return this._vocabulary}get ruleNames(){return this._ruleNames}get grammarFileName(){return this._grammarFileName}parse(g){let x=this._atn.ruleToStartState[g];for(this._rootContext=this.createInterpreterRuleContext(void 0,t.ATNState.INVALID_STATE_NUMBER,g),x.isPrecedenceRule?this.enterRecursionRule(this._rootContext,x.stateNumber,g,0):this.enterRule(this._rootContext,x.stateNumber,g);;){let b=this.atnState;switch(b.stateType){case r.ATNStateType.RULE_STOP:if(this._ctx.isEmpty)if(x.isPrecedenceRule){let _=this._ctx,S=this._parentContextStack.pop();return this.unrollRecursionContexts(S[0]),_}else return this.exitRule(),this._rootContext;this.visitRuleStopState(b);break;default:try{this.visitState(b)}catch(_){if(_ instanceof d.RecognitionException)this.state=this._atn.ruleToStopState[b.ruleIndex].stateNumber,this.context.exception=_,this.errorHandler.reportError(this,_),this.recover(_);else throw _}break}}}enterRecursionRule(g,x,b,_){this._parentContextStack.push([this._ctx,g.invokingState]),super.enterRecursionRule(g,x,b,_)}get atnState(){return this._atn.states[this.state]}visitState(g){let x=1;g.numberOfTransitions>1&&(x=this.visitDecisionState(g));let b=g.transition(x-1);switch(b.serializationType){case 1:if(this.pushRecursionContextStates.get(g.stateNumber)&&!(b.target instanceof a.LoopEndState)){let B=this._parentContextStack[this._parentContextStack.length-1],$=this.createInterpreterRuleContext(B[0],B[1],this._ctx.ruleIndex);this.pushNewRecursionContext($,this._atn.ruleToStartState[g.ruleIndex].stateNumber,this._ctx.ruleIndex)}break;case 5:this.match(b._label);break;case 2:case 7:case 8:b.matches(this._input.LA(1),v.Token.MIN_USER_TOKEN_TYPE,65535)||this.recoverInline(),this.matchWildcard();break;case 9:this.matchWildcard();break;case 3:let _=b.target,S=_.ruleIndex,C=this.createInterpreterRuleContext(this._ctx,g.stateNumber,S);_.isPrecedenceRule?this.enterRecursionRule(C,_.stateNumber,S,b.precedence):this.enterRule(C,b.target.stateNumber,S);break;case 4:let O=b;if(!this.sempred(this._ctx,O.ruleIndex,O.predIndex))throw new o.FailedPredicateException(this);break;case 6:let D=b;this.action(this._ctx,D.ruleIndex,D.actionIndex);break;case 10:if(!this.precpred(this._ctx,b.precedence)){let B=b.precedence;throw new o.FailedPredicateException(this,`precpred(_ctx, ${B})`)}break;default:throw new Error("UnsupportedOperationException: Unrecognized ATN transition type.")}this.state=b.target.stateNumber}visitDecisionState(g){let x;this.errorHandler.sync(this);let b=g.decision;return b===this.overrideDecision&&this._input.index===this.overrideDecisionInputIndex&&!this.overrideDecisionReached?(x=this.overrideDecisionAlt,this.overrideDecisionReached=!0):x=this.interpreter.adaptivePredict(this._input,b,this._ctx),x}createInterpreterRuleContext(g,x,b){return new l.InterpreterRuleContext(b,g,x)}visitRuleStopState(g){if(this._atn.ruleToStartState[g.ruleIndex].isPrecedenceRule){let _=this._parentContextStack.pop();this.unrollRecursionContexts(_[0]),this.state=_[1]}else this.exitRule();let b=this._atn.states[this.state].transition(0);this.state=b.followState.stateNumber}addDecisionOverride(g,x,b){this.overrideDecision=g,this.overrideDecisionInputIndex=x,this.overrideDecisionAlt=b}get overrideDecisionRoot(){return this._overrideDecisionRoot}recover(g){let x=this._input.index;if(this.errorHandler.recover(this,g),this._input.index===x){let b=g.getOffendingToken();if(!b)throw new Error("Expected exception to have an offending token");let _=b.tokenSource,S=_!==void 0?_.inputStream:void 0,C={source:_,stream:S};if(g instanceof s.InputMismatchException){let O=g.expectedTokens;if(O===void 0)throw new Error("Expected the exception to provide expected tokens");let D=v.Token.INVALID_TYPE;O.isNil||(D=O.minElement);let B=this.tokenFactory.create(C,D,b.text,v.Token.DEFAULT_CHANNEL,-1,-1,b.line,b.charPositionInLine);this._ctx.addErrorNode(this.createErrorNode(this._ctx,B))}else{b.tokenSource;let O=this.tokenFactory.create(C,v.Token.INVALID_TYPE,b.text,v.Token.DEFAULT_CHANNEL,-1,-1,b.line,b.charPositionInLine);this._ctx.addErrorNode(this.createErrorNode(this._ctx,O))}}}recoverInline(){return this._errHandler.recoverInline(this)}get rootContext(){return this._rootContext}};return n([u.NotNull],m.prototype,"_vocabulary",void 0),n([c.Override],m.prototype,"reset",null),n([c.Override],m.prototype,"atn",null),n([c.Override],m.prototype,"vocabulary",null),n([c.Override],m.prototype,"ruleNames",null),n([c.Override],m.prototype,"grammarFileName",null),n([c.Override],m.prototype,"enterRecursionRule",null),m=n([e(1,u.NotNull)],m),ws.ParserInterpreter=m,ws}var Ns={},Xg;function gP(){if(Xg)return Ns;Xg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u},e=w&&w.__param||function(i,o){return function(s,l){o(s,l,i)}};Object.defineProperty(ws,"__esModule",{value:!0}),ws.ParseTreeMatch=void 0;const t=J;let r=class{constructor(o,s,l,a){if(!o)throw new Error("tree cannot be null");if(!s)throw new Error("pattern cannot be null");if(!l)throw new Error("labels cannot be null");this._tree=o,this._pattern=s,this._labels=l,this._mismatchedNode=a}get(o){let s=this._labels.get(o);if(!(!s||s.length===0))return s[s.length-1]}getAll(o){const s=this._labels.get(o);return s||[]}get labels(){return this._labels}get mismatchedNode(){return this._mismatchedNode}get succeeded(){return!this._mismatchedNode}get pattern(){return this._pattern}get tree(){return this._tree}toString(){return`Match ${this.succeeded?"succeeded":"failed"}; found ${this.labels.size} labels`}};return n([t.NotNull,e(0,t.NotNull)],r.prototype,"getAll",null),n([t.NotNull],r.prototype,"labels",null),n([t.NotNull],r.prototype,"pattern",null),n([t.NotNull],r.prototype,"tree",null),n([t.Override],r.prototype,"toString",null),r=n([e(0,t.NotNull),e(1,t.NotNull),e(2,t.NotNull)],r),ws.ParseTreeMatch=r,ws}var Os={},Ns={},Ds={},qg;function nP(){if(qg)return Ds;qg=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.XPathLexer=void 0;const n=kp(),e=Yn(),t=wc(),r=gn,i=ut;let o=class Jt extends e.Lexer{constructor(l){super(l),this._interp=new t.LexerATNSimulator(Jt._ATN,this)}get vocabulary(){return Jt.VOCABULARY}get grammarFileName(){return"XPathLexer.g4"}get ruleNames(){return Jt.ruleNames}get serializedATN(){return Jt._serializedATN}get channelNames(){return Jt.channelNames}get modeNames(){return Jt.modeNames}action(l,a,u){switch(a){case 4:this.ID_action(l,u);break}}ID_action(l,a){switch(a){case 0:let u=this.text;u.charAt(0)===u.charAt(0).toUpperCase()?this.type=Jt.TOKEN_REF:this.type=Jt.RULE_REF;break}}static get _ATN(){return Jt.__ATN||(Jt.__ATN=new n.ATNDeserializer().deserialize(i.toCharArray(Jt._serializedATN))),Jt.__ATN}};return Ds.XPathLexer=o,o.TOKEN_REF=1,o.RULE_REF=2,o.ANYWHERE=3,o.ROOT=4,o.WILDCARD=5,o.BANG=6,o.ID=7,o.STRING=8,o.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],o.modeNames=["DEFAULT_MODE"],o.ruleNames=["ANYWHERE","ROOT","WILDCARD","BANG","ID","NameChar","NameStartChar","STRING"],o._LITERAL_NAMES=[void 0,void 0,void 0,"'//'","'/'","'*'","'!'"],o._SYMBOLIC_NAMES=[void 0,"TOKEN_REF","RULE_REF","ANYWHERE","ROOT","WILDCARD","BANG","ID","STRING"],o.VOCABULARY=new r.VocabularyImpl(o._LITERAL_NAMES,o._SYMBOLIC_NAMES,[]),o._serializedATNSegments=2,o._serializedATNSegment0=`줝쪺֍꾺体؇쉁 + */var n=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u},e=w&&w.__param||function(i,o){return function(s,l){o(s,l,i)}};Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.ParseTreeMatch=void 0;const t=X;let r=class{constructor(o,s,l,a){if(!o)throw new Error("tree cannot be null");if(!s)throw new Error("pattern cannot be null");if(!l)throw new Error("labels cannot be null");this._tree=o,this._pattern=s,this._labels=l,this._mismatchedNode=a}get(o){let s=this._labels.get(o);if(!(!s||s.length===0))return s[s.length-1]}getAll(o){const s=this._labels.get(o);return s||[]}get labels(){return this._labels}get mismatchedNode(){return this._mismatchedNode}get succeeded(){return!this._mismatchedNode}get pattern(){return this._pattern}get tree(){return this._tree}toString(){return`Match ${this.succeeded?"succeeded":"failed"}; found ${this.labels.size} labels`}};return n([t.NotNull,e(0,t.NotNull)],r.prototype,"getAll",null),n([t.NotNull],r.prototype,"labels",null),n([t.NotNull],r.prototype,"pattern",null),n([t.NotNull],r.prototype,"tree",null),n([t.Override],r.prototype,"toString",null),r=n([e(0,t.NotNull),e(1,t.NotNull),e(2,t.NotNull)],r),Ns.ParseTreeMatch=r,Ns}var Ds={},Ps={},Rs={},Yg;function xP(){if(Yg)return Rs;Yg=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.XPathLexer=void 0;const n=zp(),e=Jn(),t=Pc(),r=yn,i=ut;let o=class Yt extends e.Lexer{constructor(l){super(l),this._interp=new t.LexerATNSimulator(Yt._ATN,this)}get vocabulary(){return Yt.VOCABULARY}get grammarFileName(){return"XPathLexer.g4"}get ruleNames(){return Yt.ruleNames}get serializedATN(){return Yt._serializedATN}get channelNames(){return Yt.channelNames}get modeNames(){return Yt.modeNames}action(l,a,u){switch(a){case 4:this.ID_action(l,u);break}}ID_action(l,a){switch(a){case 0:let u=this.text;u.charAt(0)===u.charAt(0).toUpperCase()?this.type=Yt.TOKEN_REF:this.type=Yt.RULE_REF;break}}static get _ATN(){return Yt.__ATN||(Yt.__ATN=new n.ATNDeserializer().deserialize(i.toCharArray(Yt._serializedATN))),Yt.__ATN}};return Rs.XPathLexer=o,o.TOKEN_REF=1,o.RULE_REF=2,o.ANYWHERE=3,o.ROOT=4,o.WILDCARD=5,o.BANG=6,o.ID=7,o.STRING=8,o.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],o.modeNames=["DEFAULT_MODE"],o.ruleNames=["ANYWHERE","ROOT","WILDCARD","BANG","ID","NameChar","NameStartChar","STRING"],o._LITERAL_NAMES=[void 0,void 0,void 0,"'//'","'/'","'*'","'!'"],o._SYMBOLIC_NAMES=[void 0,"TOKEN_REF","RULE_REF","ANYWHERE","ROOT","WILDCARD","BANG","ID","STRING"],o.VOCABULARY=new r.VocabularyImpl(o._LITERAL_NAMES,o._SYMBOLIC_NAMES,[]),o._serializedATNSegments=2,o._serializedATNSegment0=`줝쪺֍꾺体؇쉁 2\b     \x07 \x07\b \b \x07 \f"\v\x07\x07\b\b  \x07 , \f  /\v   - \x07\x07 \b\v \r ʶ 2;C\\aac|¡¬¬¯¯··¼¼ÂØÚøú˃ˈ˓ˢ˦ˮˮ˰˰̂Ͷ͸͹ͼͿ΁΁ΈΈΊΌΎΎΐΣΥϷϹ҃҅҉ҌԱԳ՘՛՛գ։ֿׁׁ֓׃ׄ׆ׇ׉׉ג׬ײ״؂؇ؒ؜؞؞آ٫ٰە۪ۗ۟ۡ۬۾܁܁ܑ݌ݏ޳߂߷߼߼ࠂ࠯ࡂ࡝ࢢࢶࢸࢿࣖ॥२ॱॳঅই঎঑঒কপবল঴঴স঻া৆৉৊্৐৙৙৞য়ৡ৥২৳ਃਅਇ਌਑਒ਕਪਬਲ਴ਵ਷ਸ਺਻ਾਾੀ੄੉੊੍੏੓੓ਜ਼ਫ਼੠੠੨੷ઃઅઇએઑઓકપબલ઴વષ઻ાેૉો્૏૒૒ૢ૥૨૱ૻૻଃଅଇ଎଑଒କପବଲ଴ଵଷ଻ା୆୉୊୍୏୘୙୞ୟୡ୥୨ୱ୳୳஄அஇ஌ஐஒஔ஗஛ஜஞஞ஠஡஥஦ப஬ர஻ீ௄ைொௌ௏௒௒௙௙௨௱ంఅఇఎఐఒఔపబ఻ిెైొౌ౏౗ౘౚ౜ౢ౥౨౱ಂಅಇಎಐಒಔಪಬವಷ಻ಾೆೈೊೌ೏೗೘ೠೠೢ೥೨ೱೳ೴ഃഅഇഎഐഒഔ഼ിെൈൊൌ൐ൖ൙ൡ൥൨൱ർඁ඄අඇ඘ගඳඵල඿඿ෂ෈෌෌ෑූෘෘේ෡෨෱෴෵ฃ฼โ๐๒๛຃ຄຆຆຉຊຌຌຏຏຖນປມຣລວວຩຩຬອຯົຽ຿ໂໆ່່໊໏໒໛ໞ໡༂༂༚༛༢༫༹༹༷༷༻༻ཀཉཋ཮ཱི྆ྈྙྛ྾࿈࿈ဂ။ၒ႟ႢჇ჉჉჏჏გჼჾቊቌ቏ቒቘቚቚቜ቟ቢኊኌ኏ኒኲኴ኷ኺዀዂዂዄ዇ዊዘዚጒጔ጗ጚ፜፟፡ᎂ᎑Ꭲ᏷ᏺ᏿ᐃ᙮ᙱᚁᚃ᚜ᚢ᛬ᛰ᛺ᜂᜎᜐ᜖ᜢ᜶ᝂ᝕ᝢᝮᝰᝲ᝴᝵គ៕៙៙៞៟២៫᠍᠐᠒᠛ᠢ᡹ᢂ᢬ᢲ᣷ᤂᤠᤢ᤭ᤲ᤽᥈᥯ᥲ᥶ᦂ᦭ᦲ᧋᧒᧛ᨂ᨝ᨢ᩠ᩢ᩾᪁᪋᪒᪛᪩᪩ᪿ᪲ᬂ᭍᭒᭛᭭᭵ᮂ᯵ᰂ᰹᱂᱋ᱏ᱿ᲂᲊ᳔᳖᳒᳸ᳺ᳻ᴂ᷽᷷἗Ἒ἟ἢ὇Ὂ὏ὒὙὛὛὝὝὟὟὡ὿ᾂᾶᾸι῀῀ῄῆῈ῎ῒ῕Ῐ῝ῢ΅ῴῶῸ῾‍‑‬‰⁁⁂⁖⁖⁢⁦⁨ⁱ⁳⁳₁₁ₒ₞⃒⃞⃣⃣⃧⃲℄℄℉℉ℌℕ℗℗ℛ℟ΩΩℨℨKKℬℯℱ℻ℾ⅁ⅇ⅋⅐⅐Ⅲ↊ⰂⰰⰲⱠⱢ⳦Ⳮ⳵ⴂⴧ⴩⴩⴯⴯ⴲ⵩⵱⵱ⶁ⶘ⶢⶨⶪⶰⶲⶸⶺⷀⷂⷈⷊⷐⷒⷘⷚⷠⷢ⸁⸱⸱〇〉〣〱〳〷〺〾ぃ゘゛゜ゟァィーヾ㄁ㄇㄯㄳ㆐ㆢㆼㇲ㈁㐂䶷丂鿗ꀂ꒎ꓒ꓿ꔂ꘎ꘒ꘭Ꙃ꙱ꙶꙿꚁ꛳ꜙ꜡Ꜥ꞊ꞍꞰꞲꞹꟹ꠩ꡂ꡵ꢂ꣇꣒꣛꣢꣹ꣽꣽꣿꣿ꤂꤯ꤲ꥕ꥢ꥾ꦂ꧂꧑꧛ꧢꨀꨂ꨸ꩂ꩏꩒꩛ꩢ꩸ꩼ꫄ꫝ꫟ꫢ꫱ꫴ꫸ꬃ꬈ꬋ꬐ꬓ꬘ꬢꬨꬪꬰꬲꭜꭞꭧꭲ꯬꯮꯯꯲꯻갂힥ힲ퟈ퟍ퟽車﩯全﫛fl﬈ﬕ﬙ײַשׁשּׁטּךּמּנּנּ﭂ףּ﭅צּרּ﮳ﯕ﴿ﵒ﶑ﶔ﷉ﷲ﷽︂︑︢︱︵︶﹏﹑ﹲﹶﹸ﻾!!2;C\aac|ィ￀ᅣ￉ᅩ￑ᅯ￙ᅵ￞�\r(*<>?AOR_‚üłŶǿǿʂʞʢ˒ˢˢ̡̲̂͌͒ͼ΂Ο΢υϊϑϓϗЂҟҢҫҲӕӚӽԂԩԲե؂ܸ݂ݗݢݩࠂࠇࠊࠊࠌ࠷࠹࠺࠾࠾ࡁࡗࡢࡸࢂࢠ࣢ࣶࣴࣷंगढऻংহীুਂਅਇਈ਎ਕਗਙਛਵ਺਼ੁੁ੢੾ંઞૂૉો૨ଂଷୂୗୢ୴ஂஓంొಂ಴ೂ೴ဂ၈ၨၱႁႼႿႿგცჲ჻ᄂᄶᄸᅁᅒᅵᅸᅸᆂᇆᇌᇎᇒᇜᇞᇞሂሓሕሹቀቀኂኈኊኊኌ኏ኑኟኡኪኲዬዲዻጂጅጇጎ጑ጒጕጪጬጲጴጵጷጻጾፆፉፊፍፏፒፒፙፙ፟፥፨፮፲፶ᐂᑌᑒᑛᒂᓇᓉᓉᓒᓛᖂᖷᖺᗂᗚᗟᘂᙂᙆᙆᙒᙛᚂᚹᛂᛋᜂ᜛ᜟᜭᜲ᜻ᢢᣫᤁᤁ᫂᫺ᰂᰊᰌ᰸᰺᱂᱒ᱛᱴᲑᲔᲩᲫᲸ ⎛␂⑰⒂╅。㐰䐂䙈栂樺橂橠橢橫櫒櫯櫲櫶欂欸歂歅歒歛步歹歿殑漂潆潒澀澑澡濢濢瀂蟮蠂諴뀂뀃밂뱬뱲뱾벂벊벒벛벟베벢벥텧텫텯톄톇톍톬톯퉄퉆퐂푖푘풞풠풡풤풤풧풨풫풮풰풻풽풽풿퓅퓇픇픉플픏픖픘픞픠픻픽핀핂핆핈핈핌핒핔횧횪훂후훜훞훼훾휖휘휶휸흐흒흰흲힊힌힪힬ퟄퟆퟍퟐ\uD801\uDA02\uDA38\uDA3D\uDA6E\uDA77\uDA77\uDA86\uDA86\uDA9D\uDAA1\uDAA3\uDAB1ꛘ꜂뜶띂렟렢캣﨟"ĂDZɀC\\c|¬¬··¼¼ÂØÚøú˃ˈ˓ˢ˦ˮˮ˰˰ͲͶ͸͹ͼͿ΁΁ΈΈΊΌΎΎΐΣΥϷϹ҃ҌԱԳ՘՛՛գ։ג׬ײ״آٌٰٱٳەۗۗۧۨ۰۱ۼ۾܁܁ܒܒܔܱݏާ޳޳ߌ߬߶߷߼߼ࠂࠗࠜࠜࠦࠦࠪࠪࡂ࡚ࢢࢶࢸࢿआऻिि॒॒ग़ॣॳংই঎঑঒কপবল঴঴স঻িি৐৐৞য়ৡৣ৲৳ਇ਌਑਒ਕਪਬਲ਴ਵ਷ਸ਺਻ਜ਼ਫ਼੠੠ੴ੶ઇએઑઓકપબલ઴વષ઻િિ૒૒ૢૣૻૻଇ଎଑଒କପବଲ଴ଵଷ଻ିି୞ୟୡୣ୳୳அஅஇ஌ஐஒஔ஗஛ஜஞஞ஠஡஥஦ப஬ர஻௒௒ఇఎఐఒఔపబ఻ిిౚ౜ౢౣಂಂಇಎಐಒಔಪಬವಷ಻ಿಿೠೠೢೣೳ೴ഇഎഐഒഔ഼ിി൐൐ൖ൘ൡൣർඁඇ඘ගඳඵල඿඿ෂ෈ฃาิีโ่຃ຄຆຆຉຊຌຌຏຏຖນປມຣລວວຩຩຬອຯາິີ຿຿ໂໆ່່ໞ໡༂༂གཉཋ཮ྊྎဂာ၁၁ၒၗၜၟၣၣၧၨၰၲၷႃ႐႐ႢჇ჉჉჏჏გჼჾቊቌ቏ቒቘቚቚቜ቟ቢኊኌ኏ኒኲኴ኷ኺዀዂዂዄ዇ዊዘዚጒጔ጗ጚ፜ᎂ᎑Ꭲ᏷ᏺ᏿ᐃ᙮ᙱᚁᚃ᚜ᚢ᛬ᛰ᛺ᜂᜎᜐᜓᜢᜳᝂᝓᝢᝮᝰᝲគ឵៙៙៞៞ᠢ᡹ᢂᢆᢉᢪ᢬᢬ᢲ᣷ᤂᤠᥒ᥯ᥲ᥶ᦂ᦭ᦲ᧋ᨂᨘᨢᩖ᪩᪩ᬈᭇ᭍ᮅᮢ᮰᮱ᮼᯧᰂᰥᱏ᱑ᱜ᱿ᲂᲊᳫᳮᳰᳳ᳷᳸ᴂ᷁Ḃ἗Ἒ἟ἢ὇Ὂ὏ὒὙὛὛὝὝὟὟὡ὿ᾂᾶᾸι῀῀ῄῆῈ῎ῒ῕Ῐ῝ῢ΅ῴῶῸ῾⁳⁳₁₁ₒ₞℄℄℉℉ℌℕ℗℗ℛ℟ΩΩℨℨKKℬℯℱ℻ℾ⅁ⅇ⅋⅐⅐Ⅲ↊ⰂⰰⰲⱠⱢ⳦Ⳮ⳰⳴⳵ⴂⴧ⴩⴩⴯⴯ⴲ⵩⵱⵱ⶂ⶘ⶢⶨⶪⶰⶲⶸⶺⷀⷂⷈⷊⷐⷒⷘⷚⷠ⸱⸱〇〉〣〫〳〷〺〾ぃ゘ゟァィーヾ㄁ㄇㄯㄳ㆐ㆢㆼㇲ㈁㐂䶷丂鿗ꀂ꒎ꓒ꓿ꔂ꘎ꘒ꘡꘬꘭Ꙃ꙰ꚁꚟꚢ꛱ꜙ꜡Ꜥ꞊ꞍꞰꞲꞹꟹꠃꠅꠇꠉꠌꠎꠤꡂ꡵ꢄꢵꣴ꣹ꣽꣽꣿꣿꤌꤧꤲꥈꥢ꥾ꦆꦴ꧑꧑ꧢꧦꧨ꧱ꧼꨀꨂꨪꩂꩄꩆꩍꩢ꩸ꩼꩼꪀꪱꪳꪳꪷꪸꪻ꪿ꫂꫂ꫄꫄ꫝ꫟ꫢꫬꫴ꫶ꬃ꬈ꬋ꬐ꬓ꬘ꬢꬨꬪꬰꬲꭜꭞꭧꭲꯤ갂힥ힲ퟈ퟍ퟽車﩯全﫛fl﬈ﬕ﬙ײַײַﬡשׁשּׁטּךּמּנּנּ﭂ףּ﭅צּרּ﮳ﯕ﴿ﵒ﶑ﶔ﷉ﷲ﷽ﹲﹶﹸ﻾C\c|ィ￀ᅣ￉ᅩ￑ᅯ￙ᅵ￞\r(*<>?AOR_‚üłŶʂʞʢ˒̡̲̂͌͒ͷ΂Ο΢υϊϑϓϗЂҟҲӕӚӽԂԩԲե؂ܸ݂ݗݢݩࠂࠇࠊࠊࠌ࠷࠹࠺࠾࠾ࡁࡗࡢࡸࢂࢠ࣢ࣶࣴࣷंगढऻংহীুਂਂ਒ਕਗਙਛਵ੢੾ંઞૂૉો૦ଂଷୂୗୢ୴ஂஓంొಂ಴ೂ೴စ္ႅႱგცᄅᄨᅒᅴᅸᅸᆅᆴᇃᇆᇜᇜᇞᇞሂሓሕርኂኈኊኊኌ኏ኑኟኡኪኲዠጇጎ጑ጒጕጪጬጲጴጵጷጻጿጿፒፒ፟፣ᐂᐶᑉᑌᒂᒱᓆᓇᓉᓉᖂᖰᗚᗝᘂᘱᙆᙆᚂᚬᜂ᜛ᢢᣡᤁᤁ᫂᫺ᰂᰊᰌᰰ᱂᱂ᱴᲑ ⎛␂⑰⒂╅。㐰䐂䙈栂樺橂橠櫒櫯欂欱歂歅步歹歿殑漂潆潒潒澕澡濢濢瀂蟮蠂諴뀂뀃밂뱬뱲뱾벂벊벒벛퐂푖푘풞풠풡풤풤풧풨풫풮풰풻풽풽풿퓅퓇픇픉플픏픖픘픞픠픻픽핀핂핆핈핈`,o._serializedATNSegment1=`핌핒핔횧횪훂후훜훞훼훾휖휘휶휸흐흒흰흲힊힌힪힬ퟄퟆퟍꛘ꜂뜶띂렟렢캣﨟1\x07 \v\x07 \v\r%')\x071\x071\x071\x07,\b\x1B\x07#\x1B - \b\r\x07"  !!#" #$\b$\f%& &'( ()-\x07)*,\v+*,/-.-+.0/-01\x07)1 -`,o._serializedATN=i.join([o._serializedATNSegment0,o._serializedATNSegment1],""),Ds}var Ps={},Ug;function iP(){if(Ug)return Ps;Ug=1;/*! + \b\r\x07"  !!#" #$\b$\f%& &'( ()-\x07)*,\v+*,/-.-+.0/-01\x07)1 -`,o._serializedATN=i.join([o._serializedATNSegment0,o._serializedATNSegment1],""),Rs}var Ls={},Jg;function yP(){if(Jg)return Ls;Jg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(r,i,o,s){var l=arguments.length,a=l<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,o):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,i,o,s);else for(var c=r.length-1;c>=0;c--)(u=r[c])&&(a=(l<3?u(a):l>3?u(i,o,a):u(i,o))||a);return l>3&&a&&Object.defineProperty(i,o,a),a};Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.XPathLexerErrorListener=void 0;const e=J;let t=class{syntaxError(i,o,s,l,a,u){}};return n([e.Override],t.prototype,"syntaxError",null),Ps.XPathLexerErrorListener=t,Ps}var Rs={},Ls={},Vg;function Ko(){if(Vg)return Ls;Vg=1;/*! + */var n=w&&w.__decorate||function(r,i,o,s){var l=arguments.length,a=l<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,o):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,i,o,s);else for(var c=r.length-1;c>=0;c--)(u=r[c])&&(a=(l<3?u(a):l>3?u(i,o,a):u(i,o))||a);return l>3&&a&&Object.defineProperty(i,o,a),a};Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.XPathLexerErrorListener=void 0;const e=X;let t=class{syntaxError(i,o,s,l,a,u){}};return n([e.Override],t.prototype,"syntaxError",null),Ls.XPathLexerErrorListener=t,Ls}var ks={},Is={},Qg;function Go(){if(Qg)return Is;Qg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(r,i,o,s){var l=arguments.length,a=l<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,o):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,i,o,s);else for(var c=r.length-1;c>=0;c--)(u=r[c])&&(a=(l<3?u(a):l>3?u(i,o,a):u(i,o))||a);return l>3&&a&&Object.defineProperty(i,o,a),a};Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.XPathElement=void 0;const e=J;let t=class{constructor(i){this.nodeName=i,this.invert=!1}toString(){let i=this.invert?"!":"";return Object.constructor.name+"["+i+this.nodeName+"]"}};return n([e.Override],t.prototype,"toString",null),Ls.XPathElement=t,Ls}var Wg;function oP(){if(Wg)return Rs;Wg=1;/*! + */var n=w&&w.__decorate||function(r,i,o,s){var l=arguments.length,a=l<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,o):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,i,o,s);else for(var c=r.length-1;c>=0;c--)(u=r[c])&&(a=(l<3?u(a):l>3?u(i,o,a):u(i,o))||a);return l>3&&a&&Object.defineProperty(i,o,a),a};Object.defineProperty(Is,"__esModule",{value:!0}),Is.XPathElement=void 0;const e=X;let t=class{constructor(i){this.nodeName=i,this.invert=!1}toString(){let i=this.invert?"!":"";return Object.constructor.name+"["+i+this.nodeName+"]"}};return n([e.Override],t.prototype,"toString",null),Is.XPathElement=t,Is}var Zg;function vP(){if(Zg)return ks;Zg=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c};Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.XPathRuleAnywhereElement=void 0;const e=J,t=Ui(),r=Ko();let i=class extends r.XPathElement{constructor(s,l){super(s),this.ruleIndex=l}evaluate(s){return t.Trees.findAllRuleNodes(s,this.ruleIndex)}};return n([e.Override],i.prototype,"evaluate",null),Rs.XPathRuleAnywhereElement=i,Rs}var ks={},Kg;function sP(){if(Kg)return ks;Kg=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c};Object.defineProperty(ks,"__esModule",{value:!0}),ks.XPathRuleAnywhereElement=void 0;const e=X,t=ti(),r=Go();let i=class extends r.XPathElement{constructor(s,l){super(s),this.ruleIndex=l}evaluate(s){return t.Trees.findAllRuleNodes(s,this.ruleIndex)}};return n([e.Override],i.prototype,"evaluate",null),ks.XPathRuleAnywhereElement=i,ks}var Ms={},ex;function bP(){if(ex)return Ms;ex=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(ks,"__esModule",{value:!0}),ks.XPathRuleElement=void 0;const e=wr(),t=J,r=Ui(),i=Ko();let o=class extends i.XPathElement{constructor(l,a){super(l),this.ruleIndex=a}evaluate(l){let a=[];for(let u of r.Trees.getChildren(l))u instanceof e.ParserRuleContext&&(u.ruleIndex===this.ruleIndex&&!this.invert||u.ruleIndex!==this.ruleIndex&&this.invert)&&a.push(u);return a}};return n([t.Override],o.prototype,"evaluate",null),ks.XPathRuleElement=o,ks}var Is={},Gg;function lP(){if(Gg)return Is;Gg=1;/*! + */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.XPathRuleElement=void 0;const e=Or(),t=X,r=ti(),i=Go();let o=class extends i.XPathElement{constructor(l,a){super(l),this.ruleIndex=a}evaluate(l){let a=[];for(let u of r.Trees.getChildren(l))u instanceof e.ParserRuleContext&&(u.ruleIndex===this.ruleIndex&&!this.invert||u.ruleIndex!==this.ruleIndex&&this.invert)&&a.push(u);return a}};return n([t.Override],o.prototype,"evaluate",null),Ms.XPathRuleElement=o,Ms}var Fs={},tx;function SP(){if(tx)return Fs;tx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c};Object.defineProperty(Is,"__esModule",{value:!0}),Is.XPathTokenAnywhereElement=void 0;const e=J,t=Ui(),r=Ko();let i=class extends r.XPathElement{constructor(s,l){super(s),this.tokenType=l}evaluate(s){return t.Trees.findAllTokenNodes(s,this.tokenType)}};return n([e.Override],i.prototype,"evaluate",null),Is.XPathTokenAnywhereElement=i,Is}var Fs={},Xg;function aP(){if(Xg)return Fs;Xg=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c};Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.XPathTokenAnywhereElement=void 0;const e=X,t=ti(),r=Go();let i=class extends r.XPathElement{constructor(s,l){super(s),this.tokenType=l}evaluate(s){return t.Trees.findAllTokenNodes(s,this.tokenType)}};return n([e.Override],i.prototype,"evaluate",null),Fs.XPathTokenAnywhereElement=i,Fs}var Bs={},rx;function AP(){if(rx)return Bs;rx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.XPathTokenElement=void 0;const e=J,t=An,r=Ui(),i=Ko();let o=class extends i.XPathElement{constructor(l,a){super(l),this.tokenType=a}evaluate(l){let a=[];for(let u of r.Trees.getChildren(l))u instanceof t.TerminalNode&&(u.symbol.type===this.tokenType&&!this.invert||u.symbol.type!==this.tokenType&&this.invert)&&a.push(u);return a}};return n([e.Override],o.prototype,"evaluate",null),Fs.XPathTokenElement=o,Fs}var Ms={},Yg;function uP(){if(Yg)return Ms;Yg=1;/*! + */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.XPathTokenElement=void 0;const e=X,t=Cr,r=ti(),i=Go();let o=class extends i.XPathElement{constructor(l,a){super(l),this.tokenType=a}evaluate(l){let a=[];for(let u of r.Trees.getChildren(l))u instanceof t.TerminalNode&&(u.symbol.type===this.tokenType&&!this.invert||u.symbol.type!==this.tokenType&&this.invert)&&a.push(u);return a}};return n([e.Override],o.prototype,"evaluate",null),Bs.XPathTokenElement=o,Bs}var js={},nx;function _P(){if(nx)return js;nx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.XPathWildcardAnywhereElement=void 0;const e=J,t=Ui(),r=$p(),i=Ko();let o=class extends i.XPathElement{constructor(){super(r.XPath.WILDCARD)}evaluate(l){return this.invert?[]:t.Trees.getDescendants(l)}};return n([e.Override],o.prototype,"evaluate",null),Ms.XPathWildcardAnywhereElement=o,Ms}var Bs={},Jg;function cP(){if(Jg)return Bs;Jg=1;/*! + */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(js,"__esModule",{value:!0}),js.XPathWildcardAnywhereElement=void 0;const e=X,t=ti(),r=Gp(),i=Go();let o=class extends i.XPathElement{constructor(){super(r.XPath.WILDCARD)}evaluate(l){return this.invert?[]:t.Trees.getDescendants(l)}};return n([e.Override],o.prototype,"evaluate",null),js.XPathWildcardAnywhereElement=o,js}var $s={},ix;function TP(){if(ix)return $s;ix=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.XPathWildcardElement=void 0;const e=J,t=Ui(),r=$p(),i=Ko();let o=class extends i.XPathElement{constructor(){super(r.XPath.WILDCARD)}evaluate(l){let a=[];if(this.invert)return a;for(let u of t.Trees.getChildren(l))a.push(u);return a}};return n([e.Override],o.prototype,"evaluate",null),Bs.XPathWildcardElement=o,Bs}var Qg;function $p(){if(Qg)return Ns;Qg=1;/*! + */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty($s,"__esModule",{value:!0}),$s.XPathWildcardElement=void 0;const e=X,t=ti(),r=Gp(),i=Go();let o=class extends i.XPathElement{constructor(){super(r.XPath.WILDCARD)}evaluate(l){let a=[];if(this.invert)return a;for(let u of t.Trees.getChildren(l))a.push(u);return a}};return n([e.Override],o.prototype,"evaluate",null),$s.XPathWildcardElement=o,$s}var ox;function Gp(){if(ox)return Ps;ox=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.XPath=void 0;const n=Gc,e=Wo,t=Hi,r=wr(),i=ze,o=nP(),s=iP(),l=oP(),a=sP(),u=lP(),c=aP(),h=uP(),f=cP();let d=class HS{constructor(v,m){this.parser=v,this.path=m,this.elements=this.split(m)}split(v){let m=new o.XPathLexer(n.CharStreams.fromString(v));m.recover=b=>{throw b},m.removeErrorListeners(),m.addErrorListener(new s.XPathLexerErrorListener);let y=new e.CommonTokenStream(m);try{y.fill()}catch(b){if(b instanceof t.LexerNoViableAltException){let O="Invalid tokens or characters at index "+m.charPositionInLine+" in path '"+v+"' -- "+b.message;throw new RangeError(O)}throw b}let g=y.getTokens(),x=[],S=g.length,_=0;e:for(;_0&&this.elements[g].evaluate(S).forEach(x.add,x);g++,y=x}return y}};return Ns.XPath=d,d.WILDCARD="*",d.NOT="!",Ns}var Zg;function hP(){if(Zg)return Os;Zg=1;/*! + */Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.XPath=void 0;const n=Qc,e=Ko,t=Vi,r=Or(),i=ze,o=xP(),s=yP(),l=vP(),a=bP(),u=SP(),c=AP(),h=_P(),f=TP();let d=class Gb{constructor(v,m){this.parser=v,this.path=m,this.elements=this.split(m)}split(v){let m=new o.XPathLexer(n.CharStreams.fromString(v));m.recover=S=>{throw S},m.removeErrorListeners(),m.addErrorListener(new s.XPathLexerErrorListener);let y=new e.CommonTokenStream(m);try{y.fill()}catch(S){if(S instanceof t.LexerNoViableAltException){let O="Invalid tokens or characters at index "+m.charPositionInLine+" in path '"+v+"' -- "+S.message;throw new RangeError(O)}throw S}let g=y.getTokens(),x=[],b=g.length,_=0;e:for(;_0&&this.elements[g].evaluate(b).forEach(x.add,x);g++,y=x}return y}};return Ps.XPath=d,d.WILDCARD="*",d.NOT="!",Ps}var sx;function EP(){if(sx)return Ds;sx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Os,"__esModule",{value:!0}),Os.ParseTreePattern=void 0;const t=J,r=$p();let i=class{constructor(s,l,a,u){this._matcher=s,this._patternRuleIndex=a,this._pattern=l,this._patternTree=u}match(s){return this._matcher.match(s,this)}matches(s){return this._matcher.match(s,this).succeeded}findAll(s,l){let a=r.XPath.findAll(s,l,this._matcher.parser),u=[];for(let c of a){let h=this.match(c);h.succeeded&&u.push(h)}return u}get matcher(){return this._matcher}get pattern(){return this._pattern}get patternRuleIndex(){return this._patternRuleIndex}get patternTree(){return this._patternTree}};return n([t.NotNull],i.prototype,"_pattern",void 0),n([t.NotNull],i.prototype,"_patternTree",void 0),n([t.NotNull],i.prototype,"_matcher",void 0),n([t.NotNull,e(0,t.NotNull)],i.prototype,"match",null),n([e(0,t.NotNull)],i.prototype,"matches",null),n([t.NotNull,e(0,t.NotNull),e(1,t.NotNull)],i.prototype,"findAll",null),n([t.NotNull],i.prototype,"matcher",null),n([t.NotNull],i.prototype,"pattern",null),n([t.NotNull],i.prototype,"patternTree",null),i=n([e(0,t.NotNull),e(1,t.NotNull),e(3,t.NotNull)],i),Os.ParseTreePattern=i,Os}var js={},ex;function fP(){if(ex)return js;ex=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.ParseTreePattern=void 0;const t=X,r=Gp();let i=class{constructor(s,l,a,u){this._matcher=s,this._patternRuleIndex=a,this._pattern=l,this._patternTree=u}match(s){return this._matcher.match(s,this)}matches(s){return this._matcher.match(s,this).succeeded}findAll(s,l){let a=r.XPath.findAll(s,l,this._matcher.parser),u=[];for(let c of a){let h=this.match(c);h.succeeded&&u.push(h)}return u}get matcher(){return this._matcher}get pattern(){return this._pattern}get patternRuleIndex(){return this._patternRuleIndex}get patternTree(){return this._patternTree}};return n([t.NotNull],i.prototype,"_pattern",void 0),n([t.NotNull],i.prototype,"_patternTree",void 0),n([t.NotNull],i.prototype,"_matcher",void 0),n([t.NotNull,e(0,t.NotNull)],i.prototype,"match",null),n([e(0,t.NotNull)],i.prototype,"matches",null),n([t.NotNull,e(0,t.NotNull),e(1,t.NotNull)],i.prototype,"findAll",null),n([t.NotNull],i.prototype,"matcher",null),n([t.NotNull],i.prototype,"pattern",null),n([t.NotNull],i.prototype,"patternTree",null),i=n([e(0,t.NotNull),e(1,t.NotNull),e(3,t.NotNull)],i),Ds.ParseTreePattern=i,Ds}var Hs={},lx;function CP(){if(lx)return Hs;lx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(js,"__esModule",{value:!0}),js.RuleTagToken=void 0;const t=J,r=ze;let i=class{constructor(s,l,a){if(s==null||s.length===0)throw new Error("ruleName cannot be null or empty.");this._ruleName=s,this.bypassTokenType=l,this._label=a}get ruleName(){return this._ruleName}get label(){return this._label}get channel(){return r.Token.DEFAULT_CHANNEL}get text(){return this._label!=null?"<"+this._label+":"+this._ruleName+">":"<"+this._ruleName+">"}get type(){return this.bypassTokenType}get line(){return 0}get charPositionInLine(){return-1}get tokenIndex(){return-1}get startIndex(){return-1}get stopIndex(){return-1}get tokenSource(){}get inputStream(){}toString(){return this._ruleName+":"+this.bypassTokenType}};return n([t.NotNull],i.prototype,"ruleName",null),n([t.Override],i.prototype,"channel",null),n([t.Override],i.prototype,"text",null),n([t.Override],i.prototype,"type",null),n([t.Override],i.prototype,"line",null),n([t.Override],i.prototype,"charPositionInLine",null),n([t.Override],i.prototype,"tokenIndex",null),n([t.Override],i.prototype,"startIndex",null),n([t.Override],i.prototype,"stopIndex",null),n([t.Override],i.prototype,"tokenSource",null),n([t.Override],i.prototype,"inputStream",null),n([t.Override],i.prototype,"toString",null),i=n([e(0,t.NotNull)],i),js.RuleTagToken=i,js}var $s={},Hs={},tx;function zS(){if(tx)return Hs;tx=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.RuleTagToken=void 0;const t=X,r=ze;let i=class{constructor(s,l,a){if(s==null||s.length===0)throw new Error("ruleName cannot be null or empty.");this._ruleName=s,this.bypassTokenType=l,this._label=a}get ruleName(){return this._ruleName}get label(){return this._label}get channel(){return r.Token.DEFAULT_CHANNEL}get text(){return this._label!=null?"<"+this._label+":"+this._ruleName+">":"<"+this._ruleName+">"}get type(){return this.bypassTokenType}get line(){return 0}get charPositionInLine(){return-1}get tokenIndex(){return-1}get startIndex(){return-1}get stopIndex(){return-1}get tokenSource(){}get inputStream(){}toString(){return this._ruleName+":"+this.bypassTokenType}};return n([t.NotNull],i.prototype,"ruleName",null),n([t.Override],i.prototype,"channel",null),n([t.Override],i.prototype,"text",null),n([t.Override],i.prototype,"type",null),n([t.Override],i.prototype,"line",null),n([t.Override],i.prototype,"charPositionInLine",null),n([t.Override],i.prototype,"tokenIndex",null),n([t.Override],i.prototype,"startIndex",null),n([t.Override],i.prototype,"stopIndex",null),n([t.Override],i.prototype,"tokenSource",null),n([t.Override],i.prototype,"inputStream",null),n([t.Override],i.prototype,"toString",null),i=n([e(0,t.NotNull)],i),Hs.RuleTagToken=i,Hs}var zs={},qs={},ax;function Xb(){if(ax)return qs;ax=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.Chunk=void 0;let n=class{};return Hs.Chunk=n,Hs}var rx;function dP(){if(rx)return $s;rx=1;/*! + */Object.defineProperty(qs,"__esModule",{value:!0}),qs.Chunk=void 0;let n=class{};return qs.Chunk=n,qs}var ux;function wP(){if(ux)return zs;ux=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u};Object.defineProperty($s,"__esModule",{value:!0}),$s.TagChunk=void 0;const e=zS(),t=J;let r=class extends e.Chunk{constructor(o,s){if(super(),o==null||o.length===0)throw new Error("tag cannot be null or empty");this._tag=o,this._label=s}get tag(){return this._tag}get label(){return this._label}toString(){return this._label!=null?this._label+":"+this._tag:this._tag}};return n([t.NotNull],r.prototype,"tag",null),n([t.Override],r.prototype,"toString",null),$s.TagChunk=r,$s}var zs={},nx;function pP(){if(nx)return zs;nx=1;/*! + */var n=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u};Object.defineProperty(zs,"__esModule",{value:!0}),zs.TagChunk=void 0;const e=Xb(),t=X;let r=class extends e.Chunk{constructor(o,s){if(super(),o==null||o.length===0)throw new Error("tag cannot be null or empty");this._tag=o,this._label=s}get tag(){return this._tag}get label(){return this._label}toString(){return this._label!=null?this._label+":"+this._tag:this._tag}};return n([t.NotNull],r.prototype,"tag",null),n([t.Override],r.prototype,"toString",null),zs.TagChunk=r,zs}var Us={},cx;function OP(){if(cx)return Us;cx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(zs,"__esModule",{value:!0}),zs.TextChunk=void 0;const t=zS(),r=J;let i=class extends t.Chunk{constructor(s){if(super(),s==null)throw new Error("text cannot be null");this._text=s}get text(){return this._text}toString(){return"'"+this._text+"'"}};return n([r.NotNull],i.prototype,"_text",void 0),n([r.NotNull],i.prototype,"text",null),n([r.Override],i.prototype,"toString",null),i=n([e(0,r.NotNull)],i),zs.TextChunk=i,zs}var qs={},ix;function mP(){if(ix)return qs;ix=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Us,"__esModule",{value:!0}),Us.TextChunk=void 0;const t=Xb(),r=X;let i=class extends t.Chunk{constructor(s){if(super(),s==null)throw new Error("text cannot be null");this._text=s}get text(){return this._text}toString(){return"'"+this._text+"'"}};return n([r.NotNull],i.prototype,"_text",void 0),n([r.NotNull],i.prototype,"text",null),n([r.Override],i.prototype,"toString",null),i=n([e(0,r.NotNull)],i),Us.TextChunk=i,Us}var Vs={},hx;function NP(){if(hx)return Vs;hx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(qs,"__esModule",{value:!0}),qs.TokenTagToken=void 0;const t=Wn,r=J;let i=class extends t.CommonToken{constructor(s,l,a){super(l),this._tokenName=s,this._label=a}get tokenName(){return this._tokenName}get label(){return this._label}get text(){return this._label!=null?"<"+this._label+":"+this._tokenName+">":"<"+this._tokenName+">"}toString(){return this._tokenName+":"+this.type}};return n([r.NotNull],i.prototype,"_tokenName",void 0),n([r.NotNull],i.prototype,"tokenName",null),n([r.Override],i.prototype,"text",null),n([r.Override],i.prototype,"toString",null),i=n([e(0,r.NotNull)],i),qs.TokenTagToken=i,qs}var ox;function gP(){return ox||(ox=1,function(n){/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.TokenTagToken=void 0;const t=Kn,r=X;let i=class extends t.CommonToken{constructor(s,l,a){super(l),this._tokenName=s,this._label=a}get tokenName(){return this._tokenName}get label(){return this._label}get text(){return this._label!=null?"<"+this._label+":"+this._tokenName+">":"<"+this._tokenName+">"}toString(){return this._tokenName+":"+this.type}};return n([r.NotNull],i.prototype,"_tokenName",void 0),n([r.NotNull],i.prototype,"tokenName",null),n([r.Override],i.prototype,"text",null),n([r.Override],i.prototype,"toString",null),i=n([e(0,r.NotNull)],i),Vs.TokenTagToken=i,Vs}var fx;function DP(){return fx||(fx=1,function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__decorate||function(C,O,D,M){var j=arguments.length,k=j<3?O:M===null?M=Object.getOwnPropertyDescriptor(O,D):M,V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(C,O,D,M);else for(var se=C.length-1;se>=0;se--)(V=C[se])&&(k=(j<3?V(k):j>3?V(O,D,k):V(O,D))||k);return j>3&&k&&Object.defineProperty(O,D,k),k},t=w&&w.__param||function(C,O){return function(D,M){O(D,M,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ParseTreePatternMatcher=void 0;const r=qS(),i=Gc,o=Wo,s=ga,l=eP(),a=J,u=xa,c=$S(),h=wr(),f=rP(),d=hP(),p=Gr,v=Vo,m=fP(),y=dP(),g=An,x=pP(),S=ze,_=mP();class b{constructor(O,D){this.start="<",this.stop=">",this.escape="\\",this.escapeRE=/\\/g,this._lexer=O,this._parser=D}setDelimiters(O,D,M){if(!O)throw new Error("start cannot be null or empty");if(!D)throw new Error("stop cannot be null or empty");this.start=O,this.stop=D,this.escape=M,this.escapeRE=new RegExp(M.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g")}matches(O,D,M=0){if(typeof D=="string"){let j=this.compile(D,M);return this.matches(O,j)}else{let j=new l.MultiMap;return!this.matchImpl(O,D.patternTree,j)}}match(O,D,M=0){if(typeof D=="string"){let j=this.compile(D,M);return this.match(O,j)}else{let j=new l.MultiMap,k=this.matchImpl(O,D.patternTree,j);return new f.ParseTreeMatch(O,D,j,k)}}compile(O,D){let M=this.tokenize(O),j=new s.ListTokenSource(M),k=new o.CommonTokenStream(j);const V=this._parser;let se=new c.ParserInterpreter(V.grammarFileName,V.vocabulary,V.ruleNames,V.getATNWithBypassAlts(),k),ie;try{se.errorHandler=new r.BailErrorStrategy,ie=se.parse(D)}catch(fe){throw fe instanceof u.ParseCancellationException?fe.getCause():fe instanceof p.RecognitionException?fe:fe instanceof Error?new b.CannotInvokeStartRule(fe):fe}if(k.LA(1)!==S.Token.EOF)throw new b.StartRuleDoesNotConsumeFullPattern;return new d.ParseTreePattern(this,O,D,ie)}get lexer(){return this._lexer}get parser(){return this._parser}matchImpl(O,D,M){if(!O)throw new TypeError("tree cannot be null");if(!D)throw new TypeError("patternTree cannot be null");if(O instanceof g.TerminalNode&&D instanceof g.TerminalNode){let j;if(O.symbol.type===D.symbol.type)if(D.symbol instanceof _.TokenTagToken){let k=D.symbol;M.map(k.tokenName,O);const V=k.label;V&&M.map(V,O)}else O.text===D.text||j||(j=O);else j||(j=O);return j}if(O instanceof h.ParserRuleContext&&D instanceof h.ParserRuleContext){let j,k=this.getRuleTagToken(D);if(k){if(O.ruleContext.ruleIndex===D.ruleContext.ruleIndex){M.map(k.ruleName,O);const se=k.label;se&&M.map(se,O)}else j||(j=O);return j}if(O.childCount!==D.childCount)return j||(j=O),j;let V=O.childCount;for(let se=0;seV.length)throw new Error("unterminated tag in pattern: "+O);if(k.length=V[ie])throw new Error("tag delimiters out of order in pattern: "+O);if(se===0){let ie=O.substring(0,M);j.push(new x.TextChunk(ie))}if(se>0&&k[0]>0){let ie=O.substring(0,k[0]);j.push(new x.TextChunk(ie))}for(let ie=0;ie=0&&(me=fe.substring(0,ee),Ee=fe.substring(ee+1,fe.length)),j.push(new y.TagChunk(Ee,me)),ie+10){let ie=V[se-1]+this.stop.length;if(ie=0;se--)(V=C[se])&&(I=($<3?V(I):$>3?V(O,D,I):V(O,D))||I);return $>3&&I&&Object.defineProperty(O,D,I),I},t=w&&w.__param||function(C,O){return function(D,B){O(D,B,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ParseTreePatternMatcher=void 0;const r=Yb(),i=Qc,o=Ko,s=va,l=pP(),a=X,u=ba,c=Kb(),h=Or(),f=gP(),d=EP(),p=Xr,v=ei,m=CP(),y=wP(),g=Cr,x=OP(),b=ze,_=NP();class S{constructor(O,D){this.start="<",this.stop=">",this.escape="\\",this.escapeRE=/\\/g,this._lexer=O,this._parser=D}setDelimiters(O,D,B){if(!O)throw new Error("start cannot be null or empty");if(!D)throw new Error("stop cannot be null or empty");this.start=O,this.stop=D,this.escape=B,this.escapeRE=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g")}matches(O,D,B=0){if(typeof D=="string"){let $=this.compile(D,B);return this.matches(O,$)}else{let $=new l.MultiMap;return!this.matchImpl(O,D.patternTree,$)}}match(O,D,B=0){if(typeof D=="string"){let $=this.compile(D,B);return this.match(O,$)}else{let $=new l.MultiMap,I=this.matchImpl(O,D.patternTree,$);return new f.ParseTreeMatch(O,D,$,I)}}compile(O,D){let B=this.tokenize(O),$=new s.ListTokenSource(B),I=new o.CommonTokenStream($);const V=this._parser;let se=new c.ParserInterpreter(V.grammarFileName,V.vocabulary,V.ruleNames,V.getATNWithBypassAlts(),I),ie;try{se.errorHandler=new r.BailErrorStrategy,ie=se.parse(D)}catch(fe){throw fe instanceof u.ParseCancellationException?fe.getCause():fe instanceof p.RecognitionException?fe:fe instanceof Error?new S.CannotInvokeStartRule(fe):fe}if(I.LA(1)!==b.Token.EOF)throw new S.StartRuleDoesNotConsumeFullPattern;return new d.ParseTreePattern(this,O,D,ie)}get lexer(){return this._lexer}get parser(){return this._parser}matchImpl(O,D,B){if(!O)throw new TypeError("tree cannot be null");if(!D)throw new TypeError("patternTree cannot be null");if(O instanceof g.TerminalNode&&D instanceof g.TerminalNode){let $;if(O.symbol.type===D.symbol.type)if(D.symbol instanceof _.TokenTagToken){let I=D.symbol;B.map(I.tokenName,O);const V=I.label;V&&B.map(V,O)}else O.text===D.text||$||($=O);else $||($=O);return $}if(O instanceof h.ParserRuleContext&&D instanceof h.ParserRuleContext){let $,I=this.getRuleTagToken(D);if(I){if(O.ruleContext.ruleIndex===D.ruleContext.ruleIndex){B.map(I.ruleName,O);const se=I.label;se&&B.map(se,O)}else $||($=O);return $}if(O.childCount!==D.childCount)return $||($=O),$;let V=O.childCount;for(let se=0;seV.length)throw new Error("unterminated tag in pattern: "+O);if(I.length=V[ie])throw new Error("tag delimiters out of order in pattern: "+O);if(se===0){let ie=O.substring(0,B);$.push(new x.TextChunk(ie))}if(se>0&&I[0]>0){let ie=O.substring(0,I[0]);$.push(new x.TextChunk(ie))}for(let ie=0;ie=0&&(me=fe.substring(0,ee),Ee=fe.substring(ee+1,fe.length)),$.push(new y.TagChunk(Ee,me)),ie+10){let ie=V[se-1]+this.stop.length;if(ie=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u},e=w&&w.__param||function(i,o){return function(s,l){o(s,l,i)}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.DecisionEventInfo=void 0;const t=J;let r=class{constructor(o,s,l,a,u,c){this.decision=o,this.fullCtx=c,this.stopIndex=u,this.input=l,this.startIndex=a,this.state=s}};return n([t.NotNull],r.prototype,"input",void 0),r=n([e(2,t.NotNull)],r),Ws.DecisionEventInfo=r,Ws}var lx;function xP(){if(lx)return Vs;lx=1;/*! + */var n=w&&w.__decorate||function(i,o,s,l){var a=arguments.length,u=a<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,o,s,l);else for(var h=i.length-1;h>=0;h--)(c=i[h])&&(u=(a<3?c(u):a>3?c(o,s,u):c(o,s))||u);return a>3&&u&&Object.defineProperty(o,s,u),u},e=w&&w.__param||function(i,o){return function(s,l){o(s,l,i)}};Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.DecisionEventInfo=void 0;const t=X;let r=class{constructor(o,s,l,a,u,c){this.decision=o,this.fullCtx=c,this.stopIndex=u,this.input=l,this.startIndex=a,this.state=s}};return n([t.NotNull],r.prototype,"input",void 0),r=n([e(2,t.NotNull)],r),Gs.DecisionEventInfo=r,Gs}var px;function PP(){if(px)return Ks;px=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.AmbiguityInfo=void 0;const t=ya(),r=J;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c,h){super(s,l,u,c,h,l.useContext),this.ambigAlts=a}get ambiguousAlternatives(){return this.ambigAlts}};return n([r.NotNull],i.prototype,"ambigAlts",void 0),n([r.NotNull],i.prototype,"ambiguousAlternatives",null),i=n([e(1,r.NotNull),e(2,r.NotNull),e(3,r.NotNull)],i),Vs.AmbiguityInfo=i,Vs}var Ks={},ax;function yP(){if(ax)return Ks;ax=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.AmbiguityInfo=void 0;const t=Sa(),r=X;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c,h){super(s,l,u,c,h,l.useContext),this.ambigAlts=a}get ambiguousAlternatives(){return this.ambigAlts}};return n([r.NotNull],i.prototype,"ambigAlts",void 0),n([r.NotNull],i.prototype,"ambiguousAlternatives",null),i=n([e(1,r.NotNull),e(2,r.NotNull),e(3,r.NotNull)],i),Ks.AmbiguityInfo=i,Ks}var Xs={},mx;function RP(){if(mx)return Xs;mx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.ContextSensitivityInfo=void 0;const t=ya(),r=J;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c){super(s,l,a,u,c,!0)}};return i=n([e(1,r.NotNull),e(2,r.NotNull)],i),Ks.ContextSensitivityInfo=i,Ks}var Gs={},ux;function vP(){if(ux)return Gs;ux=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.ContextSensitivityInfo=void 0;const t=Sa(),r=X;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c){super(s,l,a,u,c,!0)}};return i=n([e(1,r.NotNull),e(2,r.NotNull)],i),Xs.ContextSensitivityInfo=i,Xs}var Ys={},gx;function LP(){if(gx)return Ys;gx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(r,i,o,s){var l=arguments.length,a=l<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,o):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,i,o,s);else for(var c=r.length-1;c>=0;c--)(u=r[c])&&(a=(l<3?u(a):l>3?u(i,o,a):u(i,o))||a);return l>3&&a&&Object.defineProperty(i,o,a),a};Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.DecisionInfo=void 0;const e=J;let t=class{constructor(i){this.invocations=0,this.timeInPrediction=0,this.SLL_TotalLook=0,this.SLL_MinLook=0,this.SLL_MaxLook=0,this.LL_TotalLook=0,this.LL_MinLook=0,this.LL_MaxLook=0,this.contextSensitivities=[],this.errors=[],this.ambiguities=[],this.predicateEvals=[],this.SLL_ATNTransitions=0,this.SLL_DFATransitions=0,this.LL_Fallback=0,this.LL_ATNTransitions=0,this.LL_DFATransitions=0,this.decision=i}toString(){return"{decision="+this.decision+", contextSensitivities="+this.contextSensitivities.length+", errors="+this.errors.length+", ambiguities="+this.ambiguities.length+", SLL_lookahead="+this.SLL_TotalLook+", SLL_ATNTransitions="+this.SLL_ATNTransitions+", SLL_DFATransitions="+this.SLL_DFATransitions+", LL_Fallback="+this.LL_Fallback+", LL_lookahead="+this.LL_TotalLook+", LL_ATNTransitions="+this.LL_ATNTransitions+"}"}};return n([e.Override],t.prototype,"toString",null),Gs.DecisionInfo=t,Gs}var Xs={},cx;function SP(){if(cx)return Xs;cx=1;/*! + */var n=w&&w.__decorate||function(r,i,o,s){var l=arguments.length,a=l<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,o):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,i,o,s);else for(var c=r.length-1;c>=0;c--)(u=r[c])&&(a=(l<3?u(a):l>3?u(i,o,a):u(i,o))||a);return l>3&&a&&Object.defineProperty(i,o,a),a};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.DecisionInfo=void 0;const e=X;let t=class{constructor(i){this.invocations=0,this.timeInPrediction=0,this.SLL_TotalLook=0,this.SLL_MinLook=0,this.SLL_MaxLook=0,this.LL_TotalLook=0,this.LL_MinLook=0,this.LL_MaxLook=0,this.contextSensitivities=[],this.errors=[],this.ambiguities=[],this.predicateEvals=[],this.SLL_ATNTransitions=0,this.SLL_DFATransitions=0,this.LL_Fallback=0,this.LL_ATNTransitions=0,this.LL_DFATransitions=0,this.decision=i}toString(){return"{decision="+this.decision+", contextSensitivities="+this.contextSensitivities.length+", errors="+this.errors.length+", ambiguities="+this.ambiguities.length+", SLL_lookahead="+this.SLL_TotalLook+", SLL_ATNTransitions="+this.SLL_ATNTransitions+", SLL_DFATransitions="+this.SLL_DFATransitions+", LL_Fallback="+this.LL_Fallback+", LL_lookahead="+this.LL_TotalLook+", LL_ATNTransitions="+this.LL_ATNTransitions+"}"}};return n([e.Override],t.prototype,"toString",null),Ys.DecisionInfo=t,Ys}var Js={},xx;function kP(){if(xx)return Js;xx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.ErrorInfo=void 0;const t=ya(),r=J;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c){super(s,l,a,u,c,l.useContext)}};return i=n([e(1,r.NotNull),e(2,r.NotNull)],i),Xs.ErrorInfo=i,Xs}var Ys={},hx;function bP(){if(hx)return Ys;hx=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Js,"__esModule",{value:!0}),Js.ErrorInfo=void 0;const t=Sa(),r=X;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c){super(s,l,a,u,c,l.useContext)}};return i=n([e(1,r.NotNull),e(2,r.NotNull)],i),Js.ErrorInfo=i,Js}var Qs={},yx;function IP(){if(yx)return Qs;yx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.LookaheadEventInfo=void 0;const t=ya(),r=J;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c,h,f){super(s,l,u,c,h,f),this.predictedAlt=a}};return i=n([e(3,r.NotNull)],i),Ys.LookaheadEventInfo=i,Ys}var Js={},fx;function AP(){if(fx)return Js;fx=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.LookaheadEventInfo=void 0;const t=Sa(),r=X;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c,h,f){super(s,l,u,c,h,f),this.predictedAlt=a}};return i=n([e(3,r.NotNull)],i),Qs.LookaheadEventInfo=i,Qs}var Zs={},vx;function MP(){if(vx)return Zs;vx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Js,"__esModule",{value:!0}),Js.PredicateEvalInfo=void 0;const t=ya(),r=J;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c,h,f,d){super(l,s,a,u,c,s.useContext),this.semctx=h,this.evalResult=f,this.predictedAlt=d}};return i=n([e(0,r.NotNull),e(2,r.NotNull),e(5,r.NotNull)],i),Js.PredicateEvalInfo=i,Js}var dx;function px(){if(dx)return Us;dx=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c},e=w&&w.__param||function(o,s){return function(l,a){s(l,a,o)}};Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.PredicateEvalInfo=void 0;const t=Sa(),r=X;let i=class extends t.DecisionEventInfo{constructor(s,l,a,u,c,h,f,d){super(l,s,a,u,c,s.useContext),this.semctx=h,this.evalResult=f,this.predictedAlt=d}};return i=n([e(0,r.NotNull),e(2,r.NotNull),e(5,r.NotNull)],i),Zs.PredicateEvalInfo=i,Zs}var bx;function Sx(){if(bx)return Ws;bx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(v,m,y,g){var x=arguments.length,S=x<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,y):g,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,m,y,g);else for(var b=v.length-1;b>=0;b--)(_=v[b])&&(S=(x<3?_(S):x>3?_(m,y,S):_(m,y))||S);return x>3&&S&&Object.defineProperty(m,y,S),S},e=w&&w.__param||function(v,m){return function(y,g){m(y,g,v)}};Object.defineProperty(Us,"__esModule",{value:!0}),Us.ProfilingATNSimulator=void 0;const t=xP(),r=xn(),i=Ac(),o=yP(),s=vP(),l=SP(),a=J,u=bP(),c=ua(),h=AP(),f=ki,d=PS();let p=class extends c.ParserATNSimulator{constructor(m){super(m.interpreter.atn,m),this._startIndex=0,this._sllStopIndex=0,this._llStopIndex=0,this.currentDecision=0,this.conflictingAltResolvedBySLL=0,this.optimize_ll1=!1,this.reportAmbiguities=!0,this.numDecisions=this.atn.decisionToState.length,this.decisions=[];for(let y=0;ythis.decisions[y].SLL_MaxLook&&(this.decisions[y].SLL_MaxLook=O,this.decisions[y].SLL_MaxLookEvent=new u.LookaheadEventInfo(y,void 0,_,m,this._startIndex,this._sllStopIndex,!1)),this._llStopIndex>=0){let D=this._llStopIndex-this._startIndex+1;this.decisions[y].LL_TotalLook+=D,this.decisions[y].LL_MinLook=this.decisions[y].LL_MinLook===0?D:Math.min(this.decisions[y].LL_MinLook,D),D>this.decisions[y].LL_MaxLook&&(this.decisions[y].LL_MaxLook=D,this.decisions[y].LL_MaxLookEvent=new u.LookaheadEventInfo(y,void 0,_,m,this._startIndex,this._llStopIndex,!0))}return _}finally{this._input=void 0,this.currentDecision=-1}}getStartState(m,y,g,x){let S=super.getStartState(m,y,g,x);return this.currentState=S,S}computeStartState(m,y,g){let x=super.computeStartState(m,y,g);return this.currentState=x,x}computeReachSet(m,y,g,x){if(this._input===void 0)throw new Error("Invalid state");let S=super.computeReachSet(m,y,g,x);return S==null&&this.decisions[this.currentDecision].errors.push(new l.ErrorInfo(this.currentDecision,y,this._input,this._startIndex,this._input.index)),this.currentState=S,S}getExistingTargetState(m,y){if(this.currentState===void 0||this._input===void 0)throw new Error("Invalid state");this.currentState.useContext?this._llStopIndex=this._input.index:this._sllStopIndex=this._input.index;let g=super.getExistingTargetState(m,y);if(g!=null&&(this.currentState=new d.SimulatorState(this.currentState.outerContext,g,this.currentState.useContext,this.currentState.remainingOuterContext),this.currentState.useContext?this.decisions[this.currentDecision].LL_DFATransitions++:this.decisions[this.currentDecision].SLL_DFATransitions++,g===i.ATNSimulator.ERROR)){let x=new d.SimulatorState(this.currentState.outerContext,m,this.currentState.useContext,this.currentState.remainingOuterContext);this.decisions[this.currentDecision].errors.push(new l.ErrorInfo(this.currentDecision,x,this._input,this._startIndex,this._input.index))}return g}computeTargetState(m,y,g,x,S,_){let b=super.computeTargetState(m,y,g,x,S,_);return S?this.decisions[this.currentDecision].LL_ATNTransitions++:this.decisions[this.currentDecision].SLL_ATNTransitions++,b}evalSemanticContextImpl(m,y,g){if(this.currentState===void 0||this._input===void 0)throw new Error("Invalid state");let x=super.evalSemanticContextImpl(m,y,g);if(!(m instanceof f.SemanticContext.PrecedencePredicate)){let _=this._llStopIndex>=0?this._llStopIndex:this._sllStopIndex;this.decisions[this.currentDecision].predicateEvals.push(new h.PredicateEvalInfo(this.currentState,this.currentDecision,this._input,this._startIndex,_,m,x,g))}return x}reportContextSensitivity(m,y,g,x,S){if(this._input===void 0)throw new Error("Invalid state");y!==this.conflictingAltResolvedBySLL&&this.decisions[this.currentDecision].contextSensitivities.push(new o.ContextSensitivityInfo(this.currentDecision,g,this._input,x,S)),super.reportContextSensitivity(m,y,g,x,S)}reportAttemptingFullContext(m,y,g,x,S){y!=null?this.conflictingAltResolvedBySLL=y.nextSetBit(0):this.conflictingAltResolvedBySLL=g.s0.configs.getRepresentedAlternatives().nextSetBit(0),this.decisions[this.currentDecision].LL_Fallback++,super.reportAttemptingFullContext(m,y,g,x,S)}reportAmbiguity(m,y,g,x,S,_,b){if(this.currentState===void 0||this._input===void 0)throw new Error("Invalid state");let C;_!=null?C=_.nextSetBit(0):C=b.getRepresentedAlternatives().nextSetBit(0),this.conflictingAltResolvedBySLL!==r.ATN.INVALID_ALT_NUMBER&&C!==this.conflictingAltResolvedBySLL&&this.decisions[this.currentDecision].contextSensitivities.push(new o.ContextSensitivityInfo(this.currentDecision,this.currentState,this._input,g,x)),this.decisions[this.currentDecision].ambiguities.push(new t.AmbiguityInfo(this.currentDecision,this.currentState,_,this._input,g,x)),super.reportAmbiguity(m,y,g,x,S,_,b)}getDecisionInfo(){return this.decisions}getCurrentState(){return this.currentState}};return n([a.Override,e(0,a.NotNull)],p.prototype,"adaptivePredict",null),n([a.Override],p.prototype,"getStartState",null),n([a.Override],p.prototype,"computeStartState",null),n([a.Override],p.prototype,"computeReachSet",null),n([a.Override],p.prototype,"getExistingTargetState",null),n([a.Override],p.prototype,"computeTargetState",null),n([a.Override],p.prototype,"evalSemanticContextImpl",null),n([a.Override],p.prototype,"reportContextSensitivity",null),n([a.Override],p.prototype,"reportAttemptingFullContext",null),n([a.Override,e(0,a.NotNull),e(5,a.NotNull),e(6,a.NotNull)],p.prototype,"reportAmbiguity",null),Us.ProfilingATNSimulator=p,Us}var mx;function va(){if(mx)return gs;mx=1;/*! + */var n=w&&w.__decorate||function(v,m,y,g){var x=arguments.length,b=x<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,y):g,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,m,y,g);else for(var S=v.length-1;S>=0;S--)(_=v[S])&&(b=(x<3?_(b):x>3?_(m,y,b):_(m,y))||b);return x>3&&b&&Object.defineProperty(m,y,b),b},e=w&&w.__param||function(v,m){return function(y,g){m(y,g,v)}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.ProfilingATNSimulator=void 0;const t=PP(),r=vn(),i=Cc(),o=RP(),s=LP(),l=kP(),a=X,u=IP(),c=fa(),h=MP(),f=Bi,d=Bb();let p=class extends c.ParserATNSimulator{constructor(m){super(m.interpreter.atn,m),this._startIndex=0,this._sllStopIndex=0,this._llStopIndex=0,this.currentDecision=0,this.conflictingAltResolvedBySLL=0,this.optimize_ll1=!1,this.reportAmbiguities=!0,this.numDecisions=this.atn.decisionToState.length,this.decisions=[];for(let y=0;ythis.decisions[y].SLL_MaxLook&&(this.decisions[y].SLL_MaxLook=O,this.decisions[y].SLL_MaxLookEvent=new u.LookaheadEventInfo(y,void 0,_,m,this._startIndex,this._sllStopIndex,!1)),this._llStopIndex>=0){let D=this._llStopIndex-this._startIndex+1;this.decisions[y].LL_TotalLook+=D,this.decisions[y].LL_MinLook=this.decisions[y].LL_MinLook===0?D:Math.min(this.decisions[y].LL_MinLook,D),D>this.decisions[y].LL_MaxLook&&(this.decisions[y].LL_MaxLook=D,this.decisions[y].LL_MaxLookEvent=new u.LookaheadEventInfo(y,void 0,_,m,this._startIndex,this._llStopIndex,!0))}return _}finally{this._input=void 0,this.currentDecision=-1}}getStartState(m,y,g,x){let b=super.getStartState(m,y,g,x);return this.currentState=b,b}computeStartState(m,y,g){let x=super.computeStartState(m,y,g);return this.currentState=x,x}computeReachSet(m,y,g,x){if(this._input===void 0)throw new Error("Invalid state");let b=super.computeReachSet(m,y,g,x);return b==null&&this.decisions[this.currentDecision].errors.push(new l.ErrorInfo(this.currentDecision,y,this._input,this._startIndex,this._input.index)),this.currentState=b,b}getExistingTargetState(m,y){if(this.currentState===void 0||this._input===void 0)throw new Error("Invalid state");this.currentState.useContext?this._llStopIndex=this._input.index:this._sllStopIndex=this._input.index;let g=super.getExistingTargetState(m,y);if(g!=null&&(this.currentState=new d.SimulatorState(this.currentState.outerContext,g,this.currentState.useContext,this.currentState.remainingOuterContext),this.currentState.useContext?this.decisions[this.currentDecision].LL_DFATransitions++:this.decisions[this.currentDecision].SLL_DFATransitions++,g===i.ATNSimulator.ERROR)){let x=new d.SimulatorState(this.currentState.outerContext,m,this.currentState.useContext,this.currentState.remainingOuterContext);this.decisions[this.currentDecision].errors.push(new l.ErrorInfo(this.currentDecision,x,this._input,this._startIndex,this._input.index))}return g}computeTargetState(m,y,g,x,b,_){let S=super.computeTargetState(m,y,g,x,b,_);return b?this.decisions[this.currentDecision].LL_ATNTransitions++:this.decisions[this.currentDecision].SLL_ATNTransitions++,S}evalSemanticContextImpl(m,y,g){if(this.currentState===void 0||this._input===void 0)throw new Error("Invalid state");let x=super.evalSemanticContextImpl(m,y,g);if(!(m instanceof f.SemanticContext.PrecedencePredicate)){let _=this._llStopIndex>=0?this._llStopIndex:this._sllStopIndex;this.decisions[this.currentDecision].predicateEvals.push(new h.PredicateEvalInfo(this.currentState,this.currentDecision,this._input,this._startIndex,_,m,x,g))}return x}reportContextSensitivity(m,y,g,x,b){if(this._input===void 0)throw new Error("Invalid state");y!==this.conflictingAltResolvedBySLL&&this.decisions[this.currentDecision].contextSensitivities.push(new o.ContextSensitivityInfo(this.currentDecision,g,this._input,x,b)),super.reportContextSensitivity(m,y,g,x,b)}reportAttemptingFullContext(m,y,g,x,b){y!=null?this.conflictingAltResolvedBySLL=y.nextSetBit(0):this.conflictingAltResolvedBySLL=g.s0.configs.getRepresentedAlternatives().nextSetBit(0),this.decisions[this.currentDecision].LL_Fallback++,super.reportAttemptingFullContext(m,y,g,x,b)}reportAmbiguity(m,y,g,x,b,_,S){if(this.currentState===void 0||this._input===void 0)throw new Error("Invalid state");let C;_!=null?C=_.nextSetBit(0):C=S.getRepresentedAlternatives().nextSetBit(0),this.conflictingAltResolvedBySLL!==r.ATN.INVALID_ALT_NUMBER&&C!==this.conflictingAltResolvedBySLL&&this.decisions[this.currentDecision].contextSensitivities.push(new o.ContextSensitivityInfo(this.currentDecision,this.currentState,this._input,g,x)),this.decisions[this.currentDecision].ambiguities.push(new t.AmbiguityInfo(this.currentDecision,this.currentState,_,this._input,g,x)),super.reportAmbiguity(m,y,g,x,b,_,S)}getDecisionInfo(){return this.decisions}getCurrentState(){return this.currentState}};return n([a.Override,e(0,a.NotNull)],p.prototype,"adaptivePredict",null),n([a.Override],p.prototype,"getStartState",null),n([a.Override],p.prototype,"computeStartState",null),n([a.Override],p.prototype,"computeReachSet",null),n([a.Override],p.prototype,"getExistingTargetState",null),n([a.Override],p.prototype,"computeTargetState",null),n([a.Override],p.prototype,"evalSemanticContextImpl",null),n([a.Override],p.prototype,"reportContextSensitivity",null),n([a.Override],p.prototype,"reportAttemptingFullContext",null),n([a.Override,e(0,a.NotNull),e(5,a.NotNull),e(6,a.NotNull)],p.prototype,"reportAmbiguity",null),Ws.ProfilingATNSimulator=p,Ws}var Ax;function Aa(){if(Ax)return ys;Ax=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(x,S,_,b){var C=arguments.length,O=C<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,_):b,D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,S,_,b);else for(var M=x.length-1;M>=0;M--)(D=x[M])&&(O=(C<3?D(O):C>3?D(S,_,O):D(S,_))||O);return C>3&&O&&Object.defineProperty(S,_,O),O},e=w&&w.__param||function(x,S){return function(_,b){S(_,b,x)}},t=w&&w.__awaiter||function(x,S,_,b){function C(O){return O instanceof _?O:new _(function(D){D(O)})}return new(_||(_=Promise))(function(O,D){function M(V){try{k(b.next(V))}catch(se){D(se)}}function j(V){try{k(b.throw(V))}catch(se){D(se)}}function k(V){V.done?O(V.value):C(V.value).then(M,j)}k((b=b.apply(x,S||[])).next())})};Object.defineProperty(gs,"__esModule",{value:!0}),gs.Parser=void 0;const r=ut,i=Zl,o=kp(),s=Hp(),l=Uo,a=Vl,u=Yn(),c=J,h=Wc,f=ua(),d=da,p=Kn,v=An,m=ze;class y{constructor(S,_){this.ruleNames=S,this.tokenStream=_}enterEveryRule(S){console.log("enter "+this.ruleNames[S.ruleIndex]+", LT(1)="+this.tokenStream.LT(1).text)}exitEveryRule(S){console.log("exit "+this.ruleNames[S.ruleIndex]+", LT(1)="+this.tokenStream.LT(1).text)}visitErrorNode(S){}visitTerminal(S){let _=S.parent.ruleContext,b=S.symbol;console.log("consume "+b+" rule "+this.ruleNames[_.ruleIndex])}}n([c.Override],y.prototype,"enterEveryRule",null),n([c.Override],y.prototype,"exitEveryRule",null),n([c.Override],y.prototype,"visitErrorNode",null),n([c.Override],y.prototype,"visitTerminal",null);let g=class gu extends p.Recognizer{constructor(S){super(),this._errHandler=new s.DefaultErrorStrategy,this._precedenceStack=new a.IntegerStack,this._buildParseTrees=!0,this._parseListeners=[],this._syntaxErrors=0,this.matchedEOF=!1,this._precedenceStack.push(0),this.inputStream=S}reset(S){(S===void 0||S)&&this.inputStream.seek(0),this._errHandler.reset(this),this._ctx=void 0,this._syntaxErrors=0,this.matchedEOF=!1,this.isTrace=!1,this._precedenceStack.clear(),this._precedenceStack.push(0);let _=this.interpreter;_!=null&&_.reset()}match(S){let _=this.currentToken;return _.type===S?(S===m.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume()):(_=this._errHandler.recoverInline(this),this._buildParseTrees&&_.tokenIndex===-1&&this._ctx.addErrorNode(this.createErrorNode(this._ctx,_))),_}matchWildcard(){let S=this.currentToken;return S.type>0?(this._errHandler.reportMatch(this),this.consume()):(S=this._errHandler.recoverInline(this),this._buildParseTrees&&S.tokenIndex===-1&&this._ctx.addErrorNode(this.createErrorNode(this._ctx,S))),S}set buildParseTree(S){this._buildParseTrees=S}get buildParseTree(){return this._buildParseTrees}getParseListeners(){return this._parseListeners}addParseListener(S){if(S==null)throw new TypeError("listener cannot be null");this._parseListeners.push(S)}removeParseListener(S){let _=this._parseListeners.findIndex(b=>b===S);_!==-1&&this._parseListeners.splice(_,1)}removeParseListeners(){this._parseListeners.length=0}triggerEnterRuleEvent(){for(let S of this._parseListeners)S.enterEveryRule&&S.enterEveryRule(this._ctx),this._ctx.enterRule(S)}triggerExitRuleEvent(){for(let S=this._parseListeners.length-1;S>=0;S--){let _=this._parseListeners[S];this._ctx.exitRule(_),_.exitEveryRule&&_.exitEveryRule(this._ctx)}}get numberOfSyntaxErrors(){return this._syntaxErrors}get tokenFactory(){return this._input.tokenSource.tokenFactory}getATNWithBypassAlts(){let S=this.serializedATN;if(S==null)throw new Error("The current parser does not support an ATN with bypass alternatives.");let _=gu.bypassAltsAtnCache.get(S);if(_==null){let b=new i.ATNDeserializationOptions;b.isGenerateRuleBypassTransitions=!0,_=new o.ATNDeserializer(b).deserialize(r.toCharArray(S)),gu.bypassAltsAtnCache.set(S,_)}return _}compileParseTreePattern(S,_,b){return t(this,void 0,void 0,function*(){if(!b){if(this.inputStream){let M=this.inputStream.tokenSource;M instanceof u.Lexer&&(b=M)}if(!b)throw new Error("Parser can't discover a lexer to use")}let C=b,O=yield Promise.resolve().then(()=>gP());return new O.ParseTreePatternMatcher(C,this).compile(S,_)})}get errorHandler(){return this._errHandler}set errorHandler(S){this._errHandler=S}get inputStream(){return this._input}set inputStream(S){this.reset(!1),this._input=S}get currentToken(){return this._input.LT(1)}notifyErrorListeners(S,_,b){_===void 0?_=this.currentToken:_===null&&(_=void 0),this._syntaxErrors++;let C=-1,O=-1;_!=null&&(C=_.line,O=_.charPositionInLine);let D=this.getErrorListenerDispatch();D.syntaxError&&D.syntaxError(this,_,C,O,S,b)}consume(){let S=this.currentToken;S.type!==gu.EOF&&this.inputStream.consume();let _=this._parseListeners.length!==0;if(this._buildParseTrees||_)if(this._errHandler.inErrorRecoveryMode(this)){let b=this._ctx.addErrorNode(this.createErrorNode(this._ctx,S));if(_)for(let C of this._parseListeners)C.visitErrorNode&&C.visitErrorNode(b)}else{let b=this.createTerminalNode(this._ctx,S);if(this._ctx.addChild(b),_)for(let C of this._parseListeners)C.visitTerminal&&C.visitTerminal(b)}return S}createTerminalNode(S,_){return new v.TerminalNode(_)}createErrorNode(S,_){return new l.ErrorNode(_)}addContextToParseTree(){let S=this._ctx._parent;S!=null&&S.addChild(this._ctx)}enterRule(S,_,b){this.state=_,this._ctx=S,this._ctx._start=this._input.LT(1),this._buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}enterLeftFactoredRule(S,_,b){if(this.state=_,this._buildParseTrees){let C=this._ctx.getChild(this._ctx.childCount-1);this._ctx.removeLastChild(),C._parent=S,S.addChild(C)}this._ctx=S,this._ctx._start=this._input.LT(1),this._buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this.matchedEOF?this._ctx._stop=this._input.LT(1):this._ctx._stop=this._input.tryLT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx._parent}enterOuterAlt(S,_){if(S.altNumber=_,this._buildParseTrees&&this._ctx!==S){let b=this._ctx._parent;b!=null&&(b.removeLastChild(),b.addChild(S))}this._ctx=S}get precedence(){return this._precedenceStack.isEmpty?-1:this._precedenceStack.peek()}enterRecursionRule(S,_,b,C){this.state=_,this._precedenceStack.push(C),this._ctx=S,this._ctx._start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(S,_,b){let C=this._ctx;C._parent=S,C.invokingState=_,C._stop=this._input.tryLT(-1),this._ctx=S,this._ctx._start=C._start,this._buildParseTrees&&this._ctx.addChild(C),this.triggerEnterRuleEvent()}unrollRecursionContexts(S){this._precedenceStack.pop(),this._ctx._stop=this._input.tryLT(-1);let _=this._ctx;if(this._parseListeners.length>0)for(;this._ctx!==S;)this.triggerExitRuleEvent(),this._ctx=this._ctx._parent;else this._ctx=S;_._parent=S,this._buildParseTrees&&S!=null&&S.addChild(_)}getInvokingContext(S){let _=this._ctx;for(;_&&_.ruleIndex!==S;)_=_._parent;return _}get context(){return this._ctx}set context(S){this._ctx=S}precpred(S,_){return _>=this._precedenceStack.peek()}getErrorListenerDispatch(){return new d.ProxyParserErrorListener(this.getErrorListeners())}inContext(S){return!1}isExpectedToken(S){let _=this.interpreter.atn,b=this._ctx,C=_.states[this.state],O=_.nextTokens(C);if(O.contains(S))return!0;if(!O.contains(m.Token.EPSILON))return!1;for(;b!=null&&b.invokingState>=0&&O.contains(m.Token.EPSILON);){let M=_.states[b.invokingState].transition(0);if(O=_.nextTokens(M.followState),O.contains(S))return!0;b=b._parent}return!!(O.contains(m.Token.EPSILON)&&S===m.Token.EOF)}get isMatchedEOF(){return this.matchedEOF}getExpectedTokens(){return this.atn.getExpectedTokens(this.state,this.context)}getExpectedTokensWithinCurrentRule(){let S=this.interpreter.atn,_=S.states[this.state];return S.nextTokens(_)}getRuleIndex(S){let _=this.getRuleIndexMap().get(S);return _??-1}get ruleContext(){return this._ctx}getRuleInvocationStack(S=this._ctx){let _=S,b=this.ruleNames,C=[];for(;_!=null;){let O=_.ruleIndex;O<0?C.push("n/a"):C.push(b[O]),_=_._parent}return C}getDFAStrings(){let S=[];for(let _ of this._interp.atn.decisionToDFA)S.push(_.toString(this.vocabulary,this.ruleNames));return S}dumpDFA(){let S=!1;for(let _ of this._interp.atn.decisionToDFA)_.isEmpty||(S&&console.log(),console.log("Decision "+_.decision+":"),tt.stdout.write(_.toString(this.vocabulary,this.ruleNames)),S=!0)}get sourceName(){return this._input.sourceName}get parseInfo(){return Promise.resolve().then(()=>px()).then(S=>{let _=this.interpreter;if(_ instanceof S.ProfilingATNSimulator)return new h.ParseInfo(_)})}setProfile(S){return t(this,void 0,void 0,function*(){let _=yield Promise.resolve().then(()=>px()),b=this.interpreter;S?b instanceof _.ProfilingATNSimulator||(this.interpreter=new _.ProfilingATNSimulator(this)):b instanceof _.ProfilingATNSimulator&&(this.interpreter=new f.ParserATNSimulator(this.atn,this)),this.interpreter.setPredictionMode(b.getPredictionMode())})}set isTrace(S){S?(this._tracer?this.removeParseListener(this._tracer):this._tracer=new y(this.ruleNames,this._input),this.addParseListener(this._tracer)):this._tracer&&(this.removeParseListener(this._tracer),this._tracer=void 0)}get isTrace(){return this._tracer!=null}};return g.bypassAltsAtnCache=new Map,n([c.NotNull],g.prototype,"_errHandler",void 0),n([c.NotNull],g.prototype,"match",null),n([c.NotNull],g.prototype,"matchWildcard",null),n([c.NotNull],g.prototype,"getParseListeners",null),n([e(0,c.NotNull)],g.prototype,"addParseListener",null),n([c.NotNull],g.prototype,"getATNWithBypassAlts",null),n([c.NotNull,e(0,c.NotNull)],g.prototype,"errorHandler",null),n([c.Override],g.prototype,"inputStream",null),n([c.NotNull],g.prototype,"currentToken",null),n([e(0,c.NotNull)],g.prototype,"enterRule",null),n([c.Override,e(0,c.Nullable)],g.prototype,"precpred",null),n([c.Override],g.prototype,"getErrorListenerDispatch",null),n([c.NotNull],g.prototype,"getExpectedTokens",null),n([c.NotNull],g.prototype,"getExpectedTokensWithinCurrentRule",null),n([c.Override],g.prototype,"parseInfo",null),gs.Parser=g,gs}var gx;function Jc(){if(gx)return ms;gx=1;/*! + */var n=w&&w.__decorate||function(x,b,_,S){var C=arguments.length,O=C<3?b:S===null?S=Object.getOwnPropertyDescriptor(b,_):S,D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,b,_,S);else for(var B=x.length-1;B>=0;B--)(D=x[B])&&(O=(C<3?D(O):C>3?D(b,_,O):D(b,_))||O);return C>3&&O&&Object.defineProperty(b,_,O),O},e=w&&w.__param||function(x,b){return function(_,S){b(_,S,x)}},t=w&&w.__awaiter||function(x,b,_,S){function C(O){return O instanceof _?O:new _(function(D){D(O)})}return new(_||(_=Promise))(function(O,D){function B(V){try{I(S.next(V))}catch(se){D(se)}}function $(V){try{I(S.throw(V))}catch(se){D(se)}}function I(V){V.done?O(V.value):C(V.value).then(B,$)}I((S=S.apply(x,b||[])).next())})};Object.defineProperty(ys,"__esModule",{value:!0}),ys.Parser=void 0;const r=ut,i=ra,o=zp(),s=Xp(),l=Zn,a=Gl,u=Jn(),c=X,h=Yc,f=fa(),d=ga,p=Gn,v=Cr,m=ze;class y{constructor(b,_){this.ruleNames=b,this.tokenStream=_}enterEveryRule(b){console.log("enter "+this.ruleNames[b.ruleIndex]+", LT(1)="+this.tokenStream.LT(1).text)}exitEveryRule(b){console.log("exit "+this.ruleNames[b.ruleIndex]+", LT(1)="+this.tokenStream.LT(1).text)}visitErrorNode(b){}visitTerminal(b){let _=b.parent.ruleContext,S=b.symbol;console.log("consume "+S+" rule "+this.ruleNames[_.ruleIndex])}}n([c.Override],y.prototype,"enterEveryRule",null),n([c.Override],y.prototype,"exitEveryRule",null),n([c.Override],y.prototype,"visitErrorNode",null),n([c.Override],y.prototype,"visitTerminal",null);let g=class bu extends p.Recognizer{constructor(b){super(),this._errHandler=new s.DefaultErrorStrategy,this._precedenceStack=new a.IntegerStack,this._buildParseTrees=!0,this._parseListeners=[],this._syntaxErrors=0,this.matchedEOF=!1,this._precedenceStack.push(0),this.inputStream=b}reset(b){(b===void 0||b)&&this.inputStream.seek(0),this._errHandler.reset(this),this._ctx=void 0,this._syntaxErrors=0,this.matchedEOF=!1,this.isTrace=!1,this._precedenceStack.clear(),this._precedenceStack.push(0);let _=this.interpreter;_!=null&&_.reset()}match(b){let _=this.currentToken;return _.type===b?(b===m.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume()):(_=this._errHandler.recoverInline(this),this._buildParseTrees&&_.tokenIndex===-1&&this._ctx.addErrorNode(this.createErrorNode(this._ctx,_))),_}matchWildcard(){let b=this.currentToken;return b.type>0?(this._errHandler.reportMatch(this),this.consume()):(b=this._errHandler.recoverInline(this),this._buildParseTrees&&b.tokenIndex===-1&&this._ctx.addErrorNode(this.createErrorNode(this._ctx,b))),b}set buildParseTree(b){this._buildParseTrees=b}get buildParseTree(){return this._buildParseTrees}getParseListeners(){return this._parseListeners}addParseListener(b){if(b==null)throw new TypeError("listener cannot be null");this._parseListeners.push(b)}removeParseListener(b){let _=this._parseListeners.findIndex(S=>S===b);_!==-1&&this._parseListeners.splice(_,1)}removeParseListeners(){this._parseListeners.length=0}triggerEnterRuleEvent(){for(let b of this._parseListeners)b.enterEveryRule&&b.enterEveryRule(this._ctx),this._ctx.enterRule(b)}triggerExitRuleEvent(){for(let b=this._parseListeners.length-1;b>=0;b--){let _=this._parseListeners[b];this._ctx.exitRule(_),_.exitEveryRule&&_.exitEveryRule(this._ctx)}}get numberOfSyntaxErrors(){return this._syntaxErrors}get tokenFactory(){return this._input.tokenSource.tokenFactory}getATNWithBypassAlts(){let b=this.serializedATN;if(b==null)throw new Error("The current parser does not support an ATN with bypass alternatives.");let _=bu.bypassAltsAtnCache.get(b);if(_==null){let S=new i.ATNDeserializationOptions;S.isGenerateRuleBypassTransitions=!0,_=new o.ATNDeserializer(S).deserialize(r.toCharArray(b)),bu.bypassAltsAtnCache.set(b,_)}return _}compileParseTreePattern(b,_,S){return t(this,void 0,void 0,function*(){if(!S){if(this.inputStream){let B=this.inputStream.tokenSource;B instanceof u.Lexer&&(S=B)}if(!S)throw new Error("Parser can't discover a lexer to use")}let C=S,O=yield Promise.resolve().then(()=>DP());return new O.ParseTreePatternMatcher(C,this).compile(b,_)})}get errorHandler(){return this._errHandler}set errorHandler(b){this._errHandler=b}get inputStream(){return this._input}set inputStream(b){this.reset(!1),this._input=b}get currentToken(){return this._input.LT(1)}notifyErrorListeners(b,_,S){_===void 0?_=this.currentToken:_===null&&(_=void 0),this._syntaxErrors++;let C=-1,O=-1;_!=null&&(C=_.line,O=_.charPositionInLine);let D=this.getErrorListenerDispatch();D.syntaxError&&D.syntaxError(this,_,C,O,b,S)}consume(){let b=this.currentToken;b.type!==bu.EOF&&this.inputStream.consume();let _=this._parseListeners.length!==0;if(this._buildParseTrees||_)if(this._errHandler.inErrorRecoveryMode(this)){let S=this._ctx.addErrorNode(this.createErrorNode(this._ctx,b));if(_)for(let C of this._parseListeners)C.visitErrorNode&&C.visitErrorNode(S)}else{let S=this.createTerminalNode(this._ctx,b);if(this._ctx.addChild(S),_)for(let C of this._parseListeners)C.visitTerminal&&C.visitTerminal(S)}return b}createTerminalNode(b,_){return new v.TerminalNode(_)}createErrorNode(b,_){return new l.ErrorNode(_)}addContextToParseTree(){let b=this._ctx._parent;b!=null&&b.addChild(this._ctx)}enterRule(b,_,S){this.state=_,this._ctx=b,this._ctx._start=this._input.LT(1),this._buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}enterLeftFactoredRule(b,_,S){if(this.state=_,this._buildParseTrees){let C=this._ctx.getChild(this._ctx.childCount-1);this._ctx.removeLastChild(),C._parent=b,b.addChild(C)}this._ctx=b,this._ctx._start=this._input.LT(1),this._buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this.matchedEOF?this._ctx._stop=this._input.LT(1):this._ctx._stop=this._input.tryLT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx._parent}enterOuterAlt(b,_){if(b.altNumber=_,this._buildParseTrees&&this._ctx!==b){let S=this._ctx._parent;S!=null&&(S.removeLastChild(),S.addChild(b))}this._ctx=b}get precedence(){return this._precedenceStack.isEmpty?-1:this._precedenceStack.peek()}enterRecursionRule(b,_,S,C){this.state=_,this._precedenceStack.push(C),this._ctx=b,this._ctx._start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(b,_,S){let C=this._ctx;C._parent=b,C.invokingState=_,C._stop=this._input.tryLT(-1),this._ctx=b,this._ctx._start=C._start,this._buildParseTrees&&this._ctx.addChild(C),this.triggerEnterRuleEvent()}unrollRecursionContexts(b){this._precedenceStack.pop(),this._ctx._stop=this._input.tryLT(-1);let _=this._ctx;if(this._parseListeners.length>0)for(;this._ctx!==b;)this.triggerExitRuleEvent(),this._ctx=this._ctx._parent;else this._ctx=b;_._parent=b,this._buildParseTrees&&b!=null&&b.addChild(_)}getInvokingContext(b){let _=this._ctx;for(;_&&_.ruleIndex!==b;)_=_._parent;return _}get context(){return this._ctx}set context(b){this._ctx=b}precpred(b,_){return _>=this._precedenceStack.peek()}getErrorListenerDispatch(){return new d.ProxyParserErrorListener(this.getErrorListeners())}inContext(b){return!1}isExpectedToken(b){let _=this.interpreter.atn,S=this._ctx,C=_.states[this.state],O=_.nextTokens(C);if(O.contains(b))return!0;if(!O.contains(m.Token.EPSILON))return!1;for(;S!=null&&S.invokingState>=0&&O.contains(m.Token.EPSILON);){let B=_.states[S.invokingState].transition(0);if(O=_.nextTokens(B.followState),O.contains(b))return!0;S=S._parent}return!!(O.contains(m.Token.EPSILON)&&b===m.Token.EOF)}get isMatchedEOF(){return this.matchedEOF}getExpectedTokens(){return this.atn.getExpectedTokens(this.state,this.context)}getExpectedTokensWithinCurrentRule(){let b=this.interpreter.atn,_=b.states[this.state];return b.nextTokens(_)}getRuleIndex(b){let _=this.getRuleIndexMap().get(b);return _??-1}get ruleContext(){return this._ctx}getRuleInvocationStack(b=this._ctx){let _=b,S=this.ruleNames,C=[];for(;_!=null;){let O=_.ruleIndex;O<0?C.push("n/a"):C.push(S[O]),_=_._parent}return C}getDFAStrings(){let b=[];for(let _ of this._interp.atn.decisionToDFA)b.push(_.toString(this.vocabulary,this.ruleNames));return b}dumpDFA(){let b=!1;for(let _ of this._interp.atn.decisionToDFA)_.isEmpty||(b&&console.log(),console.log("Decision "+_.decision+":"),tt.stdout.write(_.toString(this.vocabulary,this.ruleNames)),b=!0)}get sourceName(){return this._input.sourceName}get parseInfo(){return Promise.resolve().then(()=>Sx()).then(b=>{let _=this.interpreter;if(_ instanceof b.ProfilingATNSimulator)return new h.ParseInfo(_)})}setProfile(b){return t(this,void 0,void 0,function*(){let _=yield Promise.resolve().then(()=>Sx()),S=this.interpreter;b?S instanceof _.ProfilingATNSimulator||(this.interpreter=new _.ProfilingATNSimulator(this)):S instanceof _.ProfilingATNSimulator&&(this.interpreter=new f.ParserATNSimulator(this.atn,this)),this.interpreter.setPredictionMode(S.getPredictionMode())})}set isTrace(b){b?(this._tracer?this.removeParseListener(this._tracer):this._tracer=new y(this.ruleNames,this._input),this.addParseListener(this._tracer)):this._tracer&&(this.removeParseListener(this._tracer),this._tracer=void 0)}get isTrace(){return this._tracer!=null}};return g.bypassAltsAtnCache=new Map,n([c.NotNull],g.prototype,"_errHandler",void 0),n([c.NotNull],g.prototype,"match",null),n([c.NotNull],g.prototype,"matchWildcard",null),n([c.NotNull],g.prototype,"getParseListeners",null),n([e(0,c.NotNull)],g.prototype,"addParseListener",null),n([c.NotNull],g.prototype,"getATNWithBypassAlts",null),n([c.NotNull,e(0,c.NotNull)],g.prototype,"errorHandler",null),n([c.Override],g.prototype,"inputStream",null),n([c.NotNull],g.prototype,"currentToken",null),n([e(0,c.NotNull)],g.prototype,"enterRule",null),n([c.Override,e(0,c.Nullable)],g.prototype,"precpred",null),n([c.Override],g.prototype,"getErrorListenerDispatch",null),n([c.NotNull],g.prototype,"getExpectedTokens",null),n([c.NotNull],g.prototype,"getExpectedTokensWithinCurrentRule",null),n([c.Override],g.prototype,"parseInfo",null),ys.Parser=g,ys}var _x;function th(){if(_x)return xs;_x=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c};Object.defineProperty(ms,"__esModule",{value:!0}),ms.NoViableAltException=void 0;const e=va(),t=Gr,r=J;let i=class extends t.RecognitionException{constructor(s,l,a,u,c,h){s instanceof e.Parser&&(l===void 0&&(l=s.inputStream),a===void 0&&(a=s.currentToken),u===void 0&&(u=s.currentToken),h===void 0&&(h=s.context)),super(s,l,h),this._deadEndConfigs=c,this._startToken=a,this.setOffendingToken(s,u)}get startToken(){return this._startToken}get deadEndConfigs(){return this._deadEndConfigs}};return n([r.NotNull],i.prototype,"_startToken",void 0),ms.NoViableAltException=i,ms}var xx;function Hp(){if(xx)return ns;xx=1;/*! + */var n=w&&w.__decorate||function(o,s,l,a){var u=arguments.length,c=u<3?s:a===null?a=Object.getOwnPropertyDescriptor(s,l):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,l,a);else for(var f=o.length-1;f>=0;f--)(h=o[f])&&(c=(u<3?h(c):u>3?h(s,l,c):h(s,l))||c);return u>3&&c&&Object.defineProperty(s,l,c),c};Object.defineProperty(xs,"__esModule",{value:!0}),xs.NoViableAltException=void 0;const e=Aa(),t=Xr,r=X;let i=class extends t.RecognitionException{constructor(s,l,a,u,c,h){s instanceof e.Parser&&(l===void 0&&(l=s.inputStream),a===void 0&&(a=s.currentToken),u===void 0&&(u=s.currentToken),h===void 0&&(h=s.context)),super(s,l,h),this._deadEndConfigs=c,this._startToken=a,this.setOffendingToken(s,u)}get startToken(){return this._startToken}get deadEndConfigs(){return this._deadEndConfigs}};return n([r.NotNull],i.prototype,"_startToken",void 0),xs.NoViableAltException=i,xs}var Tx;function Xp(){if(Tx)return os;Tx=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(f,d,p,v){var m=arguments.length,y=m<3?d:v===null?v=Object.getOwnPropertyDescriptor(d,p):v,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,d,p,v);else for(var x=f.length-1;x>=0;x--)(g=f[x])&&(y=(m<3?g(y):m>3?g(d,p,y):g(d,p))||y);return m>3&&y&&Object.defineProperty(d,p,y),y},e=w&&w.__param||function(f,d){return function(p,v){d(p,v,f)}};Object.defineProperty(ns,"__esModule",{value:!0}),ns.DefaultErrorStrategy=void 0;const t=Kr,r=mt,i=ko,o=Fi,s=zi(),l=Jc(),a=Tr(),u=ze,c=J;let h=class{constructor(){this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.nextTokensState=t.ATNState.INVALID_STATE_NUMBER}reset(d){this.endErrorCondition(d)}beginErrorCondition(d){this.errorRecoveryMode=!0}inErrorRecoveryMode(d){return this.errorRecoveryMode}endErrorCondition(d){this.errorRecoveryMode=!1,this.lastErrorStates=void 0,this.lastErrorIndex=-1}reportMatch(d){this.endErrorCondition(d)}reportError(d,p){this.inErrorRecoveryMode(d)||(this.beginErrorCondition(d),p instanceof l.NoViableAltException?this.reportNoViableAlternative(d,p):p instanceof o.InputMismatchException?this.reportInputMismatch(d,p):p instanceof i.FailedPredicateException?this.reportFailedPredicate(d,p):(console.error(`unknown recognition error type: ${p}`),this.notifyErrorListeners(d,p.toString(),p)))}notifyErrorListeners(d,p,v){let m=v.getOffendingToken(d);m===void 0&&(m=null),d.notifyErrorListeners(p,m,v)}recover(d,p){this.lastErrorIndex===d.inputStream.index&&this.lastErrorStates&&this.lastErrorStates.contains(d.state)&&d.consume(),this.lastErrorIndex=d.inputStream.index,this.lastErrorStates||(this.lastErrorStates=new s.IntervalSet),this.lastErrorStates.add(d.state);let v=this.getErrorRecoverySet(d);this.consumeUntil(d,v)}sync(d){let p=d.interpreter.atn.states[d.state];if(this.inErrorRecoveryMode(d))return;let m=d.inputStream.LA(1),y=d.atn.nextTokens(p);if(y.contains(m)){this.nextTokensContext=void 0,this.nextTokensState=t.ATNState.INVALID_STATE_NUMBER;return}if(y.contains(u.Token.EPSILON)){this.nextTokensContext===void 0&&(this.nextTokensContext=d.context,this.nextTokensState=d.state);return}switch(p.stateType){case r.ATNStateType.BLOCK_START:case r.ATNStateType.STAR_BLOCK_START:case r.ATNStateType.PLUS_BLOCK_START:case r.ATNStateType.STAR_LOOP_ENTRY:if(this.singleTokenDeletion(d))return;throw new o.InputMismatchException(d);case r.ATNStateType.PLUS_LOOP_BACK:case r.ATNStateType.STAR_LOOP_BACK:this.reportUnwantedToken(d);let x=d.getExpectedTokens().or(this.getErrorRecoverySet(d));this.consumeUntil(d,x);break}}reportNoViableAlternative(d,p){let v=d.inputStream,m;v?p.startToken.type===u.Token.EOF?m="":m=v.getTextFromRange(p.startToken,p.getOffendingToken()):m="";let y="no viable alternative at input "+this.escapeWSAndQuote(m);this.notifyErrorListeners(d,y,p)}reportInputMismatch(d,p){let v=p.expectedTokens,m=v?v.toStringVocabulary(d.vocabulary):"",y="mismatched input "+this.getTokenErrorDisplay(p.getOffendingToken(d))+" expecting "+m;this.notifyErrorListeners(d,y,p)}reportFailedPredicate(d,p){let m="rule "+d.ruleNames[d.context.ruleIndex]+" "+p.message;this.notifyErrorListeners(d,m,p)}reportUnwantedToken(d){if(this.inErrorRecoveryMode(d))return;this.beginErrorCondition(d);let p=d.currentToken,v=this.getTokenErrorDisplay(p),m=this.getExpectedTokens(d),y="extraneous input "+v+" expecting "+m.toStringVocabulary(d.vocabulary);d.notifyErrorListeners(y,p,void 0)}reportMissingToken(d){if(this.inErrorRecoveryMode(d))return;this.beginErrorCondition(d);let p=d.currentToken,m="missing "+this.getExpectedTokens(d).toStringVocabulary(d.vocabulary)+" at "+this.getTokenErrorDisplay(p);d.notifyErrorListeners(m,p,void 0)}recoverInline(d){let p=this.singleTokenDeletion(d);if(p)return d.consume(),p;if(this.singleTokenInsertion(d))return this.getMissingSymbol(d);throw this.nextTokensContext===void 0?new o.InputMismatchException(d):new o.InputMismatchException(d,this.nextTokensState,this.nextTokensContext)}singleTokenInsertion(d){let p=d.inputStream.LA(1),m=d.interpreter.atn.states[d.state].transition(0).target,y=d.interpreter.atn;return y.nextTokens(m,a.PredictionContext.fromRuleContext(y,d.context)).contains(p)?(this.reportMissingToken(d),!0):!1}singleTokenDeletion(d){let p=d.inputStream.LA(2);if(this.getExpectedTokens(d).contains(p)){this.reportUnwantedToken(d),d.consume();let m=d.currentToken;return this.reportMatch(d),m}}getMissingSymbol(d){let p=d.currentToken,v=this.getExpectedTokens(d),m=u.Token.INVALID_TYPE;v.isNil||(m=v.minElement);let y;m===u.Token.EOF?y="":y="";let g=p,x=d.inputStream.tryLT(-1);return g.type===u.Token.EOF&&x!=null&&(g=x),this.constructToken(d.inputStream.tokenSource,m,y,g)}constructToken(d,p,v,m){let y=d.tokenFactory,g=m.tokenSource,x=g?g.inputStream:void 0;return y.create({source:d,stream:x},p,v,u.Token.DEFAULT_CHANNEL,-1,-1,m.line,m.charPositionInLine)}getExpectedTokens(d){return d.getExpectedTokens()}getTokenErrorDisplay(d){if(!d)return"";let p=this.getSymbolText(d);return p||(this.getSymbolType(d)===u.Token.EOF?p="":p=`<${this.getSymbolType(d)}>`),this.escapeWSAndQuote(p)}getSymbolText(d){return d.text}getSymbolType(d){return d.type}escapeWSAndQuote(d){return d=d.replace(` -`,"\\n"),d=d.replace("\r","\\r"),d=d.replace(" ","\\t"),"'"+d+"'"}getErrorRecoverySet(d){let p=d.interpreter.atn,v=d.context,m=new s.IntervalSet;for(;v&&v.invokingState>=0;){let g=p.states[v.invokingState].transition(0),x=p.nextTokens(g.followState);m.addAll(x),v=v._parent}return m.remove(u.Token.EPSILON),m}consumeUntil(d,p){let v=d.inputStream.LA(1);for(;v!==u.Token.EOF&&!p.contains(v);)d.consume(),v=d.inputStream.LA(1)}};return n([c.Override],h.prototype,"reset",null),n([e(0,c.NotNull)],h.prototype,"beginErrorCondition",null),n([c.Override],h.prototype,"inErrorRecoveryMode",null),n([e(0,c.NotNull)],h.prototype,"endErrorCondition",null),n([c.Override],h.prototype,"reportMatch",null),n([c.Override],h.prototype,"reportError",null),n([e(0,c.NotNull)],h.prototype,"notifyErrorListeners",null),n([c.Override],h.prototype,"recover",null),n([c.Override],h.prototype,"sync",null),n([e(0,c.NotNull),e(1,c.NotNull)],h.prototype,"reportNoViableAlternative",null),n([e(0,c.NotNull),e(1,c.NotNull)],h.prototype,"reportInputMismatch",null),n([e(0,c.NotNull),e(1,c.NotNull)],h.prototype,"reportFailedPredicate",null),n([e(0,c.NotNull)],h.prototype,"reportUnwantedToken",null),n([e(0,c.NotNull)],h.prototype,"reportMissingToken",null),n([c.Override],h.prototype,"recoverInline",null),n([e(0,c.NotNull)],h.prototype,"singleTokenInsertion",null),n([e(0,c.NotNull)],h.prototype,"singleTokenDeletion",null),n([c.NotNull,e(0,c.NotNull)],h.prototype,"getMissingSymbol",null),n([c.NotNull,e(0,c.NotNull)],h.prototype,"getExpectedTokens",null),n([e(0,c.NotNull)],h.prototype,"getSymbolText",null),n([e(0,c.NotNull)],h.prototype,"getSymbolType",null),n([c.NotNull,e(0,c.NotNull)],h.prototype,"escapeWSAndQuote",null),n([c.NotNull,e(0,c.NotNull)],h.prototype,"getErrorRecoverySet",null),n([e(0,c.NotNull),e(1,c.NotNull)],h.prototype,"consumeUntil",null),ns.DefaultErrorStrategy=h,ns}var yx;function qS(){if(yx)return rs;yx=1;/*! + */var n=w&&w.__decorate||function(f,d,p,v){var m=arguments.length,y=m<3?d:v===null?v=Object.getOwnPropertyDescriptor(d,p):v,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,d,p,v);else for(var x=f.length-1;x>=0;x--)(g=f[x])&&(y=(m<3?g(y):m>3?g(d,p,y):g(d,p))||y);return m>3&&y&&Object.defineProperty(d,p,y),y},e=w&&w.__param||function(f,d){return function(p,v){d(p,v,f)}};Object.defineProperty(os,"__esModule",{value:!0}),os.DefaultErrorStrategy=void 0;const t=Gr,r=mt,i=Fo,o=$i,s=Wi(),l=th(),a=Tr(),u=ze,c=X;let h=class{constructor(){this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.nextTokensState=t.ATNState.INVALID_STATE_NUMBER}reset(d){this.endErrorCondition(d)}beginErrorCondition(d){this.errorRecoveryMode=!0}inErrorRecoveryMode(d){return this.errorRecoveryMode}endErrorCondition(d){this.errorRecoveryMode=!1,this.lastErrorStates=void 0,this.lastErrorIndex=-1}reportMatch(d){this.endErrorCondition(d)}reportError(d,p){this.inErrorRecoveryMode(d)||(this.beginErrorCondition(d),p instanceof l.NoViableAltException?this.reportNoViableAlternative(d,p):p instanceof o.InputMismatchException?this.reportInputMismatch(d,p):p instanceof i.FailedPredicateException?this.reportFailedPredicate(d,p):(console.error(`unknown recognition error type: ${p}`),this.notifyErrorListeners(d,p.toString(),p)))}notifyErrorListeners(d,p,v){let m=v.getOffendingToken(d);m===void 0&&(m=null),d.notifyErrorListeners(p,m,v)}recover(d,p){this.lastErrorIndex===d.inputStream.index&&this.lastErrorStates&&this.lastErrorStates.contains(d.state)&&d.consume(),this.lastErrorIndex=d.inputStream.index,this.lastErrorStates||(this.lastErrorStates=new s.IntervalSet),this.lastErrorStates.add(d.state);let v=this.getErrorRecoverySet(d);this.consumeUntil(d,v)}sync(d){let p=d.interpreter.atn.states[d.state];if(this.inErrorRecoveryMode(d))return;let m=d.inputStream.LA(1),y=d.atn.nextTokens(p);if(y.contains(m)){this.nextTokensContext=void 0,this.nextTokensState=t.ATNState.INVALID_STATE_NUMBER;return}if(y.contains(u.Token.EPSILON)){this.nextTokensContext===void 0&&(this.nextTokensContext=d.context,this.nextTokensState=d.state);return}switch(p.stateType){case r.ATNStateType.BLOCK_START:case r.ATNStateType.STAR_BLOCK_START:case r.ATNStateType.PLUS_BLOCK_START:case r.ATNStateType.STAR_LOOP_ENTRY:if(this.singleTokenDeletion(d))return;throw new o.InputMismatchException(d);case r.ATNStateType.PLUS_LOOP_BACK:case r.ATNStateType.STAR_LOOP_BACK:this.reportUnwantedToken(d);let x=d.getExpectedTokens().or(this.getErrorRecoverySet(d));this.consumeUntil(d,x);break}}reportNoViableAlternative(d,p){let v=d.inputStream,m;v?p.startToken.type===u.Token.EOF?m="":m=v.getTextFromRange(p.startToken,p.getOffendingToken()):m="";let y="no viable alternative at input "+this.escapeWSAndQuote(m);this.notifyErrorListeners(d,y,p)}reportInputMismatch(d,p){let v=p.expectedTokens,m=v?v.toStringVocabulary(d.vocabulary):"",y="mismatched input "+this.getTokenErrorDisplay(p.getOffendingToken(d))+" expecting "+m;this.notifyErrorListeners(d,y,p)}reportFailedPredicate(d,p){let m="rule "+d.ruleNames[d.context.ruleIndex]+" "+p.message;this.notifyErrorListeners(d,m,p)}reportUnwantedToken(d){if(this.inErrorRecoveryMode(d))return;this.beginErrorCondition(d);let p=d.currentToken,v=this.getTokenErrorDisplay(p),m=this.getExpectedTokens(d),y="extraneous input "+v+" expecting "+m.toStringVocabulary(d.vocabulary);d.notifyErrorListeners(y,p,void 0)}reportMissingToken(d){if(this.inErrorRecoveryMode(d))return;this.beginErrorCondition(d);let p=d.currentToken,m="missing "+this.getExpectedTokens(d).toStringVocabulary(d.vocabulary)+" at "+this.getTokenErrorDisplay(p);d.notifyErrorListeners(m,p,void 0)}recoverInline(d){let p=this.singleTokenDeletion(d);if(p)return d.consume(),p;if(this.singleTokenInsertion(d))return this.getMissingSymbol(d);throw this.nextTokensContext===void 0?new o.InputMismatchException(d):new o.InputMismatchException(d,this.nextTokensState,this.nextTokensContext)}singleTokenInsertion(d){let p=d.inputStream.LA(1),m=d.interpreter.atn.states[d.state].transition(0).target,y=d.interpreter.atn;return y.nextTokens(m,a.PredictionContext.fromRuleContext(y,d.context)).contains(p)?(this.reportMissingToken(d),!0):!1}singleTokenDeletion(d){let p=d.inputStream.LA(2);if(this.getExpectedTokens(d).contains(p)){this.reportUnwantedToken(d),d.consume();let m=d.currentToken;return this.reportMatch(d),m}}getMissingSymbol(d){let p=d.currentToken,v=this.getExpectedTokens(d),m=u.Token.INVALID_TYPE;v.isNil||(m=v.minElement);let y;m===u.Token.EOF?y="":y="";let g=p,x=d.inputStream.tryLT(-1);return g.type===u.Token.EOF&&x!=null&&(g=x),this.constructToken(d.inputStream.tokenSource,m,y,g)}constructToken(d,p,v,m){let y=d.tokenFactory,g=m.tokenSource,x=g?g.inputStream:void 0;return y.create({source:d,stream:x},p,v,u.Token.DEFAULT_CHANNEL,-1,-1,m.line,m.charPositionInLine)}getExpectedTokens(d){return d.getExpectedTokens()}getTokenErrorDisplay(d){if(!d)return"";let p=this.getSymbolText(d);return p||(this.getSymbolType(d)===u.Token.EOF?p="":p=`<${this.getSymbolType(d)}>`),this.escapeWSAndQuote(p)}getSymbolText(d){return d.text}getSymbolType(d){return d.type}escapeWSAndQuote(d){return d=d.replace(` +`,"\\n"),d=d.replace("\r","\\r"),d=d.replace(" ","\\t"),"'"+d+"'"}getErrorRecoverySet(d){let p=d.interpreter.atn,v=d.context,m=new s.IntervalSet;for(;v&&v.invokingState>=0;){let g=p.states[v.invokingState].transition(0),x=p.nextTokens(g.followState);m.addAll(x),v=v._parent}return m.remove(u.Token.EPSILON),m}consumeUntil(d,p){let v=d.inputStream.LA(1);for(;v!==u.Token.EOF&&!p.contains(v);)d.consume(),v=d.inputStream.LA(1)}};return n([c.Override],h.prototype,"reset",null),n([e(0,c.NotNull)],h.prototype,"beginErrorCondition",null),n([c.Override],h.prototype,"inErrorRecoveryMode",null),n([e(0,c.NotNull)],h.prototype,"endErrorCondition",null),n([c.Override],h.prototype,"reportMatch",null),n([c.Override],h.prototype,"reportError",null),n([e(0,c.NotNull)],h.prototype,"notifyErrorListeners",null),n([c.Override],h.prototype,"recover",null),n([c.Override],h.prototype,"sync",null),n([e(0,c.NotNull),e(1,c.NotNull)],h.prototype,"reportNoViableAlternative",null),n([e(0,c.NotNull),e(1,c.NotNull)],h.prototype,"reportInputMismatch",null),n([e(0,c.NotNull),e(1,c.NotNull)],h.prototype,"reportFailedPredicate",null),n([e(0,c.NotNull)],h.prototype,"reportUnwantedToken",null),n([e(0,c.NotNull)],h.prototype,"reportMissingToken",null),n([c.Override],h.prototype,"recoverInline",null),n([e(0,c.NotNull)],h.prototype,"singleTokenInsertion",null),n([e(0,c.NotNull)],h.prototype,"singleTokenDeletion",null),n([c.NotNull,e(0,c.NotNull)],h.prototype,"getMissingSymbol",null),n([c.NotNull,e(0,c.NotNull)],h.prototype,"getExpectedTokens",null),n([e(0,c.NotNull)],h.prototype,"getSymbolText",null),n([e(0,c.NotNull)],h.prototype,"getSymbolType",null),n([c.NotNull,e(0,c.NotNull)],h.prototype,"escapeWSAndQuote",null),n([c.NotNull,e(0,c.NotNull)],h.prototype,"getErrorRecoverySet",null),n([e(0,c.NotNull),e(1,c.NotNull)],h.prototype,"consumeUntil",null),os.DefaultErrorStrategy=h,os}var Ex;function Yb(){if(Ex)return is;Ex=1;/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(rs,"__esModule",{value:!0}),rs.BailErrorStrategy=void 0;const e=Hp(),t=Fi,r=J,i=xa;let o=class extends e.DefaultErrorStrategy{recover(l,a){for(let u=l.context;u;u=u.parent)u.exception=a;throw new i.ParseCancellationException(a)}recoverInline(l){let a=new t.InputMismatchException(l);for(let u=l.context;u;u=u.parent)u.exception=a;throw new i.ParseCancellationException(a)}sync(l){}};return n([r.Override],o.prototype,"recover",null),n([r.Override],o.prototype,"recoverInline",null),n([r.Override],o.prototype,"sync",null),rs.BailErrorStrategy=o,rs}var US={};/*! + */var n=w&&w.__decorate||function(s,l,a,u){var c=arguments.length,h=c<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(s,l,a,u);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(h=(c<3?f(h):c>3?f(l,a,h):f(l,a))||h);return c>3&&h&&Object.defineProperty(l,a,h),h};Object.defineProperty(is,"__esModule",{value:!0}),is.BailErrorStrategy=void 0;const e=Xp(),t=$i,r=X,i=ba;let o=class extends e.DefaultErrorStrategy{recover(l,a){for(let u=l.context;u;u=u.parent)u.exception=a;throw new i.ParseCancellationException(a)}recoverInline(l){let a=new t.InputMismatchException(l);for(let u=l.context;u;u=u.parent)u.exception=a;throw new i.ParseCancellationException(a)}sync(l){}};return n([r.Override],o.prototype,"recover",null),n([r.Override],o.prototype,"recoverInline",null),n([r.Override],o.prototype,"sync",null),is.BailErrorStrategy=o,is}var Jb={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(US,"__esModule",{value:!0});var VS={};(function(n){/*! + */Object.defineProperty(Jb,"__esModule",{value:!0});var Qb={};(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(n,"__esModule",{value:!0}),n.Dependents=void 0,function(e){e[e.SELF=0]="SELF",e[e.PARENTS=1]="PARENTS",e[e.CHILDREN=2]="CHILDREN",e[e.ANCESTORS=3]="ANCESTORS",e[e.DESCENDANTS=4]="DESCENDANTS",e[e.SIBLINGS=5]="SIBLINGS",e[e.PRECEEDING_SIBLINGS=6]="PRECEEDING_SIBLINGS",e[e.FOLLOWING_SIBLINGS=7]="FOLLOWING_SIBLINGS",e[e.PRECEEDING=8]="PRECEEDING",e[e.FOLLOWING=9]="FOLLOWING"}(n.Dependents||(n.Dependents={}))})(VS);var Qc={};/*! + */Object.defineProperty(n,"__esModule",{value:!0}),n.Dependents=void 0,function(e){e[e.SELF=0]="SELF",e[e.PARENTS=1]="PARENTS",e[e.CHILDREN=2]="CHILDREN",e[e.ANCESTORS=3]="ANCESTORS",e[e.DESCENDANTS=4]="DESCENDANTS",e[e.SIBLINGS=5]="SIBLINGS",e[e.PRECEEDING_SIBLINGS=6]="PRECEEDING_SIBLINGS",e[e.FOLLOWING_SIBLINGS=7]="FOLLOWING_SIBLINGS",e[e.PRECEEDING=8]="PRECEEDING",e[e.FOLLOWING=9]="FOLLOWING"}(n.Dependents||(n.Dependents={}))})(Qb);var rh={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Go=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},fr=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.DiagnosticErrorListener=void 0;const _P=Er,_t=J,xf=Ct;class Wi{constructor(e=!0){this.exactOnly=e,this.exactOnly=e}syntaxError(e,t,r,i,o,s){}reportAmbiguity(e,t,r,i,o,s,l){if(this.exactOnly&&!o)return;let a=this.getDecisionDescription(e,t),u=this.getConflictingAlts(s,l),c=e.inputStream.getText(xf.Interval.of(r,i)),h=`reportAmbiguity d=${a}: ambigAlts=${u}, input='${c}'`;e.notifyErrorListeners(h)}reportAttemptingFullContext(e,t,r,i,o,s){let l=this.getDecisionDescription(e,t),a=e.inputStream.getText(xf.Interval.of(r,i)),u=`reportAttemptingFullContext d=${l}, input='${a}'`;e.notifyErrorListeners(u)}reportContextSensitivity(e,t,r,i,o,s){let l=this.getDecisionDescription(e,t),a=e.inputStream.getText(xf.Interval.of(r,i)),u=`reportContextSensitivity d=${l}, input='${a}'`;e.notifyErrorListeners(u)}getDecisionDescription(e,t){let r=t.decision,i=t.atnStartState.ruleIndex,o=e.ruleNames;if(i<0||i>=o.length)return r.toString();let s=o[i];return s?`${r} (${s})`:r.toString()}getConflictingAlts(e,t){if(e!=null)return e;let r=new _P.BitSet;for(let i of t)r.set(i.alt);return r}}Go([_t.Override],Wi.prototype,"syntaxError",null);Go([_t.Override,fr(0,_t.NotNull),fr(1,_t.NotNull),fr(6,_t.NotNull)],Wi.prototype,"reportAmbiguity",null);Go([_t.Override,fr(0,_t.NotNull),fr(1,_t.NotNull),fr(5,_t.NotNull)],Wi.prototype,"reportAttemptingFullContext",null);Go([_t.Override,fr(0,_t.NotNull),fr(1,_t.NotNull),fr(5,_t.NotNull)],Wi.prototype,"reportContextSensitivity",null);Go([fr(0,_t.NotNull),fr(1,_t.NotNull)],Wi.prototype,"getDecisionDescription",null);Go([_t.NotNull,fr(1,_t.NotNull)],Wi.prototype,"getConflictingAlts",null);Qc.DiagnosticErrorListener=Wi;var Zc={};/*! + */var Xo=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},fr=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(rh,"__esModule",{value:!0});rh.DiagnosticErrorListener=void 0;const FP=Er,_t=X,Tf=Ct;class Xi{constructor(e=!0){this.exactOnly=e,this.exactOnly=e}syntaxError(e,t,r,i,o,s){}reportAmbiguity(e,t,r,i,o,s,l){if(this.exactOnly&&!o)return;let a=this.getDecisionDescription(e,t),u=this.getConflictingAlts(s,l),c=e.inputStream.getText(Tf.Interval.of(r,i)),h=`reportAmbiguity d=${a}: ambigAlts=${u}, input='${c}'`;e.notifyErrorListeners(h)}reportAttemptingFullContext(e,t,r,i,o,s){let l=this.getDecisionDescription(e,t),a=e.inputStream.getText(Tf.Interval.of(r,i)),u=`reportAttemptingFullContext d=${l}, input='${a}'`;e.notifyErrorListeners(u)}reportContextSensitivity(e,t,r,i,o,s){let l=this.getDecisionDescription(e,t),a=e.inputStream.getText(Tf.Interval.of(r,i)),u=`reportContextSensitivity d=${l}, input='${a}'`;e.notifyErrorListeners(u)}getDecisionDescription(e,t){let r=t.decision,i=t.atnStartState.ruleIndex,o=e.ruleNames;if(i<0||i>=o.length)return r.toString();let s=o[i];return s?`${r} (${s})`:r.toString()}getConflictingAlts(e,t){if(e!=null)return e;let r=new FP.BitSet;for(let i of t)r.set(i.alt);return r}}Xo([_t.Override],Xi.prototype,"syntaxError",null);Xo([_t.Override,fr(0,_t.NotNull),fr(1,_t.NotNull),fr(6,_t.NotNull)],Xi.prototype,"reportAmbiguity",null);Xo([_t.Override,fr(0,_t.NotNull),fr(1,_t.NotNull),fr(5,_t.NotNull)],Xi.prototype,"reportAttemptingFullContext",null);Xo([_t.Override,fr(0,_t.NotNull),fr(1,_t.NotNull),fr(5,_t.NotNull)],Xi.prototype,"reportContextSensitivity",null);Xo([fr(0,_t.NotNull),fr(1,_t.NotNull)],Xi.prototype,"getDecisionDescription",null);Xo([_t.NotNull,fr(1,_t.NotNull)],Xi.prototype,"getConflictingAlts",null);rh.DiagnosticErrorListener=Xi;var nh={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var Qn=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},TP=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.LexerInterpreter=void 0;const EP=Yn(),CP=wc(),WS=J,Xo=J;let qr=class extends EP.Lexer{constructor(e,t,r,i,o,s,l){if(super(l),s.grammarType!==0)throw new Error("IllegalArgumentException: The ATN must be a lexer ATN.");this._grammarFileName=e,this._atn=s,this._ruleNames=r.slice(0),this._channelNames=i.slice(0),this._modeNames=o.slice(0),this._vocabulary=t,this._interp=new CP.LexerATNSimulator(s,this)}get atn(){return this._atn}get grammarFileName(){return this._grammarFileName}get ruleNames(){return this._ruleNames}get channelNames(){return this._channelNames}get modeNames(){return this._modeNames}get vocabulary(){return this._vocabulary}};Qn([WS.NotNull],qr.prototype,"_vocabulary",void 0);Qn([Xo.Override],qr.prototype,"atn",null);Qn([Xo.Override],qr.prototype,"grammarFileName",null);Qn([Xo.Override],qr.prototype,"ruleNames",null);Qn([Xo.Override],qr.prototype,"channelNames",null);Qn([Xo.Override],qr.prototype,"modeNames",null);Qn([Xo.Override],qr.prototype,"vocabulary",null);qr=Qn([TP(1,WS.NotNull)],qr);Zc.LexerInterpreter=qr;var KS={};/*! + */var ri=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},BP=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(nh,"__esModule",{value:!0});nh.LexerInterpreter=void 0;const jP=Jn(),$P=Pc(),Zb=X,Yo=X;let Ur=class extends jP.Lexer{constructor(e,t,r,i,o,s,l){if(super(l),s.grammarType!==0)throw new Error("IllegalArgumentException: The ATN must be a lexer ATN.");this._grammarFileName=e,this._atn=s,this._ruleNames=r.slice(0),this._channelNames=i.slice(0),this._modeNames=o.slice(0),this._vocabulary=t,this._interp=new $P.LexerATNSimulator(s,this)}get atn(){return this._atn}get grammarFileName(){return this._grammarFileName}get ruleNames(){return this._ruleNames}get channelNames(){return this._channelNames}get modeNames(){return this._modeNames}get vocabulary(){return this._vocabulary}};ri([Zb.NotNull],Ur.prototype,"_vocabulary",void 0);ri([Yo.Override],Ur.prototype,"atn",null);ri([Yo.Override],Ur.prototype,"grammarFileName",null);ri([Yo.Override],Ur.prototype,"ruleNames",null);ri([Yo.Override],Ur.prototype,"channelNames",null);ri([Yo.Override],Ur.prototype,"modeNames",null);ri([Yo.Override],Ur.prototype,"vocabulary",null);Ur=ri([BP(1,Zb.NotNull)],Ur);nh.LexerInterpreter=Ur;var eS={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(KS,"__esModule",{value:!0});var eh={};/*! + */Object.defineProperty(eS,"__esModule",{value:!0});var ih={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var wP=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(eh,"__esModule",{value:!0});eh.RuleContextWithAltNum=void 0;const OP=xn(),NP=J,DP=wr();class GS extends DP.ParserRuleContext{constructor(e,t){t!==void 0?super(e,t):super(),this._altNumber=OP.ATN.INVALID_ALT_NUMBER}get altNumber(){return this._altNumber}set altNumber(e){this._altNumber=e}}wP([NP.Override],GS.prototype,"altNumber",null);eh.RuleContextWithAltNum=GS;var th={};/*! + */var HP=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(ih,"__esModule",{value:!0});ih.RuleContextWithAltNum=void 0;const zP=vn(),qP=X,UP=Or();class tS extends UP.ParserRuleContext{constructor(e,t){t!==void 0?super(e,t):super(),this._altNumber=zP.ATN.INVALID_ALT_NUMBER}get altNumber(){return this._altNumber}set altNumber(e){this._altNumber=e}}HP([qP.Override],tS.prototype,"altNumber",null);ih.RuleContextWithAltNum=tS;var oh={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(th,"__esModule",{value:!0});th.RuleDependency=void 0;function PP(n){return(e,t,r)=>{}}th.RuleDependency=PP;var rh={};/*! + */Object.defineProperty(oh,"__esModule",{value:!0});oh.RuleDependency=void 0;function VP(n){return(e,t,r)=>{}}oh.RuleDependency=VP;var sh={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(rh,"__esModule",{value:!0});rh.RuleVersion=void 0;function RP(n){return(e,t,r)=>{}}rh.RuleVersion=RP;var XS={};/*! + */Object.defineProperty(sh,"__esModule",{value:!0});sh.RuleVersion=void 0;function WP(n){return(e,t,r)=>{}}sh.RuleVersion=WP;var rS={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(XS,"__esModule",{value:!0});var YS={};/*! + */Object.defineProperty(rS,"__esModule",{value:!0});var nS={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(YS,"__esModule",{value:!0});var JS={};/*! + */Object.defineProperty(nS,"__esModule",{value:!0});var iS={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(JS,"__esModule",{value:!0});var Do={};/*! + */Object.defineProperty(iS,"__esModule",{value:!0});var Lo={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var nh=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Do,"__esModule",{value:!0});Do.RewriteOperation=Do.TokenStreamRewriter=void 0;const vx=Ct,ih=J,QS=ze;class wt{constructor(e){this.tokens=e,this.programs=new Map,this.programs.set(wt.DEFAULT_PROGRAM_NAME,[]),this.lastRewriteTokenIndexes=new Map}getTokenStream(){return this.tokens}rollback(e,t=wt.DEFAULT_PROGRAM_NAME){let r=this.programs.get(t);r!=null&&this.programs.set(t,r.slice(wt.MIN_TOKEN_INDEX,e))}deleteProgram(e=wt.DEFAULT_PROGRAM_NAME){this.rollback(wt.MIN_TOKEN_INDEX,e)}insertAfter(e,t,r=wt.DEFAULT_PROGRAM_NAME){let i;typeof e=="number"?i=e:i=e.tokenIndex;let o=this.getProgram(r),s=new Sx(this.tokens,i,o.length,t);o.push(s)}insertBefore(e,t,r=wt.DEFAULT_PROGRAM_NAME){let i;typeof e=="number"?i=e:i=e.tokenIndex;let o=this.getProgram(r),s=new oi(this.tokens,i,o.length,t);o.push(s)}replaceSingle(e,t){typeof e=="number"?this.replace(e,e,t):this.replace(e,e,t)}replace(e,t,r,i=wt.DEFAULT_PROGRAM_NAME){if(typeof e!="number"&&(e=e.tokenIndex),typeof t!="number"&&(t=t.tokenIndex),e>t||e<0||t<0||t>=this.tokens.size)throw new RangeError(`replace: range invalid: ${e}..${t}(size=${this.tokens.size})`);let o=this.getProgram(i),s=new io(this.tokens,e,t,o.length,r);o.push(s)}delete(e,t,r=wt.DEFAULT_PROGRAM_NAME){t===void 0&&(t=e),typeof e=="number"?this.replace(e,t,"",r):this.replace(e,t,"",r)}getLastRewriteTokenIndex(e=wt.DEFAULT_PROGRAM_NAME){let t=this.lastRewriteTokenIndexes.get(e);return t??-1}setLastRewriteTokenIndex(e,t){this.lastRewriteTokenIndexes.set(e,t)}getProgram(e){let t=this.programs.get(e);return t==null&&(t=this.initializeProgram(e)),t}initializeProgram(e){let t=[];return this.programs.set(e,t),t}getText(e,t=wt.DEFAULT_PROGRAM_NAME){let r;e instanceof vx.Interval?r=e:r=vx.Interval.of(0,this.tokens.size-1),typeof e=="string"&&(t=e);let i=this.programs.get(t),o=r.a,s=r.b;if(s>this.tokens.size-1&&(s=this.tokens.size-1),o<0&&(o=0),i==null||i.length===0)return this.tokens.getText(r);let l=[],a=this.reduceToSingleOperationPerIndex(i),u=o;for(;u<=s&&u=this.tokens.size-1&&l.push(c.text.toString());return l.join("")}reduceToSingleOperationPerIndex(e){for(let r=0;ro.index&&a.index<=o.lastIndex&&(e[a.instructionIndex]=void 0);let l=this.getKindOfOps(e,io,r);for(let a of l){if(a.index>=o.index&&a.lastIndex<=o.lastIndex){e[a.instructionIndex]=void 0;continue}let u=a.lastIndexo.lastIndex;if(a.text==null&&o.text==null&&!u)e[a.instructionIndex]=void 0,o.index=Math.min(a.index,o.index),o.lastIndex=Math.max(a.lastIndex,o.lastIndex);else if(!u)throw new Error(`replace op boundaries of ${o} overlap with previous ${a}`)}}for(let r=0;r=a.index&&o.index<=a.lastIndex)throw new Error(`insert op ${o} within boundaries of previous ${a}`)}}let t=new Map;for(let r of e)if(r!=null){if(t.get(r.index)!=null)throw new Error("should only be one op per index");t.set(r.index,r)}return t}catOpText(e,t){let r="",i="";return e!=null&&(r=e.toString()),t!=null&&(i=t.toString()),r+i}getKindOfOps(e,t,r){let i=[];for(let o=0;o'}}nh([ih.Override],oh.prototype,"toString",null);Do.RewriteOperation=oh;class oi extends oh{constructor(e,t,r,i){super(e,t,r,i)}execute(e){return e.push(this.text.toString()),this.tokens.get(this.index).type!==QS.Token.EOF&&e.push(String(this.tokens.get(this.index).text)),this.index+1}}nh([ih.Override],oi.prototype,"execute",null);class Sx extends oi{constructor(e,t,r,i){super(e,t+1,r,i)}}class io extends oh{constructor(e,t,r,i,o){super(e,t,i,o),this.lastIndex=r}execute(e){return this.text!=null&&e.push(this.text.toString()),this.lastIndex+1}toString(){return this.text==null?"":"'}}nh([ih.Override],io.prototype,"execute",null);nh([ih.Override],io.prototype,"toString",null);var ZS={};/*! + */var lh=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.RewriteOperation=Lo.TokenStreamRewriter=void 0;const Cx=Ct,ah=X,oS=ze;class wt{constructor(e){this.tokens=e,this.programs=new Map,this.programs.set(wt.DEFAULT_PROGRAM_NAME,[]),this.lastRewriteTokenIndexes=new Map}getTokenStream(){return this.tokens}rollback(e,t=wt.DEFAULT_PROGRAM_NAME){let r=this.programs.get(t);r!=null&&this.programs.set(t,r.slice(wt.MIN_TOKEN_INDEX,e))}deleteProgram(e=wt.DEFAULT_PROGRAM_NAME){this.rollback(wt.MIN_TOKEN_INDEX,e)}insertAfter(e,t,r=wt.DEFAULT_PROGRAM_NAME){let i;typeof e=="number"?i=e:i=e.tokenIndex;let o=this.getProgram(r),s=new wx(this.tokens,i,o.length,t);o.push(s)}insertBefore(e,t,r=wt.DEFAULT_PROGRAM_NAME){let i;typeof e=="number"?i=e:i=e.tokenIndex;let o=this.getProgram(r),s=new ui(this.tokens,i,o.length,t);o.push(s)}replaceSingle(e,t){typeof e=="number"?this.replace(e,e,t):this.replace(e,e,t)}replace(e,t,r,i=wt.DEFAULT_PROGRAM_NAME){if(typeof e!="number"&&(e=e.tokenIndex),typeof t!="number"&&(t=t.tokenIndex),e>t||e<0||t<0||t>=this.tokens.size)throw new RangeError(`replace: range invalid: ${e}..${t}(size=${this.tokens.size})`);let o=this.getProgram(i),s=new lo(this.tokens,e,t,o.length,r);o.push(s)}delete(e,t,r=wt.DEFAULT_PROGRAM_NAME){t===void 0&&(t=e),typeof e=="number"?this.replace(e,t,"",r):this.replace(e,t,"",r)}getLastRewriteTokenIndex(e=wt.DEFAULT_PROGRAM_NAME){let t=this.lastRewriteTokenIndexes.get(e);return t??-1}setLastRewriteTokenIndex(e,t){this.lastRewriteTokenIndexes.set(e,t)}getProgram(e){let t=this.programs.get(e);return t==null&&(t=this.initializeProgram(e)),t}initializeProgram(e){let t=[];return this.programs.set(e,t),t}getText(e,t=wt.DEFAULT_PROGRAM_NAME){let r;e instanceof Cx.Interval?r=e:r=Cx.Interval.of(0,this.tokens.size-1),typeof e=="string"&&(t=e);let i=this.programs.get(t),o=r.a,s=r.b;if(s>this.tokens.size-1&&(s=this.tokens.size-1),o<0&&(o=0),i==null||i.length===0)return this.tokens.getText(r);let l=[],a=this.reduceToSingleOperationPerIndex(i),u=o;for(;u<=s&&u=this.tokens.size-1&&l.push(c.text.toString());return l.join("")}reduceToSingleOperationPerIndex(e){for(let r=0;ro.index&&a.index<=o.lastIndex&&(e[a.instructionIndex]=void 0);let l=this.getKindOfOps(e,lo,r);for(let a of l){if(a.index>=o.index&&a.lastIndex<=o.lastIndex){e[a.instructionIndex]=void 0;continue}let u=a.lastIndexo.lastIndex;if(a.text==null&&o.text==null&&!u)e[a.instructionIndex]=void 0,o.index=Math.min(a.index,o.index),o.lastIndex=Math.max(a.lastIndex,o.lastIndex);else if(!u)throw new Error(`replace op boundaries of ${o} overlap with previous ${a}`)}}for(let r=0;r=a.index&&o.index<=a.lastIndex)throw new Error(`insert op ${o} within boundaries of previous ${a}`)}}let t=new Map;for(let r of e)if(r!=null){if(t.get(r.index)!=null)throw new Error("should only be one op per index");t.set(r.index,r)}return t}catOpText(e,t){let r="",i="";return e!=null&&(r=e.toString()),t!=null&&(i=t.toString()),r+i}getKindOfOps(e,t,r){let i=[];for(let o=0;o'}}lh([ah.Override],uh.prototype,"toString",null);Lo.RewriteOperation=uh;class ui extends uh{constructor(e,t,r,i){super(e,t,r,i)}execute(e){return e.push(this.text.toString()),this.tokens.get(this.index).type!==oS.Token.EOF&&e.push(String(this.tokens.get(this.index).text)),this.index+1}}lh([ah.Override],ui.prototype,"execute",null);class wx extends ui{constructor(e,t,r,i){super(e,t+1,r,i)}}class lo extends uh{constructor(e,t,r,i,o){super(e,t,i,o),this.lastIndex=r}execute(e){return this.text!=null&&e.push(this.text.toString()),this.lastIndex+1}toString(){return this.text==null?"":"'}}lh([ah.Override],lo.prototype,"execute",null);lh([ah.Override],lo.prototype,"toString",null);var sS={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(ZS,"__esModule",{value:!0});var e2={};/*! + */Object.defineProperty(sS,"__esModule",{value:!0});var lS={};/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */Object.defineProperty(e2,"__esModule",{value:!0});(function(n){/*! + */Object.defineProperty(lS,"__esModule",{value:!0});(function(n){/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. - */var e=w&&w.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o),Object.defineProperty(r,s,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),t=w&&w.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&e(i,r,o)};Object.defineProperty(n,"__esModule",{value:!0}),t(vv,n),t(Sv,n),t(cc,n),t(qS(),n),t(ma,n),t(US,n),t(Gc,n),t(jp,n),t(pa,n),t(Wn,n),t(Sc,n),t(Wo,n),t(Gl,n),t(Hp(),n),t(VS,n),t(Qc,n),t(ko,n),t(Fi,n),t(jS(),n),t(pn,n),t(Yn(),n),t(Zc,n),t(Hi,n),t(ga,n),t(Jc(),n),t(va(),n),t(KS,n),t($S(),n),t(wr(),n),t(Mo,n),t(da,n),t(Gr,n),t(Kn,n),t(NS(),n),t(eh,n),t(th,n),t(rh,n),t(ze,n),t(XS,n),t(YS,n),t(JS,n),t(Do,n),t(ZS,n),t(gn,n),t(e2,n)})(pd);var t2=kp(),LP=Yn(),kP=wc();const Se=class Se extends LP.Lexer{get vocabulary(){return Se.VOCABULARY}constructor(e){super(e),this._interp=new kP.LexerATNSimulator(Se._ATN,this)}get grammarFileName(){return"YorkieSchema.g4"}get ruleNames(){return Se.ruleNames}get serializedATN(){return Se._serializedATN}get channelNames(){return Se.channelNames}get modeNames(){return Se.modeNames}static get _ATN(){return Se.__ATN||(Se.__ATN=new t2.ATNDeserializer().deserialize(_p(Se._serializedATN))),Se.__ATN}};te(Se,"T__0",1),te(Se,"T__1",2),te(Se,"T__2",3),te(Se,"T__3",4),te(Se,"T__4",5),te(Se,"T__5",6),te(Se,"T__6",7),te(Se,"T__7",8),te(Se,"T__8",9),te(Se,"T__9",10),te(Se,"T__10",11),te(Se,"T__11",12),te(Se,"T__12",13),te(Se,"T__13",14),te(Se,"T__14",15),te(Se,"T__15",16),te(Se,"T__16",17),te(Se,"T__17",18),te(Se,"T__18",19),te(Se,"T__19",20),te(Se,"T__20",21),te(Se,"T__21",22),te(Se,"T__22",23),te(Se,"T__23",24),te(Se,"T__24",25),te(Se,"T__25",26),te(Se,"T__26",27),te(Se,"T__27",28),te(Se,"T__28",29),te(Se,"T__29",30),te(Se,"Identifier",31),te(Se,"StringLiteral",32),te(Se,"NumberLiteral",33),te(Se,"BooleanLiteral",34),te(Se,"SingleLineComment",35),te(Se,"MultiLineComment",36),te(Se,"WS",37),te(Se,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),te(Se,"modeNames",["DEFAULT_MODE"]),te(Se,"ruleNames",["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","T__20","T__21","T__22","T__23","T__24","T__25","T__26","T__27","T__28","T__29","Identifier","StringLiteral","NumberLiteral","BooleanLiteral","SingleLineComment","MultiLineComment","WS"]),te(Se,"_LITERAL_NAMES",[void 0,"'type'","'='","';'","'let'","':'","'|'","'&'","'['","']'","'number'","'string'","'boolean'","'any'","'void'","'null'","'undefined'","'{'","'}'","'?'","'yorkie.Object'","'yorkie.Array'","'yorkie.Counter'","'yorkie.Text'","'yorkie.Tree'","'('","')'","'<'","','","'>'","'extends'"]),te(Se,"_SYMBOLIC_NAMES",[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"Identifier","StringLiteral","NumberLiteral","BooleanLiteral","SingleLineComment","MultiLineComment","WS"]),te(Se,"VOCABULARY",new wp(Se._LITERAL_NAMES,Se._SYMBOLIC_NAMES,[])),te(Se,"_serializedATN",`줝쪺֍꾺体؇쉁'Ĵ\b     \x07 \x07\b \b  + */var e=w&&w.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o),Object.defineProperty(r,s,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),t=w&&w.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&e(i,r,o)};Object.defineProperty(n,"__esModule",{value:!0}),t(Cv,n),t(wv,n),t(pc,n),t(Yb(),n),t(ya,n),t(Jb,n),t(Qc,n),t(Kp,n),t(xa,n),t(Kn,n),t(Tc,n),t(Ko,n),t(Jl,n),t(Xp(),n),t(Qb,n),t(rh,n),t(Fo,n),t($i,n),t(Wb(),n),t(gn,n),t(Jn(),n),t(nh,n),t(Vi,n),t(va,n),t(th(),n),t(Aa(),n),t(eS,n),t(Kb(),n),t(Or(),n),t($o,n),t(ga,n),t(Xr,n),t(Gn,n),t(Mb(),n),t(ih,n),t(oh,n),t(sh,n),t(ze,n),t(rS,n),t(nS,n),t(iS,n),t(Lo,n),t(sS,n),t(yn,n),t(lS,n)})(Ad);var aS=zp(),KP=Jn(),GP=Pc();const ve=class ve extends KP.Lexer{get vocabulary(){return ve.VOCABULARY}constructor(e){super(e),this._interp=new GP.LexerATNSimulator(ve._ATN,this)}get grammarFileName(){return"YorkieSchema.g4"}get ruleNames(){return ve.ruleNames}get serializedATN(){return ve._serializedATN}get channelNames(){return ve.channelNames}get modeNames(){return ve.modeNames}static get _ATN(){return ve.__ATN||(ve.__ATN=new aS.ATNDeserializer().deserialize(Pp(ve._serializedATN))),ve.__ATN}};te(ve,"T__0",1),te(ve,"T__1",2),te(ve,"T__2",3),te(ve,"T__3",4),te(ve,"T__4",5),te(ve,"T__5",6),te(ve,"T__6",7),te(ve,"T__7",8),te(ve,"T__8",9),te(ve,"T__9",10),te(ve,"T__10",11),te(ve,"T__11",12),te(ve,"T__12",13),te(ve,"T__13",14),te(ve,"T__14",15),te(ve,"T__15",16),te(ve,"T__16",17),te(ve,"T__17",18),te(ve,"T__18",19),te(ve,"T__19",20),te(ve,"T__20",21),te(ve,"T__21",22),te(ve,"T__22",23),te(ve,"T__23",24),te(ve,"T__24",25),te(ve,"T__25",26),te(ve,"T__26",27),te(ve,"T__27",28),te(ve,"T__28",29),te(ve,"T__29",30),te(ve,"T__30",31),te(ve,"Identifier",32),te(ve,"StringLiteral",33),te(ve,"NumberLiteral",34),te(ve,"BooleanLiteral",35),te(ve,"SingleLineComment",36),te(ve,"MultiLineComment",37),te(ve,"WS",38),te(ve,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),te(ve,"modeNames",["DEFAULT_MODE"]),te(ve,"ruleNames",["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","T__20","T__21","T__22","T__23","T__24","T__25","T__26","T__27","T__28","T__29","T__30","Identifier","StringLiteral","NumberLiteral","BooleanLiteral","SingleLineComment","MultiLineComment","WS"]),te(ve,"_LITERAL_NAMES",[void 0,"'type'","'='","';'","'let'","':'","'|'","'&'","'['","']'","'Array'","'number'","'string'","'boolean'","'any'","'void'","'null'","'undefined'","'{'","'}'","'?'","'yorkie.Object'","'yorkie.Array'","'yorkie.Counter'","'yorkie.Text'","'yorkie.Tree'","'('","')'","'<'","','","'>'","'extends'"]),te(ve,"_SYMBOLIC_NAMES",[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"Identifier","StringLiteral","NumberLiteral","BooleanLiteral","SingleLineComment","MultiLineComment","WS"]),te(ve,"VOCABULARY",new Ip(ve._LITERAL_NAMES,ve._SYMBOLIC_NAMES,[])),te(ve,"_serializedATN",`줝쪺֍꾺体؇쉁(ļ\b     \x07 \x07\b \b  -\v \v\f \f\r \r             \x1B \x1B     ! !" "# #$ $% %& &\x07\x07\b\b   +\v \v\f \f\r \r             \x1B \x1B     ! !" "# #$ $% %& &' '\x07\x07\b\b    -\v\v\v\v\v\v\v\f\f\f\f\f\f\f\r\r\r\r\r\r\r\r\x1B\x1B  \x07 ï - \f  ò\v !!\x07!ö -!\f!!ù\v!!!""þ -"\r""ÿ"""Ą -"\r""ą"Ĉ -"##########ē -#$$$$\x07$ę -$\f$$Ĝ\v$$$%%%%\x07%Ĥ -%\f%%ħ\v%%%%%%&&į -&\r&&İ&&ĥ'\x07 \v\x07\r\b  -\v\f\r\x1B!#%')+-/13\x1B579;= ?!A"C#E$G%I&K'\bC\\aac|2;C\\aac|\f\f$$2;\f\f\v\f""ļ\x07 \v\r\x1B!#%')+-/13579;=?ACEGIKMR\x07T V\vZ\r\\^\`bdkr\x1Bz~ƒ!ˆ#’%”'–)˜+¦-³/Â1Î3Ú5Ü7Þ9à;â=ä?ìAóCýEĒGĔIğKĮMN\x07vNO\x07{OP\x07rPQ\x07gQRS\x07?STU\x07=U\bVW\x07nWX\x07gXY\x07vY -Z[\x07<[\f\\]\x07~]^_\x07(_\`a\x07]abc\x07_cde\x07pef\x07wfg\x07ogh\x07dhi\x07gij\x07tjkl\x07ulm\x07vmn\x07tno\x07kop\x07ppq\x07iqrs\x07dst\x07qtu\x07quv\x07nvw\x07gwx\x07cxy\x07pyz{\x07c{|\x07p|}\x07{}~\x07x€\x07q€\x07k‚\x07f‚ƒ„\x07p„…\x07w…†\x07n†‡\x07n‡ ˆ‰\x07w‰Š\x07pŠ‹\x07f‹Œ\x07gŒ\x07hŽ\x07kŽ\x07p\x07g‘\x07f‘"’“\x07}“$”•\x07•&–—\x07A—(˜™\x07{™š\x07qš›\x07t›œ\x07mœ\x07kž\x07gžŸ\x070Ÿ \x07Q ¡\x07d¡¢\x07l¢£\x07g£¤\x07e¤¥\x07v¥*¦§\x07{§¨\x07q¨©\x07t©ª\x07mª«\x07k«¬\x07g¬­\x070­®\x07C®¯\x07t¯°\x07t°±\x07c±²\x07{²,³´\x07{´µ\x07qµ¶\x07t¶·\x07m·¸\x07k¸¹\x07g¹º\x070º»\x07E»¼\x07q¼½\x07w½¾\x07p¾¿\x07v¿À\x07gÀÁ\x07tÁ.ÂÃ\x07{ÃÄ\x07qÄÅ\x07tÅÆ\x07mÆÇ\x07kÇÈ\x07gÈÉ\x070ÉÊ\x07VÊË\x07gËÌ\x07zÌÍ\x07vÍ0ÎÏ\x07{ÏÐ\x07qÐÑ\x07tÑÒ\x07mÒÓ\x07kÓÔ\x07gÔÕ\x070ÕÖ\x07VÖ×\x07t×Ø\x07gØÙ\x07gÙ2ÚÛ\x07*Û4ÜÝ\x07+Ý6Þß\x07>ß8àá\x07.á:âã\x07@ã<äå\x07gåæ\x07zæç\x07vçè\x07gèé\x07péê\x07fêë\x07uë>ìð íï îíïòðîðññ@òðó÷\x07$ôö -õôöù÷õ÷øøúù÷úû\x07$ûBüþ ýüþÿÿýÿĀĀćāă\x070ĂĄ ăĂĄąąăąĆĆĈćāćĈĈDĉĊ\x07vĊċ\x07tċČ\x07wČē\x07gčĎ\x07hĎď\x07cďĐ\x07nĐđ\x07uđē\x07gĒĉĒčēFĔĕ\x071ĕĖ\x071ĖĚėę -ĘėęĜĚĘĚěěĝĜĚĝĞ\b$ĞHğĠ\x071Ġġ\x07,ġĥĢĤ\vģĢĤħĥĦĥģĦĨħĥĨĩ\x07,ĩĪ\x071ĪīīĬ\b%ĬJĭį \x07ĮĭįİİĮİııIJIJij\b&ijL\fð÷ÿąćĒĚĥİ\b`),te(Se,"__ATN");let Rd=Se;var Ja=Jc(),IP=va(),Qe=wr(),FP=ua();const $=class $ extends IP.Parser{get vocabulary(){return $.VOCABULARY}get grammarFileName(){return"YorkieSchema.g4"}get ruleNames(){return $.ruleNames}get serializedATN(){return $._serializedATN}createFailedPredicateException(e,t){return new nS(this,e,t)}constructor(e){super(e),this._interp=new FP.ParserATNSimulator($._ATN,this)}document(){let e=new MP(this._ctx,this.state);this.enterRule(e,0,$.RULE_document);let t;try{this.enterOuterAlt(e,1);{for(this.state=47,this._errHandler.sync(this),t=this._input.LA(1);t===$.T__0||t===$.T__3;)this.state=44,this.declaration(),this.state=49,this._errHandler.sync(this),t=this._input.LA(1);this.state=50,this.match($.EOF)}}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}declaration(){let e=new Ld(this._ctx,this.state);this.enterRule(e,2,$.RULE_declaration);try{switch(this.state=54,this._errHandler.sync(this),this._input.LA(1)){case $.T__0:this.enterOuterAlt(e,1),this.state=52,this.typeAliasDeclaration();break;case $.T__3:this.enterOuterAlt(e,2),this.state=53,this.variableDeclaration();break;default:throw new Ja.NoViableAltException(this)}}catch(t){if(t instanceof Ye)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}typeAliasDeclaration(){let e=new r2(this._ctx,this.state);this.enterRule(e,4,$.RULE_typeAliasDeclaration);let t;try{this.enterOuterAlt(e,1),this.state=56,this.match($.T__0),this.state=57,this.match($.Identifier),this.state=59,this._errHandler.sync(this),t=this._input.LA(1),t===$.T__26&&(this.state=58,this.typeParameters()),this.state=61,this.match($.T__1),this.state=62,this.type(),this.state=63,this.match($.T__2)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}variableDeclaration(){let e=new n2(this._ctx,this.state);this.enterRule(e,6,$.RULE_variableDeclaration);let t;try{this.enterOuterAlt(e,1),this.state=65,this.match($.T__3),this.state=66,this.match($.Identifier),this.state=68,this._errHandler.sync(this),t=this._input.LA(1),t===$.T__4&&(this.state=67,this.typeAnnotation()),this.state=72,this._errHandler.sync(this),t=this._input.LA(1),t===$.T__1&&(this.state=70,this.match($.T__1),this.state=71,this.expression()),this.state=74,this.match($.T__2)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}typeAnnotation(){let e=new zp(this._ctx,this.state);this.enterRule(e,8,$.RULE_typeAnnotation);try{this.enterOuterAlt(e,1),this.state=76,this.match($.T__4),this.state=77,this.type()}catch(t){if(t instanceof Ye)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}type(){let e=new Ri(this._ctx,this.state);this.enterRule(e,10,$.RULE_type);try{this.enterOuterAlt(e,1),this.state=79,this.unionType()}catch(t){if(t instanceof Ye)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}unionType(){let e=new i2(this._ctx,this.state);this.enterRule(e,12,$.RULE_unionType);let t;try{for(this.enterOuterAlt(e,1),this.state=81,this.intersectionType(),this.state=86,this._errHandler.sync(this),t=this._input.LA(1);t===$.T__5;)this.state=82,this.match($.T__5),this.state=83,this.intersectionType(),this.state=88,this._errHandler.sync(this),t=this._input.LA(1)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}intersectionType(){let e=new kd(this._ctx,this.state);this.enterRule(e,14,$.RULE_intersectionType);let t;try{for(this.enterOuterAlt(e,1),this.state=89,this.arrayType(),this.state=94,this._errHandler.sync(this),t=this._input.LA(1);t===$.T__6;)this.state=90,this.match($.T__6),this.state=91,this.arrayType(),this.state=96,this._errHandler.sync(this),t=this._input.LA(1)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}arrayType(){let e=new Id(this._ctx,this.state);this.enterRule(e,16,$.RULE_arrayType);let t;try{for(this.enterOuterAlt(e,1),this.state=97,this.primaryType(),this.state=102,this._errHandler.sync(this),t=this._input.LA(1);t===$.T__7;)this.state=98,this.match($.T__7),this.state=99,this.match($.T__8),this.state=104,this._errHandler.sync(this),t=this._input.LA(1)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}primaryType(){let e=new o2(this._ctx,this.state);this.enterRule(e,18,$.RULE_primaryType);try{switch(this.state=111,this._errHandler.sync(this),this._input.LA(1)){case $.T__24:this.enterOuterAlt(e,1),this.state=105,this.parenthesizedType();break;case $.T__9:case $.T__10:case $.T__11:case $.T__12:case $.T__13:case $.T__14:case $.T__15:this.enterOuterAlt(e,2),this.state=106,this.primitiveType();break;case $.T__16:this.enterOuterAlt(e,3),this.state=107,this.objectType();break;case $.T__19:case $.T__20:case $.T__21:case $.T__22:case $.T__23:this.enterOuterAlt(e,4),this.state=108,this.yorkieType();break;case $.Identifier:this.enterOuterAlt(e,5),this.state=109,this.typeReference();break;case $.StringLiteral:case $.NumberLiteral:case $.BooleanLiteral:this.enterOuterAlt(e,6),this.state=110,this.literal();break;default:throw new Ja.NoViableAltException(this)}}catch(t){if(t instanceof Ye)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}primitiveType(){let e=new s2(this._ctx,this.state);this.enterRule(e,20,$.RULE_primitiveType);let t;try{this.enterOuterAlt(e,1),this.state=113,t=this._input.LA(1),!(t&-32)&&1<'","'extends'"]),te($,"_SYMBOLIC_NAMES",[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"Identifier","StringLiteral","NumberLiteral","BooleanLiteral","SingleLineComment","MultiLineComment","WS"]),te($,"VOCABULARY",new wp($._LITERAL_NAMES,$._SYMBOLIC_NAMES,[])),te($,"_serializedATN",`줝쪺֍꾺体؇쉁'à     \x07 \x07\b \b  +\v\v\v\v\v\v\f\f\f\f\f\f\f\r\r\r\r\r\r\r\x1B\x1B        !!\x07!÷ +!\f!!ú\v!""\x07"þ +"\f""ā\v"""##Ć +#\r##ć###Č +#\r##č#Đ +#$$$$$$$$$$ě +$%%%%\x07%ġ +%\f%%Ĥ\v%%%&&&&\x07&Ĭ +&\f&&į\v&&&&&&''ķ +'\r''ĸ''ĭ(\x07 \v\x07\r\b  +\v\f\r\x1B!#%')+-/13\x1B579;= ?!A"C#E$G%I&K'M(\bC\\aac|2;C\\aac|\f\f$$2;\f\f\v\f""ń\x07 \v\r\x1B!#%')+-/13579;=?ACEGIKMOT\x07V X\v\\\r^\`bdfls\x1Bz‚†!‹#%š'œ)ž+ -®/»1Ê3Ö5â7ä9æ;è=ê?ìAôCûEąGĚIĜKħMĶOP\x07vPQ\x07{QR\x07rRS\x07gSTU\x07?UVW\x07=W\bXY\x07nYZ\x07gZ[\x07v[ +\\]\x07<]\f^_\x07~_\`a\x07(abc\x07]cde\x07_efg\x07Cgh\x07thi\x07tij\x07cjk\x07{klm\x07pmn\x07wno\x07oop\x07dpq\x07gqr\x07trst\x07utu\x07vuv\x07tvw\x07kwx\x07pxy\x07iyz{\x07d{|\x07q|}\x07q}~\x07n~\x07g€\x07c€\x07p‚ƒ\x07cƒ„\x07p„…\x07{…†‡\x07x‡ˆ\x07qˆ‰\x07k‰Š\x07fŠ ‹Œ\x07pŒ\x07wŽ\x07nŽ\x07n"‘\x07w‘’\x07p’“\x07f“”\x07g”•\x07h•–\x07k–—\x07p—˜\x07g˜™\x07f™$š›\x07}›&œ\x07(žŸ\x07AŸ* ¡\x07{¡¢\x07q¢£\x07t£¤\x07m¤¥\x07k¥¦\x07g¦§\x070§¨\x07Q¨©\x07d©ª\x07lª«\x07g«¬\x07e¬­\x07v­,®¯\x07{¯°\x07q°±\x07t±²\x07m²³\x07k³´\x07g´µ\x070µ¶\x07C¶·\x07t·¸\x07t¸¹\x07c¹º\x07{º.»¼\x07{¼½\x07q½¾\x07t¾¿\x07m¿À\x07kÀÁ\x07gÁÂ\x070ÂÃ\x07EÃÄ\x07qÄÅ\x07wÅÆ\x07pÆÇ\x07vÇÈ\x07gÈÉ\x07tÉ0ÊË\x07{ËÌ\x07qÌÍ\x07tÍÎ\x07mÎÏ\x07kÏÐ\x07gÐÑ\x070ÑÒ\x07VÒÓ\x07gÓÔ\x07zÔÕ\x07vÕ2Ö×\x07{×Ø\x07qØÙ\x07tÙÚ\x07mÚÛ\x07kÛÜ\x07gÜÝ\x070ÝÞ\x07VÞß\x07tßà\x07gàá\x07gá4âã\x07*ã6äå\x07+å8æç\x07>ç:èé\x07.é<êë\x07@ë>ìí\x07gíî\x07zîï\x07vïð\x07gðñ\x07pñò\x07fòó\x07uó@ôø õ÷ öõ÷úøöøùùBúøûÿ\x07$üþ +ýüþāÿýÿĀĀĂāÿĂă\x07$ăDĄĆ ąĄĆććąćĈĈďĉċ\x070ĊČ ċĊČččċčĎĎĐďĉďĐĐFđĒ\x07vĒē\x07tēĔ\x07wĔě\x07gĕĖ\x07hĖė\x07cėĘ\x07nĘę\x07uęě\x07gĚđĚĕěHĜĝ\x071ĝĞ\x071ĞĢğġ +ĠğġĤĢĠĢģģĥĤĢĥĦ\b%ĦJħĨ\x071Ĩĩ\x07,ĩĭĪĬ\vīĪĬįĭĮĭīĮİįĭİı\x07,ıIJ\x071IJijijĴ\b&ĴLĵķ \x07ĶĵķĸĸĶĸĹĹĺĺĻ\b'ĻN\føÿćčďĚĢĭĸ\b`),te(ve,"__ATN");let $d=ve;var el=th(),XP=Aa(),Qe=Or(),YP=fa();const k=class k extends XP.Parser{get vocabulary(){return k.VOCABULARY}get grammarFileName(){return"YorkieSchema.g4"}get ruleNames(){return k.ruleNames}get serializedATN(){return k._serializedATN}createFailedPredicateException(e,t){return new cb(this,e,t)}constructor(e){super(e),this._interp=new YP.ParserATNSimulator(k._ATN,this)}document(){let e=new JP(this._ctx,this.state);this.enterRule(e,0,k.RULE_document);let t;try{this.enterOuterAlt(e,1);{for(this.state=47,this._errHandler.sync(this),t=this._input.LA(1);t===k.T__0||t===k.T__3;)this.state=44,this.declaration(),this.state=49,this._errHandler.sync(this),t=this._input.LA(1);this.state=50,this.match(k.EOF)}}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}declaration(){let e=new Hd(this._ctx,this.state);this.enterRule(e,2,k.RULE_declaration);try{switch(this.state=54,this._errHandler.sync(this),this._input.LA(1)){case k.T__0:this.enterOuterAlt(e,1),this.state=52,this.typeAliasDeclaration();break;case k.T__3:this.enterOuterAlt(e,2),this.state=53,this.variableDeclaration();break;default:throw new el.NoViableAltException(this)}}catch(t){if(t instanceof Ye)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}typeAliasDeclaration(){let e=new uS(this._ctx,this.state);this.enterRule(e,4,k.RULE_typeAliasDeclaration);let t;try{this.enterOuterAlt(e,1),this.state=56,this.match(k.T__0),this.state=57,this.match(k.Identifier),this.state=59,this._errHandler.sync(this),t=this._input.LA(1),t===k.T__27&&(this.state=58,this.typeParameters()),this.state=61,this.match(k.T__1),this.state=62,this.type(),this.state=63,this.match(k.T__2)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}variableDeclaration(){let e=new cS(this._ctx,this.state);this.enterRule(e,6,k.RULE_variableDeclaration);let t;try{this.enterOuterAlt(e,1),this.state=65,this.match(k.T__3),this.state=66,this.match(k.Identifier),this.state=68,this._errHandler.sync(this),t=this._input.LA(1),t===k.T__4&&(this.state=67,this.typeAnnotation()),this.state=72,this._errHandler.sync(this),t=this._input.LA(1),t===k.T__1&&(this.state=70,this.match(k.T__1),this.state=71,this.expression()),this.state=74,this.match(k.T__2)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}typeAnnotation(){let e=new Yp(this._ctx,this.state);this.enterRule(e,8,k.RULE_typeAnnotation);try{this.enterOuterAlt(e,1),this.state=76,this.match(k.T__4),this.state=77,this.type()}catch(t){if(t instanceof Ye)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}type(){let e=new Mi(this._ctx,this.state);this.enterRule(e,10,k.RULE_type);try{this.enterOuterAlt(e,1),this.state=79,this.unionType()}catch(t){if(t instanceof Ye)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}unionType(){let e=new hS(this._ctx,this.state);this.enterRule(e,12,k.RULE_unionType);let t;try{for(this.enterOuterAlt(e,1),this.state=81,this.intersectionType(),this.state=86,this._errHandler.sync(this),t=this._input.LA(1);t===k.T__5;)this.state=82,this.match(k.T__5),this.state=83,this.intersectionType(),this.state=88,this._errHandler.sync(this),t=this._input.LA(1)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}intersectionType(){let e=new zd(this._ctx,this.state);this.enterRule(e,14,k.RULE_intersectionType);let t;try{for(this.enterOuterAlt(e,1),this.state=89,this.arrayType(),this.state=94,this._errHandler.sync(this),t=this._input.LA(1);t===k.T__6;)this.state=90,this.match(k.T__6),this.state=91,this.arrayType(),this.state=96,this._errHandler.sync(this),t=this._input.LA(1)}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}arrayType(){let e=new qd(this._ctx,this.state);this.enterRule(e,16,k.RULE_arrayType);let t;try{switch(this.state=107,this._errHandler.sync(this),this._input.LA(1)){case k.T__10:case k.T__11:case k.T__12:case k.T__13:case k.T__14:case k.T__15:case k.T__16:case k.T__17:case k.T__20:case k.T__21:case k.T__22:case k.T__23:case k.T__24:case k.T__25:case k.Identifier:case k.StringLiteral:case k.NumberLiteral:case k.BooleanLiteral:for(this.enterOuterAlt(e,1),this.state=97,this.primaryType(),this.state=102,this._errHandler.sync(this),t=this._input.LA(1);t===k.T__7;)this.state=98,this.match(k.T__7),this.state=99,this.match(k.T__8),this.state=104,this._errHandler.sync(this),t=this._input.LA(1);break;case k.T__9:this.enterOuterAlt(e,2),this.state=105,this.match(k.T__9),this.state=106,this.typeArguments();break;default:throw new el.NoViableAltException(this)}}catch(r){if(r instanceof Ye)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}primaryType(){let e=new fS(this._ctx,this.state);this.enterRule(e,18,k.RULE_primaryType);try{switch(this.state=115,this._errHandler.sync(this),this._input.LA(1)){case k.T__25:this.enterOuterAlt(e,1),this.state=109,this.parenthesizedType();break;case k.T__10:case k.T__11:case k.T__12:case k.T__13:case k.T__14:case k.T__15:case k.T__16:this.enterOuterAlt(e,2),this.state=110,this.primitiveType();break;case k.T__17:this.enterOuterAlt(e,3),this.state=111,this.objectType();break;case k.T__20:case k.T__21:case k.T__22:case k.T__23:case k.T__24:this.enterOuterAlt(e,4),this.state=112,this.yorkieType();break;case k.Identifier:this.enterOuterAlt(e,5),this.state=113,this.typeReference();break;case k.StringLiteral:case k.NumberLiteral:case k.BooleanLiteral:this.enterOuterAlt(e,6),this.state=114,this.literal();break;default:throw new el.NoViableAltException(this)}}catch(t){if(t instanceof Ye)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}primitiveType(){let e=new dS(this._ctx,this.state);this.enterRule(e,20,k.RULE_primitiveType);let t;try{this.enterOuterAlt(e,1),this.state=117,t=this._input.LA(1),!(t&-32)&&1<'","'extends'"]),te(k,"_SYMBOLIC_NAMES",[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"Identifier","StringLiteral","NumberLiteral","BooleanLiteral","SingleLineComment","MultiLineComment","WS"]),te(k,"VOCABULARY",new Ip(k._LITERAL_NAMES,k._SYMBOLIC_NAMES,[])),te(k,"_serializedATN",`줝쪺֍꾺体؇쉁(Ç     \x07 \x07\b \b  \v \v\f \f\r \r          \x070 \f3\v9 @@ -597,26 +597,58 @@ g \f  j\v -\v\v\v\v\v\v\vr -\v\f\f\r\r\x07\rx -\r\f\r\r{\v\r\r\r -Ž -’ + + + +n + +\v\v\v\v\v\v\vv +\v\f\f\r\r\x07\r| +\r\f\r\r\v\r\r\r… +’ – -˜ -œ -\x07¦ -\f©\v° -\x07¶ -\f¹\v¿ +š +œ +  +\x07ª +\f­\v´ +\x07º +\f½\và \b -\f "$&(*,\f!""$Ç18:\bC -N\fQS[cqsu~…— ™"$¡&¬(±*¾,À.0/.031/12243145\x0756979\b86879:;\x07;=\x07!<>$=<=>>??@\x07@A\f\x07AB\x07B\x07CD\x07DF\x07!EG +\f "$&(*,\r"##%Ì18:\bC +N\fQS[muwy‚‰› "¡$¥&°(µ*Â,Ä.0/.031/12243145\x0756979\b86879:;\x07;=\x07"<>$=<=>>??@\x07@A\f\x07AB\x07B\x07CD\x07DF\x07"EG FEFGGJHI\x07IK*JHJKKLLM\x07M NO\x07\x07OP\f\x07P\vQR\bR\rSX TU\x07\bUW VTWZXVXYYZX[\` \\]\x07 ]_ ^\\_b\`^\`aab\`ch\vde\x07 -eg\x07\vfdgjhfhiijhkr"lr\fmr\rnror pr,qkqlqmqnqoqprst tuy\x07vxwvx{ywyzz|{y|}\x07}~€\x07€€‚‚ƒ -ƒ„\x07„\x1B…† †‡ˆ\x07ˆ˜(‰Š\x07Š˜(‹\x07ŒŽ(ŒŽŽ˜‘\x07’(‘‘’’˜“•\x07”–(•”•––˜—‡—‰—‹——“˜™›\x07!šœ(›š›œœ!ž\x07\x1BžŸ\f\x07Ÿ \x07 #¡¢\x07¢§&£¤\x07¤¦&¥£¦©§¥§¨¨ª©§ª«\x07«%¬¯\x07!­®\x07 ®°\f\x07¯­¯°°'±²\x07²·\f\x07³´\x07´¶\f\x07µ³¶¹·µ·¸¸º¹·º»\x07»)¼¿\x07!½¿,¾¼¾½¿+ÀÁ Á-18=FJX\`hqy€‘•—›§¯·¾`),te($,"__ATN");let Pe=$;class MP extends Qe.ParserRuleContext{EOF(){return this.getToken(Pe.EOF,0)}declaration(e){return e===void 0?this.getRuleContexts(Ld):this.getRuleContext(e,Ld)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_document}enterRule(e){e.enterDocument&&e.enterDocument(this)}exitRule(e){e.exitDocument&&e.exitDocument(this)}accept(e){return e.visitDocument?e.visitDocument(this):e.visitChildren(this)}}class Ld extends Qe.ParserRuleContext{typeAliasDeclaration(){return this.tryGetRuleContext(0,r2)}variableDeclaration(){return this.tryGetRuleContext(0,n2)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_declaration}enterRule(e){e.enterDeclaration&&e.enterDeclaration(this)}exitRule(e){e.exitDeclaration&&e.exitDeclaration(this)}accept(e){return e.visitDeclaration?e.visitDeclaration(this):e.visitChildren(this)}}class r2 extends Qe.ParserRuleContext{Identifier(){return this.getToken(Pe.Identifier,0)}type(){return this.getRuleContext(0,Ri)}typeParameters(){return this.tryGetRuleContext(0,f2)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeAliasDeclaration}enterRule(e){e.enterTypeAliasDeclaration&&e.enterTypeAliasDeclaration(this)}exitRule(e){e.exitTypeAliasDeclaration&&e.exitTypeAliasDeclaration(this)}accept(e){return e.visitTypeAliasDeclaration?e.visitTypeAliasDeclaration(this):e.visitChildren(this)}}class n2 extends Qe.ParserRuleContext{Identifier(){return this.getToken(Pe.Identifier,0)}typeAnnotation(){return this.tryGetRuleContext(0,zp)}expression(){return this.tryGetRuleContext(0,d2)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_variableDeclaration}enterRule(e){e.enterVariableDeclaration&&e.enterVariableDeclaration(this)}exitRule(e){e.exitVariableDeclaration&&e.exitVariableDeclaration(this)}accept(e){return e.visitVariableDeclaration?e.visitVariableDeclaration(this):e.visitChildren(this)}}class zp extends Qe.ParserRuleContext{type(){return this.getRuleContext(0,Ri)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeAnnotation}enterRule(e){e.enterTypeAnnotation&&e.enterTypeAnnotation(this)}exitRule(e){e.exitTypeAnnotation&&e.exitTypeAnnotation(this)}accept(e){return e.visitTypeAnnotation?e.visitTypeAnnotation(this):e.visitChildren(this)}}class Ri extends Qe.ParserRuleContext{unionType(){return this.getRuleContext(0,i2)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_type}enterRule(e){e.enterType&&e.enterType(this)}exitRule(e){e.exitType&&e.exitType(this)}accept(e){return e.visitType?e.visitType(this):e.visitChildren(this)}}class i2 extends Qe.ParserRuleContext{intersectionType(e){return e===void 0?this.getRuleContexts(kd):this.getRuleContext(e,kd)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_unionType}enterRule(e){e.enterUnionType&&e.enterUnionType(this)}exitRule(e){e.exitUnionType&&e.exitUnionType(this)}accept(e){return e.visitUnionType?e.visitUnionType(this):e.visitChildren(this)}}class kd extends Qe.ParserRuleContext{arrayType(e){return e===void 0?this.getRuleContexts(Id):this.getRuleContext(e,Id)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_intersectionType}enterRule(e){e.enterIntersectionType&&e.enterIntersectionType(this)}exitRule(e){e.exitIntersectionType&&e.exitIntersectionType(this)}accept(e){return e.visitIntersectionType?e.visitIntersectionType(this):e.visitChildren(this)}}class Id extends Qe.ParserRuleContext{primaryType(){return this.getRuleContext(0,o2)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_arrayType}enterRule(e){e.enterArrayType&&e.enterArrayType(this)}exitRule(e){e.exitArrayType&&e.exitArrayType(this)}accept(e){return e.visitArrayType?e.visitArrayType(this):e.visitChildren(this)}}class o2 extends Qe.ParserRuleContext{parenthesizedType(){return this.tryGetRuleContext(0,h2)}primitiveType(){return this.tryGetRuleContext(0,s2)}objectType(){return this.tryGetRuleContext(0,l2)}yorkieType(){return this.tryGetRuleContext(0,u2)}typeReference(){return this.tryGetRuleContext(0,c2)}literal(){return this.tryGetRuleContext(0,Up)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_primaryType}enterRule(e){e.enterPrimaryType&&e.enterPrimaryType(this)}exitRule(e){e.exitPrimaryType&&e.exitPrimaryType(this)}accept(e){return e.visitPrimaryType?e.visitPrimaryType(this):e.visitChildren(this)}}class s2 extends Qe.ParserRuleContext{constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_primitiveType}enterRule(e){e.enterPrimitiveType&&e.enterPrimitiveType(this)}exitRule(e){e.exitPrimitiveType&&e.exitPrimitiveType(this)}accept(e){return e.visitPrimitiveType?e.visitPrimitiveType(this):e.visitChildren(this)}}class l2 extends Qe.ParserRuleContext{propertySignature(e){return e===void 0?this.getRuleContexts(Fd):this.getRuleContext(e,Fd)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_objectType}enterRule(e){e.enterObjectType&&e.enterObjectType(this)}exitRule(e){e.exitObjectType&&e.exitObjectType(this)}accept(e){return e.visitObjectType?e.visitObjectType(this):e.visitChildren(this)}}class Fd extends Qe.ParserRuleContext{propertyName(){return this.getRuleContext(0,a2)}typeAnnotation(){return this.getRuleContext(0,zp)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_propertySignature}enterRule(e){e.enterPropertySignature&&e.enterPropertySignature(this)}exitRule(e){e.exitPropertySignature&&e.exitPropertySignature(this)}accept(e){return e.visitPropertySignature?e.visitPropertySignature(this):e.visitChildren(this)}}class a2 extends Qe.ParserRuleContext{Identifier(){return this.tryGetToken(Pe.Identifier,0)}StringLiteral(){return this.tryGetToken(Pe.StringLiteral,0)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_propertyName}enterRule(e){e.enterPropertyName&&e.enterPropertyName(this)}exitRule(e){e.exitPropertyName&&e.exitPropertyName(this)}accept(e){return e.visitPropertyName?e.visitPropertyName(this):e.visitChildren(this)}}class u2 extends Qe.ParserRuleContext{typeArguments(){return this.tryGetRuleContext(0,qp)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_yorkieType}enterRule(e){e.enterYorkieType&&e.enterYorkieType(this)}exitRule(e){e.exitYorkieType&&e.exitYorkieType(this)}accept(e){return e.visitYorkieType?e.visitYorkieType(this):e.visitChildren(this)}}class c2 extends Qe.ParserRuleContext{Identifier(){return this.getToken(Pe.Identifier,0)}typeArguments(){return this.tryGetRuleContext(0,qp)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeReference}enterRule(e){e.enterTypeReference&&e.enterTypeReference(this)}exitRule(e){e.exitTypeReference&&e.exitTypeReference(this)}accept(e){return e.visitTypeReference?e.visitTypeReference(this):e.visitChildren(this)}}class h2 extends Qe.ParserRuleContext{type(){return this.getRuleContext(0,Ri)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_parenthesizedType}enterRule(e){e.enterParenthesizedType&&e.enterParenthesizedType(this)}exitRule(e){e.exitParenthesizedType&&e.exitParenthesizedType(this)}accept(e){return e.visitParenthesizedType?e.visitParenthesizedType(this):e.visitChildren(this)}}class f2 extends Qe.ParserRuleContext{typeParameter(e){return e===void 0?this.getRuleContexts(Md):this.getRuleContext(e,Md)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeParameters}enterRule(e){e.enterTypeParameters&&e.enterTypeParameters(this)}exitRule(e){e.exitTypeParameters&&e.exitTypeParameters(this)}accept(e){return e.visitTypeParameters?e.visitTypeParameters(this):e.visitChildren(this)}}class Md extends Qe.ParserRuleContext{Identifier(){return this.getToken(Pe.Identifier,0)}type(){return this.tryGetRuleContext(0,Ri)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeParameter}enterRule(e){e.enterTypeParameter&&e.enterTypeParameter(this)}exitRule(e){e.exitTypeParameter&&e.exitTypeParameter(this)}accept(e){return e.visitTypeParameter?e.visitTypeParameter(this):e.visitChildren(this)}}class qp extends Qe.ParserRuleContext{type(e){return e===void 0?this.getRuleContexts(Ri):this.getRuleContext(e,Ri)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeArguments}enterRule(e){e.enterTypeArguments&&e.enterTypeArguments(this)}exitRule(e){e.exitTypeArguments&&e.exitTypeArguments(this)}accept(e){return e.visitTypeArguments?e.visitTypeArguments(this):e.visitChildren(this)}}class d2 extends Qe.ParserRuleContext{Identifier(){return this.tryGetToken(Pe.Identifier,0)}literal(){return this.tryGetRuleContext(0,Up)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_expression}enterRule(e){e.enterExpression&&e.enterExpression(this)}exitRule(e){e.exitExpression&&e.exitExpression(this)}accept(e){return e.visitExpression?e.visitExpression(this):e.visitChildren(this)}}class Up extends Qe.ParserRuleContext{StringLiteral(){return this.tryGetToken(Pe.StringLiteral,0)}NumberLiteral(){return this.tryGetToken(Pe.NumberLiteral,0)}BooleanLiteral(){return this.tryGetToken(Pe.BooleanLiteral,0)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_literal}enterRule(e){e.enterLiteral&&e.enterLiteral(this)}exitRule(e){e.exitLiteral&&e.exitLiteral(this)}accept(e){return e.visitLiteral?e.visitLiteral(this):e.visitChildren(this)}}class BP{constructor(e){this.errorList=e}syntaxError(e,t,r,i,o,s){let l={severity:"error",message:o,range:{start:{column:i,line:r},end:{column:i+1,line:r}}};this.errorList.push(l)}}class jP{constructor(e){this.errorList=e}syntaxError(e,t,r,i,o,s){const l={severity:"error",message:o,range:{start:{column:i,line:r},end:{column:i+1,line:r}}};t&&(l.range.end.column=i+t.stopIndex-t.startIndex+1),this.errorList.push(l)}}function $P(n){const e=[],t=pd.CharStreams.fromString(n),r=new Rd(t);r.removeErrorListeners(),r.addErrorListener(new BP(e));const i=new pd.CommonTokenStream(r),o=new Pe(i);return o.removeErrorListeners(),o.addErrorListener(new jP(e)),o.declaration(),e}const HP=y_(n=>{const e=n.state.doc.toString();return $P(e).map(t=>({from:n.state.doc.line(t.range.start.line).from+t.range.start.column,to:n.state.doc.line(t.range.end.line).from+t.range.end.column,message:t.message,severity:t.severity}))}),zP=`// 🐾 Yorkie Schema Test +eg\x07\vfdgjhfhiinjhkl\x07\fln(mcmknov"pv\fqv\rrvsv tv,uoupuqurusutvwx xy}\x07z|{z|}{}~~€}€\x07‚„ƒ…\x07„ƒ„……††‡ +‡ˆ\x07ˆ\x1B‰Š Š‹Œ\x07Œœ(Ž\x07Žœ(‘\x07’(‘‘’’œ“•\x07”–(•”•––œ—™\x07\x1B˜š(™˜™ššœ›‹›››“›—œŸ\x07"ž (ŸžŸ  !¡¢\x07¢£\f\x07£¤\x07¤#¥¦\x07¦«&§¨\x07¨ª&©§ª­«©«¬¬®­«®¯\x07 ¯%°³\x07"±²\x07!²´\f\x07³±³´´'µ¶\x07¶»\f\x07·¸\x07¸º\f\x07¹·º½»¹»¼¼¾½»¾¿\x07 ¿)ÀÃ\x07"ÁÃ,ÂÀÂÁÃ+ÄÅ Å-18=FJX\`hmu}„‘•™›Ÿ«³»Â`),te(k,"__ATN");let Pe=k;class JP extends Qe.ParserRuleContext{EOF(){return this.getToken(Pe.EOF,0)}declaration(e){return e===void 0?this.getRuleContexts(Hd):this.getRuleContext(e,Hd)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_document}enterRule(e){e.enterDocument&&e.enterDocument(this)}exitRule(e){e.exitDocument&&e.exitDocument(this)}accept(e){return e.visitDocument?e.visitDocument(this):e.visitChildren(this)}}class Hd extends Qe.ParserRuleContext{typeAliasDeclaration(){return this.tryGetRuleContext(0,uS)}variableDeclaration(){return this.tryGetRuleContext(0,cS)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_declaration}enterRule(e){e.enterDeclaration&&e.enterDeclaration(this)}exitRule(e){e.exitDeclaration&&e.exitDeclaration(this)}accept(e){return e.visitDeclaration?e.visitDeclaration(this):e.visitChildren(this)}}class uS extends Qe.ParserRuleContext{Identifier(){return this.getToken(Pe.Identifier,0)}type(){return this.getRuleContext(0,Mi)}typeParameters(){return this.tryGetRuleContext(0,vS)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeAliasDeclaration}enterRule(e){e.enterTypeAliasDeclaration&&e.enterTypeAliasDeclaration(this)}exitRule(e){e.exitTypeAliasDeclaration&&e.exitTypeAliasDeclaration(this)}accept(e){return e.visitTypeAliasDeclaration?e.visitTypeAliasDeclaration(this):e.visitChildren(this)}}class cS extends Qe.ParserRuleContext{Identifier(){return this.getToken(Pe.Identifier,0)}typeAnnotation(){return this.tryGetRuleContext(0,Yp)}expression(){return this.tryGetRuleContext(0,bS)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_variableDeclaration}enterRule(e){e.enterVariableDeclaration&&e.enterVariableDeclaration(this)}exitRule(e){e.exitVariableDeclaration&&e.exitVariableDeclaration(this)}accept(e){return e.visitVariableDeclaration?e.visitVariableDeclaration(this):e.visitChildren(this)}}class Yp extends Qe.ParserRuleContext{type(){return this.getRuleContext(0,Mi)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeAnnotation}enterRule(e){e.enterTypeAnnotation&&e.enterTypeAnnotation(this)}exitRule(e){e.exitTypeAnnotation&&e.exitTypeAnnotation(this)}accept(e){return e.visitTypeAnnotation?e.visitTypeAnnotation(this):e.visitChildren(this)}}class Mi extends Qe.ParserRuleContext{unionType(){return this.getRuleContext(0,hS)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_type}enterRule(e){e.enterType&&e.enterType(this)}exitRule(e){e.exitType&&e.exitType(this)}accept(e){return e.visitType?e.visitType(this):e.visitChildren(this)}}class hS extends Qe.ParserRuleContext{intersectionType(e){return e===void 0?this.getRuleContexts(zd):this.getRuleContext(e,zd)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_unionType}enterRule(e){e.enterUnionType&&e.enterUnionType(this)}exitRule(e){e.exitUnionType&&e.exitUnionType(this)}accept(e){return e.visitUnionType?e.visitUnionType(this):e.visitChildren(this)}}class zd extends Qe.ParserRuleContext{arrayType(e){return e===void 0?this.getRuleContexts(qd):this.getRuleContext(e,qd)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_intersectionType}enterRule(e){e.enterIntersectionType&&e.enterIntersectionType(this)}exitRule(e){e.exitIntersectionType&&e.exitIntersectionType(this)}accept(e){return e.visitIntersectionType?e.visitIntersectionType(this):e.visitChildren(this)}}class qd extends Qe.ParserRuleContext{primaryType(){return this.tryGetRuleContext(0,fS)}typeArguments(){return this.tryGetRuleContext(0,ch)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_arrayType}enterRule(e){e.enterArrayType&&e.enterArrayType(this)}exitRule(e){e.exitArrayType&&e.exitArrayType(this)}accept(e){return e.visitArrayType?e.visitArrayType(this):e.visitChildren(this)}}class fS extends Qe.ParserRuleContext{parenthesizedType(){return this.tryGetRuleContext(0,yS)}primitiveType(){return this.tryGetRuleContext(0,dS)}objectType(){return this.tryGetRuleContext(0,pS)}yorkieType(){return this.tryGetRuleContext(0,gS)}typeReference(){return this.tryGetRuleContext(0,xS)}literal(){return this.tryGetRuleContext(0,Jp)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_primaryType}enterRule(e){e.enterPrimaryType&&e.enterPrimaryType(this)}exitRule(e){e.exitPrimaryType&&e.exitPrimaryType(this)}accept(e){return e.visitPrimaryType?e.visitPrimaryType(this):e.visitChildren(this)}}class dS extends Qe.ParserRuleContext{constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_primitiveType}enterRule(e){e.enterPrimitiveType&&e.enterPrimitiveType(this)}exitRule(e){e.exitPrimitiveType&&e.exitPrimitiveType(this)}accept(e){return e.visitPrimitiveType?e.visitPrimitiveType(this):e.visitChildren(this)}}class pS extends Qe.ParserRuleContext{propertySignature(e){return e===void 0?this.getRuleContexts(Ud):this.getRuleContext(e,Ud)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_objectType}enterRule(e){e.enterObjectType&&e.enterObjectType(this)}exitRule(e){e.exitObjectType&&e.exitObjectType(this)}accept(e){return e.visitObjectType?e.visitObjectType(this):e.visitChildren(this)}}class Ud extends Qe.ParserRuleContext{propertyName(){return this.getRuleContext(0,mS)}typeAnnotation(){return this.getRuleContext(0,Yp)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_propertySignature}enterRule(e){e.enterPropertySignature&&e.enterPropertySignature(this)}exitRule(e){e.exitPropertySignature&&e.exitPropertySignature(this)}accept(e){return e.visitPropertySignature?e.visitPropertySignature(this):e.visitChildren(this)}}class mS extends Qe.ParserRuleContext{Identifier(){return this.tryGetToken(Pe.Identifier,0)}StringLiteral(){return this.tryGetToken(Pe.StringLiteral,0)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_propertyName}enterRule(e){e.enterPropertyName&&e.enterPropertyName(this)}exitRule(e){e.exitPropertyName&&e.exitPropertyName(this)}accept(e){return e.visitPropertyName?e.visitPropertyName(this):e.visitChildren(this)}}class gS extends Qe.ParserRuleContext{typeArguments(){return this.tryGetRuleContext(0,ch)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_yorkieType}enterRule(e){e.enterYorkieType&&e.enterYorkieType(this)}exitRule(e){e.exitYorkieType&&e.exitYorkieType(this)}accept(e){return e.visitYorkieType?e.visitYorkieType(this):e.visitChildren(this)}}class xS extends Qe.ParserRuleContext{Identifier(){return this.getToken(Pe.Identifier,0)}typeArguments(){return this.tryGetRuleContext(0,ch)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeReference}enterRule(e){e.enterTypeReference&&e.enterTypeReference(this)}exitRule(e){e.exitTypeReference&&e.exitTypeReference(this)}accept(e){return e.visitTypeReference?e.visitTypeReference(this):e.visitChildren(this)}}class yS extends Qe.ParserRuleContext{type(){return this.getRuleContext(0,Mi)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_parenthesizedType}enterRule(e){e.enterParenthesizedType&&e.enterParenthesizedType(this)}exitRule(e){e.exitParenthesizedType&&e.exitParenthesizedType(this)}accept(e){return e.visitParenthesizedType?e.visitParenthesizedType(this):e.visitChildren(this)}}class vS extends Qe.ParserRuleContext{typeParameter(e){return e===void 0?this.getRuleContexts(Vd):this.getRuleContext(e,Vd)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeParameters}enterRule(e){e.enterTypeParameters&&e.enterTypeParameters(this)}exitRule(e){e.exitTypeParameters&&e.exitTypeParameters(this)}accept(e){return e.visitTypeParameters?e.visitTypeParameters(this):e.visitChildren(this)}}class Vd extends Qe.ParserRuleContext{Identifier(){return this.getToken(Pe.Identifier,0)}type(){return this.tryGetRuleContext(0,Mi)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeParameter}enterRule(e){e.enterTypeParameter&&e.enterTypeParameter(this)}exitRule(e){e.exitTypeParameter&&e.exitTypeParameter(this)}accept(e){return e.visitTypeParameter?e.visitTypeParameter(this):e.visitChildren(this)}}class ch extends Qe.ParserRuleContext{type(e){return e===void 0?this.getRuleContexts(Mi):this.getRuleContext(e,Mi)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_typeArguments}enterRule(e){e.enterTypeArguments&&e.enterTypeArguments(this)}exitRule(e){e.exitTypeArguments&&e.exitTypeArguments(this)}accept(e){return e.visitTypeArguments?e.visitTypeArguments(this):e.visitChildren(this)}}class bS extends Qe.ParserRuleContext{Identifier(){return this.tryGetToken(Pe.Identifier,0)}literal(){return this.tryGetRuleContext(0,Jp)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_expression}enterRule(e){e.enterExpression&&e.enterExpression(this)}exitRule(e){e.exitExpression&&e.exitExpression(this)}accept(e){return e.visitExpression?e.visitExpression(this):e.visitChildren(this)}}class Jp extends Qe.ParserRuleContext{StringLiteral(){return this.tryGetToken(Pe.StringLiteral,0)}NumberLiteral(){return this.tryGetToken(Pe.NumberLiteral,0)}BooleanLiteral(){return this.tryGetToken(Pe.BooleanLiteral,0)}constructor(e,t){super(e,t)}get ruleIndex(){return Pe.RULE_literal}enterRule(e){e.enterLiteral&&e.enterLiteral(this)}exitRule(e){e.exitLiteral&&e.exitLiteral(this)}accept(e){return e.visitLiteral?e.visitLiteral(this):e.visitChildren(this)}}var SS={},hh={};/*! + * Copyright 2016 The ANTLR Project. All rights reserved. + * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. + */var _a=w&&w.__decorate||function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Ta=w&&w.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(hh,"__esModule",{value:!0});hh.AbstractParseTreeVisitor=void 0;const dn=X;class Jo{visit(e){return e.accept(this)}visitChildren(e){let t=this.defaultResult(),r=e.childCount;for(let i=0;i0){a.push(c),u.push(h),h=0,c=c.getChild(0);continue}do{if(c instanceof r.RuleNode&&this.exitRule(s,c),a.length===0){c=void 0,h=0;break}let f=a[a.length-1];if(h++,c=h=t.startIndex&&(l=t.stopIndex-t.startIndex+1);const a={severity:"error",message:o,range:{start:{column:i,line:r},end:{column:i+l,line:r}}};this.errorList.push(a)}}function rR(n){const e=[],t=Ad.CharStreams.fromString(n),r=new $d(t);r.removeErrorListeners(),r.addErrorListener(new eR(e));const i=new Ad.CommonTokenStream(r),o=new Pe(i);o.removeErrorListeners(),o.addErrorListener(new tR(e));const s=o.document(),l=new ZP;SS.ParseTreeWalker.DEFAULT.walk(l,s),l.typeReferences.forEach(c=>{l.symbolTable.has(c.typeName)||l.errors.push({message:`Type '${c.typeName}' is not defined.`,line:c.line,column:c.column})});const a=l.errors.map(c=>({severity:"error",message:c.message,range:{start:{column:c.column,line:c.line},end:{column:c.column+1,line:c.line}}}));return{errors:[...e,...a]}}const nR=R_(n=>{const e=n.state.doc.toString();return rR(e).errors.map(t=>({from:n.state.doc.line(t.range.start.line).from+t.range.start.column,to:n.state.doc.line(t.range.end.line).from+t.range.end.column,message:t.message,severity:t.severity}))}),iR=`// 🐾 Yorkie Schema Test // Every document should start with 'Document' type. type Document = { @@ -644,4 +676,4 @@ type Document = { ytree: yorkie.Tree; // Yorkie Tree ytext: yorkie.Text; // Yorkie Text ytext: yorkie.Text<{b:boolean;}>; // Yorkie Text: Type Parameter -};`;new de({state:Me.create({doc:zP,extensions:[cw,HP,C_()]}),parent:document.getElementById("editor")}); +};`;new de({state:Fe.create({doc:iR,extensions:[Tw,nR,$_()]}),parent:document.getElementById("editor")}); diff --git a/index.html b/index.html index 48adbe7..1009277 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ overflow: auto; } - +

Yorkie Schema Test